]> git.saurik.com Git - wxWidgets.git/blame - include/wx/gtk1/mdi.h
wxMessageBox off the main thread lost result code.
[wxWidgets.git] / include / wx / gtk1 / mdi.h
CommitLineData
c801d85f 1/////////////////////////////////////////////////////////////////////////////
8ef94bfc 2// Name: wx/gtk1/mdi.h
d2824cdb 3// Purpose: TDI-based MDI implementation for wxGTK1
c801d85f 4// Author: Robert Roebling
d2824cdb 5// Modified by: 2008-10-31 Vadim Zeitlin: derive from the base classes
58614078 6// Copyright: (c) 1998 Robert Roebling
d2824cdb 7// (c) 2008 Vadim Zeitlin
65571936 8// Licence: wxWindows licence
c801d85f
KB
9/////////////////////////////////////////////////////////////////////////////
10
d2824cdb
VZ
11#ifndef _WX_GTK1_MDI_H_
12#define _WX_GTK1_MDI_H_
c801d85f 13
c801d85f
KB
14#include "wx/frame.h"
15
b5dbe15d 16class WXDLLIMPEXP_FWD_CORE wxMDIChildFrame;
d2824cdb 17class WXDLLIMPEXP_FWD_CORE wxMDIClientWindow;
c801d85f 18
d2824cdb 19typedef struct _GtkNotebook GtkNotebook;
c801d85f
KB
20
21//-----------------------------------------------------------------------------
22// wxMDIParentFrame
23//-----------------------------------------------------------------------------
24
d2824cdb 25class WXDLLIMPEXP_CORE wxMDIParentFrame : public wxMDIParentFrameBase
c801d85f 26{
ab2b3dd4 27public:
f6bcfd97
BP
28 wxMDIParentFrame() { Init(); }
29 wxMDIParentFrame(wxWindow *parent,
30 wxWindowID id,
31 const wxString& title,
32 const wxPoint& pos = wxDefaultPosition,
33 const wxSize& size = wxDefaultSize,
34 long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL,
35 const wxString& name = wxFrameNameStr)
36 {
37 Init();
38
39 (void)Create(parent, id, title, pos, size, style, name);
40 }
41
d2824cdb
VZ
42 bool Create(wxWindow *parent,
43 wxWindowID id,
44 const wxString& title,
45 const wxPoint& pos = wxDefaultPosition,
46 const wxSize& size = wxDefaultSize,
47 long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL,
48 const wxString& name = wxFrameNameStr);
c801d85f 49
d2824cdb
VZ
50 // we don't store the active child in m_currentChild unlike the base class
51 // version so override this method to find it dynamically
52 virtual wxMDIChildFrame *GetActiveChild() const;
f6bcfd97 53
d2824cdb
VZ
54 // implement base class pure virtuals
55 // ----------------------------------
f6bcfd97 56
ab2b3dd4
RR
57 virtual void ActivateNext();
58 virtual void ActivatePrevious();
716b7364 59
d2824cdb
VZ
60 static bool IsTDI() { return true; }
61
f6bcfd97 62 // implementation
ab2b3dd4 63
ab2b3dd4
RR
64 bool m_justInserted;
65
716b7364 66 virtual void GtkOnSize( int x, int y, int width, int height );
ab2b3dd4 67 virtual void OnInternalIdle();
f6bcfd97 68
8487f887 69private:
d2824cdb 70 void Init();
f6bcfd97 71
8487f887 72 DECLARE_DYNAMIC_CLASS(wxMDIParentFrame)
c801d85f
KB
73};
74
75//-----------------------------------------------------------------------------
76// wxMDIChildFrame
77//-----------------------------------------------------------------------------
78
d2824cdb 79class WXDLLIMPEXP_CORE wxMDIChildFrame : public wxTDIChildFrame
c801d85f 80{
8487f887 81public:
d2824cdb
VZ
82 wxMDIChildFrame() { Init(); }
83 wxMDIChildFrame(wxMDIParentFrame *parent,
84 wxWindowID id,
85 const wxString& title,
86 const wxPoint& pos = wxDefaultPosition,
87 const wxSize& size = wxDefaultSize,
88 long style = wxDEFAULT_FRAME_STYLE,
89 const wxString& name = wxFrameNameStr)
90 {
91 Init();
92
93 Create(parent, id, title, pos, size, style, name);
94 }
95
96 bool Create(wxMDIParentFrame *parent,
97 wxWindowID id,
98 const wxString& title,
99 const wxPoint& pos = wxDefaultPosition,
100 const wxSize& size = wxDefaultSize,
101 long style = wxDEFAULT_FRAME_STYLE,
102 const wxString& name = wxFrameNameStr);
885df446
VZ
103
104 virtual ~wxMDIChildFrame();
f6bcfd97 105
8487f887
RR
106 virtual void SetMenuBar( wxMenuBar *menu_bar );
107 virtual wxMenuBar *GetMenuBar() const;
c801d85f 108
8487f887 109 virtual void Activate();
f6bcfd97 110
d2824cdb
VZ
111 virtual void SetTitle(const wxString& title);
112
113 // implementation
f6bcfd97
BP
114
115 void OnActivate( wxActivateEvent& event );
116 void OnMenuHighlight( wxMenuEvent& event );
117
716b7364 118 wxMenuBar *m_menuBar;
716b7364 119 GtkNotebookPage *m_page;
ab2b3dd4 120 bool m_justInserted;
f6bcfd97 121
8487f887 122private:
d2824cdb
VZ
123 void Init();
124
125 GtkNotebook *GTKGetNotebook() const;
126
f6bcfd97 127 DECLARE_EVENT_TABLE()
8487f887 128 DECLARE_DYNAMIC_CLASS(wxMDIChildFrame)
c801d85f
KB
129};
130
131//-----------------------------------------------------------------------------
132// wxMDIClientWindow
133//-----------------------------------------------------------------------------
134
d2824cdb 135class WXDLLIMPEXP_CORE wxMDIClientWindow : public wxMDIClientWindowBase
c801d85f 136{
ab2b3dd4 137public:
d2824cdb
VZ
138 wxMDIClientWindow() { }
139
140 virtual bool CreateClient(wxMDIParentFrame *parent,
141 long style = wxVSCROLL | wxHSCROLL);
8487f887
RR
142
143private:
144 DECLARE_DYNAMIC_CLASS(wxMDIClientWindow)
c801d85f
KB
145};
146
d2824cdb 147#endif // _WX_GTK1_MDI_H_