Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

CUI_Button Class Reference

Any sort of button in the UI. More...

#include <CUI_Button.h>

Inheritance diagram for CUI_Button:

CUI_Widget CUI_Frame CUI_MultipleStateButton CUI_ResizeButton List of all members.

Public Member Functions

 CUI_Button (CUI_UI *ui=NULL, float x=0, float y=0, float x2=1, float y2=1, CUI_Frame *parent=NULL, IUI_Shader *shader=NULL, IUI_Shader *cursor=NULL, CUI_CoordSys *coordsys=NULL, char *text=NULL, IUI_Font *font=NULL, float textscale=0.8, IUI_Border *border=NULL, IUI_Shader *hover=NULL, IUI_Shader *disable=NULL, IUI_Shader *click=NULL)
 constructor

virtual ~CUI_Button ()
 destructor

virtual bool Render (double dtime, IUI_Renderer *renderer)
 overloaded render

virtual bool SetShader (IUI_Shader *shader)
 set the shader for this button

virtual bool SetHoverShader (IUI_Shader *shader)
 set the shader to be used when this button is being hovered over

virtual bool SetDisableShader (IUI_Shader *shader)
 set the shader to be used when this button is disabled

virtual bool SetClickShader (IUI_Shader *shader)
 set the shader to be used when this button is clicked

virtual bool IsClickable ()
 we want to accept mouse input

virtual bool Click (int &id, int &numparam, void **param)
 Call the click action function.

virtual void DeleteParam (void *param)
 Delete a parameter allocated by this frame.


Protected Attributes

IUI_Shaderm_defaultShader
 the default shader

IUI_Shaderm_hoverShader
 the hover shader

IUI_Shaderm_disableShader
 the disabled shader

IUI_Shaderm_clickShader
 the clicked shader


Detailed Description

Any sort of button in the UI.

In general, buttons should not have children, but it is allowed in the spec.

Recognized flags:
[system]
UI_CLICKED
UI_HOVER
UI_SELECTED

UI_DISABLED
UI_INACTIVE


Member Function Documentation

bool CUI_Button::Click int &  id,
int &  numparam,
void **  param
[virtual]
 

Call the click action function.

The UI will only call this function when the button is let up while over the same button it was clicked on.
Knowing the type of the parameters is up to the callback function which should be written specifically for the buttons it was designed to handle.

Parameters:
id modified frameID
numparam [modified] number of parameters in the list
param [modified] pointer to a list of parameters

Reimplemented from CUI_Frame.

Reimplemented in CUI_MultipleStateButton.

virtual void CUI_Button::DeleteParam void *  param  )  [inline, virtual]
 

Delete a parameter allocated by this frame.

Buttons do not pass back parameters

Reimplemented from CUI_Frame.

Reimplemented in CUI_MultipleStateButton.

bool CUI_Button::SetClickShader IUI_Shader shader  )  [virtual]
 

set the shader to be used when this button is clicked

See also:
SetShader

bool CUI_Button::SetDisableShader IUI_Shader shader  )  [virtual]
 

set the shader to be used when this button is disabled

See also:
SetShader

bool CUI_Button::SetHoverShader IUI_Shader shader  )  [virtual]
 

set the shader to be used when this button is being hovered over

See also:
SetShader

bool CUI_Button::SetShader IUI_Shader shader  )  [virtual]
 

set the shader for this button

this is the default shader

See also:
SetHoverShader

SetDisableShader

SetClickShader

Reimplemented from CUI_Frame.


The documentation for this class was generated from the following files:
Generated on Mon Sep 29 23:07:03 2003 for glGUI by doxygen 1.3.4