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.
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.
EditMinMax()
Default constructor.
EditMinMax(DataType min, DataType max)
This constructor sets Min and Max properties.
EditMinMax& Min(DataType min)
EditMinMax& Max(DataType max)
EditMinMax& NotNull(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.
EditMinMaxNotNull()
Default constructor.
EditMinMaxNotNull(DataType min, DataType max)
This constructor sets Min and Max properties.
EditMinMaxNotNull& Min(DataType min)
EditMinMaxNotNull& Max(DataType max)
EditMinMaxNotNull& NotNull(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:
typedef EditMinMax<Date, ConvertDate> EditDate
Edit field for date values.
typedef EditMinMaxNotNull<Date, ConvertDate> EditDateNotNull
Edit field for not null date values.
typedef EditMinMax<double, ConvertDouble> EditDouble
Edit field for double values.
typedef EditMinMax<double, ConvertFloat> EditFloat
Edit field for float values. The difference from EditDouble is that when decimals are rounded to be presented to user, EditFloat rounds to just 7 valid digits to reflect the precision of float type.
typedef EditMinMaxNotNull<double, ConvertDouble> EditDoubleNotNull
Edit field for not null double values.
typedef EditMinMax<int, ConvertInt> EditInt
Edit field for integer values.
typedef EditMinMaxNotNull<int, ConvertInt> EditIntNotNull
Edit field for not null integer values.
typedef EditMinMaxNotNull<int64, EditInt64> EditInt64NotNull
Edit field for not null int64 values.
typedef EditMinMaxNotNull<double, EditFloat> EditFloatNotNull
Edit field for not null float values.
typedef EditMinMax<int64, ConvertInt64> EditInt64
Edit field for 64 bit integer values.
typedef EditMinMax<Time, ConvertTime> EditTime
Edit field for time values.
typedef EditMinMaxNotNull<Time, ConvertTime> EditTimeNotNull
Edit field for not null time values.
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.
EditString()
Default constructor.
EditString(int maxlen)
This constructor sets maxlen as maximum length of contained text.
EditString& MaxLen(int maxlen)
Sets maxlen as maximum length of contained text.maxlen Returns *this.
EditString& NotNull(bool nn = true)
Sets NotNull property.
EditString& TrimLeft(bool b = true)
EditString& TrimRight(bool b = true)
EditString& TrimBoth(bool b = true)
Whitechars on the left/right/both side(s) are removed.
class EditStringNotNull : public EditString
This class sets the NotNull property in the constructors.
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.
EditIntSpin()
Default constructor. Spin buttons are on.
EditIntSpin(int min, int max)
This constructor sets the min and max values. Spin buttons are on.
~EditIntSpin()
Default destructor.
EditIntSpin& ShowSpin(bool s = true)
Shows/hides spin buttons.
EditIntSpin& SetInc(int _inc)
Set the increment factor to _inc.
int GetInc() const
Returns the increment factor.
class EditDoubleSpin : public EditDouble
This editor adds spin buttons to the EditDouble class.
EditDoubleSpin(double inc = 0.1)
Sets the spin increment to inc. 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.
~EditDoubleSpin()
Default destructor.
EditDoubleSpin& SetInc(double _inc = 0.1)
Set the spin increment to _inc.
double GetInc() const
Returns current spin increment.
EditDoubleSpin& ShowSpin(bool s = true)
Shows/hides spin buttons.
class EditDoubleNotNullSpin : public EditDoubleSpin
This editor adds spin buttons to the EditDoubleNotNull class.
EditDoubleNotNullSpin(double inc = 0.1)
Sets the spin increment to inc. Spin buttons are on.
EditDoubleNotNullSpin(double min, double max, double inc = 0.1)
This constructor sets min, max and inc values. Spin buttons are on.
|