CrystalSpace

Public API Reference

Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

csInputLine Class Reference
[Input line]

The Input Line class implements a rectangular are where user can enter any text. More...

#include <csiline.h>

Inheritance diagram for csInputLine:

csComponent csSpinBox List of all members.

Public Methods

 csInputLine (csComponent *iParent, int iMaxLen=CSIL_DEFAULTLENGTH, csInputLineFrameStyle iFrameStyle=csifsThickRect)
 Create input line object.

virtual void SetText (const char *iText)
 Set text field.

virtual void Draw ()
 Draw the input line.

virtual bool HandleEvent (iEvent &Event)
 Handle external events.

virtual void SetState (int mask, bool enable)
 Override SetState method to redraw input line when it is switched.

void SetSelection (int iStart, int iEnd)
 Select text from character iStart to character iEnd.

void SetCursorPos (int NewPos, bool ExtendSel)
 Set new cursor position and extend selection if extendsel == true.

virtual void SuggestSize (int &w, int &h)
 Report the minimal size of inputline.

virtual bool IsValidPos (int NewPos)
 Check whenever new cursor position is valid.

virtual bool IsValidChar (char iChar)
 Check whenever a character is valid for inserting into string.

virtual bool IsValidString (const char *iText)
 Check if string after modification is valid.

void DeleteSelection ()
 Delete selection.


Protected Methods

int GetCharX (int iNum)
 Query character X position within component.

void SetTextExt (const char *iText)
 Set text, drop the selection and don't move the cursor.


Detailed Description

The Input Line class implements a rectangular are where user can enter any text.

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 61 of file csiline.h.


Constructor & Destructor Documentation

csInputLine::csInputLine csComponent   iParent,
int    iMaxLen = CSIL_DEFAULTLENGTH,
csInputLineFrameStyle    iFrameStyle = csifsThickRect
 

Create input line object.


Member Function Documentation

void csInputLine::DeleteSelection  
 

Delete selection.

virtual void csInputLine::Draw   [virtual]
 

Draw the input line.

Reimplemented from csComponent.

Reimplemented in csSpinBox.

int csInputLine::GetCharX int    iNum [protected]
 

Query character X position within component.

virtual bool csInputLine::HandleEvent iEvent   Event [virtual]
 

Handle external events.

Reimplemented from csComponent.

Reimplemented in csSpinBox.

virtual bool csInputLine::IsValidChar char    iChar [virtual]
 

Check whenever a character is valid for inserting into string.

virtual bool csInputLine::IsValidPos int    NewPos [virtual]
 

Check whenever new cursor position is valid.

virtual bool csInputLine::IsValidString const char *    iText [virtual]
 

Check if string after modification is valid.

void csInputLine::SetCursorPos int    NewPos,
bool    ExtendSel
 

Set new cursor position and extend selection if extendsel == true.

void csInputLine::SetSelection int    iStart,
int    iEnd
 

Select text from character iStart to character iEnd.

virtual void csInputLine::SetState int    mask,
bool    enable
[virtual]
 

Override SetState method to redraw input line when it is switched.

Reimplemented from csComponent.

virtual void csInputLine::SetText const char *    iText [virtual]
 

Set text field.

Reimplemented from csComponent.

Reimplemented in csSpinBox.

void csInputLine::SetTextExt const char *    iText [protected]
 

Set text, drop the selection and don't move the cursor.

virtual void csInputLine::SuggestSize int &    w,
int &    h
[virtual]
 

Report the minimal size of inputline.

Reimplemented from csComponent.


The documentation for this class was generated from the following file:
Generated for Crystal Space by doxygen 1.2.18