MGUI::POPUP Class Reference

Base class for 'popup' windows. More...

#include <mgui/popup.h>

Inheritance diagram for MGUI::POPUP:
Inheritance graph
[legend]

List of all members.

Public Types

enum  LOCATION {
  LOCATION_Xmin = 0x00, LOCATION_Xmax = 0x01, LOCATION_Xcenter = 0x02, LOCATION_Ymin = 0x00,
  LOCATION_Ymax = 0x04, LOCATION_Ycenter = 0x08, LOCATION_XminYmin = (LOCATION_Xmin|LOCATION_Ymin), LOCATION_XminYmax = (LOCATION_Xmin|LOCATION_Ymax),
  LOCATION_X = 0x03, LOCATION_Y = 0x0C
}

Public Member Functions

 POPUP ()
virtual ~POPUP ()
ERRVALUE Create (MDLGPARENT dlgparent)
void Destroy ()
bool IsCreated () const
ERRVALUE Open (MGUI::POINT pt, int width=0, int height=0, LOCATION locInPopup=LOCATION_XminYmin)
ERRVALUE Open (const MGUI::CTRL &ctrl, const LRECT2D *pRect=0, int width=0, int height=0, LOCATION locInCtrl=LOCATION_XminYmax, LOCATION locInPopup=LOCATION_XminYmin)

Protected Member Functions

void Close (ERRVALUE RetValue)
MDLGPARENT GetDlgParent () const
LAYOUT_PANE_BASEGetMainPane ()
void SetReturnValue (ERRVALUE RetValue)

Private Member Functions

virtual ERRVALUE v_CreateContent ()=0
virtual void v_OnOpen ()

Detailed Description

Base class for 'popup' windows.

A popup window has no title bar and minimal borders. It is generally considered to be transient and appears in response to user clicking on another control such as a button. Clicking outside the popup window will close it, returning EUserCancel from Open(). Usually clicking on a control in the popup will perform some action and also close the window. A popup cannot be used as a parent for other dialogs.


Member Enumeration Documentation

Enumerator:
LOCATION_Xmin 

Minimum X (left).

LOCATION_Xmax 

Maximum X (right).

LOCATION_Xcenter 
LOCATION_Ymin 

Minimum Y (top).

LOCATION_Ymax 

Maximum Y (bottom).

LOCATION_Ycenter 
LOCATION_XminYmin 
LOCATION_XminYmax 
LOCATION_X 
LOCATION_Y 

Constructor & Destructor Documentation

MGUI::POPUP::POPUP (  ) 

Constructor.

virtual MGUI::POPUP::~POPUP (  )  [virtual]

Destructor.


Member Function Documentation

void MGUI::POPUP::Close ( ERRVALUE  RetValue  )  [protected]

Close the popup window and return specified value.

ERRVALUE MGUI::POPUP::Create ( MDLGPARENT  dlgparent  ) 

Create popup over specified parent.

Parameters:
dlgparent Parent for popup
void MGUI::POPUP::Destroy (  ) 

Destroy the shell.

MDLGPARENT MGUI::POPUP::GetDlgParent (  )  const [inline, protected]

Get parent for use in launching other dialogs from popup.

LAYOUT_PANE_BASE& MGUI::POPUP::GetMainPane (  )  [inline, protected]

Get main layout pane.

Typically used in v_CreateContent.

bool MGUI::POPUP::IsCreated (  )  const [inline]

Determine if has been 'created' yet.

ERRVALUE MGUI::POPUP::Open ( MGUI::POINT  pt,
int  width = 0,
int  height = 0,
LOCATION  locInPopup = LOCATION_XminYmin 
)

Open the popup window relative to specified point and wait for it to be closed.

Returns:
EUserCancel if user closes by clicking outside window. Create() must have been performed before using this variant of Open().
Parameters:
pt Point in display coordinates
width Width override, 0 to retain current width
height Height override, 0 to retain current height
locInPopup Location in popup to place at specified point
ERRVALUE MGUI::POPUP::Open ( const MGUI::CTRL ctrl,
const LRECT2D pRect = 0,
int  width = 0,
int  height = 0,
LOCATION  locInCtrl = LOCATION_XminYmax,
LOCATION  locInPopup = LOCATION_XminYmin 
)

Open the popup window relative to specified control and wait for it to be closed.

Returns:
EUserCancel if user closes by clicking outside window. If popup has not been created yet will use specified control's shell as parent to create popup.
Parameters:
ctrl Control to show relative to
pRect Rectangle in specified control coordinates, 0 to use control's entire rectangle
width Width override, 0 to retain current width
height Height override, 0 to retain current height
locInCtrl Location on control / rectangle
locInPopup Location in popup to match
void MGUI::POPUP::SetReturnValue ( ERRVALUE  RetValue  )  [protected]

Set return value if previously closed.

Has no effect if Close was not previously called. Typically used if a dialog was launched from the popup.

virtual ERRVALUE MGUI::POPUP::v_CreateContent (  )  [private, pure virtual]

Create contents.

Derived class must implement this. Return 0 for success or an error code < 0. This will be called by the popup creation code and must not be called directly. This is normally overridden only by the specific popup implementation and not by the code that actually uses that popup implementation. Implementation should call GetMainPane() to determine the pane to create the controls in. This function should not open another dialog, modal or non-modal.

virtual void MGUI::POPUP::v_OnOpen (  )  [private, virtual]

Called when popup opened.

Default implementation does nothing.


The documentation for this class was generated from the following file:

Generated on Sun Oct 7 21:36:13 2012 for TNTsdk 2012 by  doxygen 1.6.1