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