GLOW API version 1.0 reference

Back to
Table of contents


class GlowSliderWidget

General information

type: class
inherits: GlowWidget
module: glowSliderWidget

GlowSliderWidget is a numeric slider widget. It supports both vertical and horizontal sliders, either ascending or descending, with either linear or logarithmic scale.

GLOW programs that make use of slider widgets should use this class.

Constants

Options

enum GlowSliderWidget::Options defaultOptions

Defaults (ticks on bottom/right, increasing, linear)

enum GlowSliderWidget::Options ticksOnBottom

Ticks on bottom for a horizontal slider.

enum GlowSliderWidget::Options ticksOnRight

Ticks on right for a vertical slider.

enum GlowSliderWidget::Optionsv ticksOnTop

Ticks on top for a horizontal slider.

enum GlowSliderWidget::Options ticksOnLeft

Ticks on left for a vertical slider.

enum GlowSliderWidget::Options increasing

Values increase towards the bottom/right.

enum GlowSliderWidget::Options decreasing

Values decrease towards the bottom/right.

enum GlowSliderWidget::Options linear

Values scale linearly.

enum GlowSliderWidget::Options logarithmic

Values scale logarithmically.

Inherited constants
These constants are inherited from GlowWidget.

enum GlowWidget::AutoPackError noAutoPackError
enum GlowWidget::AutoPackError hAutoPackError
enum GlowWidget::AutoPackError vAutoPackError

enum 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 centerPos

enum { unspecifiedSize }
enum { unspecifiedPos }

Methods

Constructors and destructor

GlowSliderWidget(GlowWidget* parent, const GlowSliderParams& params)

Creates a new GlowSliderWidget using the given params and adds it to parent's children.

GlowSliderWidget(GlowWidgetRoot* root, const GlowSliderParams& params)

Creates a new GlowSliderWidget using the given params and adds it to the top level under root.

GlowSliderWidget(void)

Creates a new GlowSliderWidget but does not initialize it. A slider created in this way may not be used until its Init() method is called.

void Init(GlowWidget* parent, const GlowSliderParams& params)

Initializes a new GlowSliderWidget using the given params and adds it to parent's children.

void Init(GlowWidgetRoot* root, const GlowSliderParams& params)

Initializes a new GlowSliderWidget using the given params and adds it to the top level under root.

virtual ~GlowSliderWidget(void)

Value attributes

double GetValue(void) const

Returns the current value of the slider.

double GetMinimum(void) const

Returns the minimum value of the slider.

double GetMaximum(void) const

Returns the maximum value of the slider.

void SetValue(double val)

Sets the current value of the slider.

void SetMinimum(double val)

Sets the minimum value of the slider.

void SetMaximum(double val)

Sets the maximum value of the slider.

int GetNumTickMarks(void) const

Returns the number of tick marks.

void SetNumTickMarks(int numTicks)

Sets the number of tick marks.

GlowSliderWidget::Options GetOptions(void) const

Returns the options for the slider.

void SetOptions(GlowSliderWidget::Options options)

Sets the options for the slider

Color attributes

GlowColor GetStripColor(void) const

void SetStripColor(GlowColor c)

GlowColor GetIndicatorColor(void) const

void SetIndicatorColor(GlowColor c)

GlowColor GetTickMarkColor(void) const

void SetTickMarkColor(GlowColor c)

GlowColor GetHiliteIndicatorColor(void) const

void SetHiliteIndicatorColor(GlowColor c)

GlowColor GetDisableStripColor(void) const

void SetDisableStripColor(GlowColor c)

GlowColor GetDisableIndicatorColor(void) const

void SetDisableIndicatorColor(GlowColor c)

GlowColor GetDisableTickMarkColor(void) const

void SetDisableTickMarkColor(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 GlowSliderMessage&>& Notifier(void)

Returns a reference to the sender used by the slider to notify objects of indicator drag and release messages. Bind this sender to a GlowSliderReceiver to cause that receiver to be notified of slider events.

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)

Sliders 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 GlowSliderParams& params)

Initializes a new GlowSliderWidget 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 slider 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 GlowSliderReceivers.

virtual void OnReleased(Glow::MouseButton mouseButton, Glow::Modifiers modifiers)

Called when a slider indicator is released. 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 GlowSliderReceivers.

Inherited methods
These methods are inherited from GlowWidget.

virtual void OnWidgetPaint(void)

GlowSliderWidget overrides this method to draw the slider. You should not override it again unless a subclass needs to modify how sliders are drawn.

virtual void OnWidgetMouseDown(Glow::MouseButton mouseButton, int x, int y, Glow::Modifiers modifiers)

GlowSliderWidget 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)

GlowSliderWidget 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)

GlowSliderWidget 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 GlowSliderWidget 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)

GlowSliderWidget implements this method to pack a slider. 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