Model Railroad System 2.2.2
Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
CabWidgets::LocomotiveDirection Class Reference

Locomotive Direction widget. More...

Public Member Functions

 direction ()
 Return the current direction. More...
 
 LocomotiveDirection (name,...)
 Build and install all component widgets and process configuration. More...
 
 invoke ()
 Method to invoke the widget. More...
 
 direction_sense (dir)
 Method to set the sensed direction. More...
 

Private Member Functions

 _setdirection (dir)
 Set the current direction. More...
 

Private Attributes

 reverse
 Reverse button component. More...
 
 currentDirection
 Current direction label component. More...
 
 forward
 Forward button component. More...
 
 _direction
 The current direction. More...
 

Static Private Attributes

static _left
 Left bitmap (reverse button). More...
 
static _right
 Right bitmap (forward button). More...
 

Detailed Description

Locomotive Direction widget.

This widget implements Locomotive Direction control / display. There are buttons for selecting the direction and the current direction is displayed.

Parameters
pathPathname of the widget.
...Options:
  • -command Script to call when the direction is changed. The new direction is appended.
Author
Robert Heller <heller@deepsoft.com>

Constructor & Destructor Documentation

◆ LocomotiveDirection()

CabWidgets::LocomotiveDirection::LocomotiveDirection ( name  ,
  ... 
)

Build and install all component widgets and process configuration.

Parameters
...Argument list (option value pairs). Gets passed to the implicitly defined configurelist method.

Member Function Documentation

◆ _setdirection()

CabWidgets::LocomotiveDirection::_setdirection ( dir  )
private

Set the current direction.

Bound to direction buttons.

Parameters
dirLocalized string containing the direction.

◆ direction()

CabWidgets::LocomotiveDirection::direction ( )

Return the current direction.

◆ direction_sense()

CabWidgets::LocomotiveDirection::direction_sense ( dir  )

Method to set the sensed direction.

Parameters
dirThe localized direction to set.

◆ invoke()

CabWidgets::LocomotiveDirection::invoke ( )

Method to invoke the widget.

This calls the script (if any) defined by the -command option.

Member Data Documentation

◆ _direction

CabWidgets::LocomotiveDirection::_direction
private

The current direction.

◆ _left

CabWidgets::LocomotiveDirection::_left
staticprivate

Left bitmap (reverse button).

◆ _right

CabWidgets::LocomotiveDirection::_right
staticprivate

Right bitmap (forward button).

◆ currentDirection

CabWidgets::LocomotiveDirection::currentDirection
private

Current direction label component.

◆ forward

CabWidgets::LocomotiveDirection::forward
private

Forward button component.

◆ reverse

CabWidgets::LocomotiveDirection::reverse
private

Reverse button component.