]> git.saurik.com Git - wxWidgets.git/blame - include/wx/os2/toplevel.h
made AdjustForParentClientOrigin const
[wxWidgets.git] / include / wx / os2 / toplevel.h
CommitLineData
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)
9// Licence: wxWindows licence
10///////////////////////////////////////////////////////////////////////////////
11
12#ifndef _WX_MSW_TOPLEVEL_H_
13#define _WX_MSW_TOPLEVEL_H_
14
15#ifdef __GNUG__
16 #pragma interface "toplevel.h"
17#endif
18
b82186f0 19enum ETemplateID { kResizeableDialog = 127
076d1afa
DW
20 ,kCaptionDialog
21 ,kNoCaptionDialog
22 };
23
24// ----------------------------------------------------------------------------
25// wxTopLevelWindowOS2
26// ----------------------------------------------------------------------------
27
28class WXDLLEXPORT wxTopLevelWindowOS2 : public wxTopLevelWindowBase
29{
30public:
31 // constructors and such
32 wxTopLevelWindowOS2() { Init(); }
33
34 wxTopLevelWindowOS2( wxWindow* pParent
35 ,wxWindowID vId
36 ,const wxString& rsTitle
37 ,const wxPoint& rPos = wxDefaultPosition
38 ,const wxSize& rSize = wxDefaultSize
39 ,long lStyle = wxDEFAULT_FRAME_STYLE
40 ,const wxString& rsName = wxFrameNameStr
41 )
42 {
43 Init();
44
45 (void)Create(pParent, vId, rsTitle, rPos, rSize, lStyle, rsName);
46 }
47
48 bool Create( wxWindow* pParent
49 ,wxWindowID vId
50 ,const wxString& rsTitle
51 ,const wxPoint& rPos = wxDefaultPosition
52 ,const wxSize& rSize = wxDefaultSize
53 ,long lStyle = wxDEFAULT_FRAME_STYLE
54 ,const wxString& rsName = wxFrameNameStr
55 );
56
57 virtual ~wxTopLevelWindowOS2();
58
59 //
60 // Implement base class pure virtuals
61 //
62 virtual void Iconize(bool bIconize = TRUE);
63 inline 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);
b82186f0 68 virtual void SendSizeEvent(void);
076d1afa
DW
69 virtual void SetIcon(const wxIcon& rIcon);
70 virtual bool Show(bool bShow = TRUE);
71 virtual bool ShowFullScreen( bool bShow
72 ,long lStyle = wxFULLSCREEN_ALL
73 );
74
75 //
76 // EnableCloseButton(FALSE) may be used to remove the "Close"
77 // button from the title bar
78 //
79 bool EnableCloseButton(bool bEnable = TRUE);
80 HWND GetFrame(void) const { return m_hFrame; }
81
82 //
83 // Implementation from now on
84 // --------------------------
85 //
45e0dc94 86 PSWP GetSwpClient(void) { return &m_vSwpClient; }
076d1afa
DW
87protected:
88 //
89 // Common part of all ctors
90 //
91 void Init(void);
92
93 //
94 // Create a new frame, return FALSE if it couldn't be created
95 //
96 bool CreateFrame( const wxString& rsTitle
97 ,const wxPoint& rPos
98 ,const wxSize& rSize
99 );
100
101 //
102 // Create a new dialog using the given dialog template from resources,
103 // return FALSE if it couldn't be created
104 //
105 bool CreateDialog( ULONG ulDlgTemplate
106 ,const wxString& rsTitle
107 ,const wxPoint& rPos
108 ,const wxSize& rSize
109 );
110
111 //
112 // Common part of Iconize(), Maximize() and Restore()
113 //
114 void DoShowWindow(int nShowCmd);
115
116 //
117 // Implement the geometry-related methods for a top level window
118 //
119 virtual void DoSetClientSize( int nWidth
120 ,int nHeight
121 );
122 virtual void DoGetClientSize( int* pnWidth
123 ,int* pnHeight
124 ) const;
125
126 //
b9b1d6c8 127 // Translate wxWindows flags into OS flags
076d1afa 128 //
b9b1d6c8
DW
129 virtual WXDWORD OS2GetStyle( long lFlag
130 ,WXDWORD* pdwExstyle
131 ) const;
076d1afa
DW
132 //
133 // Is the frame currently iconized?
134 //
135 bool m_bIconized;
136
137 //
138 // Should the frame be maximized when it will be shown? set by Maximize()
139 // when it is called while the frame is hidden
140 //
141 bool m_bMaximizeOnShow;
142
143 //
144 // Data to save/restore when calling ShowFullScreen
145 //
146 long m_lFsStyle; // Passed to ShowFullScreen
147 wxRect m_vFsOldSize;
148 long m_lFsOldWindowStyle;
149 bool m_bFsIsMaximized;
150 bool m_bFsIsShowing;
151
152 WXHWND m_hFrame;
153 SWP m_vSwp;
154 SWP m_vSwpClient;
45e0dc94 155 static bool m_sbInitialized;
076d1afa
DW
156}; // end of CLASS wxTopLevelWindowOS2
157
158//
159// List of all frames and modeless dialogs
160//
161extern WXDLLEXPORT_DATA(wxWindowList) wxModelessWindows;
162
163#endif // _WX_MSW_TOPLEVEL_H_
164