GLOW API version 1.0 reference

Back to
Table of contents


class GlowRadioButtonWidget

General information

type: class
inherits: GlowWidget
module: glowRadioButtonWidget

GlowRadioButtonWidget is a radio button widget. It can exist in two states: on and off. Radio buttons must be contained in a GlowRadioGroupWidget, which manages exclusion and state for the radio buttons.

GLOW programs that make use of radio buttons should use this class.

Constants

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

GlowRadioButtonWidget(GlowRadioGroupWidget* parent, const GlowRadioButtonParams& params)

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

GlowRadioButtonWidget(void)

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

void Init(GlowRadioGroupWidget* parent, const GlowRadioButtonParams& params)

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

virtual ~GlowRadioButtonWidget(void)

Attributes

const char* GetText(void) const

Returns the label string for the radio button.

void SetText(const char* text)

Sets the label string for the radio button.

GlowFont GetFont(void) const

Returns the font for the radio button label.

void SetFont(GlowFont font)

Sets the font for the radio button label.

int GetSpacing(void) const

Returns the pixel spacing between the box and label.

void SetSpacing(int spacing)

Sets the pixel spacing between the box and label.

bool GetState(void) const

Returns the current state of the radio button.

Color attributes

GlowColor GetBoxColor(void) const

void SetBoxColor(GlowColor c)

GlowColor GetTextColor(void) const

void SetTextColor(GlowColor c)

GlowColor GetSpotColor(void) const

void SetSpotColor(GlowColor c)

GlowColor GetHiliteBoxColor(void) const

void SetHiliteBoxColor(GlowColor c)

GlowColor GetHiliteTextColor(void) const

void SetHiliteTextColor(GlowColor c)

GlowColor GetHiliteSpotColor(void) const

void SetHiliteSpotColor(GlowColor c)

GlowColor GetDisableBoxColor(void) const

void SetDisableBoxColor(GlowColor c)

GlowColor GetDisableTextColor(void) const

void SetDisableTextColor(GlowColor c)

GlowColor GetDisableSpotColor(void) const

void SetDisableSpotColor(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)

Other methods

void CropWidth(void)

Reduces the width of a radio button to fit snugly around the label. Only reduces the width: does not widen the widget if it is too narrow to contain the label.

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)

Radio buttons 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

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

Inherited methods
These methods are inherited from GlowWidget.

virtual void OnWidgetPaint(void)

GlowRadioButtonWidget overrides this method to draw the check box. You should not override it again unless a subclass needs to modify how radio buttons are drawn.

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

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

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

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

GlowCheckBox implements this method to pack a radio button. 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