Overview
Examples
Screenshots
Comparisons
Applications
Download
Manual
Status & Roadmap
FAQ
Authors & License
Forums
Wiki
Funding Ultimate++
Search on this site











SourceForge.net Logo



EditField derived classes

Widgets editing values in text representation are based on EditField and appropriate Convert class. Majority of them are defined using simple EditValue, EditMinMax and EditMinMaxNotNull template classes:

 

template <class DataType, class Cv>

class EditValue : public EditField, public Cv

This class provides composition of EditField and specific Convert class. The advantage of deriving from Convert is that all Convert setup methods (like setting min/max value) are directly available without using further glue code.

 

EditValueoperator=(const DataTypet)

This helper operator allows direct assignment of value type to the editor.

 

operator DataType() const

This helper operator allows direct retrieval of value type from the editor.

 

EditValue()

Constructor assigns Convert class (in fact, *this) as the EditField converter.

 

 

 

template <class DataType, class Cv>

class EditMinMax : public EditValue<DataType, Cv

Wrapper class for converters providing Min, Max and NotNull properties.

 

EditMinMaxoperator=(const DataTypet)

This helper operator allows direct assignment of value type to the editor.

 

EditMinMax()

Default constructor.

 

EditMinMax(DataType min, DataType max)

This constructor sets Min and Max properties.

 

EditMinMaxMin(DataType min)

EditMinMaxMax(DataType max)

EditMinMaxNotNull(bool nn = true)

Sets Min, Max and NotNull properties. In fact, the only purpose of these methods is to change the returns value to the correctly typed *this.

 

 

 

template <class DataType, class Cv>

class EditMinMaxNotNull : public EditValue<DataType, Cv

Similar to EditMinMax template class, but constructs activate NotNull property.

 

EditMinMaxNotNulloperator=(const DataTypet)

This helper operator allows direct assignment of value type to the editor.

 

EditMinMaxNotNull()

Default constructor.

 

EditMinMaxNotNull(DataType min, DataType max)

This constructor sets Min and Max properties.

 

EditMinMaxNotNullMin(DataType min)

EditMinMaxNotNullMax(DataType max)

EditMinMaxNotNullNotNull(bool nn = true)

Sets Min, Max and NotNull properties. In fact, the only purpose of these methods is to change the returns value to the correctly typed *this.

 

 

 

Based on EditMinMax and EditMinMaxNotNull, basic value editors are defined as typedefs:

 

class

typedef

EditDate

EditMinMax<Date, ConvertDate>

EditDateNotNull

EditMinMaxNotNull<Date, ConvertDate>

EditDouble

EditMinMax<double, ConvertDouble>

EditDoubleNotNull

EditMinMaxNotNull<double, ConvertDouble>

EditInt

EditMinMax<int, ConvertInt>

EditIntNotNull

EditMinMaxNotNull<int, ConvertInt>

EditTime

EditMinMax<Time, ConvertTime>

EditTimeNotNull

EditMinMaxNotNull<Time, ConvertTime>

 

 

 

Some value editors are not based on EditMinMax and EditMinMaxNotNull:

 

class EditString : public EditValue<WString, ConvertString> 

EditString is not based on EditMinMax because instead of minimal and maximal values, it implements "maximum number of characters" constraint.

 

operator const WString&() const

This helper operator allows direct retrieval of value type from the editor.

 

EditStringoperator=(const WString& data)

EditStringoperator=(const String& data)

These helper operators allow a direct assignment of value type to the editor.

 

EditString()

Default constructor.

 

EditString(int maxlen)

This constructor sets maxlen as maximum length of contained text.

 

EditStringMaxLen(int maxlen)

Sets maxlen as maximum length of contained text.maxlen Returns *this.

 

EditStringNotNull(bool nn = true)

Sets NotNull property.

 

 

 

class EditStringNotNull : public EditString

This class sets the NotNull property in the constructors.

 

EditStringNotNulloperator=(const WString& data)

EditStringNotNulloperator=(const String& data)

These helper operators allow a direct assignment of value type to the editor.

 

EditStringNotNull()

Default constructor.

 

EditStringNotNull(int maxlen)

This constructor sets maxlen as maximum length of contained text.

 

 

 

class EditIntSpin : public EditInt

This editor adds spin buttons to the EditInt class.

 

EditIntSpinShowSpin(bool s = true)

Shows/hides spin buttons.

 

EditIntSpin()

Default constructor. Spin buttons are on.

 

EditIntSpin(int min, int max)

This constructor sets the  min max values. Spin buttons are on.

 

 

 

class EditDoubleSpin : public EditDouble

This editor adds spin buttons to the EditInt class.

 

EditDoubleSpinSetInc(double inc = 0.1)

Set the spin increment.

 

double GetInc() const

Returns current spin increment.

 

EditDoubleSpinShowSpin(bool s = true)

Shows/hides spin buttons.

 

EditDoubleSpin(double inc = 0.1)

Sets the spin increment. Spin buttons are on.

 

EditDoubleSpin(double min, double max, double inc = 0.1)

This constructor sets min, max and inc values. Spin buttons are on.