1 ///////////////////////////////////////////////////////////////////////////// 
   4 // Author:      Robert Roebling 
   6 // Copyright:   (c) 1998 Robert Roebling 
   7 // Licence:     wxWindows licence 
   8 ///////////////////////////////////////////////////////////////////////////// 
  14 #include "wx/object.h" 
  16 #include "wx/control.h" 
  19 #include "wx/toolbar.h" 
  21 //----------------------------------------------------------------------------- 
  23 //----------------------------------------------------------------------------- 
  25 class WXDLLIMPEXP_CORE wxMDIParentFrame
; 
  26 class WXDLLIMPEXP_CORE wxMDIClientWindow
; 
  27 class WXDLLIMPEXP_CORE wxMDIChildFrame
; 
  29 //----------------------------------------------------------------------------- 
  31 //----------------------------------------------------------------------------- 
  33 extern WXDLLEXPORT_DATA(const wxChar
) wxFrameNameStr
[]; 
  34 extern WXDLLEXPORT_DATA(const wxChar
) wxStatusLineNameStr
[]; 
  36 //----------------------------------------------------------------------------- 
  38 //----------------------------------------------------------------------------- 
  40 class WXDLLIMPEXP_CORE wxMDIParentFrame
: public wxFrame
 
  43     wxMDIParentFrame() { Init(); } 
  44     wxMDIParentFrame(wxWindow 
*parent
, 
  46                      const wxString
& title
, 
  47                      const wxPoint
& pos 
= wxDefaultPosition
, 
  48                      const wxSize
& size 
= wxDefaultSize
, 
  49                      long style 
= wxDEFAULT_FRAME_STYLE 
| wxVSCROLL 
| wxHSCROLL
, 
  50                      const wxString
& name 
= wxFrameNameStr
) 
  54         (void)Create(parent
, id
, title
, pos
, size
, style
, name
); 
  57     virtual ~wxMDIParentFrame(); 
  58     bool Create( wxWindow 
*parent
, 
  60                  const wxString
& title
, 
  61                  const wxPoint
& pos 
= wxDefaultPosition
, 
  62                  const wxSize
& size 
= wxDefaultSize
, 
  63                  long style 
= wxDEFAULT_FRAME_STYLE 
| wxVSCROLL 
| wxHSCROLL
, 
  64                  const wxString
& name 
= wxFrameNameStr 
); 
  66     wxMDIChildFrame 
*GetActiveChild() const; 
  68     wxMDIClientWindow 
*GetClientWindow() const; 
  69     virtual wxMDIClientWindow 
*OnCreateClient(); 
  71     virtual void Cascade() {} 
  72     virtual void Tile(wxOrientation 
WXUNUSED(orient
) = wxHORIZONTAL
) {} 
  73     virtual void ArrangeIcons() {} 
  74     virtual void ActivateNext(); 
  75     virtual void ActivatePrevious(); 
  79     wxMDIClientWindow  
*m_clientWindow
; 
  82     virtual void GtkOnSize( int x
, int y
, int width
, int height 
); 
  83     virtual void OnInternalIdle(); 
  88     virtual void DoGetClientSize(int *width
, int *height
) const; 
  91     friend class wxMDIChildFrame
; 
  93     DECLARE_DYNAMIC_CLASS(wxMDIParentFrame
) 
  96 //----------------------------------------------------------------------------- 
  98 //----------------------------------------------------------------------------- 
 100 class WXDLLIMPEXP_CORE wxMDIChildFrame
: public wxFrame
 
 104     wxMDIChildFrame( wxMDIParentFrame 
*parent
, 
 106                      const wxString
& title
, 
 107                      const wxPoint
& pos 
= wxDefaultPosition
, 
 108                      const wxSize
& size 
= wxDefaultSize
, 
 109                      long style 
= wxDEFAULT_FRAME_STYLE
, 
 110                      const wxString
& name 
= wxFrameNameStr 
); 
 112     virtual ~wxMDIChildFrame(); 
 113     bool Create( wxMDIParentFrame 
*parent
, 
 115                  const wxString
& title
, 
 116                  const wxPoint
& pos 
= wxDefaultPosition
, 
 117                  const wxSize
& size 
= wxDefaultSize
, 
 118                  long style 
= wxDEFAULT_FRAME_STYLE
, 
 119                  const wxString
& name 
= wxFrameNameStr 
); 
 121     virtual void SetMenuBar( wxMenuBar 
*menu_bar 
); 
 122     virtual wxMenuBar 
*GetMenuBar() const; 
 124     virtual void AddChild( wxWindowBase 
*child 
); 
 126     virtual void Activate(); 
 130     virtual wxStatusBar
* CreateStatusBar( int WXUNUSED(number
) = 1, 
 131                                         long WXUNUSED(style
) = 1, 
 132                                         wxWindowID 
WXUNUSED(id
) = 1, 
 133                                         const wxString
& WXUNUSED(name
) = wxEmptyString
) 
 134       { return (wxStatusBar
*)NULL
; } 
 136     virtual wxStatusBar 
*GetStatusBar() const { return (wxStatusBar
*)NULL
; } 
 137     virtual void SetStatusText( const wxString 
&WXUNUSED(text
), int WXUNUSED(number
)=0 ) {} 
 138     virtual void SetStatusWidths( int WXUNUSED(n
), const int WXUNUSED(widths_field
)[] ) {} 
 142     virtual void DoSetSizeHints( int WXUNUSED(minW
), 
 144                                  int WXUNUSED(maxW
) = wxDefaultCoord
, 
 145                                  int WXUNUSED(maxH
) = wxDefaultCoord
, 
 146                                  int WXUNUSED(incW
) = wxDefaultCoord
, 
 147                                  int WXUNUSED(incH
) = wxDefaultCoord
) {} 
 151     virtual wxToolBar
* CreateToolBar( long WXUNUSED(style
), 
 152                                        wxWindowID 
WXUNUSED(id
), 
 153                                        const wxString
& WXUNUSED(name
) ) 
 154         { return (wxToolBar
*)NULL
; } 
 155     virtual wxToolBar 
*GetToolBar() const { return (wxToolBar
*)NULL
; } 
 156 #endif // wxUSE_TOOLBAR 
 159     virtual void SetIcon(const wxIcon
& icon
) 
 160         { wxTopLevelWindowBase::SetIcon(icon
); } 
 161     virtual void SetIcons(const wxIconBundle
& icons 
) 
 162         { wxTopLevelWindowBase::SetIcons(icons
); } 
 165     virtual void SetTitle( const wxString 
&title 
); 
 168     virtual void Maximize( bool WXUNUSED(maximize
) = true ) { } 
 169     virtual bool IsMaximized() const { return true; } 
 170     virtual void Iconize(bool WXUNUSED(iconize
) = true) { } 
 171     virtual bool IsIconized() const { return false; } 
 172     virtual void Restore() {} 
 174     virtual bool IsTopLevel() const { return false; } 
 176     void OnActivate( wxActivateEvent
& event 
); 
 177     void OnMenuHighlight( wxMenuEvent
& event 
); 
 181     wxMenuBar         
*m_menuBar
; 
 182     GtkNotebookPage   
*m_page
; 
 186     // override wxFrame methods to not do anything 
 187     virtual void DoSetSize(int x
, int y
, 
 188                            int width
, int height
, 
 189                            int sizeFlags 
= wxSIZE_AUTO
); 
 190     virtual void DoSetClientSize(int width
, int height
); 
 191     virtual void DoGetClientSize( int *width
, int *height 
) const; 
 194     DECLARE_EVENT_TABLE() 
 195     DECLARE_DYNAMIC_CLASS(wxMDIChildFrame
) 
 198 //----------------------------------------------------------------------------- 
 200 //----------------------------------------------------------------------------- 
 202 class WXDLLIMPEXP_CORE wxMDIClientWindow
: public wxWindow
 
 206     wxMDIClientWindow( wxMDIParentFrame 
*parent
, long style 
= 0 ); 
 207     virtual ~wxMDIClientWindow(); 
 208     virtual bool CreateClient( wxMDIParentFrame 
*parent
, long style 
= wxVSCROLL 
| wxHSCROLL 
); 
 211     DECLARE_DYNAMIC_CLASS(wxMDIClientWindow
)