Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | Related Pages | Examples

fgl::FGEditBox Class Reference

#include <fastgl.h>

Inheritance diagram for fgl::FGEditBox:

Inheritance graph
[legend]
Collaboration diagram for fgl::FGEditBox:

Collaboration graph
[legend]
List of all members.

Detailed Description

You can use this object to get any text or number from user. When you activate such object, you can use keyboard to edit the text (HOME, DEL, BACKSPACE, ARROWS and ESC work properly). The input is passed to your program when the user hits the 'ENTER' key. The ESC key pressing terminates the input without change. You can type input line up to 127 characters long. The special shortcuts CTRL+INS and SHIFT+INS are used to standard COPY&PASTE mechanism.

editbox.png
Examples:

buttons.cpp, and updown.cpp.


Public Member Functions

virtual void draw (void)
const double ToDouble () const
const int ToInteger () const
const char * ToString () const
void ClickUp (int state=1)
void PasswdMode (int m)
void HexMode (int m)
void CapsMode (int m)
void ChangeItem (int *p)
void ChangeItem (char *p)
void ChangeItem (double *p)
void SetRange (double mi, double ma)
void SetRange (int mi, int ma)
void SetSize (int ns)
void Disable (void)
 FGEditBox (int xs, int ys, int ws1, int ws2, const char *nm, int key, FGWindow *w, int *pt, int ink, int paper, ControlCall f, int mn, int mx, int check, void *user_data)
 FGEditBox (int sz, int xs, int ys, int ws1, int ws2, const char *nm, int key, FGWindow *w, char *pt, int ink, int paper, ControlCall f, void *user_data)
 FGEditBox (int xs, int ys, int ws1, int ws2, const char *nm, int key, FGWindow *w, double *pt, int ink, int paper, ControlCall f, double mn, double mx, int check, void *user_data)

Static Public Attributes

static const int bufsize = 252

Protected Member Functions

virtual void draw (bool cursor, bool first_time=false)

Protected Attributes

int w1
int w2
int min
int max
dtype data_type
unsigned first:1
unsigned passwd:1
unsigned check_range:1
unsigned hex:1
unsigned caps:2
unsigned isinput:1
double mind
double maxd
void * ptr
char buf [bufsize]
int pos
int maxpos
int iline
int icol
int offset
int size

Static Protected Attributes

static char clip [bufsize]
static int is_clip


Constructor & Destructor Documentation

fgl::FGEditBox::FGEditBox int  xs,
int  ys,
int  ws1,
int  ws2,
const char *  nm,
int  key,
FGWindow w,
int *  pt,
int  ink,
int  paper,
ControlCall  f,
int  mn,
int  mx,
int  check,
void *  user_data
 

Create an editbox for an integer number input. Don't call this directly. Rather use FGWindow::AddEditBox() methods instead.

fgl::FGEditBox::FGEditBox int  sz,
int  xs,
int  ys,
int  ws1,
int  ws2,
const char *  nm,
int  key,
FGWindow w,
char *  pt,
int  ink,
int  paper,
ControlCall  f,
void *  user_data
 

Create an editbox for an text input. Don't call this directly. Rather use FGWindow::AddEditBox() methods instead.

fgl::FGEditBox::FGEditBox int  xs,
int  ys,
int  ws1,
int  ws2,
const char *  nm,
int  key,
FGWindow w,
double *  pt,
int  ink,
int  paper,
ControlCall  f,
double  mn,
double  mx,
int  check,
void *  user_data
 

Create an editbox for an double precission number input. Don't call this directly. Rather use FGWindow::AddEditBox() methods instead.


Member Function Documentation

void fgl::FGEditBox::CapsMode int  m  ) 
 

draw only input text with/without cursor

All letters will be converted to the capitals.

void fgl::FGEditBox::ChangeItem double *  p  )  [inline]
 

Change the data that are edited by editbox. You must call this methods to apropriate FGEditBox type - this is for an double type of the object.

void fgl::FGEditBox::ChangeItem char *  p  )  [inline]
 

Change the data that are edited by editbox. You must call this methods to apropriate FGEditBox type - this is for an string type of the object.

void fgl::FGEditBox::ChangeItem int *  p  )  [inline]
 

Change the data that are edited by editbox. You must call this methods to apropriate FGEditBox type - this is for an integer type of the object.

void fgl::FGEditBox::ClickUp int  state = 1  )  [virtual]
 

Switch the inputbox into input mode (shows cursor and redirect all FGWindow's keypress into one).

Reimplemented from fgl::FGControl.

void fgl::FGEditBox::Disable void   ) 
 

Override the disable methods.

Reimplemented from fgl::FGControl.

void fgl::FGEditBox::draw void   )  [virtual]
 

draw all

Reimplemented from fgl::FGControl.

void fgl::FGEditBox::draw bool  cursor,
bool  first_time = false
[protected, virtual]
 

redraw input string

void fgl::FGEditBox::HexMode int  m  )  [inline]
 

The input will parsed as a hexadecimal number (without '0x' prefix).

void fgl::FGEditBox::PasswdMode int  m  )  [inline]
 

Sets password mode. All typed characters will be shown as '*'.

void fgl::FGEditBox::SetRange int  mi,
int  ma
[inline]
 

Change the range for edited values. You must call this methods to apropriate FGEditBox type - this one is for a int type of the object.

void fgl::FGEditBox::SetRange double  mi,
double  ma
[inline]
 

Change the range for edited values. You must call this methods to apropriate FGEditBox type - this one is for a double type of the object.

void fgl::FGEditBox::SetSize int  ns  )  [inline]
 

Sets a new size of the input string. Default is calculated from the objects width. You can set values from 1 to 127.

const double fgl::FGEditBox::ToDouble  )  const [inline, virtual]
 

Dynamic cast.

Reimplemented from fgl::FGControl.

const int fgl::FGEditBox::ToInteger  )  const [inline, virtual]
 

Dynamic cast.

Reimplemented from fgl::FGControl.

const char* fgl::FGEditBox::ToString  )  const [inline, virtual]
 

Dynamic cast.

Reimplemented from fgl::FGControl.


Member Data Documentation

const int fgl::FGEditBox::bufsize = 252 [static]
 

max. size of the edited text string


Generated on Wed Feb 9 11:31:44 2005 for OpenGUI by  doxygen 1.4.0