GCombo Class Reference

Combo Box widget. More...

#include <GCombo.h>

Inheritance diagram for GCombo:

GControl List< char > GView GView

List of all members.

Public Types

enum  SelectedState { SelectedDisable, SelectedHide, SelectedShow }

Public Member Functions

 GCombo (int id, int x, int y, int cx, int cy, char *name)
 Constructor.
char * GetClass ()
bool Sort ()
 Returns whether to sort the list.
void Sort (bool s)
 Sets whether to sort the list.
int Sub ()
 Returns whether to classify the list into submenus.
void Sub (int Type)
 Makes the list of entries sort into submenus. Good for large lists.
void Value (int64 i)
 Sets the selected item.
int64 Value ()
 Returns the select item.
bool Name (char *n)
 Sets the selected item by name.
char * Name ()
 Returns the selected item's name.
GSubMenuGetMenu ()
 Gets the menu used.
void SetMenu (GSubMenu *m)
 Sets the menu used.
SelectedState GetSelectedState ()
 Gets the selected item's state when the menu is shown.
void SetSelectedState (SelectedState s)
 Sets the selected item's state when the menu is shown.
bool Delete ()
 Deletes the currently select item in the list.
bool Delete (int i)
 Deletes the item at index 'i'.
bool Delete (char *p)
 Deletes the item matching 'p'.
void Empty ()
 Clears all items in the list.
bool Insert (char *p, int Index=-1)
 Inserts a new item.
int GetItems ()
 Gets the items in the list.
char * operator[] (int i)
 Returns the item at index 'i'.
int OnEvent (GMessage *Msg)
 Called to process every message received by this window.
void OnMouseClick (GMouse &m)
 The mouse was clicked over this view.
bool OnKey (GKey &k)
 A key was pressed while this view has focus.
void OnFocus (bool f)
 The view gains or loses the keyboard focus.
void OnPaint (GSurface *pDC)
 Called to paint the onscreen representation of the view.
void SetFont (GFont *Fnt, bool OwnIt=false)
 Sets the font for this control.
void OnAttach ()
 Called after the view is attached to a new parent.
bool SetPos (GRect &p, bool Repaint=false)
 Set the position of the view in terms of it's parent.
void Value (int64 i)
 Sets the integer representation of the view's contents.
int64 Value ()
 Gets the integer representation of the view's contents.
int OnEvent (GMessage *Msg)
 Called to process every message received by this window.
bool Delete ()
 Deletes the current item.
bool Delete (int i)
 Deletes the item at position 'i'.


Detailed Description

Combo Box widget.

Member Enumeration Documentation

This state describes what happens to the currently selected entry in the list when the menu is openned.

Enumerator:
SelectedDisable  Disable the current item.
SelectedHide  Hide the current item.
SelectedShow  Show (enabled) the current item.


Constructor & Destructor Documentation

GCombo::GCombo ( int  id,
int  x,
int  y,
int  cx,
int  cy,
char *  name 
)

Constructor.

Parameters:
id  The control ID
x  The left edge x coordinate
y  The top edge y coordinate
cx  The width
cy  The height
name  The initial text

References Name(), GView::SetId(), SetPos(), and GView::SetTabStop().


Member Function Documentation

char* GCombo::GetClass (  )  [inline]

The class' name. Should be overriden in child classes to return the right class name. Mostly used for debugging, but in the win32 port it is also the default WIN32 class name passed to RegisterClass() in GView::CreateClass().

Returns:
the Class' name for debugging

Reimplemented from GView.

bool GCombo::Insert ( char *  p,
int  Index = -1 
)

Inserts a new item.

Parameters:
p  The new item
Index  The location to insert or -1 for the end of the list

References GView::Invalidate().

Referenced by GFontSelect::GFontSelect().

void GCombo::SetFont ( GFont Fnt,
bool  OwnIt = false 
) [virtual]

Sets the font for this control.

The lifetime of the font passed in is the responsibility of the caller. The GView object assumes the pointer will be valid at all times.

Reimplemented from GView.

References GView::GetFont(), GView::Invalidate(), and Name().

void GCombo::Sub ( int  Type  ) 

Makes the list of entries sort into submenus. Good for large lists.

Parameters:
Type  The type of classification to use. One of GV_INT32, GV_DOUBLE or GV_STRING.


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

Generated on Wed Dec 1 15:41:02 2010 for Lgi by  doxygen 1.5.7.1