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

CUI_MessageBox Class Reference

A Message Box. More...

#include <CUI_MessageBox.h>

Inheritance diagram for CUI_MessageBox:

CUI_Control CUI_Frame List of all members.

Public Member Functions

 CUI_MessageBox (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 *message=NULL, char *title=NULL, IUI_Shader *icon=NULL, unsigned short type=UI_MB_OK)
virtual ~CUI_MessageBox ()
virtual bool SetUI (CUI_UI *ui)
 Set UI - add child elements to the ui.

virtual bool ProcessKey (unsigned long key)
 Process a incoming key.

virtual bool CallbackFunc (int id, int numparam, void *param)
 Callback function to handle updating the selection.

virtual bool SetFont (IUI_Font *font)
 Set the font for this messagebox.

virtual bool SetMessage (char *text)
 Update the message text.

virtual bool SetTitle (char *text)
 Update the title.

virtual bool SetIcon (IUI_Shader *icon)
 Set the icon shader.

virtual bool SetType (unsigned short type)
 Set the type.

virtual bool SetButtonShaders (IUI_Shader *shader=NULL, IUI_Shader *hover=NULL, IUI_Shader *click=NULL)
 Set the shaders for the default button.

virtual bool SetOptionalButtonShaders (IUI_Shader *shader=NULL, IUI_Shader *hover=NULL, IUI_Shader *click=NULL)
 Set the shaders for the optional button.

virtual bool SetScrollShaders (IUI_Shader *shader=NULL, IUI_Shader *barShader=NULL)
 Set the shaders for the scrollbar.

virtual bool SetTextBoxShader (IUI_Shader *shader)
 Set the shader for the textbox background.

virtual bool SetTextBoxSize (unsigned int columns, unsigned int rows)
 Set the size of the textbox.


Protected Attributes

CUI_Widgetm_titleFrame
 The widget to display the title.

CUI_ScrollableTextBoxm_messageFrame
 The scrollable TextBox that displays the message.

CUI_Framem_iconFrame
 The frame that displays the icon.

CUI_Buttonm_defaultButton
 The default button.

CUI_Buttonm_optionalButton
 The secondary optional button.

unsigned short m_type
 The type of this message box.

unsigned short m_selected
 Currently selected.


Detailed Description

A Message Box.

Similar functionality to the win32 MessageBox. A title and text displaying a message, an icon to quickly give an idea of the context, and either an OK button or YES and NO buttons.

No Pop-Up functionality is builtin to the class itself. Maybe in CUI_UI?

There is no real control functionality in this class, but I think it is necessary enough in general usage for it to make sense to include it in the control library.

Recognized flags:
[system]
UI_CLICKED
UI_HOVER
UI_SELECTED

UI_DISABLED
UI_INACTIVE


Constructor & Destructor Documentation

CUI_MessageBox::CUI_MessageBox 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 *  message = NULL,
char *  title = NULL,
IUI_Shader icon = NULL,
unsigned short  type = UI_MB_OK
 

The type parameter is taken from defines in the header. Which are also used as parameters for the returntype in callback.

CUI_MessageBox::~CUI_MessageBox  )  [virtual]
 

responsible for deleting the child UI elements


Member Function Documentation

bool CUI_MessageBox::CallbackFunc int  id,
int  numparam,
void *  param
[virtual]
 

Callback function to handle updating the selection.

Update currently selected, redo param and send it to the global

Parameter is one integer giving the ID of what has been selected

See also:
UI_MB_OK

UI_MB_YES

UI_MB_NO

Returns:
true if the global callback does NOT need to be called

false if the global callback needs to be called

Reimplemented from CUI_Frame.

bool CUI_MessageBox::ProcessKey unsigned long  key  )  [virtual]
 

Process a incoming key.

Space/enter takes currently selected button (ok/yes is default).

Left/right Arrows move between yes/no

Reimplemented from CUI_Frame.


Member Data Documentation

unsigned short CUI_MessageBox::m_type [protected]
 

The type of this message box.

See also:
UI_MB_OK

UI_MB_YESNO


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