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

fgl::listbox Class Reference

#include <listbox.h>

Inheritance diagram for fgl::listbox:

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

Collaboration graph
[legend]
List of all members.

Detailed Description

Abstract parent for all visual containers - i.e. LISTBOX-es. Don't use this class directly!


Public Member Functions

void SetColors (int a, int b, int c, int d)
void Draw (int i=1)
void ShowCursor (void)
void HideCursor (void)
void Up (void)
void Down (void)
void Begin (void)
void End (void)
void SetSize (int)
int GetSize (void) const
void SetIndex (int)
int GetIndex (void) const
void SetIndexRel (int)
int GetCurrent (void) const
void SetToItemRel (int a)
void Resize (int a)
void SetToItem (int a)
void RedrawItem (void)
int Test (int, int)
int DoListBox (int key)
virtual const int ToInteger () const

Protected Member Functions

void Cursor (int)
int AdjustCursor (int item)
int Enabled (void)
 listbox (int xs, int ys, int w, int h, int DropDown, FGWindow *wind)
virtual void draw (void)
virtual void DrawItem (int, int, int, int)
virtual void WheelSpin (int direction)

Protected Attributes

int cursor
int slider
int drop_down
unsigned color_bg0
unsigned color_bg1
unsigned color_fg0
unsigned color_fg1
int xx
int yy
int curr
int count
int fpol
int line
int onew
int oneh


Member Function Documentation

int fgl::listbox::AdjustCursor int  item  )  [protected]
 

Try move cursor at new index and adjust all variables to new values.

void fgl::listbox::Begin void   ) 
 

Move at the start of the listbox.

Examples:
listbox.cpp.

int fgl::listbox::DoListBox int  key  ) 
 

The default listbox keypress handler. This function handle keys for moving across the listbox. The right place to call this is into the FGWindow handler on KEYEVENT switch.

void fgl::listbox::Down void   ) 
 

Move one line DOWN in the listbox.

Examples:
listbox.cpp.

void fgl::listbox::Draw int  i = 1  ) 
 

Redraw the whole object on the screen, the parameter 'i' is flag for cursor drawing (yes or no).

int fgl::listbox::Enabled void   )  [inline, protected]
 

Returns false if there aren't data int the object.

void fgl::listbox::End void   ) 
 

Move at the end (last line) of the listbox.

Examples:
listbox.cpp.

int fgl::listbox::GetCurrent void   )  const [inline]
 

Deprecated:
Set the current item in the listbox. Use GetIndex() instead.

int fgl::listbox::GetIndex void   )  const [inline]
 

Returns the current item in the listbox.

int fgl::listbox::GetSize void   )  const [inline]
 

Returns current size (number of lines).

void fgl::listbox::HideCursor void   ) 
 

Hide cursor at its position.

void fgl::listbox::RedrawItem void   )  [inline]
 

Redraw the current item/line in the listbox.

void fgl::listbox::Resize int  a  )  [inline]
 

Deprecated:
Set the new size of list box (i.e. number of items in it). Use SetSize() instead.

void fgl::listbox::SetColors int  a,
int  b,
int  c,
int  d
[inline]
 

Sets the listbox's colors.

Parameters:
a paper for normal item
b ink for normal item
c paper for selected item
d ink for selected item

void fgl::listbox::SetIndex int   ) 
 

Set the current item in the listbox.

void fgl::listbox::SetIndexRel int   ) 
 

Set the current item relative to the current item in the listbox.

void fgl::listbox::SetSize int   ) 
 

Set the new size of list box (i.e. number of items in it).

void fgl::listbox::SetToItem int  a  )  [inline]
 

Deprecated:
Set the current item in the listbox. Use SetIndex() instead.

void fgl::listbox::SetToItemRel int  a  )  [inline]
 

Deprecated:
Set the current item relative to the current item in the listbox. Use SetIndexRel() instead.

void fgl::listbox::ShowCursor void   ) 
 

Draw cursor at its position.

int fgl::listbox::Test int  ccx,
int  ccy
 

The right place for calling this function is into the Window handler on a CLICKLEFTEVENT case.

Parameters:
ccx the 'x' coordinate of mouse click
ccy the 'y' coordinate of mouse click
Returns:
(-1) if thest fails or the index to the listbox container.
Examples:
listbox.cpp.

void fgl::listbox::Up void   ) 
 

Move one line UP in the listbox.

Examples:
listbox.cpp.


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