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& operator=(const DataType& t)
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.
EditMinMax& operator=(const DataType& t)
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.
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& operator=(const DataType& t)
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.
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:
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.
EditString& operator=(const WString & data)
EditString& operator=(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.
EditString& MaxLen(int maxlen)
Sets maxlen as maximum length of contained text.maxlen Returns *this.
EditString& NotNull(bool nn = true)
Sets NotNull property.
class EditStringNotNull : public EditString
This class sets the NotNull property in the constructors.
EditStringNotNull& operator=(const WString & data)
EditStringNotNull& operator=(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.
EditIntSpin& ShowSpin(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.
EditDoubleSpin& SetInc(double inc = 0.1)
Set the spin increment.
double GetInc() const
Returns current spin increment.
EditDoubleSpin& ShowSpin(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.
|