Return to Index

Toggle

Parent class: Widget

The Toggle widget provides a boolean input control. The widget can display different text for the on and off states, and the current state is reflected by a yellow indicator light.


Object Events:
ToggledAn event generated when the toggle changes state.

Method Summary:
Toggle::Toggle();
void Toggle::setOnLabel(const String& pText);
void Toggle::setOffLabel(const String& pText);
String Toggle::getOnLabel();
String Toggle::getOffLabel();
void Toggle::setState(bool pState);
bool Toggle::getState();
void Toggle::toggle();



Toggle::Toggle
Toggle::Toggle();

Constructs a new toggle widget.

void Toggle::setOnLabel
void Toggle::setOnLabel(const String& pText);

Changes the text displayed when the toggle is on.
Parameters:
const String& pTextThe text label.

void Toggle::setOffLabel
void Toggle::setOffLabel(const String& pText);

Changes the text displayed when the toggle is off.
Parameters:
const String& pTextThe text label.

String Toggle::getOnLabel
String Toggle::getOnLabel();

Returns the text displayed when the toggle is on.

String Toggle::getOffLabel
String Toggle::getOffLabel();

Returns the text displayed when the toggle is off.

void Toggle::setState
void Toggle::setState(bool pState);

Changes the state of the toggle. Note that this does not generate a Toggle event.
Parameters:
bool pStateThe new state.

bool Toggle::getState
bool Toggle::getState();

Returns the current state of the toggle.

void Toggle::toggle
void Toggle::toggle();

Changes to the opposite state. This generates a Toggled event.


Generated automatically by docgen 0.0.1
© 2003 Aron Dobos