class MASKING_DLL_DECLSPEC Scroller
The scroller widget.
Inheritance:
Public Methods
-
void Setup(int x, int y, int w, int h, int key, int flags, int totalItems, int visibleItems, int pos, int o)
- Shortcut for Widget::Setup(), SetRange(), SetPosition() and SetOrientation()
-
void HandleEvent(Widget& obj, int msg, int arg1=0, int arg2=0)
- Main event handler.
-
virtual void SetOrientation(int o)
- Sets the Scroller's orientation.
-
virtual int GetOrientation()
- Returns the orientation of the scroller
-
void SetRange(int totalItems, int visibleItems)
- Sets the range of values in which the scroller may be scrolled.
-
int GetVisibleItems()
- Returns the number of items the object attached to the scroller can display on one "screen"
-
void SetPosition(int pos)
- Sets the position of the scroller
-
void Increment()
- Moves the scroller position right or up
-
void Decrement()
- Moves the scroller position left or down
Protected Fields
-
ScrollBack back
- The underlaying background widget
-
ArrowButton bUp
- The underlaying up/right arrow button
-
ArrowButton bDown
- The underlaying down/left arrow button
-
ScrollButton bGrip
- The underlaying gripper button
-
int visibleItems
- The number of items the scrolled object can display on one screen.
-
int orientation
- The orientation of the scroller.
-
Point gOffset
- The offset of the point on the gripper where the user grabbed it to drag from the centre
-
int hInc
- Vertical and horizontal increment values
Protected Methods
-
void MsgInitSkin()
- Initializes the Scroller and it's widgets with the default bitmaps, fonts and colours as defined by the skin
-
void CalculateGripperPosition()
- Updates the position of the draggable scroller button dependin on current position and orientation
-
void UpdateSize()
- Updates the size and position of all the widgets depending on the size of the scroller and its orientation.
-
bool MsgWantTab()
- Returns false to indicate the scroller itself can't be tabbed to.
Documentation
The scroller widget. A Scroller is just like a Slider or a SpinBox except
that it represents the data a bit differently. Like a SpinBox it has two
buttons for scrolling up and down but it also has a third button that can
be dragged like a slider's button. A Scroller can be either horizontal or
vertical. Its width or height (depending on orientation) is set automatically
according to the background bitmap.
ScrollBack back
-
The underlaying background widget
ArrowButton bUp
-
The underlaying up/right arrow button
ArrowButton bDown
-
The underlaying down/left arrow button
ScrollButton bGrip
-
The underlaying gripper button
int visibleItems
-
The number of items the scrolled object can display on one screen.
The scroll button is resized to reflect the relation between the
number of visible items and the number of all items.
int orientation
-
The orientation of the scroller. If 0 the scroller is vertical otherwise it is horizontal.
Point gOffset
-
The offset of the point on the gripper where the user grabbed it to drag from the centre
int hInc
-
Vertical and horizontal increment values
void MsgInitSkin()
-
Initializes the Scroller and it's widgets with the default bitmaps,
fonts and colours as defined by the skin
void CalculateGripperPosition()
-
Updates the position of the draggable scroller button dependin on current position and orientation
void UpdateSize()
-
Updates the size and position of all the widgets depending on the
size of the scroller and its orientation. If the scroller is horizontal
its height is set to the height of the background bitmap othwerwise its
width is set to the width if the background bitmap.
bool MsgWantTab()
-
Returns false to indicate the scroller itself can't be tabbed to.
Instead the underlaying widgets can be tabbed to.
void Setup(int x, int y, int w, int h, int key, int flags, int totalItems, int visibleItems, int pos, int o)
-
Shortcut for Widget::Setup(), SetRange(), SetPosition() and SetOrientation()
void HandleEvent(Widget& obj, int msg, int arg1=0, int arg2=0)
-
Main event handler.
Handles events such as button clicks and keypresses so that the scroller
is updated whenever a button is clicked or dragged, etc.
virtual void SetOrientation(int o)
-
Sets the Scroller's orientation. Pass 0 for a vertical Scroller, 1 for a horizontal one.
virtual int GetOrientation()
-
Returns the orientation of the scroller
void SetRange(int totalItems, int visibleItems)
-
Sets the range of values in which the scroller may be scrolled.
Note that this function takes different parameters than
ScrollObject::SetRange(min, max). TotalItems is the number of all
items the scroller can scroll (min is implicitlly 0 and max equals
totalItems) and visibleItems is the number of items the scrolled
object is capable of displaying on one screen. This is needed
because the little draggable scroll button is sized proportionally
to the number of currently visible items.
int GetVisibleItems()
-
Returns the number of items the object attached to the scroller can display
on one "screen"
void SetPosition(int pos)
-
Sets the position of the scroller
void Increment()
-
Moves the scroller position right or up
void Decrement()
-
Moves the scroller position left or down
- This class has no child classes.
- See Also:
- Scroller, SpinBox
Alphabetic index Hierarchy of classes
Back to front page
|
page generated with DOC++