GCheckBox Class Reference

#include <GCheckBox.h>

Inheritance diagram for GCheckBox:

GView

List of all members.

Public Member Functions

 GCheckBox (int id, int x, int y, int cx, int cy, char *name, int InitState=false)
 Constructor.
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.
char16NameW ()
 Returns the wide char text associated with this view.
bool Name (char *n)
 Sets the utf-8 text associated with this view.
bool NameW (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.


Detailed Description

A checkbox to allow the user to select a boolean setting, i.e. a non-mutually exclusive option. For mutually exclusive options see GRadioButton.

Constructor & Destructor Documentation

GCheckBox::GCheckBox ( int  id,
int  x,
int  y,
int  cx,
int  cy,
char *  name,
int  InitState = false 
)

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 text of the label
InitState  The initial state of the control

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


Member Function Documentation

bool GCheckBox::Name ( 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 Name().

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().

Referenced by NameW().

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(), and GView::Invalidate().

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:

  • Fully off: 0
  • Fully on: 1
  • Partially on/Undefined: 2


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