00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037 #ifndef INC_MGUI_SHELL_H
00038 #define INC_MGUI_SHELL_H
00039
00040 #ifndef INC_MI32_STDDEFNS_H
00041 #include <mi32/stddefns.h>
00042 #endif
00043
00044 #ifndef INC_MI32_HELPID_H
00045 #include <mi32/helpid.h>
00046 #endif
00047
00048 #ifndef INC_MGUI_COMMAND_H
00049 #include <mgui/command.h>
00050 #endif
00051
00052 #ifndef INC_MGUI_LAYOUT_H
00053 #include <mgui/layout.h>
00054 #endif
00055
00056 #ifndef INC_MI32_RECT_H
00057 #include <mi32/rect.h>
00058 #endif
00059
00060
00061 #ifndef GENERATING_DOXYGEN_OUTPUT
00062
00063 class CWnd;
00064 namespace MGUI {
00065 class CTRL_STATUSBAR;
00066 class DLGSHELL;
00067 class TOPSHELL;
00068 }
00069 #endif // GENERATING_DOXYGEN_OUTPUT
00070
00071
00072 namespace MGUI {
00073
00074
00075 class SHELL {
00076 public:
00077
00078 class PLACEMENT;
00079
00080
00081 MDLGPARENT GetDlgParent (
00082 ) const;
00083
00084
00085 void Destroy ();
00086
00087
00088 HELPID GetHelpID (
00089 ) const { return (m_HelpID); }
00090
00091
00092 LAYOUT_PANE_MAIN& GetMainPane (
00093 ) { return (v_GetMainPane()); }
00094
00095
00096 void GetPlacement (
00097 PLACEMENT& placement
00098 ) const;
00099
00100
00101 bool IsCreated (
00102 ) const {
00103 #ifdef WIN32_MFC
00104 return (m_pWnd != 0);
00105 #else
00106 return (m_shell != 0);
00107 #endif
00108 }
00109
00110
00111
00112 bool SetPlacement (
00113 const PLACEMENT& placement
00114 );
00115
00116
00117
00118
00119 void SetPlacementByKey (
00120 const char *PlacementKey
00121 );
00122
00123
00124 void SetTitle (
00125 const MISTRING& title
00126 );
00127
00128 protected:
00129
00130
00131 SHELL (
00132 HELPID helpid
00133 );
00134
00135
00136 virtual ~SHELL ();
00137
00138
00139 MGUI::COMMAND_ROUTER* GetCmdRouter (
00140 ) const {
00141 #ifdef X_NATIVE
00142 return (0);
00143 #else
00144 return (v_GetCmdRouter());
00145 #endif
00146 }
00147
00148 void SetMenuBar (
00149 const MGUI::MENU& menu
00150 );
00151
00152
00153 void SetStatusBar (
00154 MGUI::CTRL_STATUSBAR& StatusBar
00155 ) { m_pStatusBar = &StatusBar; }
00156
00157 private:
00158 #ifndef GENERATING_DOXYGEN_OUTPUT
00159
00160 friend class MGUI::TOPSHELL;
00161 friend class MGUI::DLGSHELL;
00162
00163 #ifdef WIN32_MFC
00164 CWnd *m_pWnd;
00165 #endif
00166 #ifdef X_NATIVE
00167 Widget m_shell;
00168 LAYOUT_PANE_MAIN m_MainPane;
00169 #endif
00170 HELPID m_HelpID;
00171 CTRL_STATUSBAR *m_pStatusBar;
00172 char *m_PlacementKey;
00173 bool m_AllowClose;
00174 MISTRING m_Title;
00175
00176 #ifdef X_NATIVE
00177 void AttachShell (Widget shell, bool AllowClose=true);
00178 #endif
00179 void OnCloseRequest () { v_OnCloseRequest(); }
00180 #ifdef X_NATIVE
00181 static void OnNotifyXDelete (Widget, SHELL*, void*);
00182 #endif
00183
00184
00185 SHELL (const SHELL&);
00186 SHELL& operator= (const SHELL&);
00187
00188 #endif // GENERATING_DOXYGEN_OUTPUT
00189
00190
00191
00192
00193
00194 virtual int v_CreateContent () = 0;
00195
00196
00197 virtual void v_Destroy () = 0;
00198
00199 #ifdef WIN32_MFC
00200
00201 virtual MGUI::COMMAND_ROUTER* v_GetCmdRouter () const = 0;
00202 #endif
00203
00204
00205 virtual LAYOUT_PANE_MAIN& v_GetMainPane () = 0;
00206
00207
00208
00209 virtual void v_OnCloseRequest () = 0;
00210
00211 };
00212
00213
00214
00215 class SHELL::PLACEMENT {
00216 public:
00217
00218
00219 PLACEMENT ();
00220
00221 const LRECT2D& GetNormalPosition (
00222 ) const { return (m_NormalPosition); }
00223
00224 void IniRead (
00225 INIHANDLE IniHandle,
00226 const char *IniGroup,
00227 const char *IniName
00228 );
00229
00230 void IniWrite (
00231 INIHANDLE IniHandle,
00232 const char *IniGroup,
00233 const char *IniName
00234 ) const;
00235
00236 bool IsMaximized (
00237 ) const { return (m_IsMaximized); };
00238
00239 void SetMaximized (
00240 bool Maximized
00241 ) { m_IsMaximized = Maximized; }
00242
00243 void SetNormalPosition (
00244 const LRECT2D& NormalPosition
00245 ) { m_NormalPosition = NormalPosition; }
00246
00247 private:
00248 #ifndef GENERATING_DOXYGEN_OUTPUT
00249 bool m_IsMaximized;
00250 LRECT2D m_NormalPosition;
00251 #endif // GENERATING_DOXYGEN_OUTPUT
00252 };
00253
00254 }
00255
00256 #endif // INC_MGUI_SHELL_H