]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/gtk/mdi.h
1 /////////////////////////////////////////////////////////////////////////////
4 // Author: Robert Roebling
6 // Copyright: (c) 1998 Robert Roebling
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
19 #include "wx/object.h"
21 #include "wx/control.h"
24 #include "wx/toolbar.h"
26 //-----------------------------------------------------------------------------
28 //-----------------------------------------------------------------------------
30 class wxMDIParentFrame
;
31 class wxMDIClientWindow
;
32 class wxMDIChildFrame
;
34 //-----------------------------------------------------------------------------
36 //-----------------------------------------------------------------------------
38 extern const char* wxFrameNameStr
;
39 extern const char* wxStatusLineNameStr
;
41 //-----------------------------------------------------------------------------
43 //-----------------------------------------------------------------------------
45 class wxMDIParentFrame
: public wxFrame
47 DECLARE_DYNAMIC_CLASS(wxMDIParentFrame
)
49 friend class wxMDIChildFrame
;
53 wxMDIParentFrame(void);
54 wxMDIParentFrame( wxWindow
*parent
,
55 wxWindowID id
, const wxString
& title
,
56 const wxPoint
& pos
= wxDefaultPosition
, const wxSize
& size
= wxDefaultSize
,
57 long style
= wxDEFAULT_FRAME_STYLE
| wxVSCROLL
| wxHSCROLL
,
58 const wxString
& name
= wxFrameNameStr
);
59 ~wxMDIParentFrame(void);
60 bool Create( wxWindow
*parent
,
61 wxWindowID id
, const wxString
& title
,
62 const wxPoint
& pos
= wxDefaultPosition
, const wxSize
& size
= wxDefaultSize
,
63 long style
= wxDEFAULT_FRAME_STYLE
| wxVSCROLL
| wxHSCROLL
,
64 const wxString
& name
= wxFrameNameStr
);
67 void GetClientSize(int *width
, int *height
) const;
68 wxMDIChildFrame
*GetActiveChild(void) const;
70 wxMDIClientWindow
*GetClientWindow(void) const;
71 virtual wxMDIClientWindow
*OnCreateClient(void);
73 virtual void Cascade(void) {};
74 virtual void Tile(void) {};
75 virtual void ArrangeIcons(void) {};
76 virtual void ActivateNext(void);
77 virtual void ActivatePrevious(void);
79 void OnActivate( wxActivateEvent
& event
);
80 void OnSysColourChanged( wxSysColourChangedEvent
& event
);
84 wxMDIChildFrame
*m_currentChild
;
86 void SetMDIMenuBar( wxMenuBar
*menu_bar
);
87 virtual void GtkOnSize( int x
, int y
, int width
, int height
);
91 wxMDIClientWindow
*m_clientWindow
;
92 bool m_parentFrameActive
;
93 wxMenuBar
*m_mdiMenuBar
;
98 //-----------------------------------------------------------------------------
100 //-----------------------------------------------------------------------------
102 class wxMDIChildFrame
: public wxFrame
104 DECLARE_DYNAMIC_CLASS(wxMDIChildFrame
)
108 wxMDIChildFrame(void);
109 wxMDIChildFrame( wxMDIParentFrame
*parent
,
110 wxWindowID id
, const wxString
& title
,
111 const wxPoint
& pos
= wxDefaultPosition
, const wxSize
& size
= wxDefaultSize
,
112 long style
= wxDEFAULT_FRAME_STYLE
, const wxString
& name
= wxFrameNameStr
);
113 ~wxMDIChildFrame(void);
114 bool Create( wxMDIParentFrame
*parent
,
115 wxWindowID id
, const wxString
& title
,
116 const wxPoint
& pos
= wxDefaultPosition
, const wxSize
& size
= wxDefaultSize
,
117 long style
= wxDEFAULT_FRAME_STYLE
, const wxString
& name
= wxFrameNameStr
);
119 virtual void SetMenuBar( wxMenuBar
*menu_bar
);
120 virtual wxMenuBar
*GetMenuBar();
122 virtual void GetClientSize( int *width
, int *height
) const;
123 virtual void AddChild( wxWindow
*child
);
125 virtual void Activate(void);
128 virtual wxStatusBar
* CreateStatusBar( int WXUNUSED(number
)=1, long WXUNUSED(style
)=1,
129 wxWindowID
WXUNUSED(id
)=1, const wxString
& WXUNUSED(name
)=WXSTRINGCAST NULL
) {return (wxStatusBar
*)NULL
; }
130 virtual wxStatusBar
*GetStatusBar() { return (wxStatusBar
*)NULL
; }
131 virtual void SetStatusText( const wxString
&WXUNUSED(text
), int WXUNUSED(number
) ) {}
132 virtual void SetStatusWidths( int WXUNUSED(n
), int *WXUNUSED(width
) ) {}
135 virtual void SetSizeHints( int WXUNUSED(minW
), int WXUNUSED(minH
), int WXUNUSED(maxW
),
136 int WXUNUSED(maxH
), int WXUNUSED(incW
) ) {}
139 virtual wxToolBar
* CreateToolBar( long WXUNUSED(style
), wxWindowID
WXUNUSED(id
),
140 const wxString
& WXUNUSED(name
) ) { return (wxToolBar
*)NULL
; }
141 virtual wxToolBar
*GetToolBar() { return (wxToolBar
*)NULL
; }
144 void SetIcon( const wxIcon
&icon
) { m_icon
= icon
; }
147 void SetTitle( const wxString
&title
) { m_title
= title
; }
148 wxString
GetTitle() const { return m_title
; }
151 virtual void Maximize(void) {}
152 virtual void Restore(void) {}
154 void OnActivate( wxActivateEvent
&event
);
158 wxMenuBar
*m_menuBar
;
162 GtkNotebookPage
*m_page
;
164 DECLARE_EVENT_TABLE()
167 //-----------------------------------------------------------------------------
169 //-----------------------------------------------------------------------------
171 class wxMDIClientWindow
: public wxWindow
173 DECLARE_DYNAMIC_CLASS(wxMDIClientWindow
)
177 wxMDIClientWindow(void);
178 wxMDIClientWindow( wxMDIParentFrame
*parent
, long style
= 0 );
179 ~wxMDIClientWindow(void);
180 virtual bool CreateClient( wxMDIParentFrame
*parent
, long style
= wxVSCROLL
| wxHSCROLL
);
181 void AddChild( wxWindow
*child
);