#include <CInput.h>
Public Member Functions | |
CInput (const char *label=0, int layoutSize=10, CLayoutAlign layoutAlign=CLayoutAlign::TOP) | |
~CInput () override | |
int | controlType () const |
void | controlType (int type) |
Variant | data () const override |
void | data (const Variant &v) override |
CControlKind | kind () const override |
String | className () const override |
Fl_Font | textFont () const override |
void | textFont (Fl_Font f) override |
uchar | textSize () const override |
void | textSize (uchar s) override |
int | maxLength () const override |
void | maxLength (int) override |
virtual void | preferredWidth (int &w) const |
virtual void | preferredHeight (int &h) const |
bool | preferredSize (int &w, int &h) override |
Public Member Functions inherited from sptk::CControl | |
CControl (const char *label, int layoutSize=20, CLayoutAlign layoutAlign=CLayoutAlign::TOP) | |
Constructor in SPTK style. More... | |
void | resize (int x, int y, int w, int h) override |
Resizes the control and inside widgets. More... | |
void | draw () override |
Draws the control. | |
virtual int | tag () const |
Returns the control's user data tag. | |
virtual void | tag (int t) |
Sets the control's user data tag. | |
virtual Fl_Font | textFont () const |
Returns the control's text font. More... | |
virtual void | textFont (Fl_Font) |
Sets the control's text font. More... | |
virtual uchar | textSize () const |
Returns the control's text font size. More... | |
virtual void | textSize (uchar) |
Sets the control's text font size. More... | |
virtual Fl_Color | textColor () const |
Returns the control's text color. More... | |
virtual void | textColor (Fl_Color) |
Sets the control's text color. More... | |
virtual Fl_Color | labelColor () const |
Returns the control's label color. | |
virtual void | labelColor (Fl_Color) |
Sets the control's label color. | |
virtual Fl_Color | color () const |
Returns the control's background color. | |
virtual void | color (Fl_Color) |
Sets the control's background color. | |
uint32_t | flags () const |
Returns the control's flags. | |
void | flags (uint32_t flags) |
Sets the control's flags. | |
Fl_Widget * | control () const |
Returns main widget inside the container. | |
const String & | label () const override |
Returns control's label. More... | |
void | label (const String &) override |
Sets control's label. More... | |
Fl_Menu_ * | menu () const |
Returns control's menu. | |
void | menu (const Fl_Menu_Item *) |
Sets control's menu. | |
Fl_Font | labelFont () const |
Returns control's label font. | |
void | labelSize (Fl_Font f) |
Sets control's label font. | |
uchar | labelSize () const |
Returns control's label font size. | |
void | labelSize (uchar) |
Sets control's label font size. | |
uint32_t | labelWidth () const |
Returns control's label width. | |
void | labelWidth (uint32_t) |
Sets control's label width. | |
void | hint (const String &str) |
Sets control's hint (tooltip) More... | |
String | hint () const |
Returns control's hint (tooltip) | |
virtual int | maxLength () const |
Returns control's max input length, if applicable. More... | |
virtual void | maxLength (int) |
Sets control's max input length, if applicable. More... | |
virtual const String & | fieldName () const |
Returns control's field name for universal data connection. | |
virtual void | fieldName (const String &) |
Sets control's field name for universal data connection. | |
virtual CControlKind | kind () const =0 |
Returns control's kind (internal SPTK RTTI). More... | |
String | className () const override |
Returns control's class name (internal SPTK RTTI). More... | |
virtual void | reset () |
Sets the control to empty text (for the input entries) More... | |
virtual void | load (Query *) |
Loads control data from query fields. More... | |
virtual void | save (Query *) |
Saves control data to query params. More... | |
void | load (const xdoc::SNode &node, CLayoutXMLmode xmlMode) override |
Loads control data from XML. More... | |
void | load (const xdoc::SNode &node) override |
Loads control data from XML. More... | |
void | save (const xdoc::SNode &node, CLayoutXMLmode xmlMode) const override |
Saves control data to XML. More... | |
virtual void | save (const xdoc::SNode &node) const |
Saves control data to XML. More... | |
virtual bool | valid () const =0 |
Returns true if the control state is valid, and the data is inside the limits (if applicable) More... | |
virtual Variant | data () const |
The universal data connector. More... | |
virtual void | data (const Variant &v) |
The universal data connector, sets control data. More... | |
void | fireEvent (CEvent ev, int32_t arg) |
Fires the event generated by this control. | |
const CEventInfo & | event () const |
Returns the last event fired by this control. | |
CEvent | eventType () const |
Returns the event type for the last fired by this control. | |
int | eventArgument () const |
Returns the event argument for the last fired by this control. | |
CControl & | operator= (const String &str) |
Control data assignment. | |
CControl & | operator= (const char *str) |
Control data assignment. | |
CControl & | operator= (int32_t v) |
Control data assignment. | |
CControl & | operator= (uint32_t v) |
Control data assignment. | |
CControl & | operator= (int64_t v) |
Control data assignment. | |
CControl & | operator= (float v) |
Control data assignment. | |
CControl & | operator= (double v) |
Control data assignment. | |
CControl & | operator= (const DateTime &dt) |
Control data assignment. | |
CControl & | operator= (const Field &fld) |
Control data assignment. | |
operator String () const | |
Control data conversion. | |
operator int32_t () const | |
Control data conversion. | |
operator uint32_t () const | |
Control data conversion. | |
operator int64_t () const | |
Control data conversion. | |
operator uint64_t () const | |
Control data conversion. | |
operator float () const | |
Control data conversion. | |
operator double () const | |
Control data conversion. | |
operator DateTime () const | |
Control data conversion. | |
Public Member Functions inherited from sptk::CLayoutClient | |
CLayoutClient (Fl_Widget *widget, int layoutSize, CLayoutAlign ca) | |
virtual | ~CLayoutClient () |
CLayoutAlign | layoutAlign () const |
void | layoutAlign (CLayoutAlign al) |
int | layoutSize () const |
void | layoutSize (int ls) |
virtual void | label (const String &l) |
virtual const String & | label () const |
void | name (const char *aname) |
void | name (const String &aname) |
const String & | name () const |
virtual bool | preferredSize (int &w, int &h) |
virtual bool | computeSize (int &w, int &h) |
virtual String | className () const |
Fl_Widget * | widget () const |
virtual void | load (const xdoc::SNode &node, CLayoutXMLmode xmlMode) |
virtual void | load (const std::shared_ptr< xdoc::Node > &node) |
virtual void | save (const std::shared_ptr< xdoc::Node > &node, CLayoutXMLmode xmlMode) const |
Static Public Member Functions | |
static CLayoutClient * | creator (const xdoc::SNode &node) |
Static Public Member Functions inherited from sptk::CControl | |
static CControlKind | controlNameToType (const String &typeName, int &maxLength, const String &values="") |
Converts control name to control kind. | |
static void | defaultControlMenuCopy (Fl_Widget *, void *) |
Default callback function to support CControl default menu item 'Copy'. | |
static void | defaultControlMenuCut (Fl_Widget *, void *) |
Default callback function to support CControl default menu item 'Delete'. | |
static void | defaultControlMenuPaste (Fl_Widget *, void *) |
Default callback function to support CControl default menu item 'Paste'. | |
static void | defaultControlMenuClear (Fl_Widget *, void *) |
Default callback function to support CControl default menu item 'Clear'. | |
Protected Member Functions | |
void | load (Query *) override |
void | save (Query *) override |
void | load (const xdoc::SNode &node, CLayoutXMLmode xmlMode) override |
void | save (const xdoc::SNode &node, CLayoutXMLmode xmlMode) const override |
bool | valid () const override |
CInput (const char *label, int layoutSize, CLayoutAlign layoutAlign, bool autoCreate) | |
Protected Member Functions inherited from sptk::CControl | |
bool | containsFocus () const |
Does the control contain focus? | |
void | notifyFocus (bool gotFocus=true) |
Internal focus notification on focus change. | |
virtual void | onEnter () |
Internal focus notification on focus change. | |
virtual void | onExit () |
Internal focus notification on focus change. More... | |
uint32_t | labelHeight () const |
Computes the label height based on the labelFont() and labelWidth() | |
int | handle (int) override |
Special handle() method. | |
Protected Member Functions inherited from sptk::CLayoutClient | |
int | lastPreferredH () const |
int | lastPreferredW () const |
void | lastPreferredH (int height) |
void | lastPreferredW (int width) |
Additional Inherited Members | |
Static Public Attributes inherited from sptk::CControl | |
static const Fl_Menu_Item | defaultControlMenu [] |
CControl default menu. | |
Static Protected Member Functions inherited from sptk::CControl | |
static void | internalCallback (Fl_Widget *internalWidget, void *data) |
Internal callback function. | |
Protected Attributes inherited from sptk::CControl | |
bool | m_limited {false} |
uint32_t | m_labelWidth {0} |
Fl_Color | m_labelColor |
Fl_Color | m_textColor |
Fl_Font | m_textFont |
uchar | m_textSize {0} |
String | m_fieldName |
String | m_hint |
Fl_Widget * | m_control {nullptr} |
int | m_tag {0} |
uint32_t | m_controlFlags {0} |
Control's special flags (a bit combination of InputEntryFlags). More... | |
Fl_Menu_Button * | m_menuButton {nullptr} |
CEventInfo | m_event |
bool | m_hasFocus {false} |
Protected Attributes inherited from sptk::CLayoutClient | |
Fl_Widget * | m_widget |
String | m_name |
String | m_label |
CLayoutAlign | m_layoutAlign |
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.
|
protected |
sptk::CInput::CInput | ( | const char * | label = 0 , |
int | layoutSize = 10 , |
||
CLayoutAlign | layoutAlign = CLayoutAlign::TOP |
||
) |
Constructor in SPTK style
label | const char *, label |
layoutSize | int, widget align in layout |
layoutAlign | CLayoutAlign, widget align in layout |
|
override |
Destructor
|
inlineoverridevirtual |
Returns the control class name, SPTK-style RTTI
Reimplemented from sptk::CControl.
Reimplemented in sptk::CSplitter, sptk::CIntegerInput, sptk::CMemoInput, and sptk::CPhoneNumberInput.
int sptk::CInput::controlType | ( | ) | const |
Returns input widget input type
void sptk::CInput::controlType | ( | int | type | ) |
Sets input widget input type
|
static |
Creates a widget based on the XML node information
|
overridevirtual |
Universal data connection, returns data from control
Reimplemented from sptk::CControl.
Reimplemented in sptk::CMemoInput, sptk::CPhoneNumberInput, and sptk::CProgressBar.
Referenced by sptk::CFileDialog::fileName().
|
overridevirtual |
Universal data connection, sets data from control
Reimplemented from sptk::CControl.
Reimplemented in sptk::CMemoInput, sptk::CPhoneNumberInput, and sptk::CProgressBar.
|
inlineoverridevirtual |
Returns the control kind, SPTK-style RTTI
Implements sptk::CControl.
Reimplemented in sptk::CIntegerInput, sptk::CMemoInput, and sptk::CPhoneNumberInput.
References STRING.
|
inlineoverrideprotectedvirtual |
Loads control data from XML
Layout information may also include widget size and position, as well as visible() and active() states
node | xml::Node*, the XML node |
xmlMode | CLayoutXMLmode, the mode defining how the layout and/or data should be stored |
Reimplemented from sptk::CControl.
References sptk::CControl::load().
|
overrideprotectedvirtual |
Loads data from query
Reimplemented from sptk::CControl.
|
overridevirtual |
Returns the input text maximum length, 0 - unlimited
Reimplemented from sptk::CControl.
|
overridevirtual |
Sets the input text maximum length, 0 - unlimited
Reimplemented from sptk::CControl.
|
virtual |
Computes the optimal widget height
h | int&, input - height offered by the program, output - height required by widget |
Reimplemented in sptk::CDateInput.
|
overridevirtual |
Computes the optimal widget size
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 |
Reimplemented from sptk::CLayoutClient.
Reimplemented in sptk::CMemoInput, and sptk::CProgressBar.
|
virtual |
Computes the optimal widget width
w | int&, input - width offered by the program, output - width required by widget |
Reimplemented in sptk::CTimeInput, and sptk::CPhoneNumberInput.
|
inlineoverrideprotected |
Saves control data to XML
Layout information may also include widget size and position, as well as visible() and active() states
node | xml::Node*, the XML node |
xmlMode | CLayoutXMLmode, the mode defining how the layout and/or data should be stored |
References sptk::CControl::save().
|
overrideprotectedvirtual |
Saves data to query
Reimplemented from sptk::CControl.
Reimplemented in sptk::CIntegerInput, and sptk::CMemoInput.
|
overridevirtual |
Returns the input text font type
Reimplemented from sptk::CControl.
Reimplemented in sptk::CMemoInput.
|
overridevirtual |
|
overridevirtual |
Returns the input text font size
Reimplemented from sptk::CControl.
Reimplemented in sptk::CMemoInput.
|
overridevirtual |
|
inlineoverrideprotectedvirtual |
Returns true if the input data is valid
Implements sptk::CControl.
Reimplemented in sptk::CIntegerInput, and sptk::CPhoneNumberInput.