#include <GCheckBox.h>
Public Member Functions | |
GCheckBox (int id, int x, int y, int cx, int cy, const char *name, int InitState=false) | |
Constructor. | |
const char * | GetClass () |
bool | ThreeState () |
Returns whether the control is 3 state. | |
void | ThreeState (bool t) |
int64 | Value () |
Returns the current value, 0 or 1. Or possibly 2 if ThreeState() is set. | |
void | Value (int64 b) |
Sets the current value. | |
char * | Name () |
Returns the utf-8 text associated with this view. | |
char16 * | NameW () |
Returns the wide char text associated with this view. | |
bool | Name (const char *n) |
Sets the utf-8 text associated with this view. | |
bool | NameW (const char16 *n) |
Sets the wide char text associated with this view. | |
void | SetFont (GFont *Fnt, bool OwnIt=false) |
Sets the font for this control. | |
void | OnMouseClick (GMouse &m) |
The mouse was clicked over this view. | |
void | OnMouseEnter (GMouse &m) |
Mouse moves into the area over the control. | |
void | OnMouseExit (GMouse &m) |
Mouse leaves the area over the control. | |
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 | OnAttach () |
Called after the view is attached to a new parent. | |
int | OnEvent (GMessage *Msg) |
Called to process every message received by this window. |
GCheckBox::GCheckBox | ( | int | id, | |
int | x, | |||
int | y, | |||
int | cx, | |||
int | cy, | |||
const char * | name, | |||
int | InitState = false | |||
) |
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 text of the label |
InitState | The initial state of the control |
References Name(), GView::SetId(), GView::SetPos(), and GView::SetTabStop().
const char* GCheckBox::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 GCheckBox::ThreeState | ( | bool | t | ) |
Sets whether the control is 3 state.
In the case that the control is 3 state, the 3 states are:
char16* GCheckBox::NameW | ( | ) | [inline, virtual] |
Returns the wide char text associated with this view.
On Win32 the wide characters are 16 bits, on unix systems they are 32-bit characters.
Reimplemented from GView.
References GView::NameW().
bool GCheckBox::Name | ( | const char * | n | ) |
Sets the utf-8 text associated with this view.
Name and NameW are interchangable. Using them in any order will convert the text between utf-8 and wide to satify any requirement. Generally once the opposing version of the string is required both the utf-8 and wide copies of the string remain cached in RAM until the Name is changed.
Reimplemented from GView.
References GView::GetFont(), and GView::Name().
void GCheckBox::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 GView::SetFont().