sptk2 logo
SPTK Home Page
Public Member Functions | Protected Member Functions | List of all members
sptk::CInput_ Class Reference

#include <CInput.h>

Inheritance diagram for sptk::CInput_:
sptk::CLayoutClient

Public Member Functions

 CInput_ (const char *label=0, int layoutSize=20, CLayoutAlign layoutAlign=CLayoutAlign::TOP)
 
int handle (int event) override
 
uchar textSize () const
 
void textSize (uchar sz)
 
Fl_Font textFont () const
 
void textFont (Fl_Font fnt)
 
int maxLength () const
 
void maxLength (int ml)
 
bool preferredSize (int &w, int &h) override
 
void mask (const char *maskString)
 
- 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 Stringlabel () const
 
void name (const char *aname)
 
void name (const String &aname)
 
const Stringname () 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
 

Protected Member Functions

void maskValue ()
 
- Protected Member Functions inherited from sptk::CLayoutClient
int lastPreferredH () const
 
int lastPreferredW () const
 
void lastPreferredH (int height)
 
void lastPreferredW (int width)
 

Additional Inherited Members

- Protected Attributes inherited from sptk::CLayoutClient
Fl_Widget * m_widget
 
String m_name
 
String m_label
 
CLayoutAlign m_layoutAlign
 

Detailed Description

Base input widget

Extends the standard Fl_Input with the extra input types for the date, time, and phone input masks. It also supports the optional maximum input length. In is used mainly as the internal widget in different CControl-derived widgets.

Constructor & Destructor Documentation

◆ CInput_()

sptk::CInput_::CInput_ ( const char *  label = 0,
int  layoutSize = 20,
CLayoutAlign  layoutAlign = CLayoutAlign::TOP 
)

Constructor in SPTK style

Parameters
labelconst char *, label
layoutSizeint, widget align in layout
layoutAlignCLayoutAlign, widget align in layout

Member Function Documentation

◆ handle()

int sptk::CInput_::handle ( int  event)
override

CInput_-specific version of FLTK handle() function

Parameters
eventint, FLTK event
Returns
true if the event was processed

◆ mask()

void sptk::CInput_::mask ( const char *  maskString)

Sets the optional mask to the input widget. Passing an empty string as the maskString clears the mask.

Parameters
maskStringconst char *, the mask string.

◆ maskValue()

void sptk::CInput_::maskValue ( )
protected

Conversion of the outside input value into internal masked value using mask (if defined)

◆ maxLength() [1/2]

int sptk::CInput_::maxLength ( ) const
inline

Returns the maximum length for the input text

◆ maxLength() [2/2]

void sptk::CInput_::maxLength ( int  ml)
inline

Sets the maximum length for the input text

◆ preferredSize()

bool sptk::CInput_::preferredSize ( int &  w,
int &  h 
)
overridevirtual

Computes the optimal widgets size

Parameters
wint&, input - width offered by the program, output - width required by widget
hint&, 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.

◆ textFont() [1/2]

Fl_Font sptk::CInput_::textFont ( ) const
inline

Returns the font type for the input text

◆ textFont() [2/2]

void sptk::CInput_::textFont ( Fl_Font  fnt)
inline

Sets the font type for the input text

◆ textSize() [1/2]

uchar sptk::CInput_::textSize ( ) const
inline

Returns the font size for the input text

◆ textSize() [2/2]

void sptk::CInput_::textSize ( uchar  sz)
inline

Sets the font size for the input text


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

Fri Oct 14 2022 09:58:37: SPTK 5.4.1