GLOW API version 1.0 reference

Back to
Table of contents


class GlowQuickPalette

General information

type: class
inherits: (none)
module: glowQuickPalette

GlowQuickPalette defines the QuickPalette API for creating widgets. You cannot instantiate a GlowQuickPalette directly, but instead you should use one if its subclasses, GlowQuickPaletteWindow, GlowQuickPaletteSubwindow or GlowQuickPanelWidget.

GLOW programs that use the QuickPalette interface should use this API to create widgets.

Constants

General settings constant
Use this constant to specify using the parent's setting for spacing or margins.

enum { parentSetting }

Arrangement constants
These constants specify whether to arrange the widgets horizontally or vertically.

enum GlowQuickPalette::Arrangement parentArrangement
enum GlowQuickPalette::Arrangement vertical
enum GlowQuickPalette::Arrangement horizontal

Alignment constants
These constants specify how to align widgets in this palette.

enum GlowQuickPalette::Alignment parentAlignment
enum GlowQuickPalette::Alignment alignTop
enum GlowQuickPalette::Alignment alignBottom
enum GlowQuickPalette::Alignment alignLeft
enum GlowQuickPalette::Alignment alignRight
enum GlowQuickPalette::Alignment alignCenter
enum GlowQuickPalette::Alignment alignExpand

Methods

Widget creation methods
These methods may be used to add widgets to the panel.

GlowQuickPanelWidget* AddPanel(GlowPanelWidget::Style style = GlowPanelWidget::plainStyle, const char* label = 0, GlowQuickPalette::Arrangement arrangement = GlowQuickPalette::parentArrangement, GlowQuickPalette::Alignment alignment = GlowQuickPalette::parentAlignment, int spacing = GlowQuickPalette::parentSetting, int hmargin = GlowQuickPalette::parentSetting, int vmargin = GlowQuickPalette::parentSetting)

Adds a panel to the panel, with options specified by the given params. style denotes the border drawing style for the panel. label gives a label to the panel, or pass the null pointer for no label. arrangement specifies whether widgets in the new panel should be arranged vertically in a column or horizontally in a row. alignment denotes the alignment of widgets in the new panel. spacing denotes the spacing in pixels between widgets in the new panel. hmargin and vmargin denote the spacing between the pixels and the new panel border. The method returns a pointer to a GlowQuickPanelWidget, a panel that may in turn be filled using the QuickPalette interface.

GlowQuickPanelWidget* AddArrangingPanel(GlowQuickPalette::Arrangement arrangement = GlowQuickPalette::parentArrangement, GlowQuickPalette::Alignment alignment = GlowQuickPalette::parentAlignment, int spacing = GlowQuickPalette::parentSetting, int inset = 0)

Adds an arranging panel to the panel, with options specified by the given params. This kind of panel is meant to be used to arrange widgets in a palette; as such, it always has no border or label, and the margin in the direction of the parent's arrangement is zero. arrangement specifies whether widgets in the new panel should be arranged vertically in a column or horizontally in a row. alignment denotes the alignment of widgets in the new panel. spacing denotes the spacing in pixels between widgets in the new panel. inset gives a value in pixels to "indent" the panel; the margin orthogonal to the parent arrangement is set to this value. The method returns a pointer to a GlowQuickPanelWidget, a panel that may in turn be filled using the QuickPalette interface. This method has the same effect as calling AddPanel() with a style of GlowQuickPanelWidget::plainStyle, no label, and a margin of 0.

GlowPanelWidget* AddFixedPanel(int width, int height, GlowPanelWidget::Style style = GlowPanelWidget::plainStyle)

Adds a fixed-size panel to the panel, with options specified by the given params. This kind of panel cannot be filled using the QuickPalette interface. width and height give the size for the new panel. style denotes the border drawing style for the panel.

GlowSeparatorWidget* AddSeparator(GlowSeparatorWidget::Style style = GlowSeparatorWidget::valleyStyle)

Adds a separator to the panel. style denotes the drawing style for the separator.

GlowPushButtonWidget* AddPushButton(const char* label, GlowPushButtonReceiver* receiver = 0)

Adds a pushbutton to the panel. label gives the text label for the pushbutton. receiver provides a receiver to receive events from the new pushbutton, or pass the null pointer if you do not want to bind a receiver.

GlowDismissPushButtonWidget* AddDismissPushButton(const char* label, GlowComponent* toDismiss, GlowPushButtonReceiver* receiver = 0)

Adds a dismiss-pushbutton to the panel. label gives the text label for the pushbutton. toDismiss specifies the component to dismiss (close) after the button is pressed. receiver provides a receiver to receive events from the new pushbutton, or pass the null pointer if you do not want to bind a receiver.

GlowMenuButtonWidget* AddMenuButton(const char* label, GlowMenu* menu, GlowMenuButtonWidget::IconType icon = GlowMenuButtonWidget::menuIcon)

Adds a menu button to the panel. label gives the text label for the menu button. menu gives a menu to attach to the button. icon gives the kind of icon to use for the menu button.

GlowLabeledPopupMenuWidget* AddPopupMenu(const char* label, GlowPopupMenuReceiver* receiver = 0)

Adds a labeled popup menu to the panel. label gives the text label for the popup menu. receiver provides a receiver to receive events from the new popup menu, or pass the null pointer if you do not want to bind a receiver.

GlowCheckBoxWidget* AddCheckBox(const char* label, GlowCheckBoxWidget::State initialValue = GlowCheckBoxWidget::off, GlowCheckBoxReceiver* receiver = 0)

Adds a checkbox to the panel. label gives the text label for the checkbox. initialValue gives the initial value for the checkbox. receiver provides a receiver to receive events from the new checkbox, or pass the null pointer if you do not want to bind a receiver.

GlowQuickRadioGroupWidget* AddRadioGroup(GlowQuickPalette::Arrangement arrangement = GlowQuickPalette::vertical, int spacing = 3, GlowRadioButtonReceiver* receiver = 0)

Adds a radio group to the panel. arrangement gives the arrangement (vertical or horizontal) for the radio group. spacing gives the pixel spacing between radio buttons. receiver provides a receiver to receive events from the new radio group, or pass the null pointer if you do not want to bind a receiver. The method returns a pointer to a GlowQuickRadioGroupWidget, a radio group that may be filled with radio buttons using the QuickPalette interface.

GlowLabeledSliderWidget* AddSlider(float min, float max, float initial, GlowSliderWidget::Options options = GlowSliderWidget::defaultOptions, int numTicks = 2, const char* valueLabel = 0, const char* label = 0, GlowSliderReceiver* receiver = 0)

Adds a labeled slider widget to the panel. min, max and initial specify the range and initial value for the slider. options gives options for the slider. numTicks gives the number of tick marks to draw. valueLabel specifies a printf pattern for labeling the minimum and maximum values. label specifies a printf pattern for the main label. receiver provides a receiver to receive events from the new slider, or pass the null pointer if you do not want to bind a receiver.

GlowScrollBarWidget* AddScrollBar(long min, long max, long span, long initialTop, GlowScrollBarReceiver* receiver = 0)

Adds a scroll bar widget to the panel. min, max, span and initialTop specify the range, indicator span and initial value for the scroll bar. receiver provides a receiver to receive events from the new scroll bar, or pass the null pointer if you do not want to bind a receiver.

GlowLabeledTextFieldWidget* AddTextField(int width, const char* text = "", const char* label = 0)

Adds a text field widget to the panel. width specifies the width for the text field in pixels. text gives the initial text value for the field. label specifies a label for the text field, or pass the null pointer for no label.

GlowLabeledHiddenTextFieldWidget* AddHiddenTextField(int width, const char* text = "", char hideCharacter = '#', const char* label = 0)

Adds a hidden-input text field widget to the panel. width specifies the width for the text field in pixels. text gives the initial text value for the field. hideCharacter gives a character to use to hide the real input. label specifies a label for the text field, or pass the null pointer for no label.

GlowLabelWidget* AddLabel(const char* text)

Adds a static label to the panel. text gives the text to draw.

Packing and arrangement parameters
These methods may be used to alter packing parameters.

GlowQuickPalette::Arrangement GetArrangement(void) const

Returns the current arrangement setting (vertical or horizontal).

void SetArrangement(GlowQuickPalette::Arrangement value)

Sets the current arrangement setting (vertical or horizontal).

GlowQuickPalette::Alignment GetAlignment(void) const

Returns the current alignment setting.

void SetAlignment(GlowQuickPalette::Alignment value)

Sets the current alignment setting.

int GetSpacing(void) const

Returns the current element spacing setting in pixels.

void SetSpacing(int value)

Sets the current element spacing setting in pixels.

int GetHMargin(void) const

Returns the current horizontal margin setting in pixels.

int GetVMargin(void) const

Returns the current vertical margin setting in pixels.

void SetHMargin(int value)

Sets the current horizontal margin setting in pixels.

void SetVMargin(int value)

Sets the current vertical margin setting in pixels.

Information
These methods may be used to get information about the QuickPalette.

GlowQuickPanelWidget* QuickPaletteRoot(void) const

Returns a pointer to the GlowQuickPanelWidget being used as the root of this QuickPalette. If you want to add a widget directly to the QuickPalette without using one of the methods provided by the QuickPalette API, then add the widget as a child of this panel widget.

Back to
Table of contents


The GLOW Toolkit