Base class for 'top level' application shells. More...
#include <mgui/topshell.h>

Public Types | |
| enum | BUTTONS { BUTTON_RunJob = 0x02, BUTTON_SaveJob = 0x04, BUTTON_Close = 0x08, BUTTON_Help = 0x10, BUTTON_Run = 0x20, BUTTON_Exit = 0x40, BUTTONS_Default = 0x00 } |
| enum | STYLE { STYLE_Default = 0x0000, STYLE_NoClose = 0x0001, STYLE_NoMinimize = 0x0002, STYLE_NoMaximize = 0x0004, STYLE_NoResize = 0x0008, STYLE_RightAlignButtons = 0x0010 } |
Public Member Functions | |
| TOPSHELL (HELPID helpid) | |
| virtual | ~TOPSHELL () |
| void | Create (const char *PlacementKey=0, TEXTID TitleID=TEXTID__None, STYLE style=TOPSHELL::STYLE_Default, ICONID WindowIcon=ICONID_TITLE_TNTMIPS) |
| void | EnableDocking (DOCKEDGE dockedges=DOCKEDGE_Any) |
| bool | IsVisible () const |
| void | SetVisible (bool visible=true) |
Protected Member Functions | |
| void | CreateButton (MGUI::CTRL_PUSHBUTTON &Button, const MISTRING &label) |
| MGUI::CTRL_PUSHBUTTON & | CreateButton (BUTTONS button, const MISTRING &label) |
| MGUI::CTRL_PUSHBUTTON & | CreateButton (BUTTONS button) |
| void | CreateButtons (BUTTONS buttons=BUTTONS_Default) |
| void | SetIgnoreNonVisible (bool IgnoreNonVisible=true) |
| void | SetRootSpacing (int RootSpacing, int RootBorder=0) |
| void | SetRunEnabled (bool enabled=true) |
Private Member Functions | |
| virtual int | v_CreateContent ()=0 |
| virtual void | v_OnClose () |
| virtual void | v_OnCloseRequest ()=0 |
| virtual void | v_OnOpen () |
| virtual void | v_OnRun () |
| virtual void | v_OnRunJob () |
| virtual void | v_OnSaveJob () |
Base class for 'top level' application shells.
Top-level shells are windows whose parent is the 'desktop'.
| BUTTON_RunJob |
Call v_OnRunJob when pressed. |
| BUTTON_SaveJob |
Call v_OnSaveJob when pressed. |
| BUTTON_Close |
Calls v_OnCloseRequest() when pressed. |
| BUTTON_Help |
Displays the help specified by the HELPID in the constructor when pressed. |
| BUTTON_Run |
Calls v_OnRun when pressed. |
| BUTTON_Exit |
Same as BUTTON_Close, except for the label. Note: if you want the button to actually exit the application, you should call APP_MAIN::Exit() from v_OnCloseRequest(). |
| BUTTONS_Default |
Creates 'Run', 'Exit' and 'Help' buttons. |
| MGUI::TOPSHELL::TOPSHELL | ( | HELPID | helpid | ) |
Constructor.
| virtual MGUI::TOPSHELL::~TOPSHELL | ( | ) | [virtual] |
Destructor.
| void MGUI::TOPSHELL::Create | ( | const char * | PlacementKey = 0, |
|
| TEXTID | TitleID = TEXTID__None, |
|||
| STYLE | style = TOPSHELL::STYLE_Default, |
|||
| ICONID | WindowIcon = ICONID_TITLE_TNTMIPS | |||
| ) |
Create the actual shell graphical object.
| PlacementKey | Ini/Registry key for automatic placement management | |
| TitleID | Text ID for title | |
| style | Shell style | |
| WindowIcon | Icon to place at the top left of the window title bar |
| void MGUI::TOPSHELL::CreateButton | ( | MGUI::CTRL_PUSHBUTTON & | Button, | |
| const MISTRING & | label | |||
| ) | [protected] |
Create application-defined button at the bottom of the window.
If you want, for example 'Run', 'Test', 'Exit' and 'Help' buttons, you can use CreateButton for the standard ones and AddButton for the 'Test' button. The order you create the buttons is important. The Button parameter should be a reference to a CTRL_PUSHBUTTON which is a member of your TOPSHELL-derived class. This method will take care of making all the buttons the same size.
| MGUI::CTRL_PUSHBUTTON& MGUI::TOPSHELL::CreateButton | ( | BUTTONS | button, | |
| const MISTRING & | label | |||
| ) | [protected] |
Create standard button with label override.
| button | Button to create |
| MGUI::CTRL_PUSHBUTTON& MGUI::TOPSHELL::CreateButton | ( | BUTTONS | button | ) | [protected] |
Create standard button with default label.
| button | Button to create |
| void MGUI::TOPSHELL::CreateButtons | ( | BUTTONS | buttons = BUTTONS_Default |
) | [protected] |
Create standard buttons at bottom of dialog.
Default button labels will be 'Run...', 'Exit', and 'Help'
| buttons | Buttons to create |
| void MGUI::TOPSHELL::EnableDocking | ( | DOCKEDGE | dockedges = DOCKEDGE_Any |
) |
Enable edges of shell for control bar docking.
If not specified and control bars are created for the shell then all edges are assumed to be enabled for docking.
| dockedges | Sides of shell enabled for docking of control bars |
| bool MGUI::TOPSHELL::IsVisible | ( | ) | const |
Determine if currently visible.
| void MGUI::TOPSHELL::SetIgnoreNonVisible | ( | bool | IgnoreNonVisible = true |
) | [inline, protected] |
Set to ignore nonvisible items when doing layout.
This must be called before Create() and is usually done in the subclass constructor.
| void MGUI::TOPSHELL::SetRootSpacing | ( | int | RootSpacing, | |
| int | RootBorder = 0 | |||
| ) | [inline, protected] |
Set spacing and border for root pane.
This must be called before Create() and is usually done in the subclass constructor. If not called the default spacing is 4 pixels and border is 0.
| void MGUI::TOPSHELL::SetRunEnabled | ( | bool | enabled = true |
) | [protected] |
Enable (or disable) the Run, Run Job and Save Job buttons.
| void MGUI::TOPSHELL::SetVisible | ( | bool | visible = true |
) |
Set whether shell is visible or not.
Will call v_OnOpen or v_OnClose.
| virtual int MGUI::TOPSHELL::v_CreateContent | ( | ) | [private, pure virtual] |
Create shell contents.
Derived class MUST implement this. Function must return TRUE to show shell immediately, FALSE to not show the shell, or an error code < 0. This will be called by the shell creation code and thus must not be called directly. This is normally overridden only by the specific shell implementation and not by the code that actually uses that shell implementation. The implementation should call GetMainPane() to determine the pane to create the controls in.
Implements MGUI::SHELL.
Implemented in MIE::IMPEXPDIALOG_BASE.
| virtual void MGUI::TOPSHELL::v_OnClose | ( | ) | [private, virtual] |
Called when shell gets hidden or closed.
| virtual void MGUI::TOPSHELL::v_OnCloseRequest | ( | ) | [private, pure virtual] |
Called when user requests that shell be 'closed'.
Usually results from an OS or Window Manager notification. To honor request and close the shell, override and call Destroy().
Implements MGUI::SHELL.
Implemented in MIE::IMPEXPDIALOG_BASE.
| virtual void MGUI::TOPSHELL::v_OnOpen | ( | ) | [private, virtual] |
Called after shell is actually displayed.
Reimplemented in MIE::IMPEXPDIALOG_BASE.
| virtual void MGUI::TOPSHELL::v_OnRun | ( | ) | [private, virtual] |
Called when the 'Run' button is pressed.
| virtual void MGUI::TOPSHELL::v_OnRunJob | ( | ) | [private, virtual] |
Called when the 'Run Job' button is pressed.
| virtual void MGUI::TOPSHELL::v_OnSaveJob | ( | ) | [private, virtual] |
Called when the 'Save Job' button is pressed.
1.6.1