Model Railroad System  2.2.2
Public Member Functions | Private Member Functions | Private Attributes | List of all members
OvalWidgets::OvalScale Class Reference

An oval scale widget, much like a standard Tk scale widget. More...

Public Member Functions

 OvalScale (name, _canvas,...)
 Constructor initialize and build an Oval Scale. More...
 
 ~OvalScale ()
 Destructor free up all resources. More...
 
 set (value)
 Method to set the value of the scale. More...
 
 get ()
 Method to get the value of the scale. More...
 

Private Member Functions

 _ConfigureXY (option, value)
 Method to configure an x or y coordinate. More...
 
 _ConfigureWL (option, value)
 Method to configure a width or length option. More...
 
 _ConfigureText (option, value)
 Method to configure the text of the button. More...
 
 _MoveThumb (mx, my)
 Method bound to button1 motion move the thumb. More...
 
 _BaseRect (mx, my)
 Method bound to button 1 presses. More...
 

Private Attributes

 canvas
 Canvas the widget is on. More...
 
 _value
 Value of the scale. More...
 

Detailed Description

An oval scale widget, much like a standard Tk scale widget.

Parameters
_canvasThe canvas to draw the widget on.
...Options:
  • -x The X coordinate (default 0).
  • -y The Y coordinate (default 0).
  • -width The width of the scale (default 40).
  • -length The length of the scale (default 100).
  • -background The background color (default white).
  • -foreground The background color (default black).
  • -orientation The orientation of the scrollbar, horizontal or vertical (readonly, default vertical).
  • -from Start value of the scale (readonly, default 0).
  • -to End value of the scale (readonly, defalut 100).
  • -digits Number of digits to display (readonly, default 2).
  • -text Scale label (default "").
  • -showvalue Flag to indicate if the value should be displayed (readonly, default yes).
  • -variable Variable name to hold the value (default {}).
  • -bigincrement Large increment value (readonly, default 0).
  • -command The command of the scrollbar (default {}).
Author
Robert Heller <heller@deepsoft.com>

Constructor & Destructor Documentation

◆ OvalScale()

OvalWidgets::OvalScale::OvalScale ( name  ,
_canvas  ,
  ... 
)

Constructor initialize and build an Oval Scale.

Parameters
_canvasThe canvas to draw the scrollbar on.
...The option value list.

◆ ~OvalScale()

OvalWidgets::OvalScale::~OvalScale ( )

Destructor free up all resources.

Member Function Documentation

◆ _BaseRect()

OvalWidgets::OvalScale::_BaseRect ( mx  ,
my   
)
private

Method bound to button 1 presses.

Parameters
mxMouse X coordinate.
myMouse Y coordinate.

◆ _ConfigureText()

OvalWidgets::OvalScale::_ConfigureText ( option  ,
value   
)
private

Method to configure the text of the button.

Parameters
optionThe name of the option to configure.
valueThe value to configure it to.

◆ _ConfigureWL()

OvalWidgets::OvalScale::_ConfigureWL ( option  ,
value   
)
private

Method to configure a width or length option.

Parameters
optionThe name of the option to configure.
valueThe value of the option.

◆ _ConfigureXY()

OvalWidgets::OvalScale::_ConfigureXY ( option  ,
value   
)
private

Method to configure an x or y coordinate.

Parameters
optionThe name of the option to configure.
valueThe value of the option.

◆ _MoveThumb()

OvalWidgets::OvalScale::_MoveThumb ( mx  ,
my   
)
private

Method bound to button1 motion move the thumb.

Parameters
mxMouse X coordinate.
myMouse Y coordinate.

◆ get()

OvalWidgets::OvalScale::get ( )

Method to get the value of the scale.

◆ set()

OvalWidgets::OvalScale::set ( value  )

Method to set the value of the scale.

Parameters
valueThe value to set the scale to.

Member Data Documentation

◆ _value

OvalWidgets::OvalScale::_value
private

Value of the scale.

◆ canvas

OvalWidgets::OvalScale::canvas
private

Canvas the widget is on.