sptk2 logo
SPTK Home Page

sptk::CInput Class Reference
[GUI Classes]

Text input widget. More...

#include <CInput.h>

Inheritance diagram for sptk::CInput:

sptk::CControl sptk::CLayoutClient sptk::CBox sptk::CDateIntervalInput sptk::CDateTimeBaseInput sptk::CFloatInput sptk::CHtmlBox sptk::CIntegerInput sptk::CMemoInput sptk::CPasswordInput sptk::CPhoneNumberInput sptk::CProgressBar

List of all members.

Public Member Functions

 CInput (const char *label=0, int layoutSize=10, CLayoutAlign layoutAlign=SP_ALIGN_TOP)
 Constructor in SPTK style.
virtual ~CInput ()
 Destructor.
int controlType () const
 Returns input widget input type.
void controlType (int type)
 Sets input widget input type.
virtual CVariant data () const
 Universal data connection, returns data from control.
virtual void data (const CVariant v)
 Universal data connection, sets data from control.
virtual CControlKind kind () const
 Returns the control kind, SPTK-style RTTI.
virtual std::string className () const
 Returns the control class name, SPTK-style RTTI.
virtual Fl_Font textFont () const
 Returns the input text font type.
virtual void textFont (Fl_Font f)
 Sets the input text font type.
virtual uchar textSize () const
 Returns the input text font size.
virtual void textSize (uchar s)
 Sets the input text font size.
virtual int maxLength () const
 Returns the input text maximum length, 0 - unlimited.
virtual void maxLength (int)
 Sets the input text maximum length, 0 - unlimited.
virtual void preferredWidth (int &w) const
 Computes the optimal widget width.
virtual void preferredHeight (int &h) const
 Computes the optimal widget height.
virtual bool preferredSize (int &w, int &h)
 Computes the optimal widget size.

Static Public Member Functions

static CLayoutClientcreator (CXmlNode *node)
 Creates a widget based on the XML node information.

Protected Member Functions

virtual void load (CQuery *)
 Loads data from query.
virtual void save (CQuery *)
 Saves data to query.
virtual void load (const CXmlNode *node, CLayoutXMLmode xmlMode)
 Loads control data from XML.
virtual void save (CXmlNode *node, CLayoutXMLmode xmlMode) const
 Saves control data to XML.
virtual bool valid () const
 Returns true if the input data is valid.
 CInput (const char *label, int layoutSize, CLayoutAlign layoutAlign, bool autoCreate)
 Special internal constructor for derived classes.


Detailed Description

Text input widget.

Implements the simple single-line input box. While it can be used by itself, it's also a base class for several other SPTK widgets. As CControl descendant it's a layout client.


Constructor & Destructor Documentation

sptk::CInput::CInput ( const char *  label,
int  layoutSize,
CLayoutAlign  layoutAlign,
bool  autoCreate 
) [protected]

Special internal constructor for derived classes.

Parameters:
label const char *, label
layoutSize int, widget align in layout
layoutAlign CLayoutAlign, widget align in layout
autoCreate bool, if true CControl will create CInput_ widget and make it the main internal widget.

sptk::CInput::CInput ( const char *  label = 0,
int  layoutSize = 10,
CLayoutAlign  layoutAlign = SP_ALIGN_TOP 
)

Constructor in SPTK style.

Parameters:
label const char *, label
layoutSize int, widget align in layout
layoutAlign CLayoutAlign, widget align in layout


Member Function Documentation

virtual CControlKind sptk::CInput::kind (  )  const [inline, virtual]

Returns the control kind, SPTK-style RTTI.

See also:
CControlKind for more information

Implements sptk::CControl.

Reimplemented in sptk::CBox, sptk::CDateIntervalInput, sptk::CDateInput, sptk::CTimeInput, sptk::CDateTimeInput, sptk::CFloatInput, sptk::CHtmlBox, sptk::CIntegerInput, sptk::CMemoInput, and sptk::CPhoneNumberInput.

References sptk::DCV_STRING.

virtual void sptk::CInput::load ( const CXmlNode node,
CLayoutXMLmode  xmlMode 
) [inline, protected, virtual]

Loads control data from XML.

Layout information may also include widget size and position, as well as visible() and active() states

Parameters:
node CXmlNode*, the XML node
xmlMode CLayoutXMLmode, the mode defining how the layout and/or data should be stored

Reimplemented from sptk::CControl.

Reimplemented in sptk::CDateTimeBaseInput.

References sptk::CControl::load().

virtual void sptk::CInput::preferredHeight ( int &  h  )  const [virtual]

Computes the optimal widget height.

Parameters:
h int&, input - height offered by the program, output - height required by widget

Reimplemented in sptk::CDateInput.

virtual bool sptk::CInput::preferredSize ( int &  w,
int &  h 
) [virtual]

Computes the optimal widget size.

Parameters:
w int&, input - width offered by the program, output - width required by widget
h int&, input - height offered by the program, output - height required by widget
Returns:
true if the size is stable (doesn't depend on input sizes)

Reimplemented from sptk::CLayoutClient.

Reimplemented in sptk::CBox, sptk::CHtmlBox, sptk::CMemoInput, and sptk::CProgressBar.

virtual void sptk::CInput::preferredWidth ( int &  w  )  const [virtual]

Computes the optimal widget width.

Parameters:
w int&, input - width offered by the program, output - width required by widget

Reimplemented in sptk::CTimeInput, and sptk::CPhoneNumberInput.

virtual void sptk::CInput::save ( CXmlNode node,
CLayoutXMLmode  xmlMode 
) const [inline, protected, virtual]

Saves control data to XML.

Layout information may also include widget size and position, as well as visible() and active() states

Parameters:
node CXmlNode*, the XML node
xmlMode CLayoutXMLmode, the mode defining how the layout and/or data should be stored

Reimplemented from sptk::CControl.

Reimplemented in sptk::CDateTimeBaseInput.

References sptk::CControl::save().


The documentation for this class was generated from the following file:

Mon Mar 5 11:56:15 2012: SPTK 3.5.7