class MASKING_DLL_DECLSPEC Slider

The slider widget.

Inheritance:

Slider - Progress - Separator - Widget - Rect


Public Methods

[more]void SetOrientation(int o)
Sets the orientation of the slider.
[more]void SetBitmap(int background, int button)
Sets the sliders skin bitmaps.
[more]void Setup(int x, int y, int w, int h, int key, int flags, int m, int M, int p, int o)
A shortcut for Widget::Setup(), ScrollObject::SetRange(), ScrollObject::SetPosition() and SetOrientation()

Protected Fields

[more]int bitmap[2]
Two indices pointing to the slider bitmaps in the skin's bitmap arrays
[more]int offset
The offset of the point on the gripper where the user grabbed it to drag from the centre

Protected Methods

[more]void Draw(Bitmap &canvas)
Draws either a horizontal or a vertical slider
[more]void MsgLPress()
[more]void MsgLRelease()
[more]void MsgMousemove(const Point &d)
[more]void MsgWheel(int z)
These handle moving the slider button with the mouse
[more]bool MsgChar(int c)
Handles keyboard input.
[more]bool MsgWantfocus()
Returns true to indicate the slider takes input focus
[more]void MsgInitSkin()
Initializes the slider with the default slider bitmaps
[more]void DrawHorizontalSlider(Bitmap &canvas)
Helper function for drawing a horizontal slider
[more]void DrawVerticalSlider(Bitmap &canvas)
Helper function for drawing a vertical slider
[more]void Toggle()
A helper function for switching the state of the slider between normal and selected


Documentation

The slider widget. This is a simple slider that can be moved with both the mouse and the keyboard. Can be horizontal or vertical. Every time the position of the slider changes it sends a MSG_SCROLL message to the parent dialog passing the new position as the first argument.
oint bitmap[2]
Two indices pointing to the slider bitmaps in the skin's bitmap arrays

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

ovoid Draw(Bitmap &canvas)
Draws either a horizontal or a vertical slider

ovoid MsgLPress()

ovoid MsgLRelease()

ovoid MsgMousemove(const Point &d)

ovoid MsgWheel(int z)
These handle moving the slider button with the mouse

obool MsgChar(int c)
Handles keyboard input. It enables moving the slider button with the keyboard. The slider can be moved by eithe left and right or up and down arrows (depending on orientation) and HOME and END keys.

obool MsgWantfocus()
Returns true to indicate the slider takes input focus

ovoid MsgInitSkin()
Initializes the slider with the default slider bitmaps

ovoid DrawHorizontalSlider(Bitmap &canvas)
Helper function for drawing a horizontal slider

ovoid DrawVerticalSlider(Bitmap &canvas)
Helper function for drawing a vertical slider

ovoid Toggle()
A helper function for switching the state of the slider between normal and selected

ovoid SetOrientation(int o)
Sets the orientation of the slider. Pass 0 for vertical and 1 for horizontal.

ovoid SetBitmap(int background, int button)
Sets the sliders skin bitmaps. Unlike most other widgets the slider uses two bitmaps instead of just one. It uses one for the background and another for the draggable button. The slider is automatically resized to the width or height of the background bitmap depending on orientation. The button bitmap is usually of the same width (or height) as the background bitmap although it may be smaller but it mustn't be bigger.

ovoid Setup(int x, int y, int w, int h, int key, int flags, int m, int M, int p, int o)
A shortcut for Widget::Setup(), ScrollObject::SetRange(), ScrollObject::SetPosition() and SetOrientation()


This class has no child classes.

Alphabetic index Hierarchy of classes


Back to front page   |   page generated with DOC++