]>
Commit | Line | Data |
---|---|---|
076d1afa DW |
1 | /////////////////////////////////////////////////////////////////////////////// |
2 | // Name: wx/msw/toplevel.h | |
3 | // Purpose: wxTopLevelWindowMSW is the MSW implementation of wxTLW | |
4 | // Author: Vadim Zeitlin | |
5 | // Modified by: | |
6 | // Created: 20.09.01 | |
7 | // RCS-ID: $Id$ | |
8 | // Copyright: (c) 2001 SciTech Software, Inc. (www.scitechsoft.com) | |
65571936 | 9 | // Licence: wxWindows licence |
076d1afa DW |
10 | /////////////////////////////////////////////////////////////////////////////// |
11 | ||
12 | #ifndef _WX_MSW_TOPLEVEL_H_ | |
13 | #define _WX_MSW_TOPLEVEL_H_ | |
14 | ||
10769d8c | 15 | enum ETemplateID { kResizeableDialog = 130 |
076d1afa DW |
16 | ,kCaptionDialog |
17 | ,kNoCaptionDialog | |
18 | }; | |
19 | ||
20 | // ---------------------------------------------------------------------------- | |
21 | // wxTopLevelWindowOS2 | |
22 | // ---------------------------------------------------------------------------- | |
23 | ||
24 | class WXDLLEXPORT wxTopLevelWindowOS2 : public wxTopLevelWindowBase | |
25 | { | |
26 | public: | |
27 | // constructors and such | |
28 | wxTopLevelWindowOS2() { Init(); } | |
29 | ||
30 | wxTopLevelWindowOS2( wxWindow* pParent | |
31 | ,wxWindowID vId | |
32 | ,const wxString& rsTitle | |
33 | ,const wxPoint& rPos = wxDefaultPosition | |
34 | ,const wxSize& rSize = wxDefaultSize | |
35 | ,long lStyle = wxDEFAULT_FRAME_STYLE | |
36 | ,const wxString& rsName = wxFrameNameStr | |
37 | ) | |
38 | { | |
39 | Init(); | |
40 | ||
41 | (void)Create(pParent, vId, rsTitle, rPos, rSize, lStyle, rsName); | |
42 | } | |
43 | ||
44 | bool Create( wxWindow* pParent | |
45 | ,wxWindowID vId | |
46 | ,const wxString& rsTitle | |
47 | ,const wxPoint& rPos = wxDefaultPosition | |
48 | ,const wxSize& rSize = wxDefaultSize | |
49 | ,long lStyle = wxDEFAULT_FRAME_STYLE | |
50 | ,const wxString& rsName = wxFrameNameStr | |
51 | ); | |
52 | ||
53 | virtual ~wxTopLevelWindowOS2(); | |
54 | ||
55 | // | |
56 | // Implement base class pure virtuals | |
57 | // | |
58 | virtual void Iconize(bool bIconize = TRUE); | |
59 | inline virtual bool IsFullScreen(void) const { return m_bFsIsShowing; } | |
60 | virtual bool IsIconized(void) const; | |
61 | virtual bool IsMaximized(void) const; | |
62 | virtual void Maximize(bool bMaximize = TRUE); | |
63 | virtual void Restore(void); | |
b82186f0 | 64 | virtual void SendSizeEvent(void); |
076d1afa | 65 | virtual void SetIcon(const wxIcon& rIcon); |
3437f881 | 66 | virtual void SetIcons(const wxIconBundle& rIcons); |
f618020a | 67 | |
076d1afa DW |
68 | virtual bool Show(bool bShow = TRUE); |
69 | virtual bool ShowFullScreen( bool bShow | |
70 | ,long lStyle = wxFULLSCREEN_ALL | |
71 | ); | |
72 | ||
73 | // | |
74 | // EnableCloseButton(FALSE) may be used to remove the "Close" | |
75 | // button from the title bar | |
76 | // | |
77 | bool EnableCloseButton(bool bEnable = TRUE); | |
78 | HWND GetFrame(void) const { return m_hFrame; } | |
79 | ||
80 | // | |
81 | // Implementation from now on | |
82 | // -------------------------- | |
83 | // | |
45e0dc94 | 84 | PSWP GetSwpClient(void) { return &m_vSwpClient; } |
47df2b8c DW |
85 | |
86 | void OnActivate(wxActivateEvent& rEvent); | |
87 | ||
88 | void SetLastFocus(wxWindow *pWin) { m_pWinLastFocused = pWin; } | |
89 | wxWindow* GetLastFocus(void) const { return m_pWinLastFocused; } | |
076d1afa DW |
90 | protected: |
91 | // | |
92 | // Common part of all ctors | |
93 | // | |
94 | void Init(void); | |
95 | ||
96 | // | |
97 | // Create a new frame, return FALSE if it couldn't be created | |
98 | // | |
99 | bool CreateFrame( const wxString& rsTitle | |
100 | ,const wxPoint& rPos | |
101 | ,const wxSize& rSize | |
102 | ); | |
103 | ||
104 | // | |
105 | // Create a new dialog using the given dialog template from resources, | |
106 | // return FALSE if it couldn't be created | |
107 | // | |
108 | bool CreateDialog( ULONG ulDlgTemplate | |
109 | ,const wxString& rsTitle | |
110 | ,const wxPoint& rPos | |
111 | ,const wxSize& rSize | |
112 | ); | |
113 | ||
114 | // | |
115 | // Common part of Iconize(), Maximize() and Restore() | |
116 | // | |
117 | void DoShowWindow(int nShowCmd); | |
118 | ||
119 | // | |
120 | // Implement the geometry-related methods for a top level window | |
121 | // | |
122 | virtual void DoSetClientSize( int nWidth | |
123 | ,int nHeight | |
124 | ); | |
125 | virtual void DoGetClientSize( int* pnWidth | |
126 | ,int* pnHeight | |
127 | ) const; | |
128 | ||
129 | // | |
77ffb593 | 130 | // Translate wxWidgets flags into OS flags |
076d1afa | 131 | // |
b9b1d6c8 DW |
132 | virtual WXDWORD OS2GetStyle( long lFlag |
133 | ,WXDWORD* pdwExstyle | |
134 | ) const; | |
6ed98c6a DW |
135 | |
136 | // | |
137 | // Choose the right parent to use with CreateWindow() | |
138 | // | |
139 | virtual WXHWND OS2GetParent(void) const; | |
140 | ||
076d1afa DW |
141 | // |
142 | // Is the frame currently iconized? | |
143 | // | |
144 | bool m_bIconized; | |
145 | ||
146 | // | |
147 | // Should the frame be maximized when it will be shown? set by Maximize() | |
148 | // when it is called while the frame is hidden | |
149 | // | |
150 | bool m_bMaximizeOnShow; | |
151 | ||
152 | // | |
153 | // Data to save/restore when calling ShowFullScreen | |
154 | // | |
155 | long m_lFsStyle; // Passed to ShowFullScreen | |
156 | wxRect m_vFsOldSize; | |
157 | long m_lFsOldWindowStyle; | |
158 | bool m_bFsIsMaximized; | |
159 | bool m_bFsIsShowing; | |
160 | ||
47df2b8c DW |
161 | wxWindow* m_pWinLastFocused; |
162 | ||
076d1afa DW |
163 | WXHWND m_hFrame; |
164 | SWP m_vSwp; | |
165 | SWP m_vSwpClient; | |
45e0dc94 | 166 | static bool m_sbInitialized; |
6ed98c6a | 167 | static wxWindow* m_spHiddenParent; |
47df2b8c DW |
168 | |
169 | DECLARE_EVENT_TABLE() | |
076d1afa DW |
170 | }; // end of CLASS wxTopLevelWindowOS2 |
171 | ||
076d1afa DW |
172 | #endif // _WX_MSW_TOPLEVEL_H_ |
173 |