#include <GCombo.h>
Public Types | |
enum | SelectedState { SelectedDisable, SelectedHide, SelectedShow } |
Public Member Functions | |
GCombo (int id, int x, int y, int cx, int cy, const char *name) | |
Constructor. | |
const 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 (const char *n) |
Sets the selected item by name. | |
char * | Name () |
Returns the selected item's name. | |
GSubMenu * | GetMenu () |
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 (const 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'. | |
bool | Delete (char *p) |
Deletes the pointer 'p'. | |
bool | Insert (char *p, int Index=-1) |
Inserts a pointer. |
GCombo::GCombo | ( | int | id, | |
int | x, | |||
int | y, | |||
int | cx, | |||
int | cy, | |||
const char * | name | |||
) |
Constructor.
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().
const 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().
Reimplemented from GView.
void GCombo::Sub | ( | int | Type | ) |
bool GCombo::Insert | ( | const char * | p, | |
int | Index = -1 | |||
) |
Inserts a new item.
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(), Name(), and GView::SetFont().