Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
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:

 

 

EditValue

 

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.

 

 

Constructor Detail

 

EditValue()

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

 

 

 

EditMinMax

 

template <class DataType, class Cv>

class EditMinMax : public EditValue<DataType, Cv> 

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

 

 

Constructor Detail

 

EditMinMax()

Default constructor.

 


 

EditMinMax(DataType min, DataType max)

This constructor sets Min and Max properties.

 

 

Public Method List

 

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.

 

 

 

 

EditMinMaxNotNull

 

template <class DataType, class Cv>

class EditMinMaxNotNull : public EditValue<DataType, Cv> 

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

 

 

Constructor Detail

 

EditMinMaxNotNull()

Default constructor.

 


 

EditMinMaxNotNull(DataType min, DataType max)

This constructor sets Min and Max properties.

 

 

Public Method List

 

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 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 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:

 

 

EditString

 

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.

 

 

Constructor Detail

 

EditString()

Default constructor.

 


 

EditString(int maxlen)

This constructor sets maxlen as maximum length of contained text.

 

 

Public Method List

 

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.

 

 

 

EditStringNotNull

 

class EditStringNotNull : public EditString

This class sets the NotNull property in the constructors.

 

 

Constructor Detail

 

EditStringNotNull()

Default constructor.

 


 

EditStringNotNull(int maxlen)

This constructor sets maxlen as maximum length of contained text.

 

 

 

 

EditIntSpin

 

class EditIntSpin : public EditInt

This editor adds spin buttons to the EditInt class.

 

 

Constructor Detail

 

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.

 

 

Public Method List

 

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.

 

 

 

 

EditDoubleSpin

 

class EditDoubleSpin : public EditDouble

This editor adds spin buttons to the EditDouble class.

 

 

Constructor Detail

 

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.

 

 

Public Method List

 

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.

 

 

 

 

EditDoubleNotNullSpin

 

class EditDoubleNotNullSpin : public EditDoubleSpin

This editor adds spin buttons to the EditDoubleNotNull class.

 

 

Constructor Detail

 

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.

 

 

Last edit by cxl on 03/07/2017. Do you want to contribute?. T++