- Implemented start.active.
This commit is contained in:
Paul Beckingham 2011-05-02 22:53:47 -04:00
parent 27752bd510
commit f9ab8f2a1c
5 changed files with 61 additions and 21 deletions

View file

@ -25,7 +25,11 @@
//
////////////////////////////////////////////////////////////////////////////////
#include <Context.h>
#include <ColStart.h>
#include <text.h>
extern Context context;
////////////////////////////////////////////////////////////////////////////////
ColumnStart::ColumnStart ()
@ -40,3 +44,51 @@ ColumnStart::~ColumnStart ()
}
////////////////////////////////////////////////////////////////////////////////
// Overriden so that style <----> label are linked.
// Note that you can not determine which gets called first.
void ColumnStart::setStyle (const std::string& value)
{
_style = value;
if (_style == "active" && _label == "Started")
_label = "A";
}
////////////////////////////////////////////////////////////////////////////////
// Set the minimum and maximum widths for the value.
void ColumnStart::measure (Task& task, int& minimum, int& maximum)
{
minimum = maximum = 0;
if (task.has (_attribute))
{
if (_style == "active")
{
}
else
ColumnDate::measure (task, minimum, maximum);
}
}
////////////////////////////////////////////////////////////////////////////////
void ColumnStart::render (
std::vector <std::string>& lines,
Task& task,
int width,
Color& color)
{
if (task.has (_attribute))
{
if (_style == "active")
{
lines.push_back (
color.colorize (
rightJustify (
context.config.get ("active.indicator"), width)));
}
else
ColumnDate::render (lines, task, width, color);
}
}
////////////////////////////////////////////////////////////////////////////////