class MASKING_DLL_DECLSPEC Slider
The slider widget.
Inheritance:
Public Methods
-
void SetOrientation(int o)
- Sets the orientation of the slider.
-
void SetBitmap(int background, int button)
- Sets the sliders skin bitmaps.
-
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
-
int bitmap[2]
- Two indices pointing to the slider bitmaps in the skin's bitmap arrays
-
int offset
- The offset of the point on the gripper where the user grabbed it to drag from the centre
Protected Methods
-
void Draw(Bitmap &canvas)
- Draws either a horizontal or a vertical slider
-
void MsgLPress()
-
void MsgLRelease()
-
void MsgMousemove(const Point &d)
-
void MsgWheel(int z)
- These handle moving the slider button with the mouse
-
bool MsgChar(int c)
- Handles keyboard input.
-
bool MsgWantfocus()
- Returns true to indicate the slider takes input focus
-
void MsgInitSkin()
- Initializes the slider with the default slider bitmaps
-
void DrawHorizontalSlider(Bitmap &canvas)
- Helper function for drawing a horizontal slider
-
void DrawVerticalSlider(Bitmap &canvas)
- Helper function for drawing a vertical slider
-
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.
int bitmap[2]
-
Two indices pointing to the slider bitmaps in the skin's bitmap arrays
int offset
-
The offset of the point on the gripper where the user grabbed it to drag from the centre
void Draw(Bitmap &canvas)
-
Draws either a horizontal or a vertical slider
void MsgLPress()
void MsgLRelease()
void MsgMousemove(const Point &d)
void MsgWheel(int z)
-
These handle moving the slider button with the mouse
bool 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.
bool MsgWantfocus()
-
Returns true to indicate the slider takes input focus
void MsgInitSkin()
-
Initializes the slider with the default slider bitmaps
void DrawHorizontalSlider(Bitmap &canvas)
-
Helper function for drawing a horizontal slider
void DrawVerticalSlider(Bitmap &canvas)
-
Helper function for drawing a vertical slider
void Toggle()
-
A helper function for switching the state of the slider between normal and selected
void SetOrientation(int o)
-
Sets the orientation of the slider. Pass 0 for vertical and 1 for horizontal.
void 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.
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()
- This class has no child classes.
Alphabetic index Hierarchy of classes
Back to front page
|
page generated with DOC++