Planeshift
|
A simple scroll bar widget. More...
#include <pawscrollbar.h>
Public Member Functions | |
virtual void | Draw () |
Draws the widget and all of it's children. | |
virtual void | EnableValueLimit (bool limited) |
Sets if the constraint of current scrollbar value should be used. | |
virtual float | GetCurrentValue () |
Get the current value of the scroll bar. | |
virtual float | GetMaxValue () |
virtual float | GetMinValue () |
virtual float | GetTickValue () |
Returns the tick value of this scroll bar. | |
virtual bool | OnButtonPressed (int button, int keyModifier, pawsWidget *widget) |
Called whenever a button is pressed. | |
virtual bool | OnButtonReleased (int button, int keyModifier, pawsWidget *widget) |
Called whenever a button is released. | |
virtual bool | OnGainFocus (bool=true) |
Changes hasFocus to TRUE and reports status to parent. | |
virtual bool | OnMouseDown (int button, int modifiers, int x, int y) |
Manage mouse down event to test for and apply window changes. | |
virtual bool | OnMouseExit () |
Called whenever the mouse leaves this widget. | |
virtual bool | OnMouseUp (int button, int modifiers, int x, int y) |
Manage mouse up event. | |
virtual void | OnResize () |
Sets the new position of the close button. | |
virtual void | OnUpdateData (const char *dataname, PAWSData &data) |
pawsScrollBar (const pawsScrollBar &origin) | |
pawsScrollBar () | |
virtual bool | PostSetup () |
This is called after the widget and all of it's children have been created. | |
bool | ScrollDown () |
Scrolls one step down. | |
bool | ScrollUp () |
Scrolls one step up. | |
virtual void | SetCurrentValue (float value, bool triggerEvent=true, bool publish=true) |
Set the current value that this scroll bar should have. | |
virtual void | SetHorizontal (bool value) |
virtual void | SetMaxValue (float value) |
Set the max value that this scroll bar should have. | |
virtual void | SetMinValue (float value) |
Set the min value that this scroll bar should have. | |
virtual void | SetReversed (bool reversed) |
Sets if scrollbar should return reversed scroll value: left/top=maxValue, right/bottom=minValue. | |
virtual void | SetTickValue (float tick) |
Set the amount that this scroll bar should change by. | |
virtual bool | Setup (iDocumentNode *node) |
Setup this widget. | |
virtual | ~pawsScrollBar () |
Protected Member Functions | |
int | GetScrollBarSize () |
int | GetThumbScaleLength () |
void | LimitCurrentValue () |
Adjusts currentValue so that 0<=currentValue<=maxValue. | |
void | MoveThumbToMouse () |
Sets position of thumb on screen and currentValue according to mouse position. | |
void | SetButtonLayout () |
Sets positions and sizes of up and down buttons. | |
void | SetThumbLayout () |
Sets position and size of thumb on screen according to currentValue. | |
void | SetThumbVisibility () |
Protected Attributes | |
csRef< iVirtualClock > | clock |
float | currentValue |
pawsButton * | downButton |
csString | downGrey |
int | downHeight |
int | downOffsetx |
int | downOffsety |
csString | downPressed |
csString | downUnpressed |
int | downWidth |
bool | horizontal |
int | lastButton |
int | lastModifiers |
pawsWidget * | lastWidget |
bool | limited |
float | maxValue |
float | minValue |
bool | mouseDown |
bool | mouseIsDraggingThumb |
bool | reversed |
csTicks | scrollTicks |
Keep track of ticks for scrolling. | |
pawsWidget * | thumb |
int | thumbDragPoint |
csString | thumbMoving |
csString | thumbStopped |
float | tickValue |
This is how much value should change on a scroll. | |
pawsButton * | upButton |
csString | upGrey |
int | upHeight |
int | upOffsetx |
int | upOffsety |
csString | upPressed |
csString | upUnpressed |
int | upWidth |
A simple scroll bar widget.
Definition at line 64 of file pawscrollbar.h.
pawsScrollBar::pawsScrollBar | ( | ) |
pawsScrollBar::pawsScrollBar | ( | const pawsScrollBar & | origin | ) |
virtual pawsScrollBar::~pawsScrollBar | ( | ) | [virtual] |
virtual void pawsScrollBar::Draw | ( | ) | [virtual] |
Draws the widget and all of it's children.
Reimplemented from pawsWidget.
virtual void pawsScrollBar::EnableValueLimit | ( | bool | limited | ) | [virtual] |
Sets if the constraint of current scrollbar value should be used.
limited | Should the value be limited ? |
virtual float pawsScrollBar::GetCurrentValue | ( | ) | [virtual] |
Get the current value of the scroll bar.
virtual float pawsScrollBar::GetMaxValue | ( | ) | [inline, virtual] |
Definition at line 90 of file pawscrollbar.h.
virtual float pawsScrollBar::GetMinValue | ( | ) | [inline, virtual] |
Definition at line 99 of file pawscrollbar.h.
int pawsScrollBar::GetScrollBarSize | ( | ) | [protected] |
int pawsScrollBar::GetThumbScaleLength | ( | ) | [protected] |
virtual float pawsScrollBar::GetTickValue | ( | ) | [inline, virtual] |
Returns the tick value of this scroll bar.
Definition at line 132 of file pawscrollbar.h.
void pawsScrollBar::LimitCurrentValue | ( | ) | [protected] |
Adjusts currentValue so that 0<=currentValue<=maxValue.
void pawsScrollBar::MoveThumbToMouse | ( | ) | [protected] |
Sets position of thumb on screen and currentValue according to mouse position.
virtual bool pawsScrollBar::OnButtonPressed | ( | int | button, |
int | keyModifier, | ||
pawsWidget * | widget | ||
) | [virtual] |
Called whenever a button is pressed.
button | The button pressed. |
keyModifier | Modifier key in effect. |
widget | The widget the button belongs to. |
Reimplemented from pawsWidget.
virtual bool pawsScrollBar::OnButtonReleased | ( | int | button, |
int | keyModifier, | ||
pawsWidget * | widget | ||
) | [virtual] |
Called whenever a button is released.
button | The button released. |
keyModifier | Modifier key in effect. |
widget | The widget the button belongs to. |
Reimplemented from pawsWidget.
virtual bool pawsScrollBar::OnGainFocus | ( | bool | = true | ) | [inline, virtual] |
Changes hasFocus to TRUE and reports status to parent.
Reimplemented from pawsWidget.
Definition at line 150 of file pawscrollbar.h.
Manage mouse down event to test for and apply window changes.
button | Type of button: 1 resizable or movable, 2 context menu or config window. |
modifiers | Used with PAWS_CONSTRUCTION. |
x | Used to test for resize. |
y | Used to test for resize. |
Reimplemented from pawsWidget.
virtual bool pawsScrollBar::OnMouseExit | ( | ) | [virtual] |
Called whenever the mouse leaves this widget.
Reimplemented from pawsWidget.
Manage mouse up event.
Reimplemented from pawsWidget.
virtual void pawsScrollBar::OnResize | ( | ) | [virtual] |
Sets the new position of the close button.
Reimplemented from pawsWidget.
virtual void pawsScrollBar::OnUpdateData | ( | const char * | dataname, |
PAWSData & | data | ||
) | [virtual] |
Reimplemented from pawsWidget.
virtual bool pawsScrollBar::PostSetup | ( | ) | [virtual] |
This is called after the widget and all of it's children have been created.
Reimplemented from pawsWidget.
bool pawsScrollBar::ScrollDown | ( | ) |
Scrolls one step down.
bool pawsScrollBar::ScrollUp | ( | ) |
Scrolls one step up.
void pawsScrollBar::SetButtonLayout | ( | ) | [protected] |
Sets positions and sizes of up and down buttons.
virtual void pawsScrollBar::SetCurrentValue | ( | float | value, |
bool | triggerEvent = true , |
||
bool | publish = true |
||
) | [virtual] |
Set the current value that this scroll bar should have.
value | The current value of this bar. |
triggerEvent | |
publish |
virtual void pawsScrollBar::SetHorizontal | ( | bool | value | ) | [virtual] |
virtual void pawsScrollBar::SetMaxValue | ( | float | value | ) | [virtual] |
Set the max value that this scroll bar should have.
value | The max value that this bar can have. |
virtual void pawsScrollBar::SetMinValue | ( | float | value | ) | [virtual] |
Set the min value that this scroll bar should have.
value | The min value that this bar can have. |
virtual void pawsScrollBar::SetReversed | ( | bool | reversed | ) | [inline, virtual] |
Sets if scrollbar should return reversed scroll value: left/top=maxValue, right/bottom=minValue.
Definition at line 144 of file pawscrollbar.h.
void pawsScrollBar::SetThumbLayout | ( | ) | [protected] |
Sets position and size of thumb on screen according to currentValue.
void pawsScrollBar::SetThumbVisibility | ( | ) | [protected] |
virtual void pawsScrollBar::SetTickValue | ( | float | tick | ) | [virtual] |
Set the amount that this scroll bar should change by.
tick | The tick value to change by. |
virtual bool pawsScrollBar::Setup | ( | iDocumentNode * | ) | [virtual] |
Setup this widget.
Reimplemented from pawsWidget.
csRef<iVirtualClock> pawsScrollBar::clock [protected] |
Definition at line 195 of file pawscrollbar.h.
float pawsScrollBar::currentValue [protected] |
Definition at line 188 of file pawscrollbar.h.
pawsButton * pawsScrollBar::downButton [protected] |
Definition at line 206 of file pawscrollbar.h.
csString pawsScrollBar::downGrey [protected] |
Definition at line 221 of file pawscrollbar.h.
int pawsScrollBar::downHeight [protected] |
Definition at line 227 of file pawscrollbar.h.
int pawsScrollBar::downOffsetx [protected] |
Definition at line 224 of file pawscrollbar.h.
int pawsScrollBar::downOffsety [protected] |
Definition at line 225 of file pawscrollbar.h.
csString pawsScrollBar::downPressed [protected] |
Definition at line 223 of file pawscrollbar.h.
csString pawsScrollBar::downUnpressed [protected] |
Definition at line 222 of file pawscrollbar.h.
int pawsScrollBar::downWidth [protected] |
Definition at line 226 of file pawscrollbar.h.
bool pawsScrollBar::horizontal [protected] |
Definition at line 232 of file pawscrollbar.h.
int pawsScrollBar::lastButton [protected] |
Definition at line 202 of file pawscrollbar.h.
int pawsScrollBar::lastModifiers [protected] |
Definition at line 203 of file pawscrollbar.h.
pawsWidget* pawsScrollBar::lastWidget [protected] |
Definition at line 204 of file pawscrollbar.h.
bool pawsScrollBar::limited [protected] |
Definition at line 233 of file pawscrollbar.h.
float pawsScrollBar::maxValue [protected] |
Definition at line 189 of file pawscrollbar.h.
float pawsScrollBar::minValue [protected] |
Definition at line 190 of file pawscrollbar.h.
bool pawsScrollBar::mouseDown [protected] |
Definition at line 199 of file pawscrollbar.h.
bool pawsScrollBar::mouseIsDraggingThumb [protected] |
Definition at line 209 of file pawscrollbar.h.
bool pawsScrollBar::reversed [protected] |
Definition at line 200 of file pawscrollbar.h.
csTicks pawsScrollBar::scrollTicks [protected] |
Keep track of ticks for scrolling.
Definition at line 198 of file pawscrollbar.h.
pawsWidget* pawsScrollBar::thumb [protected] |
Definition at line 208 of file pawscrollbar.h.
int pawsScrollBar::thumbDragPoint [protected] |
Definition at line 210 of file pawscrollbar.h.
csString pawsScrollBar::thumbMoving [protected] |
Definition at line 230 of file pawscrollbar.h.
csString pawsScrollBar::thumbStopped [protected] |
Definition at line 229 of file pawscrollbar.h.
float pawsScrollBar::tickValue [protected] |
This is how much value should change on a scroll.
Definition at line 193 of file pawscrollbar.h.
pawsButton* pawsScrollBar::upButton [protected] |
Definition at line 206 of file pawscrollbar.h.
csString pawsScrollBar::upGrey [protected] |
Definition at line 213 of file pawscrollbar.h.
int pawsScrollBar::upHeight [protected] |
Definition at line 219 of file pawscrollbar.h.
int pawsScrollBar::upOffsetx [protected] |
Definition at line 216 of file pawscrollbar.h.
int pawsScrollBar::upOffsety [protected] |
Definition at line 217 of file pawscrollbar.h.
csString pawsScrollBar::upPressed [protected] |
Definition at line 215 of file pawscrollbar.h.
csString pawsScrollBar::upUnpressed [protected] |
Definition at line 214 of file pawscrollbar.h.
int pawsScrollBar::upWidth [protected] |
Definition at line 218 of file pawscrollbar.h.