View
- Code reorganization. Much can be moved to default behavior in the base class.
This commit is contained in:
@@ -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 ());
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Reference in New Issue
Block a user