Base class for 'popup' windows. More...
#include <mgui/popup.h>

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_BASE & | GetMainPane () |
| void | SetReturnValue (ERRVALUE RetValue) |
Private Member Functions | |
| virtual ERRVALUE | v_CreateContent ()=0 |
| virtual void | v_OnOpen () |
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.
| MGUI::POPUP::POPUP | ( | ) |
Constructor.
| virtual MGUI::POPUP::~POPUP | ( | ) | [virtual] |
Destructor.
| 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.
| 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.
| 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.
| 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.
1.6.1