Columns
- Refactored column objects to contain a ::validate method, for the validation of incoming data. - Context.columns is now a vector of one of each column object, indexed by attribute name, for validation purposes.
This commit is contained in:
@@ -37,8 +37,8 @@ extern Context context;
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
ColumnStart::ColumnStart ()
|
||||
{
|
||||
_label = STRING_COLUMN_LABEL_STARTED;
|
||||
_attribute = "start";
|
||||
_name = "start";
|
||||
_label = STRING_COLUMN_LABEL_STARTED;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -46,6 +46,12 @@ ColumnStart::~ColumnStart ()
|
||||
{
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
bool ColumnStart::validate (std::string& value)
|
||||
{
|
||||
return ColumnDate::validate (value);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Overriden so that style <----> label are linked.
|
||||
// Note that you can not determine which gets called first.
|
||||
@@ -63,7 +69,7 @@ void ColumnStart::measure (Task& task, int& minimum, int& maximum)
|
||||
{
|
||||
minimum = maximum = 0;
|
||||
|
||||
if (task.has (_attribute))
|
||||
if (task.has (_name))
|
||||
{
|
||||
if (_style == "active")
|
||||
{
|
||||
@@ -82,7 +88,7 @@ void ColumnStart::render (
|
||||
int width,
|
||||
Color& color)
|
||||
{
|
||||
if (task.has (_attribute))
|
||||
if (task.has (_name))
|
||||
{
|
||||
if (_style == "active")
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user