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

CascadeMessageBox Class Reference

implements a message box More...

#include <cascade/app/CascadeMessageBox.h>

Inheritance diagram for CascadeMessageBox:

CascadeWindow CascadeObject List of all members.

Public Types

enum  Type { Ok = 0, OkCancel = 1, YesNo = 2 }

Public Member Functions

 CascadeMessageBox ()
virtual ~CascadeMessageBox ()
bool MessageBox (CascadeString &text, const CascadeString &title, Type type=Ok, bool bDefault=true)
void Dismiss (bool bResult)
void Dismiss ()

Protected Member Functions

virtual void OnPaint (CascadeBitmap &bitmap)
virtual bool OnKeyDown (u32 nKey)
virtual bool OnKeyUp (u32 nKey)
void LayoutBox ()

Static Protected Member Functions

static void StaticButtonCallback (const CascadeButtonWidget *pButton, const CascadeButtonWidget::State &newState, void *pClientData)

Protected Attributes

CascadeString m_text
CascadeString m_title
CascadeRect m_rectText
CascadeRect m_rectTitle
Type m_type
CascadeButtonWidget m_buttonOkYes
CascadeButtonWidget m_buttonCancelNo
bool m_bResult

Detailed Description

implements a message box

Skip the description

CascadeMessageBox is a class that can be used to prompt the user for a Yes/No, Ok/Cancel, or Ok response.

NOTE NOTE NOTE THIS CLASS DOES NOT WORK DO NOT USE NOTE NOTE NOTE THIS CLASS DOES NOT WORK DO NOT USE NOTE NOTE NOTE THIS CLASS DOES NOT WORK DO NOT USE NOTE NOTE NOTE THIS CLASS DOES NOT WORK DO NOT USE NOTE NOTE NOTE THIS CLASS DOES NOT WORK DO NOT USE NOTE NOTE NOTE THIS CLASS DOES NOT WORK DO NOT USE NOTE NOTE NOTE THIS CLASS DOES NOT WORK DO NOT USE NOTE NOTE NOTE THIS CLASS DOES NOT WORK DO NOT USE NOTE NOTE NOTE THIS CLASS DOES NOT WORK DO NOT USE NOTE NOTE NOTE THIS CLASS DOES NOT WORK DO NOT USE NOTE NOTE NOTE THIS CLASS DOES NOT WORK DO NOT USE NOTE NOTE NOTE THIS CLASS DOES NOT WORK DO NOT USE NOTE NOTE NOTE THIS CLASS DOES NOT WORK DO NOT USE NOTE NOTE NOTE THIS CLASS DOES NOT WORK DO NOT USE


class CascadeMessageBox


Member Enumeration Documentation

enum CascadeMessageBox::Type
 

Enumeration values:
Ok 
OkCancel 
YesNo 


Constructor & Destructor Documentation

CascadeMessageBox::CascadeMessageBox  ) 
 

default constructor

The CascadeMessageBox constructor is lightweight.

virtual CascadeMessageBox::~CascadeMessageBox  )  [virtual]
 

destructor

The CascadeMessageBox destructor is lightweight.


Member Function Documentation

void CascadeMessageBox::Dismiss  ) 
 

dismisses a message box programatically using the default result

Dismiss may be used to dismiss a modal message box. Dismiss should only be called from the main app thread. This version of Dismiss will cause MessageBox() to return it's default value.

See also:
MessageBox

void CascadeMessageBox::Dismiss bool  bResult  ) 
 

dismisses a message box programatically

Dismiss may be used to dismiss a modal message box. Dismiss should only be called from the main app thread. Usually the user will dismiss the message box via the user interface. In this case, Dismiss() need not be called. Dismiss() is provided to allow you the client to take down a message box in response to a timer or some other event in your code.

Parameters:
bResult the result that MessageBox() should return with.
See also:
MessageBox

void CascadeMessageBox::LayoutBox  )  [protected]
 

bool CascadeMessageBox::MessageBox CascadeString text,
const CascadeString title,
Type  type = Ok,
bool  bDefault = true
 

posts the message box

MessageBox() puts up a message box and returns true if Ok or Yes was selected, false if Cancel or No was selected. MessageBox() puts up the message box modally, which means that the function doesn't return until the message box is dismissed either by the user or programatically with one of the Dismiss functions.

Note:
Modal windows operate by running a special app message loop and only exiting that message loop when the modal window vanishes. Special considerations must be taken when using modal windows.
See also:
CascadeWindow::ModalMaterialize()
Parameters:
text the message text of the message box
title the title of the message box
type the type of the message box
bDefault set to true to have Ok or Yes be the default button, false to have Cancel or No be the default button
Returns:
true if Ok or Yes was selected, false if Cancel or No was selected
See also:
Type

Dismiss()

virtual bool CascadeMessageBox::OnKeyDown u32  nKey  )  [protected, virtual]
 

called to handle a key down CK_KEY message

OnKeyDown() gets called to handle a key down message. return true to indicate you have processed the message; false to allow the message to continue to be dispatched. NOTE that navigation keys (CK_NORTH, etc.) do not get dispatched to OnKeyDown(), they get dispatched to OnNavKey().

Parameters:
nKey the CK_KEY being notified
Returns:
true to prevent further message processing, false to allow it
See also:
OnKeyUp()

CascadeApp

Reimplemented from CascadeWindow.

virtual bool CascadeMessageBox::OnKeyUp u32  nKey  )  [protected, virtual]
 

called to handle a key down CK_KEY message

OnKeyDown() gets called to handle a key up message. return true to indicate you have processed the message; false to allow the message to continue to be dispatched. NOTE that navigation key up messages don't get dispatched to CascadeWindows. CascadeWindows only receive Nav key down messages to their OnNavKey() procedures.

Parameters:
nKey the CK_KEY being notified
Returns:
true to prevent further message processing, false to allow it
See also:
OnKeyDown()

CascadeApp

Reimplemented from CascadeWindow.

virtual void CascadeMessageBox::OnPaint CascadeBitmap bitmap  )  [protected, virtual]
 

Called to instruct this window to paint

OnPaint() is called by the Cascade Windowing system to instruct your window to paint (on the bitmap passed in). Higher system performance will result if you manually clip your painting to the bitmap's clipRect (bitmap.GetClipRect()), though this is not required. It IS required to manually clip your painting to the window's absolute rect (since the graphics library doesn't yet support clipping). OnPaint() will only be called by the Cascade windowing system if some portion of the window's absolute rect intersects with the bitmap's clipRect. clients can manually call OnPaint to instruct the window to paint to an arbitrary bitmap outside of the context of the Cascade windowing system. Note that OnPaint() is a paint handling function for a single window. To cause a window and all of its child windows to paint, call PaintTree() instead.

Note:
Windows are themselves responsible for determining if they are the active window with input focus and rendering appropriately.
Parameters:
bitmap The bitmap to paint onto
See also:
OnPaint()

CascadeBitmap

Reimplemented from CascadeWindow.

static void CascadeMessageBox::StaticButtonCallback const CascadeButtonWidget pButton,
const CascadeButtonWidget::State newState,
void *  pClientData
[static, protected]
 


Member Data Documentation

bool CascadeMessageBox::m_bResult [protected]
 

CascadeButtonWidget CascadeMessageBox::m_buttonCancelNo [protected]
 

CascadeButtonWidget CascadeMessageBox::m_buttonOkYes [protected]
 

CascadeRect CascadeMessageBox::m_rectText [protected]
 

CascadeRect CascadeMessageBox::m_rectTitle [protected]
 

CascadeString CascadeMessageBox::m_text [protected]
 

CascadeString CascadeMessageBox::m_title [protected]
 

Type CascadeMessageBox::m_type [protected]
 


The documentation for this class was generated from the following file:
Generated on Sun Jul 24 14:27:19 2005 for Cascade Library by  doxygen 1.4.1