|
| OvalSrollBar (name, _canvas,...) |
| Constructor initialize and build an Oval Scrollbar. More...
|
|
| ~OvalSrollBar () |
| Destructor free up all resources. More...
|
|
| resize (newMin, newMax) |
| Resize method. More...
|
|
| delta (deltaX, deltaY) |
| Method to return a real number indicating the fractional change in the scrollbar setting that corresponds to a given change in slider position. More...
|
|
| fraction (x, y) |
| Method to return a real number between 0 and 1 indicating where the point given by x and y lies in the trough area of the scrollbar. More...
|
|
| get () |
| Method to return the scrollbar settings in the form of a list whose elements are the arguments to the most recent set widget command. More...
|
|
| identify (x, y) |
| Method to return the name of the element under the point given by x and y (such as arrow1), or an empty string if the point does not lie in any element of the scrollbar. More...
|
|
| set (first, last) |
| This method is invoked by the scrollbar’s associated widget to tell the scrollbar about the current view in the widget. More...
|
|
Oval SrollBar.
Works just like a normal scrollbar widget.
- Parameters
-
_canvas | The canvas to draw the widget on. |
... | Options:
- -x The X coordinate (default 0).
- -y The Y coordinate (default 0).
- -width The width of the scrollbar (default 40).
- -length The length of the scrollbar (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).
- -command The command of the scrollbar (default {}).
|
- Author
- Robert Heller <heller@deepsoft.com>
OvalWidgets::OvalSrollBar::delta |
( |
deltaX |
, |
|
|
deltaY |
|
|
) |
| |
Method to return a real number indicating the fractional change in the scrollbar setting that corresponds to a given change in slider position.
For example, if the scrollbar is horizontal, the result indicates how much the scrollbar setting must change to move the slider deltaX pixels to the right (deltaY is ignored in this case). If the scrollbar is vertical, the result indicates how much the scrollbar setting must change to move the slider deltaY pixels down. The arguments and the result may be zero or negative.
- Parameters
-
deltaX | Amount of movement if scrollbar is horizontal. |
deltaY | Amount of movement if scrollbar is vertical. |
OvalWidgets::OvalSrollBar::fraction |
( |
x |
, |
|
|
y |
|
|
) |
| |
Method to return a real number between 0 and 1 indicating where the point given by x and y lies in the trough area of the scrollbar.
The value 0 corresponds to the top or left of the trough, the value 1 corresponds to the bottom or right, 0.5 corresponds to the middle, and so on. X and y must be pixel coordinates relative to the scrollbar widget. If x and y refer to a point outside the trough, the closest point in the trough is used.
- Parameters
-
x | The X coordinate to check. |
y | The Y coordinate to check. |
OvalWidgets::OvalSrollBar::set |
( |
first |
, |
|
|
last |
|
|
) |
| |
This method is invoked by the scrollbar’s associated widget to tell the scrollbar about the current view in the widget.
The command takes two arguments, each of which is a real fraction between 0 and 1. The fractions describe the range of the document that is visible in the associated widget. For example, if first is 0.2 and last is 0.4, it means that the first part of the document visible in the window is 20% of the way through the document, and the last visible part is 40% of the way through.
- Parameters
-
first | First visible fraction. |
last | Last visible fraction. |