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