class GmButton

Class description

Inheritance:


Public Methods

[more] GmButton ()
Standard constructor
[more]virtual void applyLayout (float minX, float minY, float minZ, float maxX, float maxY, float maxZ)
Repositions and resizes this component based on parameters passed into the method.
[more]virtual float getBorderWidth ()
Gets the width of the border around the button.
[more]virtual GmTypes::ButtonStateType getState ()
Gets the state of the button.
[more]virtual char* getText ()
Gets the text that is currently associated with this widget
[more]GlmColor4* getTextColor ()
Gets the text color that is currently assigned to the text.
[more]void getTextJustification (GmTypes::JustificationType& horizontal, GmTypes::JustificationType& vertical)
Gets the type of justification for the text in this widget.
[more]float getTextPointSize ()
Gets the size of the text in points.
[more]virtual void mousePressEvent (GmEvent* event)
Event processing function to process a mouse press event.
[more]virtual void mouseReleaseEvent (GmEvent* event)
Event processing function to process a mouse release event.
[more]virtual void setAbsoluteGeometry (float x, float y, float z, float width, float height, float depth)
Sets the absolute geometry to use for this drawable object.
[more]virtual void setBorderWidth (float borderWidth)
Sets the width of the border around the button.
[more]virtual void setCoordType (GmTypes::CoordinateType coordType)
Sets the coordinate type for this object.
[more]virtual void setDepth (float depth)
Sets the depth of the drawable object in units.
[more]virtual void setHeight (float height)
Sets the height of the drawable object in units.
[more]virtual void setPosition (float x, float y, float z)
Sets the position of the drawable.
[more]virtual void setPosition (GlmPoint3* point)
Sets the position of the drawable.
[more]virtual void setRelativeGeometry (float x, float y, float width, float height)
Sets the relative geometry to use for this drawable object.
[more]virtual void setRelativeGeometry (float x, float y, float z, float width, float height, float depth)
Sets the relative geometry to use for this drawable object.
[more]virtual void setState (GmTypes::ButtonStateType state)
Sets the state of the button.
[more]virtual void setText (char* text)
Sets the text of this text widget to the given text.
[more]void setTextColor (float r, float g, float b, float a)
Sets the display color of the text to the given red, green, blue and alpha values.
[more]void setTextColor (GlmColor4* color)
Sets the display color of the text.
[more]void setTextJustification (GmTypes::JustificationType horizontal, GmTypes::JustificationType vertical)
Sets the horizontal and vertical text justification for the widget text.
[more]void setTextPointSize (float pointSize)
Sets the point size of the text, this will affect the size at which the font is rendered for the text string.
[more]virtual void setVisible (bool visible)
Sets the visibility of the drawable object.
[more]virtual void setWidth (float width)
Sets the width of the drawable object in units.
[more]virtual ~GmButton ()
Virtual destructor

Protected Fields

[more]float mBorderWidth
The width of the border around the button
[more]GmTypes::ButtonStateType mState
The state of the button.
[more]GmTextWidget* mTextWidget
Some text for labeling the button


Inherited from GmInteractiveWidget:

Public Fields

oGmFocusEventHandler* focusEventHandler
oGmKeyEventHandler* keyEventHandler
oGmAnimation* mFocusGainAnim
oGmAnimation* mFocusLoseAnim
oGmTypes::FocusType mFocusState
ounsigned int mFocusTimestamp
oGmAnimation* mKeyPressAnim
oGmAnimation* mKeyReleaseAnim
oGmAnimation* mMouseExitAnim
oGmAnimation* mMouseOverAnim
oGmAnimation* mMousePressAnim
oGmAnimation* mMouseReleaseAnim
oWidgetIDType mWidgetId
oGmToolTip* mWidgetToolTip
oGmMouseEventHandler* mouseEventHandler
oGmUserEventHandler* userEventHandler
oGmWidgetEventHandler* widgetEventHandler

Public Methods

ovirtual void focusGainEvent(GmEvent* event)
ovirtual void focusLoseEvent(GmEvent* event)
ovirtual WidgetIDType getWidgetId()
ovirtual void keyPressEvent(GmEvent* event)
ovirtual void keyReleaseEvent(GmEvent* event)
ovirtual void mouseDragEvent(GmEvent* event)
ovirtual void mouseMoveEvent(GmEvent* event)
ovirtual void setFocusEventHandler(GmFocusEventHandler* focusHandler, WidgetIDType widgetId)
ovirtual void setKeyEventHandler(GmKeyEventHandler* keyHandler, WidgetIDType widgetId)
ovirtual void setMouseEventHandler(GmMouseEventHandler* mouseHandler, WidgetIDType widgetId)
ovirtual void setToolTip(GmToolTip* tooltip)
ovirtual void setUserEventHandler(GmUserEventHandler* userHandler, WidgetIDType widgetId)
ovirtual void setWidgetEventHandler(GmWidgetEventHandler* widgetHandler, WidgetIDType widgetId)
ovirtual void userEvent(GmEvent* event)
ovirtual void wheelMoveEvent(GmEvent* event)

Protected Methods

ovirtual void render2dToolTip(GmTypes::RenderOptionType renderOptions)


Inherited from GmAnimatedWidget:

Public Methods

ovirtual void animationFinished(GmTypes::AnimationType animationType)
ovirtual void applyAnimationTransforms()
ovirtual void setEventAnimation(GmTypes::AnimationType animType, GmAnimation* animation)

Protected Fields

oGmAnimation* mAppearAnimation
oGmTypes::AnimationType mCurrentAnimation
oGmAnimation* mIdleAnimation
oGmAnimation* mVanishAnimation


Inherited from GmDrawable:

Public Methods

ovirtual GlmColor4* getBaseColor()
ovirtual GmTypes::CoordinateType getCoordType()
ovirtual float getDepth()
ovirtual float getGlDepth()
ovirtual void getGlExtents(float& width, float& height)
ovirtual float getGlHeight()
ovirtual GlmPoint3* getGlPosition()
ovirtual float getGlWidth()
ovirtual float getHeight()
ovirtual void getMinimumGeometry(float& width, float& height, float& depth)
ovirtual GlmPoint3* getPosition()
ovirtual bool getVisible()
ovirtual float getWidth()
ovirtual void render(GmTypes::RenderOptionType renderOptions)
ovirtual void setBaseColor(GlmColor4* color)
ovirtual void setBaseColor(float r, float g, float b, float a)

Protected Fields

oGlmColor4 mBaseColor
oGmTypes::CoordinateType mCoordType
ofloat mDepth
obool mDisplayListGenerate
oint mDisplayListId
ofloat mGlDepth
ofloat mGlHeight
oGlmPoint3 mGlPosition
ofloat mGlWidth
ofloat mHeight
oGlmPoint3 mPosition
obool mVisible
ofloat mWidth

Protected Methods

ovirtual bool getDisplayListGenerate()
ovirtual int getDisplayListId()
ovirtual void render2d(GmTypes::RenderOptionType renderOptions)
ovirtual void render2dSelect(GmTypes::RenderOptionType renderOptions)
ovirtual void setDisplayListGenerate(bool generate)
ovirtual void setDisplayListId(int id)


Inherited from GmObject:

Public Methods

ounsigned short getObjectId()

Protected Fields

oThe object ID is used to uniquely identify each GmObject unsigned short mObjectId


Inherited from GmAnimationEventHandler:


Documentation

Class description
oGmTypes::ButtonStateType mState
The state of the button. This can usually be GMBS_PRESSED or GMBS_UNPRESSED.

ofloat mBorderWidth
The width of the border around the button

oGmTextWidget* mTextWidget
Some text for labeling the button

o GmButton()
Standard constructor

ovirtual ~GmButton()
Virtual destructor

ovirtual void setState(GmTypes::ButtonStateType state)
Sets the state of the button. A button can have two states, pressed and unpressed.

Parameters:
- state the state to set the button to

ovirtual GmTypes::ButtonStateType getState()
Gets the state of the button.

Returns:
the pressed state of the button.

ovirtual void setBorderWidth(float borderWidth)
Sets the width of the border around the button. The border width is the total percentage that the border should visually encompass on the button.

Parameters:
border - the width of the border around the button. The value is the total percentage that the border should visually encompass on the button

ovirtual float getBorderWidth()
Gets the width of the border around the button.

Returns:
the width of the border around the button

ovirtual void setText(char* text)
Sets the text of this text widget to the given text.

Parameters:
text - the text to set this widget to display

ovirtual char* getText()
Gets the text that is currently associated with this widget

Returns:
s a pointer to the text that this widget is set to display. THIS IS A BORROWED POINTER, DO NOT DELETE IT!

ovoid setTextColor(GlmColor4* color)
Sets the display color of the text.

Parameters:
color - the color to set the text color to

ovoid setTextColor(float r, float g, float b, float a)
Sets the display color of the text to the given red, green, blue and alpha values.

Parameters:
r - the red component of the color
g - the green component of the color
b - the blue component of the color
a - the alpha component of the color

oGlmColor4* getTextColor()
Gets the text color that is currently assigned to the text.

Returns:
the text color as a GlmColor4 object, THIS IS A BORROWED REFERENCE, DO NOT DELETE IT!

ovoid setTextPointSize(float pointSize)
Sets the point size of the text, this will affect the size at which the font is rendered for the text string.

Parameters:
pointSize - the size of the text in points

ofloat getTextPointSize()
Gets the size of the text in points.

Returns:
the point size of the text that is to be rendered by this widget.

ovoid setTextJustification(GmTypes::JustificationType horizontal, GmTypes::JustificationType vertical)
Sets the horizontal and vertical text justification for the widget text.

Parameters:
horizontal - the horizontal justification to use for the text widget.
vertical - the vertical justification to use for the text widget.

ovoid getTextJustification(GmTypes::JustificationType& horizontal, GmTypes::JustificationType& vertical)
Gets the type of justification for the text in this widget.

Parameters:
horizontal - the horizontal text justification for the widget
vertical - the vertical text justification for the widget

ovirtual void setCoordType(GmTypes::CoordinateType coordType)
Sets the coordinate type for this object. The coordinate type can either be CT_ABSOLUTE or CT_RELATIVE. Absolute placement is where the object should be placed in world coordinates, where relative placement is done as a percentage of the parent container. For objects of container classes, the only coordinate type available are relative coordinates.

Parameters:
coordType - the coordinate type to set this drawable object to

ovirtual void setPosition(float x, float y, float z)
Sets the position of the drawable. The top-left most pixel of the rendered image will be located at the given point if the coordinate type is CT_ABSOLUTE. If the coordinate type for this drawable is CT_RELATIVE, the value should be from 0%-100% (0.0 to 1.0) and will be a relative to the drawable's parent container.

Parameters:
- x the X position of the drawable object
- y the Y position of the drawable object
z - the Z position of the drawable object

ovirtual void setPosition(GlmPoint3* point)
Sets the position of the drawable. The top-left most pixel of the rendered image will be located at the given point if the coordinate type is CT_ABSOLUTE. If the coordinate type for this drawable is CT_RELATIVE, the value should be from 0%-100% (0.0 to 1.0) and will be a relative to the drawable's parent container.

Parameters:
point - the point to use as the top-left rendering location of the drawable.

ovirtual void setWidth(float width)
Sets the width of the drawable object in units. If the coordinate type for this drawable is CT_RELATIVE, the value should be from 0%-100% (0.0 to 1.0) and will be a relative to the drawable's parent container.

Parameters:
width - the width to set the drawable object's width to.

ovirtual void setHeight(float height)
Sets the height of the drawable object in units. If the coordinate type for this drawable is CT_RELATIVE, the value should be from 0%-100% (0.0 to 1.0) and will be a relative to the drawable's parent container.

Parameters:
height - the height to set the drawable object's height to.

ovirtual void setDepth(float depth)
Sets the depth of the drawable object in units. If the coordinate type for this drawable is CT_RELATIVE, the value should be from 0%-100% (0.0 to 1.0) and will be a relative to the drawable's parent container.

Parameters:
depth - the depth to set the drawable object's depth to.

ovirtual void setVisible(bool visible)
Sets the visibility of the drawable object. If the visibility is set to false, the object is not drawn. If the visibility is set to true, the object will be drawn.

Parameters:
visible - the visibility status to set this drawable object to

ovirtual void setAbsoluteGeometry(float x, float y, float z, float width, float height, float depth)
Sets the absolute geometry to use for this drawable object. This method is provided merely for convenience.

Parameters:
- x the absolute X value for this drawable
- y the absolute Y value for this drawable
z - the absolute Z value for this drawable
width - the width of this drawable
height - the height of this drawable
depth - the depth of this drawable

ovirtual void setRelativeGeometry(float x, float y, float width, float height)
Sets the relative geometry to use for this drawable object. This method is provided merely for convenience. This method is intended to be used with 2d layouts.

Parameters:
- x the absolute X value for this drawable
- y the absolute Y value for this drawable
width - the width of this drawable
height - the height of this drawable

ovirtual void setRelativeGeometry(float x, float y, float z, float width, float height, float depth)
Sets the relative geometry to use for this drawable object. This method is provided merely for convenience.

Parameters:
- x the absolute X value for this drawable
- y the absolute Y value for this drawable
z - the absolute Z value for this drawable
width - the width of this drawable
height - the height of this drawable
depth - the depth of this drawable

ovirtual void applyLayout(float minX, float minY, float minZ, float maxX, float maxY, float maxZ)
Repositions and resizes this component based on parameters passed into the method. These parameters are usually passed in by the parent class or parent layout manager.

Parameters:
minX - the starting X position of the constraint volume
minY - the starting Y position of the constraint volume
minZ - the starting Z position of the constraint volume
maxX - the ending X position of the constraint volume
maxY - the ending X position of the constraint volume
maxZ - the ending Z position of the constraint volume

ovirtual void mousePressEvent(GmEvent* event)
Event processing function to process a mouse press event.

Parameters:
event - the mouse press event for this object to process

ovirtual void mouseReleaseEvent(GmEvent* event)
Event processing function to process a mouse release event.

Parameters:
event - the mouse release event for this object to process


Direct child classes:
GmMenu
GmGraphicButton
GmCheckBox

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.