|
Back to Table of contents |
General information |
type: class
inherits: GlowWidget
module: glowScrollBarWidgetGlowScrollBarWidget is a scroll bar widget. It supports both vertical and horizontal proportional scroll bars with double arrows on each end (subject to space constraints).
GLOW programs that make use of scroll bar widgets should use this class.
Constants |
Parts
enum GlowScrollBarWidget::Part noPart
No partenum GlowScrollBarWidget::Part upButtonPart
Up button part. (No way to distinguish between the two up-buttons)enum GlowScrollBarWidget::Part downButtonPart
Down button part. (No way to distinguish between the two down-buttons)enum GlowScrollBarWidget::Part upPagePart
Page-up area.enum GlowScrollBarWidget::Part downPagePart
Page-down area.enum GlowScrollBarWidget::Part indicatorPart
In the indicator.Other constants
enum { spanPageStep }
Special constant for the pageStep attribute. Sets it equal to the span of the indicator.Inherited constants
These constants are inherited from GlowWidget.enum GlowWidget::AutoPackError noAutoPackError
enum GlowWidget::AutoPackError hAutoPackError
enum GlowWidget::AutoPackError vAutoPackErrorenum GlowWidget::AutoPackOptions noReshape
enum GlowWidget::AutoPackOptions preferredSize
enum GlowWidget::AutoPackOptions expandPreferredSize
enum GlowWidget::AutoPackOptions forcedSize
enum GlowWidget::AutoPackOptions noMove
enum GlowWidget::AutoPackOptions leftPos
enum GlowWidget::AutoPackOptions rightPos
enum GlowWidget::AutoPackOptions topPos
enum GlowWidget::AutoPackOptions bottomPos
enum GlowWidget::AutoPackOptions centerPosenum { unspecifiedSize }
enum { unspecifiedPos }
Methods |
Constructors and destructor
GlowScrollBarWidget(GlowWidget* parent, const GlowScrollBarParams& params)
Creates a new GlowScrollBarWidget using the given params and adds it to parent's children.GlowScrollBarWidget(GlowWidgetRoot* root, const GlowScrollBarParams& params)
Creates a new GlowScrollBarWidget using the given params and adds it to the top level under root.GlowScrollBarWidget(void)
Creates a new GlowScrollBarWidget but does not initialize it. A scroll bar created in this way may not be used until its Init() method is called.void Init(GlowWidget* parent, const GlowScrollBarParams& params)
Initializes a new GlowScrollBarWidget using the given params and adds it to parent's children.void Init(GlowWidgetRoot* root, const GlowScrollBarParams& params)
Initializes a new GlowScrollBarWidget using the given params and adds it to the top level under root.virtual ~GlowScrollBarWidget(void)
Value attributes
int GetTopValue(void) const
Returns the value at the "top" of the indicator.int GetBottomValue(void) const
Returns the value at the "bottom" of the indicator. Same as GetTopValue() + GetSpan().void SetTopValue(int value)
Sets the value at the "top" of the indicator.void MoveTopValue(int delta)
Moves the value at the "top" of the indicator by a delta.int GetMinimum(void) const
Returns the minimum value for the scroll bar.void SetMinimum(int value)
Sets the minimum value for the scroll bar.int GetMaximum(void) const
Returns the maximum value for the scroll bar.void SetMaximum(int value)
Sets the maximum value for the scroll bar.int GetSpan(void) const
Returns the span of the indicator.void SetSpan(int span)
Sets the span of the indicator.Behavior attributes
int GetFirstDelay(void) const
Returns the delay in milliseconds between the first and second "hits" when depressing a button.void SetFirstDelay(int msecs)
Sets the delay in milliseconds between the first and second "hits" when depressing a button.int GetSecondDelay(void) const
Returns the delay in milliseconds between subsequent "hits" when depressing a button.void SetSecondDelay(int msecs)
Sets the delay in milliseconds between subsequent "hits" when depressing a button.int GetArrowStep(void) const
Returns the delta caused by each "hit" when depressing an arrow button.void SetArrowStep(int value)
Sets the delta caused by each "hit" when depressing an arrow button.int GetPageStep(void) const
Returns the delta caused by each "hit" when in the page-up or page-down region. May also return the constant spanPageStep.void SetPageStep(int value)
Sets the delta caused by each "hit" when in the page-up or page-down region. May also use the constant spanPageStep.Color attributes
GlowColor GetStripColor(void) const
void SetStripColor(GlowColor c)
GlowColor GetIndicatorColor(void) const
void SetIndicatorColor(GlowColor c)
GlowColor GetShadowColor(void) const
void SetShadowColor(GlowColor c)
GlowColor GetButtonColor(void) const
void SetButtonColor(GlowColor c)
GlowColor GetButtonIconColor(void) const
void SetButtonIconColor(GlowColor c)
GlowColor GetHiliteStripColor(void) const
void SetHiliteStripColor(GlowColor c)
GlowColor GetHiliteIndicatorColor(void) const
void SetHiliteIndicatorColor(GlowColor c)
GlowColor GetHiliteButtonColor(void) const
void SetHiliteButtonColor(GlowColor c)
GlowColor GetHiliteButtonIconColor(void) const
void SetHiliteButtonIconColor(GlowColor c)
GlowColor GetDisableStripColor(void) const
void SetDisableStripColor(GlowColor c)
GlowColor GetDisableIndicatorColor(void) const
void SetDisableIndicatorColor(GlowColor c)
GlowColor GetDisableButtonColor(void) const
void SetDisableButtonColor(GlowColor c)
GlowColor GetDisableButtonIconColor(void) const
void SetDisableButtonIconColor(GlowColor c)
GlowColor GetDisableOutlineColor(void) const
void SetDisableOutlineColor(GlowColor c)
GlowColor GetLightBevelColor(void) const
void SetLightBevelColor(GlowColor c)
GlowColor GetDarkBevelColor(void) const
void SetDarkBevelColor(GlowColor c)
Notifiers
TSender<const GlowScrollBarMessage&>& Notifier(void)
Returns a reference to the sender used by the scrollbar to notify objects of scroll bar messages. Bind this sender to a GlowScrollBarReceiver to cause that receiver to be notified as the scroll bar is being manipulated.Inherited methods
These methods are inherited from GlowWidget.void Move(int x, int y)
int PositionX(void) const
int PositionY(void) const
int RootPositionX(void) const
int RootPositionY(void) const
int GlobalPositionX(void) const
int GlobalPositionY(void) const
void Reshape(int width, int height)
int Width(void) const
int Height(void) const
GlowWidget::AutoPackError AutoPack(int leftLimit, int rightLimit, int topLimit, int bottomLimit, GlowWidget::AutoPackOptions hOption, GlowWidget::AutoPackOptions vOption, int& leftMargin, int& rightMargin, int& topMargin, int& bottomMargin)
GlowWidget::AutoPackError AutoPack(int leftLimit, int rightLimit, int topLimit, int bottomLimit, GlowWidget::AutoPackOptions hOption, GlowWidget::AutoPackOptions vOption)GlowWidget::AutoPackError AutoReshape(int& leftMargin, int& rightMargin, int& topMargin, int& bottomMargin)
GlowWidget::AutoPackError AutoReshape()void Hide(void)
void Show(void)
bool IsVisible(void) const
bool IsInvisible(void) const
bool IsVisibleMasked(void) const
void Refresh(void)
void SetRefreshEnabled(bool enabled)
bool IsRefreshEnabled(void) const
void SetClipping(bool clip)
bool IsClipping(void)
void GrabKeyboardFocus(void)
Scroll bars should not attempt to grab the keyboard focus unless a subclass makes use of keyboard events.void RelinquishKeyboardFocus(void)
bool HasKeyboardFocus(void)
GlowWidgetRoot* Root(void)
void SetRefCon(long refcon)
long GetRefCon(void)
Inherited methods
These methods are inherited from GlowComponent.void Close(void)
GlowComponent* Parent(void) const
GlowSubwindow* WhichWindow(void)
GlowSubwindow* ParentWindow(void) const
GlowWindow* ToplevelWindow(void)
bool IsToplevel(void) const
GlowComponent* Next(void) const
GlowComponent* Prev(void) const
int NumChildren(void) const
GlowComponent* FirstChild(void) const
GlowComponent* LastChild(void) const
void ReorderChild(GlowComponent* child, GlowComponent* pos)
void KillChildren(void)
void Activate(void)
void Deactivate(void)
bool IsActive(void)
bool IsInactive(void)
bool IsActiveStandby(void)
void Paint(void)
Protected methods for subclasses |
Initialization
void Init(GlowWidgetRoot* root, GlowWidget* parent, const GlowScrollBarParams& params)
Initializes a new GlowScrollBarWidget using the given params and adds it to root's hierarchy under parent. parent must be present in root's hierarchy.Inherited methods
These methods are inherited from GlowWidget.void NormalizeCoordinates(int x, int y, GLfloat& xn, GLfloat& yn) const
void RegisterMouseEvents(void)
void RegisterKeyboardEvents(void)
void UnegisterMouseEvents(void)
void UnregisterKeyboardEvents(void)
Overrideable methods |
Event handlers
These methods are called as soon as a widget-level event occurs. The default methods typically send the appropriate messages to the attached receivers.virtual void OnDragged(Glow::MouseButton mouseButton, Glow::Modifiers modifiers)
Called when a scroll bar indicator is being dragged. mouseButton is the mouse button pressed (see constants in Glow) and modifiers gives the keyboard modifiers that were down when the mouse button was pressed. The default method sends messages to the attached GlowScrollBarReceivers.virtual void OnPart(GlowScrollBarWidget::Part part, Glow::MouseButton mouseButton, Glow::Modifiers modifiers)
Called when a scroll bar button or page area is hit or depressed. part gives the part in question, mouseButton is the mouse button pressed (see constants in Glow) and modifiers gives the keyboard modifiers that were down when the mouse button was pressed. The default method changes the value of the scroll bar as defined by GetArrowStep() and GetPageStep(), and then sends messages to the attached GlowScrollBarReceivers.virtual void OnReleased(GlowScrollBarWidget::Part part, Glow::MouseButton mouseButton, Glow::Modifiers modifiers)
Called when a scroll bar indicator is released. part gives the part that was released (which could be indicatorPart, or either of the button or page parts), mouseButton is the mouse button pressed (see constants in Glow) and modifiers gives the keyboard modifiers that were down when the mouse button was pressed. The default method sends messages to the attached GlowScrollBarReceivers.Inherited methods
These methods are inherited from GlowWidget.virtual void OnWidgetPaint(void)
GlowScrollBarWidget overrides this method to draw the scroll bar. You should not override it again unless a subclass needs to modify how scroll bars are drawn.virtual void OnWidgetMouseDown(Glow::MouseButton mouseButton, int x, int y, Glow::Modifiers modifiers)
GlowScrollBarWidget overrides this method to handle mouse events. You should not override it again unless a subclass needs to modify how events are handled.virtual void OnWidgetMouseUp(Glow::MouseButton mouseButton, int x, int y, Glow::Modifiers modifiers)
GlowScrollBarWidget overrides this method to handle mouse events. You should not override it again unless a subclass needs to modify how events are handled.virtual void OnWidgetMouseDrag(int x, int y)
GlowScrollBarWidget overrides this method to handle mouse events. You should not override it again unless a subclass needs to modify how events are handled.virtual void OnWidgetKeyboard(Glow::KeyCode key, int x, int y, Glow::Modifiers modifiers)
The standard GlowScrollBarWidget does not handle keyboard events. Override this method if a subclass needs to receive keyboard events.virtual void OnWidgetMove(int x, int y)
virtual void OnWidgetReshape(int width, int height)
virtual void OnWidgetInvisible(void)
virtual void OnWidgetVisible(void)
virtual void OnWidgetDeactivate(void)
virtual void OnWidgetActivate(void)
virtual void OnGotKeyboardFocus(void)
virtual void OnLostKeyboardFocus(void)
virtual GlowWidget::AutoPackError OnAutoPack(int hSize, int vSize, GlowWidget::AutoPackOptions hOption, GlowWidget::AutoPackOptions vOption, int& leftMargin, int& rightMargin, int& topMargin, int& bottomMargin)
GlowScrollBarWidget implements this method to pack a scroll bar. Override it if a subclass requires different packing.Inherited methods
These methods are inherited from GlowComponent, but are used by GlowWidget and should not be overridden again.virtual void OnActivate(void)
virtual void OnDeactivate(void)
virtual void OnBeginPaint(void)
virtual void OnEndPaint(void)
|
Back to Table of contents |
The GLOW Toolkit