class MASKING_DLL_DECLSPEC Scroller

The scroller widget.

Inheritance:

Scroller - CompoundWidget - Dialog - Widget - Rect

Scroller - ScrollObject


Public Methods

[more]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()
[more]void HandleEvent(Widget& obj, int msg, int arg1=0, int arg2=0)
Main event handler.
[more]virtual void SetOrientation(int o)
Sets the Scroller's orientation.
[more]virtual int GetOrientation()
Returns the orientation of the scroller
[more]void SetRange(int totalItems, int visibleItems)
Sets the range of values in which the scroller may be scrolled.
[more]int GetVisibleItems()
Returns the number of items the object attached to the scroller can display on one "screen"
[more]void SetPosition(int pos)
Sets the position of the scroller
[more]void Increment()
Moves the scroller position right or up
[more]void Decrement()
Moves the scroller position left or down

Protected Fields

[more]ScrollBack back
The underlaying background widget
[more]ArrowButton bUp
The underlaying up/right arrow button
[more]ArrowButton bDown
The underlaying down/left arrow button
[more]ScrollButton bGrip
The underlaying gripper button
[more]int visibleItems
The number of items the scrolled object can display on one screen.
[more]int orientation
The orientation of the scroller.
[more]Point gOffset
The offset of the point on the gripper where the user grabbed it to drag from the centre
[more]int hInc
Vertical and horizontal increment values

Protected Methods

[more]void MsgInitSkin()
Initializes the Scroller and it's widgets with the default bitmaps, fonts and colours as defined by the skin
[more]void CalculateGripperPosition()
Updates the position of the draggable scroller button dependin on current position and orientation
[more]void UpdateSize()
Updates the size and position of all the widgets depending on the size of the scroller and its orientation.
[more]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.

oScrollBack back
The underlaying background widget

oArrowButton bUp
The underlaying up/right arrow button

oArrowButton bDown
The underlaying down/left arrow button

oScrollButton bGrip
The underlaying gripper button

oint 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.

oint orientation
The orientation of the scroller. If 0 the scroller is vertical otherwise it is horizontal.

oPoint gOffset
The offset of the point on the gripper where the user grabbed it to drag from the centre

oint hInc
Vertical and horizontal increment values

ovoid MsgInitSkin()
Initializes the Scroller and it's widgets with the default bitmaps, fonts and colours as defined by the skin

ovoid CalculateGripperPosition()
Updates the position of the draggable scroller button dependin on current position and orientation

ovoid 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.

obool MsgWantTab()
Returns false to indicate the scroller itself can't be tabbed to. Instead the underlaying widgets can be tabbed to.

ovoid 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()

ovoid 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.

ovirtual void SetOrientation(int o)
Sets the Scroller's orientation. Pass 0 for a vertical Scroller, 1 for a horizontal one.

ovirtual int GetOrientation()
Returns the orientation of the scroller

ovoid 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.

oint GetVisibleItems()
Returns the number of items the object attached to the scroller can display on one "screen"

ovoid SetPosition(int pos)
Sets the position of the scroller

ovoid Increment()
Moves the scroller position right or up

ovoid 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++