![]() |
Public API Reference |
#include <csiline.h>
Inheritance diagram for csInputLine:
Public Methods | |
csInputLine (csComponent *iParent, int iMaxLen=CSIL_DEFAULTLENGTH, csInputLineFrameStyle iFrameStyle=csifsThickRect) | |
Create input line object. More... | |
virtual void | SetText (const char *iText) |
Set text field. More... | |
virtual void | Draw () |
Draw the input line. More... | |
virtual bool | HandleEvent (iEvent &Event) |
Handle external events. More... | |
virtual void | SetState (int mask, bool enable) |
Override SetState method to redraw input line when it is switched. More... | |
void | SetSelection (int iStart, int iEnd) |
Select text from character iStart to character iEnd. More... | |
void | SetCursorPos (int NewPos, bool ExtendSel) |
Set new cursor position and extend selection if extendsel == true. More... | |
virtual void | SuggestSize (int &w, int &h) |
Report the minimal size of inputline. More... | |
virtual bool | IsValidPos (int NewPos) |
Check whenever new cursor position is valid. More... | |
virtual bool | IsValidChar (char iChar) |
Check whenever a character is valid for inserting into string. More... | |
virtual bool | IsValidString (const char *iText) |
Check if string after modification is valid. More... | |
void | DeleteSelection () |
Delete selection. More... | |
Protected Methods | |
int | GetCharX (int iNum) |
Query character X position within component. More... | |
void | SetTextExt (const char *iText) |
Set text, drop the selection and don't move the cursor. More... |
The class has a method called IsValidChar() which can be overriden to implement specific needs, for example if you would like to implement a input line which accepts only numbers you can just override the method IsValidChar() and analyze entered characters. There is also a more general method called IsValidString() which checks the just-modified string for correctness. If method decides that string is incorrect, the changes are undone.
Definition at line 59 of file csiline.h.
|
Create input line object.
|
|
Delete selection.
|
|
Draw the input line.
Reimplemented from csComponent. Reimplemented in csSpinBox. |
|
Query character X position within component.
|
|
Handle external events.
Reimplemented from csComponent. Reimplemented in csSpinBox. |
|
Check whenever a character is valid for inserting into string.
|
|
Check whenever new cursor position is valid.
|
|
Check if string after modification is valid.
|
|
Set new cursor position and extend selection if extendsel == true.
|
|
Select text from character iStart to character iEnd.
|
|
Override SetState method to redraw input line when it is switched.
Reimplemented from csComponent. |
|
Set text field.
Reimplemented from csComponent. Reimplemented in csSpinBox. |
|
Set text, drop the selection and don't move the cursor.
|
|
Report the minimal size of inputline.
Reimplemented from csComponent. |