mgui/topshell.h

Go to the documentation of this file.
00001 /**
00002  * \file mgui/topshell.h
00003  * \brief MGUI::TOPSHELL definitions
00004  *
00005  * \if NODOC
00006  * $Id: topshell.h_v 1.3 2003/10/03 19:58:19 linux32build!build Exp $
00007  *
00008  * $Log: topshell.h_v $
00009  * Revision 1.3  2003/10/03 19:58:19  linux32build!build
00010  * Doxygen
00011  *
00012  * Revision 1.2  2003/09/15 13:49:32  fileserver!dwilliss
00013  * Doxygen
00014  *
00015  * Revision 1.1  2003/05/28 16:08:43  mju
00016  * Initial revision
00017  *
00018  * \endif
00019 **/
00020 
00021 #ifndef  INC_MGUI_TOPSHELL_H
00022 #define  INC_MGUI_TOPSHELL_H
00023 
00024 #ifndef  INC_MGUI_SHELLBASE_H
00025 #include <mgui/shell.h>
00026 #endif
00027 
00028 #ifdef WIN32_MFC
00029 class CFrameWnd;
00030 #endif
00031 
00032 
00033 namespace MGUI {
00034 
00035 enum DOCKEDGE {
00036    DOCKEDGE_Left =         0x1000,
00037    DOCKEDGE_Top =          0x2000,
00038    DOCKEDGE_Right =        0x4000,
00039    DOCKEDGE_Bottom =       0x8000,
00040    DOCKEDGE_Any =          0xF000
00041    };
00042 DEFINE_ENUM_OP_BITWISE(DOCKEDGE);
00043 
00044 
00045 //! Base class for 'top level' application shells.
00046 //! Top-level shells are windows whose parent is the 'desktop'.
00047 class TOPSHELL : public MGUI::SHELL {
00048    public:
00049 
00050       enum STYLE {
00051          STYLE_Default =      0x0000,
00052          STYLE_NoClose =      0x0001,
00053          STYLE_NoMinimize =   0x0002,
00054          STYLE_NoMaximize =   0x0004,
00055          STYLE_NoResize =     0x0008,     //!< Don't allow resizing, implies NoMaximize also
00056          };
00057 
00058       //! Constructor.
00059       TOPSHELL (
00060          HELPID helpid
00061          );
00062 
00063       //! Destructor.
00064       virtual ~TOPSHELL ();
00065 
00066       //! Create the actual shell graphical object.
00067       void Create (
00068          const char *PlacementKey = 0,             //!< Ini/Registry key for automatic placement management
00069          TEXTID TitleID = TEXTID__None,            //!< Text ID for title
00070          STYLE style = TOPSHELL::STYLE_Default     //!< Shell style
00071          );
00072 
00073       //! Enable edges of shell for control bar docking.
00074       //! If not specified and control bars are created for the shell then all edges are
00075       //! assumed to be enabled for docking.
00076       void EnableDocking (
00077          DOCKEDGE dockedges = DOCKEDGE_Any         //!< Sides of shell enabled for docking of control bars
00078          );
00079 
00080       //! Set whether shell is visible or not.
00081       void SetVisible (
00082          bool visible = true
00083          );
00084 
00085    protected:
00086 
00087    private:
00088       #ifndef GENERATING_DOXYGEN_OUTPUT
00089 
00090    #ifdef WIN32_MFC
00091       CFrameWnd *m_pFrame;
00092    #endif
00093    #ifdef X_NATIVE
00094       Widget m_form;
00095    #endif
00096 
00097    #ifdef X_NATIVE
00098       void AdjustAttachments ();
00099    #endif
00100 
00101       // Overrides from SHELL.
00102       virtual LAYOUT_PANE_MAIN& v_GetMainPane ();
00103       virtual void v_Destroy ();
00104 
00105       #endif // GENERATING_DOXYGEN_OUTPUT
00106 
00107       // Overridables
00108 
00109       //! Create shell contents.
00110       //! Derived class MUST implement this.  Function must return TRUE to show shell immediately,
00111       //! FALSE to not show the shell, or an error code < 0.  This will be called by the shell
00112       //! creation code and thus must not be called directly.  This is normally overridden only by
00113       //! the specific shell implementation and not by the code that actually uses that shell implementation.
00114       //! The implementation should call GetMainPane() to determine the pane to create the controls in.
00115       virtual int v_CreateContent () = 0;
00116 
00117       //! Called when shell gets hidden or closed.
00118       virtual void v_OnClose ();
00119 
00120       //! Called when user requests that shell be 'closed'.
00121       //! Usually results from an OS or Window Manager notification.
00122       //! To honor request and close the shell, override and call Destroy().
00123       virtual void v_OnCloseRequest () = 0;
00124 
00125       //! Called after shell is actually displayed.
00126       virtual void v_OnOpen ();
00127 
00128    };
00129 DEFINE_ENUM_OP_BITWISE(TOPSHELL::STYLE);
00130 
00131 }  // End namespace MGUI
00132 
00133 #endif   // INC_MGUI_TOPSHELL_H

Generated on Thu Aug 12 06:18:30 2004 for TNTsdk by doxygen 1.3.4-20031026