- Code reorganization.  Much can be moved to default behavior in the
  base class.
This commit is contained in:
Paul Beckingham
2011-04-27 00:22:56 -04:00
parent 63c84129f2
commit 29649bdf07
8 changed files with 85 additions and 159 deletions

View File

@@ -25,16 +25,21 @@
//
////////////////////////////////////////////////////////////////////////////////
#include <iomanip>
#include <sstream>
#include <math.h>
#include <Context.h>
#include <ColID.h>
#include <text.h>
extern Context context;
////////////////////////////////////////////////////////////////////////////////
ColumnID::ColumnID ()
{
setLabel ("id");
_type = "number";
_style = "default";
_label = "ID";
}
////////////////////////////////////////////////////////////////////////////////
@@ -57,21 +62,18 @@ void ColumnID::measure (Task& task, int& minimum, int& maximum)
minimum = maximum = length;
}
////////////////////////////////////////////////////////////////////////////////
void ColumnID::renderHeader (std::vector <std::string>& lines, int width)
{
lines.push_back ("ID");
}
////////////////////////////////////////////////////////////////////////////////
void ColumnID::render (std::vector <std::string>& lines, Task* task, int width)
{
}
////////////////////////////////////////////////////////////////////////////////
std::string ColumnID::type () const
{
return "number";
std::stringstream line;
line << std::setw (width) << std::setfill (' ') << task->id;
if (task->id)
line << task->id;
else
line << '-';
lines.push_back (line.str ());
}
////////////////////////////////////////////////////////////////////////////////