Model Railroad System
2.2.1
|
Toggle switch object type. More...
Public Member Functions | |
Toggle (name, _ctcpanel, _canvas,...) | |
Construct a toggle switch object. More... | |
~Toggle () | |
Clean up all data objects and free up all resources. More... | |
getv () | |
Method to get our value (lever position). More... | |
setv (state) | |
Method to set out value (level position). More... | |
geti (ind) | |
Method to get the state of one of our indicators (none). More... | |
seti (ind, value) | |
Method to set an indicator's state (none). More... | |
invoke () | |
Method to invoke the toggle switch. More... | |
Private Member Functions | |
_VerifyOrientationHV (option, value) | |
Method to validate an orientation option of horizontal or vertical. More... | |
_configureLeftLabel (option, value) | |
Method to update the leftlabel option. More... | |
_configureRightLabel (option, value) | |
Method to update the rightlabel option. More... | |
_configureCenterLabel (option, value) | |
Method to update the centerlabel option. More... | |
_AddTLever (pos) | |
Method to add (draw) a toggle switch lever. More... | |
_MoveTLever (mx, my) | |
Method to move an object's lever. More... | |
Private Attributes | |
ctcpanel | |
The CTC Panel component (parent widget). More... | |
canvas | |
The canvas component (parent widget component). More... | |
lever | |
Toggle switch object type.
These are on the control panel and represent simple toggle switches.
_ctcpanel | The CTCPanel megawidget. |
_canvas | The control panel canvas to draw the switch plate on. |
... | Options:
|
CTCPanel::Toggle::Toggle | ( | name | , |
_ctcpanel | , | ||
_canvas | , | ||
... | |||
) |
Construct a toggle switch object.
_ctcpanel | The CTCPanel megawidget. |
_canvas | The control panel canvas to draw the Code Button on. |
... | Option list. |
CTCPanel::Toggle::~Toggle | ( | ) |
Clean up all data objects and free up all resources.
|
private |
Method to add (draw) a toggle switch lever.
pos | The lever's position (Left, Right, or Center). |
|
private |
Method to update the centerlabel option.
|
private |
Method to update the leftlabel option.
|
private |
Method to update the rightlabel option.
|
private |
Method to move an object's lever.
mx | Mouse X coordinate. The lever is moved to be near the mouse pointer. |
my | Mouse Y coordinate. The lever is moved to be near the mouse pointer. |
|
private |
Method to validate an orientation option of horizontal or vertical.
CTCPanel::Toggle::geti | ( | ind | ) |
Method to get the state of one of our indicators (none).
CTCPanel::Toggle::getv | ( | ) |
Method to get our value (lever position).
CTCPanel::Toggle::invoke | ( | ) |
Method to invoke the toggle switch.
One of the command scripts is executed depending on the lever position.
CTCPanel::Toggle::seti | ( | ind | , |
value | |||
) |
Method to set an indicator's state (none).
CTCPanel::Toggle::setv | ( | state | ) |
Method to set out value (level position).
state | The new state to set. |
|
private |
The canvas component (parent widget component).
|
private |
The CTC Panel component (parent widget).
|
private |