Model Railroad System 2.2.2
|
Main CTC Panel megawidget. More...
Public Member Functions | |
CTCPanel (name,...) | |
Build and install all component widgets and process configuration. More... | |
updateSR (canvas, newheight, newwidth) | |
Method to update one of the canvases scroll region. More... | |
zoomBy (zoomFactor) | |
Method to zoom the display by a zoom factor. More... | |
setZoom (zoomFactor) | |
Method to set the zoom factor to a specific factor. More... | |
getZoom () | |
Return the zoom (scaling) factor. More... | |
getv (name) | |
Method to get the value (or state) of an object. More... | |
setv (name, value) | |
Method to set the value (or state) of an object. More... | |
geti (name, ind) | |
Method to get the indicator state of an object. More... | |
seti (name, ind, value) | |
Method to set the indicator state of an object. More... | |
itemcget (name, option) | |
Method to get a configuration option from an object. More... | |
itemconfigure (name,...) | |
Method to set a configuration option from an object. More... | |
exists (name) | |
Test if the named object exists. More... | |
delete (name) | |
Delete a named object. More... | |
move (name, x, y) | |
Move a named object. More... | |
invoke (name) | |
Method to invoke an object. More... | |
coords (name, tname) | |
Method to fetch the coordinates of some part of an object. More... | |
bind (name,...) | |
Method to set a binding on an Object. More... | |
print (name, fp) | |
Method to print the named object to the specificied file channel. More... | |
objectlist (cp="", class="") | |
Method to return the list of objects. More... | |
cplist () | |
Method to return the list of controlpoints. More... | |
create_SWPlate (name,...) | |
Method to create a switch plate object. More... | |
create_SIGPlate (name,...) | |
Method to create a signal plate object. More... | |
create_CodeButton (name,...) | |
Method to create a code button object. More... | |
create_Toggle (name,...) | |
Method to create a toggle switch object. More... | |
create_Lamp (name,...) | |
Method to create a lamp object. More... | |
create_CTCLabel (name,...) | |
Method to create a CTC Label label object. More... | |
create_Switch (name,...) | |
Method to create a switch (turnout) object. More... | |
create_SchLabel (name,...) | |
Method to create a schematic label object. More... | |
create_StraightBlock (name,...) | |
Method to create a straight block of track object. More... | |
create_EndBumper (name,...) | |
Method to create a end bumper of track object. More... | |
create_CurvedBlock (name,...) | |
Method to create a curved block of track object. More... | |
create_ScissorCrossover (name,...) | |
Method to create a scissor crossover object. More... | |
create_Crossover (name,...) | |
Method to create a crossover object. More... | |
create_Crossing (name,...) | |
Method to create a track crossing object. More... | |
create_SingleSlip (name,...) | |
Method to create a single slip object. More... | |
create_DoubleSlip (name,...) | |
Method to create a double slip object. More... | |
create_ThreeWaySW (name,...) | |
Method to create a three way switch object. More... | |
create_HiddenBlock (name,...) | |
Method to create a hidden block of track object. More... | |
create_StubYard (name,...) | |
Method to create a stub (deadend) yard object. More... | |
create_ThroughYard (name,...) | |
Method to create a through yard object. More... | |
create_PushButton (name,...) | |
Method to create a push button object. More... | |
create_Signal (name,...) | |
Method to create a signal object. More... | |
schematic_crosshair (...) | |
Display crosshairs on the schematic canvas. More... | |
controls_crosshair (...) | |
Display crosshairs on the controls canvas. More... | |
Protected Member Functions | |
checkInitCP (cp) | |
Method to check that a control point has been initialized. More... | |
updateAndSyncCP (cp) | |
Method to update and syncronize a control point. More... | |
lappendCP (cp, slot, what) | |
Method to lappend something to a slot in a control point's data. More... | |
lremoveCP (cp, slot, what) | |
Method to remove something from a slot in a control point's data. More... | |
Private Member Functions | |
_PosInteger (option, value) | |
Method to validate a positive non zero integer option. More... | |
_CtcMainSyncX (this, other, first, last) | |
Internal method to x scroll updates. More... | |
_CtcMainHScroll2 (...) | |
Internal method to scroll two canvases at the same time. More... | |
_crosshairStart (canvas, xvar, yvar) | |
Start using the crosshairs. More... | |
_crosshairMove (canvas, xvar, yvar, mx, my) | |
Bound to mouse movement events. More... | |
_crosshairEnd (canvas, xvar, yvar, mx, my) | |
Bound to left button down. More... | |
Private Attributes | |
schematic | |
The schematic component. More... | |
schematicYscroll | |
The schematic y scroll bar component. More... | |
xscroll | |
The shared x scroll bar component. More... | |
controls | |
The controls component. More... | |
controlsYscroll | |
The controls y scroll bar component. More... | |
scale | |
The current scale value. More... | |
CPList | |
The list of control points. More... | |
CPData | |
The Control point data array. More... | |
Objects | |
The object array. More... | |
_ch_oldgrab | |
Used save the old grab. More... | |
_ch_oldfocus | |
Used save the old focus. More... | |
Main CTC Panel megawidget.
This megawidget implements two display areas, each with a vertical (Y) scrollbar. They share a horizontal (X) scrollbar. The upper display area contains schematic trackwork and the lower display area contains various switches, buttons, and lamps that deal with trackage control points.
path | Pathname of the widget. |
... | Options:
|
CTCPanel::CTCPanel::CTCPanel | ( | name | , |
... | |||
) |
Build and install all component widgets and process configuration.
... | Argument list (option value pairs). Gets passed to the implicitly defined configurelist method. |
|
private |
Bound to left button down.
Ends crosshairs and returns the results.
canvas | The canvas the crosshairs are on. |
xvar | The name of the global variable to receive the X result. |
yvar | The name of the global variable to receive the Y result. |
mx | The X mouse position. |
my | The Y mouse position. |
|
private |
Bound to mouse movement events.
canvas | The canvas the crosshairs are on. |
xvar | The name of the global variable to receive the X result. |
yvar | The name of the global variable to receive the Y result. |
mx | The X mouse position. |
my | The Y mouse position. |
|
private |
Start using the crosshairs.
canvas | The canvas the crosshairs are on. |
xvar | The name of the global variable to receive the X result. |
yvar | The name of the global variable to receive the Y result. |
|
private |
Internal method to scroll two canvases at the same time.
Bound to the horizontal scrollbar's -command.
... | The arguments passed from the scroll bar. |
|
private |
Internal method to x scroll updates.
Updates the scrolling for both canvases, making sure that they are in sync. The scrollbar is also updated. This method is bound to the -xscrollcommands of the schematic and controls canvases.
this | The canvas whose scrolling changed. |
other | The other canvas, which needs to be syncronized. |
first | The coordinate of the first (left most) visible part of the canvas. Passed from the canvas. |
last | The coordinate of the last (right most) visible part of the canvas. Passed from the canvas. |
|
private |
Method to validate a positive non zero integer option.
option | The option name. |
value | The value to validate. |
CTCPanel::CTCPanel::bind | ( | name | , |
... | |||
) |
Method to set a binding on an Object.
name | The name of the object to set a binding on. |
sequence | The event sequence to bind to. |
script | The script to run when the binding event occurs. If the script is prefixed with a "+", it is appended to any existing script. |
|
protected |
Method to check that a control point has been initialized.
Should only be called from object constructors.
cp | The name of the control point. |
CTCPanel::CTCPanel::controls_crosshair | ( | ... | ) |
Display crosshairs on the controls canvas.
... | Options:
|
CTCPanel::CTCPanel::coords | ( | name | , |
tname | |||
) |
Method to fetch the coordinates of some part of an object.
name | The name of the object to fetch coordinates from. |
tname | The name of the terminal of the object to fetch the coordinates of. See the individual element descriptions for valid terminal names. |
CTCPanel::CTCPanel::cplist | ( | ) |
Method to return the list of controlpoints.
CTCPanel::CTCPanel::create_CodeButton | ( | name | , |
... | |||
) |
Method to create a code button object.
name | The name of the new code button. |
... | The argument list for the object constructor. |
See CodeButton for defails.
CTCPanel::CTCPanel::create_Crossing | ( | name | , |
... | |||
) |
Method to create a track crossing object.
name | The name of the new crossing. |
... | The argument list for the object constructor. |
See Crossing for defails.
CTCPanel::CTCPanel::create_Crossover | ( | name | , |
... | |||
) |
Method to create a crossover object.
name | The name of the new crossover. |
... | The argument list for the object constructor. |
See Crossover for defails.
CTCPanel::CTCPanel::create_CTCLabel | ( | name | , |
... | |||
) |
Method to create a CTC Label label object.
name | The name of the new label. |
... | The argument list for the object constructor. |
See CTCLabel for defails.
CTCPanel::CTCPanel::create_CurvedBlock | ( | name | , |
... | |||
) |
Method to create a curved block of track object.
name | The name of the new track block. |
... | The argument list for the object constructor. |
See CurvedBlock for defails.
CTCPanel::CTCPanel::create_DoubleSlip | ( | name | , |
... | |||
) |
Method to create a double slip object.
name | The name of the new switch. |
... | The argument list for the object constructor. |
See DoubleSlip for defails.
CTCPanel::CTCPanel::create_EndBumper | ( | name | , |
... | |||
) |
Method to create a end bumper of track object.
name | The name of the new track block. |
... | The argument list for the object constructor. |
See EndBumper for defails.
CTCPanel::CTCPanel::create_HiddenBlock | ( | name | , |
... | |||
) |
Method to create a hidden block of track object.
name | The name of the new track block. |
... | The argument list for the object constructor. |
See HiddenBlock for defails.
CTCPanel::CTCPanel::create_Lamp | ( | name | , |
... | |||
) |
Method to create a lamp object.
name | The name of the new lamp. |
... | The argument list for the object constructor. |
See Lamp for defails.
CTCPanel::CTCPanel::create_PushButton | ( | name | , |
... | |||
) |
Method to create a push button object.
name | The name of the push button. |
... | The argument list for the object constructor. |
See PushButton for defails.
CTCPanel::CTCPanel::create_SchLabel | ( | name | , |
... | |||
) |
Method to create a schematic label object.
name | The name of the new label. |
... | The argument list for the object constructor. |
See SchLabel for defails.
CTCPanel::CTCPanel::create_ScissorCrossover | ( | name | , |
... | |||
) |
Method to create a scissor crossover object.
name | The name of the new crossover. |
... | The argument list for the object constructor. |
See ScissorCrossover for defails.
CTCPanel::CTCPanel::create_Signal | ( | name | , |
... | |||
) |
Method to create a signal object.
name | The name of the signal. |
... | The argument list for the object constructor. |
See Signal for defails.
CTCPanel::CTCPanel::create_SIGPlate | ( | name | , |
... | |||
) |
Method to create a signal plate object.
name | The name of the new signal plate. |
... | The argument list for the object constructor. |
See SIGPlate for defails.
CTCPanel::CTCPanel::create_SingleSlip | ( | name | , |
... | |||
) |
Method to create a single slip object.
name | The name of the new switch. |
... | The argument list for the object constructor. |
See SingleSlip for defails.
CTCPanel::CTCPanel::create_StraightBlock | ( | name | , |
... | |||
) |
Method to create a straight block of track object.
name | The name of the new track block. |
... | The argument list for the object constructor. |
See StraightBlock for defails.
CTCPanel::CTCPanel::create_StubYard | ( | name | , |
... | |||
) |
Method to create a stub (deadend) yard object.
name | The name of the new yard. |
... | The argument list for the object constructor. |
See StubYard for defails.
CTCPanel::CTCPanel::create_Switch | ( | name | , |
... | |||
) |
Method to create a switch (turnout) object.
name | The name of the new switch. |
... | The argument list for the object constructor. |
See Switch for defails.
CTCPanel::CTCPanel::create_SWPlate | ( | name | , |
... | |||
) |
Method to create a switch plate object.
name | The name of the new switch plate. |
... | The argument list for the object constructor. |
See SWPlate for details.
CTCPanel::CTCPanel::create_ThreeWaySW | ( | name | , |
... | |||
) |
Method to create a three way switch object.
name | The name of the new switch. |
... | The argument list for the object constructor. |
See ThreeWaySW for defails.
CTCPanel::CTCPanel::create_ThroughYard | ( | name | , |
... | |||
) |
Method to create a through yard object.
name | The name of the new yard. |
... | The argument list for the object constructor. |
See ThroughYard for defails.
CTCPanel::CTCPanel::create_Toggle | ( | name | , |
... | |||
) |
Method to create a toggle switch object.
name | The name of the new toggle switch. |
... | The argument list for the object constructor. |
See Toggle for defails.
CTCPanel::CTCPanel::delete | ( | name | ) |
Delete a named object.
name | The name of the object to delete. |
CTCPanel::CTCPanel::exists | ( | name | ) |
Test if the named object exists.
name | The object to test for. |
CTCPanel::CTCPanel::geti | ( | name | , |
ind | |||
) |
Method to get the indicator state of an object.
name | The name of the object to fetch the indicator state of. |
ind | The indicator whose state is return. See the individual element descriptions for valid indicator names. |
CTCPanel::CTCPanel::getv | ( | name | ) |
Method to get the value (or state) of an object.
name | The name of the object to fetch the value of. |
CTCPanel::CTCPanel::getZoom | ( | ) |
Return the zoom (scaling) factor.
CTCPanel::CTCPanel::invoke | ( | name | ) |
Method to invoke an object.
Returns true if the element is occupied.
name | The name of the object to invoke. |
See the individual object invoke methods for details.
CTCPanel::CTCPanel::itemcget | ( | name | , |
option | |||
) |
Method to get a configuration option from an object.
name | The object whose configuration option is to be fetched from. |
option | The option to fetch. See the individual element descriptions for valid options. |
CTCPanel::CTCPanel::itemconfigure | ( | name | , |
... | |||
) |
Method to set a configuration option from an object.
name | The object whose configuration option is to be configured. |
... | The configuration arguments. |
|
protected |
Method to lappend something to a slot in a control point's data.
Should only be called from object constructors.
cp | The control point to update. |
slot | The slot to update. |
what | The object to add to the slot. |
|
protected |
Method to remove something from a slot in a control point's data.
Should only be called from object destructors.
cp | The control point to update. |
slot | The slot to update. |
what | The object to remove from the slot. |
CTCPanel::CTCPanel::move | ( | name | , |
x | , | ||
y | |||
) |
Move a named object.
name | The name of the object to be moved. |
x | The amount of the x movement. |
y | The amount of the y movement. |
CTCPanel::CTCPanel::objectlist | ( | cp | = "" , |
class | = "" |
||
) |
Method to return the list of objects.
cp | (optional) The name of control point to return the object of. If cp is the empty string, return all objects. |
class | (optional) The class of objects to return. If class is the empty string, return all classes of objects. |
CTCPanel::CTCPanel::print | ( | name | , |
fp | |||
) |
Method to print the named object to the specificied file channel.
name | The object to print. |
fp | The file channel to print to. |
CTCPanel::CTCPanel::schematic_crosshair | ( | ... | ) |
Display crosshairs on the schematic canvas.
... | Options:
|
CTCPanel::CTCPanel::seti | ( | name | , |
ind | , | ||
value | |||
) |
Method to set the indicator state of an object.
name | The name of the object whose indicator state is to be set. |
ind | The indicator to update. See the individual element descriptions for valid indicator names. |
value | The new indicator value, generally on or off. |
CTCPanel::CTCPanel::setv | ( | name | , |
value | |||
) |
Method to set the value (or state) of an object.
name | The name of the object to update. |
value | The value to set it to. See the individual element descriptions for valid values. |
CTCPanel::CTCPanel::setZoom | ( | zoomFactor | ) |
Method to set the zoom factor to a specific factor.
zoomFactor | The zoom factor. |
|
protected |
Method to update and syncronize a control point.
Should only be called from object methods.
cp | The name of the control point. |
CTCPanel::CTCPanel::updateSR | ( | canvas | , |
newheight | , | ||
newwidth | |||
) |
Method to update one of the canvases scroll region.
Bound to the Configure event of each of the canvases.
canvas | The canvas to update. |
newheight | The new height. |
newwidth | The new width. |
CTCPanel::CTCPanel::zoomBy | ( | zoomFactor | ) |
Method to zoom the display by a zoom factor.
zoomFactor | The zoom factor. |
|
private |
Used save the old focus.
|
private |
Used save the old grab.
|
private |
The controls component.
|
private |
The controls y scroll bar component.
|
private |
The Control point data array.
|
private |
The list of control points.
|
private |
The object array.
|
private |
The current scale value.
|
private |
The schematic component.
|
private |
The schematic y scroll bar component.
|
private |
The shared x scroll bar component.