]>
Commit | Line | Data |
---|---|---|
0e320a79 | 1 | ///////////////////////////////////////////////////////////////////////////// |
743e24aa | 2 | // Name: wx/os2/window.h |
0e320a79 | 3 | // Purpose: wxWindow class |
54da4255 | 4 | // Author: David Webster |
0e320a79 | 5 | // Modified by: |
cdf1e714 | 6 | // Created: 10/12/99 |
0e320a79 | 7 | // RCS-ID: $Id$ |
cdf1e714 | 8 | // Copyright: (c) David Webster |
65571936 | 9 | // Licence: wxWindows licence |
0e320a79 DW |
10 | ///////////////////////////////////////////////////////////////////////////// |
11 | ||
12 | #ifndef _WX_WINDOW_H_ | |
13 | #define _WX_WINDOW_H_ | |
14 | ||
cdf1e714 | 15 | #define wxUSE_MOUSEEVENT_HACK 0 |
0e320a79 | 16 | |
cdf1e714 DW |
17 | // --------------------------------------------------------------------------- |
18 | // headers | |
19 | // --------------------------------------------------------------------------- | |
63415778 DW |
20 | #define INCL_DOS |
21 | #define INCL_PM | |
22 | #define INCL_GPI | |
23 | #include <os2.h> | |
24 | ||
0e320a79 | 25 | |
3011bf2b DW |
26 | // --------------------------------------------------------------------------- |
27 | // forward declarations | |
28 | // --------------------------------------------------------------------------- | |
29 | #ifndef CW_USEDEFAULT | |
30 | # define CW_USEDEFAULT ((int)0x80000000) | |
31 | #endif | |
32 | ||
0e320a79 DW |
33 | // --------------------------------------------------------------------------- |
34 | // forward declarations | |
35 | // --------------------------------------------------------------------------- | |
36 | ||
37 | class WXDLLEXPORT wxButton; | |
38 | ||
cdf1e714 DW |
39 | // --------------------------------------------------------------------------- |
40 | // wxWindow declaration for OS/2 PM | |
41 | // --------------------------------------------------------------------------- | |
54da4255 | 42 | |
210a651b | 43 | class WXDLLEXPORT wxWindowOS2 : public wxWindowBase |
0e320a79 | 44 | { |
0e320a79 | 45 | public: |
210a651b | 46 | wxWindowOS2() |
3e282d33 DW |
47 | { |
48 | Init(); | |
49 | } | |
cdf1e714 | 50 | |
210a651b DW |
51 | wxWindowOS2( wxWindow* pParent |
52 | ,wxWindowID vId | |
53 | ,const wxPoint& rPos = wxDefaultPosition | |
54 | ,const wxSize& rSize = wxDefaultSize | |
55 | ,long lStyle = 0 | |
56 | ,const wxString& rName = wxPanelNameStr | |
57 | ) | |
0e320a79 DW |
58 | { |
59 | Init(); | |
776d87d5 DW |
60 | Create( pParent |
61 | ,vId | |
62 | ,rPos | |
63 | ,rSize | |
64 | ,lStyle | |
65 | ,rName | |
66 | ); | |
0e320a79 DW |
67 | } |
68 | ||
210a651b | 69 | virtual ~wxWindowOS2(); |
0e320a79 | 70 | |
776d87d5 DW |
71 | bool Create( wxWindow* pParent |
72 | ,wxWindowID vId | |
73 | ,const wxPoint& rPos = wxDefaultPosition | |
74 | ,const wxSize& rSize = wxDefaultSize | |
75 | ,long lStyle = 0 | |
76 | ,const wxString& rName = wxPanelNameStr | |
77 | ); | |
0e320a79 | 78 | |
cdf1e714 | 79 | // implement base class pure virtuals |
743e24aa WS |
80 | virtual void SetLabel(const wxString& label); |
81 | virtual wxString GetLabel(void) const; | |
776d87d5 DW |
82 | virtual void Raise(void); |
83 | virtual void Lower(void); | |
e951b8e4 WS |
84 | virtual bool Show(bool bShow = true); |
85 | virtual bool Enable(bool bEnable = true); | |
776d87d5 | 86 | virtual void SetFocus(void); |
1cee3f60 | 87 | virtual void SetFocusFromKbd(void); |
776d87d5 DW |
88 | virtual bool Reparent(wxWindow* pNewParent); |
89 | virtual void WarpPointer( int x | |
90 | ,int y | |
91 | ); | |
e951b8e4 | 92 | virtual void Refresh( bool bEraseBackground = true |
776d87d5 DW |
93 | ,const wxRect* pRect = (const wxRect *)NULL |
94 | ); | |
06519806 DW |
95 | virtual void Freeze(void); |
96 | virtual void Update(void); | |
97 | virtual void Thaw(void); | |
b9b1d6c8 | 98 | virtual void SetWindowStyleFlag(long lStyle); |
776d87d5 DW |
99 | virtual bool SetCursor(const wxCursor& rCursor); |
100 | virtual bool SetFont(const wxFont& rFont); | |
101 | virtual int GetCharHeight(void) const; | |
102 | virtual int GetCharWidth(void) const; | |
103 | virtual void GetTextExtent( const wxString& rString | |
104 | ,int* pX | |
105 | ,int* pY | |
106 | ,int* pDescent = (int *)NULL | |
107 | ,int* pExternalLeading = (int *)NULL | |
108 | ,const wxFont* pTheFont = (const wxFont *)NULL | |
109 | ) const; | |
19193a2c | 110 | #if wxUSE_MENUS_NATIVE |
776d87d5 DW |
111 | virtual bool DoPopupMenu( wxMenu* pMenu |
112 | ,int nX | |
113 | ,int nY | |
114 | ); | |
19193a2c | 115 | #endif // wxUSE_MENUS_NATIVE |
776d87d5 DW |
116 | |
117 | virtual void SetScrollbar( int nOrient | |
118 | ,int nPos | |
119 | ,int nThumbVisible | |
120 | ,int nRange | |
e951b8e4 | 121 | ,bool bRefresh = true |
776d87d5 DW |
122 | ); |
123 | virtual void SetScrollPos( int nOrient | |
124 | ,int nPos | |
e951b8e4 | 125 | ,bool bRefresh = true |
776d87d5 DW |
126 | ); |
127 | virtual int GetScrollPos(int nOrient) const; | |
128 | virtual int GetScrollThumb(int nOrient) const; | |
129 | virtual int GetScrollRange(int nOrient) const; | |
130 | virtual void ScrollWindow( int nDx | |
131 | ,int nDy | |
132 | ,const wxRect* pRect = (wxRect *)NULL | |
133 | ); | |
0e320a79 | 134 | |
45e0dc94 DW |
135 | inline HWND GetScrollBarHorz(void) const {return m_hWndScrollBarHorz;} |
136 | inline HWND GetScrollBarVert(void) const {return m_hWndScrollBarVert;}; | |
cdf1e714 | 137 | #if wxUSE_DRAG_AND_DROP |
776d87d5 | 138 | virtual void SetDropTarget(wxDropTarget* pDropTarget); |
cdf1e714 | 139 | #endif // wxUSE_DRAG_AND_DROP |
0e320a79 DW |
140 | |
141 | // Accept files for dragging | |
776d87d5 | 142 | virtual void DragAcceptFiles(bool bAccept); |
0e320a79 | 143 | |
19193a2c | 144 | #ifndef __WXUNIVERSAL__ |
776d87d5 | 145 | // Native resource loading (implemented in src/os2/nativdlg.cpp) |
cdf1e714 | 146 | // FIXME: should they really be all virtual? |
776d87d5 DW |
147 | virtual bool LoadNativeDialog( wxWindow* pParent |
148 | ,wxWindowID& vId | |
149 | ); | |
150 | virtual bool LoadNativeDialog( wxWindow* pParent | |
151 | ,const wxString& rName | |
152 | ); | |
153 | wxWindow* GetWindowChild1(wxWindowID vId); | |
154 | wxWindow* GetWindowChild(wxWindowID vId); | |
19193a2c | 155 | #endif //__WXUNIVERSAL__ |
cdf1e714 DW |
156 | |
157 | // implementation from now on | |
158 | // -------------------------- | |
159 | ||
160 | // simple accessors | |
161 | // ---------------- | |
86de7616 | 162 | |
776d87d5 DW |
163 | WXHWND GetHWND(void) const { return m_hWnd; } |
164 | void SetHWND(WXHWND hWnd) { m_hWnd = hWnd; } | |
165 | virtual WXWidget GetHandle(void) const { return GetHWND(); } | |
166 | bool GetUseCtl3D(void) const { return m_bUseCtl3D; } | |
167 | bool GetTransparentBackground(void) const { return m_bBackgroundTransparent; } | |
09fe7dc6 | 168 | void SetTransparentBackground(bool bT = true) { m_bBackgroundTransparent = bT; } |
54da4255 | 169 | |
cdf1e714 DW |
170 | // event handlers |
171 | // -------------- | |
a885d89a | 172 | void OnSetFocus(wxFocusEvent& rEvent); |
776d87d5 DW |
173 | void OnEraseBackground(wxEraseEvent& rEvent); |
174 | void OnIdle(wxIdleEvent& rEvent); | |
cdf1e714 DW |
175 | |
176 | public: | |
f289196b | 177 | |
86de7616 DW |
178 | // Windows subclassing |
179 | void SubclassWin(WXHWND hWnd); | |
776d87d5 | 180 | void UnsubclassWin(void); |
86de7616 | 181 | |
776d87d5 DW |
182 | WXFARPROC OS2GetOldWndProc(void) const { return m_fnOldWndProc; } |
183 | void OS2SetOldWndProc(WXFARPROC fnProc) { m_fnOldWndProc = fnProc; } | |
47df2b8c | 184 | // |
e951b8e4 | 185 | // Return true if the window is of a standard (i.e. not wxWidgets') class |
47df2b8c DW |
186 | // |
187 | bool IsOfStandardClass(void) const { return m_fnOldWndProc != NULL; } | |
86de7616 | 188 | |
776d87d5 DW |
189 | wxWindow* FindItem(long lId) const; |
190 | wxWindow* FindItemByHWND( WXHWND hWnd | |
e951b8e4 | 191 | ,bool bControlOnly = false |
776d87d5 | 192 | ) const; |
86de7616 | 193 | |
77ffb593 | 194 | // Make a Windows extended style from the given wxWidgets window style ?? applicable to OS/2?? |
776d87d5 | 195 | static WXDWORD MakeExtendedStyle( long lStyle |
e951b8e4 | 196 | ,bool bEliminateBorders = true |
776d87d5 | 197 | ); |
86de7616 | 198 | |
e951b8e4 WS |
199 | // PM only: true if this control is part of the main control |
200 | virtual bool ContainsHWND(WXHWND WXUNUSED(hWnd)) const { return false; }; | |
86de7616 | 201 | |
77ffb593 | 202 | // translate wxWidgets style flags for this control into the PM style |
b9b1d6c8 DW |
203 | // and optional extended style for the corresponding native control |
204 | // | |
205 | // this is the function that should be overridden in the derived classes, | |
206 | // but you will mostly use OS2GetCreateWindowFlags() below | |
207 | virtual WXDWORD OS2GetStyle( long lFlags | |
208 | ,WXDWORD* pdwExstyle = NULL | |
209 | ) const; | |
210 | ||
77ffb593 | 211 | // get the MSW window flags corresponding to wxWidgets ones |
b9b1d6c8 DW |
212 | // |
213 | // the functions returns the flags (WS_XXX) directly and puts the ext | |
214 | // (WS_EX_XXX) flags into the provided pointer if not NULL | |
215 | WXDWORD OS2GetCreateWindowFlags(WXDWORD* pdwExflags = NULL) const | |
216 | { return OS2GetStyle(GetWindowStyle(), pdwExflags); } | |
217 | ||
218 | ||
6ed98c6a DW |
219 | // get the HWND to be used as parent of this window with CreateWindow() |
220 | virtual WXHWND OS2GetParent(void) const; | |
221 | ||
e951b8e4 | 222 | // returns true if the window has been created |
3011bf2b | 223 | bool OS2Create( PSZ zClass |
edf1dfa1 | 224 | ,const wxChar* zTitle |
3011bf2b DW |
225 | ,WXDWORD dwStyle |
226 | ,const wxPoint& rPos | |
227 | ,const wxSize& rSize | |
228 | ,void* pCtlData | |
229 | ,WXDWORD dwExStyle | |
230 | ,bool bIsChild | |
231 | ); | |
776d87d5 DW |
232 | virtual bool OS2Command( WXUINT uParam |
233 | ,WXWORD nId | |
234 | ); | |
cdf1e714 | 235 | |
19193a2c | 236 | #ifndef __WXUNIVERSAL__ |
cdf1e714 | 237 | // Create an appropriate wxWindow from a HWND |
776d87d5 DW |
238 | virtual wxWindow* CreateWindowFromHWND( wxWindow* pParent |
239 | ,WXHWND hWnd | |
240 | ); | |
cdf1e714 DW |
241 | |
242 | // Make sure the window style reflects the HWND style (roughly) | |
776d87d5 | 243 | virtual void AdoptAttributesFromHWND(void); |
19193a2c | 244 | #endif |
cdf1e714 DW |
245 | |
246 | // Setup background and foreground colours correctly | |
776d87d5 | 247 | virtual void SetupColours(void); |
cdf1e714 DW |
248 | |
249 | // ------------------------------------------------------------------------ | |
250 | // helpers for message handlers: these perform the same function as the | |
251 | // message crackers from <windowsx.h> - they unpack WPARAM and LPARAM into | |
252 | // the correct parameters | |
253 | // ------------------------------------------------------------------------ | |
254 | ||
776d87d5 DW |
255 | void UnpackCommand( WXWPARAM wParam |
256 | ,WXLPARAM lParam, | |
257 | WXWORD* pId | |
258 | ,WXHWND* pHwnd | |
259 | ,WXWORD* pCmd | |
260 | ); | |
261 | void UnpackActivate( WXWPARAM wParam | |
262 | ,WXLPARAM lParam | |
263 | ,WXWORD* pState | |
776d87d5 DW |
264 | ,WXHWND* pHwnd |
265 | ); | |
266 | void UnpackScroll( WXWPARAM wParam | |
267 | ,WXLPARAM lParam | |
268 | ,WXWORD* pCode | |
269 | ,WXWORD* pPos | |
270 | ,WXHWND* pHwnd | |
271 | ); | |
776d87d5 DW |
272 | void UnpackMenuSelect( WXWPARAM wParam |
273 | ,WXLPARAM lParam | |
274 | ,WXWORD* pTtem | |
275 | ,WXWORD* pFlags | |
276 | ,WXHMENU* pHmenu | |
277 | ); | |
cdf1e714 DW |
278 | |
279 | // ------------------------------------------------------------------------ | |
776d87d5 | 280 | // internal handlers for OS2 messages: all handlers return a boolen value: |
e951b8e4 | 281 | // true means that the handler processed the event and false that it didn't |
cdf1e714 DW |
282 | // ------------------------------------------------------------------------ |
283 | ||
776d87d5 | 284 | // there are several cases where we have virtual functions for PM |
cdf1e714 DW |
285 | // message processing: this is because these messages often require to be |
286 | // processed in a different manner in the derived classes. For all other | |
776d87d5 | 287 | // messages, however, we do *not* have corresponding OS2OnXXX() function |
cdf1e714 | 288 | // and if the derived class wants to process them, it should override |
776d87d5 | 289 | // OS2WindowProc() directly. |
cdf1e714 DW |
290 | |
291 | // scroll event (both horizontal and vertical) | |
776d87d5 DW |
292 | virtual bool OS2OnScroll( int nOrientation |
293 | ,WXWORD nSBCode | |
294 | ,WXWORD pos | |
295 | ,WXHWND control | |
296 | ); | |
cdf1e714 | 297 | |
cdf1e714 | 298 | // owner-drawn controls need to process these messages |
776d87d5 DW |
299 | virtual bool OS2OnDrawItem( int nId |
300 | ,WXDRAWITEMSTRUCT* pItem | |
301 | ); | |
f5ea767e | 302 | virtual long OS2OnMeasureItem( int nId |
776d87d5 DW |
303 | ,WXMEASUREITEMSTRUCT* pItem |
304 | ); | |
cdf1e714 | 305 | |
9794cae1 DW |
306 | virtual void OnPaint(wxPaintEvent& rEvent); |
307 | ||
cdf1e714 | 308 | // the rest are not virtual |
776d87d5 DW |
309 | bool HandleCreate( WXLPCREATESTRUCT vCs |
310 | ,bool* pMayCreate | |
311 | ); | |
cdf1e714 | 312 | bool HandleInitDialog(WXHWND hWndFocus); |
776d87d5 DW |
313 | bool HandleDestroy(void); |
314 | bool HandlePaint(void); | |
315 | bool HandleEraseBkgnd(WXHDC vDC); | |
316 | bool HandleMinimize(void); | |
317 | bool HandleMaximize(void); | |
318 | bool HandleSize( int nX | |
319 | ,int nY | |
320 | ,WXUINT uFlag | |
321 | ); | |
61243a51 | 322 | bool HandleGetMinMaxInfo(PSWP pMmInfo); |
776d87d5 DW |
323 | bool HandleShow( bool bShow |
324 | ,int nStatus | |
325 | ); | |
326 | bool HandleActivate( int nFlag | |
776d87d5 DW |
327 | ,WXHWND hActivate |
328 | ); | |
329 | bool HandleCommand( WXWORD nId | |
330 | ,WXWORD nCmd | |
331 | ,WXHWND hControl | |
332 | ); | |
333 | bool HandleSysCommand( WXWPARAM wParam | |
334 | ,WXLPARAM lParam | |
335 | ); | |
1d0edc0f DW |
336 | bool HandlePaletteChanged(void); |
337 | bool HandleQueryNewPalette(void); | |
776d87d5 | 338 | bool HandleSysColorChange(void); |
1d0edc0f DW |
339 | bool HandleDisplayChange(void); |
340 | bool HandleCaptureChanged(WXHWND hBainedCapture); | |
341 | ||
61243a51 | 342 | bool HandleCtlColor(WXHBRUSH* hBrush); |
776d87d5 DW |
343 | bool HandleSetFocus(WXHWND hWnd); |
344 | bool HandleKillFocus(WXHWND hWnd); | |
61243a51 | 345 | bool HandleEndDrag(WXWPARAM wParam); |
776d87d5 DW |
346 | bool HandleMouseEvent( WXUINT uMsg |
347 | ,int nX | |
348 | ,int nY | |
349 | ,WXUINT uFlags | |
350 | ); | |
351 | bool HandleMouseMove( int nX | |
352 | ,int nY | |
353 | ,WXUINT uFlags | |
354 | ); | |
598d8cac | 355 | bool HandleChar( WXWPARAM wParam |
776d87d5 | 356 | ,WXLPARAM lParam |
e951b8e4 | 357 | ,bool bIsASCII = false |
776d87d5 | 358 | ); |
a086de98 | 359 | bool HandleKeyDown( WXWPARAM wParam |
776d87d5 DW |
360 | ,WXLPARAM lParam |
361 | ); | |
a086de98 | 362 | bool HandleKeyUp( WXWPARAM wParam |
776d87d5 DW |
363 | ,WXLPARAM lParam |
364 | ); | |
365 | bool HandleQueryDragIcon(WXHICON* phIcon); | |
61243a51 DW |
366 | bool HandleSetCursor( USHORT vId |
367 | ,WXHWND hWnd | |
776d87d5 | 368 | ); |
0e320a79 | 369 | |
f9efbe3a DW |
370 | bool IsMouseInWindow(void) const; |
371 | bool OS2GetCreateWindowCoords( const wxPoint& rPos | |
372 | ,const wxSize& rSize | |
373 | ,int& rnX | |
374 | ,int& rnY | |
375 | ,int& rnWidth | |
376 | ,int& rnHeight | |
377 | ) const; | |
378 | ||
cdf1e714 | 379 | // Window procedure |
a885d89a | 380 | virtual MRESULT OS2WindowProc( WXUINT uMsg |
776d87d5 DW |
381 | ,WXWPARAM wParam |
382 | ,WXLPARAM lParam | |
383 | ); | |
0e320a79 | 384 | |
cdf1e714 | 385 | // Calls an appropriate default window procedure |
a885d89a | 386 | virtual MRESULT OS2DefWindowProc( WXUINT uMsg |
776d87d5 DW |
387 | ,WXWPARAM wParam |
388 | ,WXLPARAM lParam | |
389 | ); | |
390 | virtual bool OS2ProcessMessage(WXMSG* pMsg); | |
f140b352 | 391 | virtual bool OS2ShouldPreProcessMessage(WXMSG* pMsg); |
776d87d5 DW |
392 | virtual bool OS2TranslateMessage(WXMSG* pMsg); |
393 | virtual void OS2DestroyWindow(void); | |
0e320a79 | 394 | |
cdf1e714 DW |
395 | // this function should return the brush to paint the window background |
396 | // with or 0 for the default brush | |
776d87d5 DW |
397 | virtual WXHBRUSH OnCtlColor( WXHDC hDC |
398 | ,WXHWND hWnd | |
399 | ,WXUINT uCtlColor | |
400 | ,WXUINT uMessage | |
401 | ,WXWPARAM wParam | |
402 | ,WXLPARAM lParam | |
403 | ); | |
27476f73 | 404 | |
cdf1e714 | 405 | // Responds to colour changes: passes event on to children. |
776d87d5 | 406 | void OnSysColourChanged(wxSysColourChangedEvent& rEvent); |
0e320a79 | 407 | |
776d87d5 DW |
408 | // initialize various fields of wxMouseEvent (common part of OS2OnMouseXXX) |
409 | void InitMouseEvent( wxMouseEvent& rEvent | |
410 | ,int nX | |
411 | ,int nY | |
412 | ,WXUINT uFlags | |
413 | ); | |
0e320a79 | 414 | |
3a50d19c | 415 | void MoveChildren(int nDiff); |
1b7735e1 | 416 | PSWP GetSwp(void) {return &m_vWinSwp;} |
3a50d19c | 417 | |
cdf1e714 | 418 | protected: |
a885d89a DW |
419 | // PM can't create some MSW styles natively but can perform these after |
420 | // creation by sending messages | |
421 | typedef enum extra_flags { kFrameToolWindow = 0x0001 | |
422 | ,kVertCaption = 0x0002 | |
423 | ,kHorzCaption = 0x0004 | |
424 | } EExtraFlags; | |
425 | // Some internal sizeing id's to make it easy for event handlers | |
426 | typedef enum size_types { kSizeNormal | |
427 | ,kSizeMax | |
428 | ,kSizeMin | |
429 | } ESizeTypes; | |
cdf1e714 | 430 | // the window handle |
776d87d5 | 431 | WXHWND m_hWnd; |
cdf1e714 DW |
432 | |
433 | // the old window proc (we subclass all windows) | |
776d87d5 | 434 | WXFARPROC m_fnOldWndProc; |
cdf1e714 | 435 | |
008089f6 | 436 | // additional (OS2 specific) flags |
776d87d5 DW |
437 | bool m_bUseCtl3D:1; // Using CTL3D for this control |
438 | bool m_bBackgroundTransparent:1; | |
439 | bool m_bMouseInWindow:1; | |
3437f881 | 440 | bool m_bLastKeydownProcessed:1; |
776d87d5 | 441 | bool m_bWinCaptured:1; |
008089f6 | 442 | WXDWORD m_dwExStyle; |
849949b1 DW |
443 | |
444 | // the size of one page for scrolling | |
776d87d5 DW |
445 | int m_nXThumbSize; |
446 | int m_nYThumbSize; | |
0e320a79 | 447 | |
cdf1e714 DW |
448 | #if wxUSE_MOUSEEVENT_HACK |
449 | // the coordinates of the last mouse event and the type of it | |
776d87d5 DW |
450 | long m_lLastMouseX, |
451 | long m_lLastMouseY; | |
452 | int m_nLastMouseEvent; | |
cdf1e714 DW |
453 | #endif // wxUSE_MOUSEEVENT_HACK |
454 | ||
776d87d5 | 455 | WXHMENU m_hMenu; // Menu, if any |
0fe536e3 | 456 | unsigned long m_ulMenubarId; // it's Id, if any |
cdf1e714 DW |
457 | |
458 | // the return value of WM_GETDLGCODE handler | |
776d87d5 | 459 | long m_lDlgCode; |
cdf1e714 DW |
460 | |
461 | // implement the base class pure virtuals | |
776d87d5 DW |
462 | virtual void DoClientToScreen( int* pX |
463 | ,int* pY | |
464 | ) const; | |
465 | virtual void DoScreenToClient( int* pX | |
466 | ,int* pY | |
467 | ) const; | |
468 | virtual void DoGetPosition( int* pX | |
469 | ,int* pY | |
470 | ) const; | |
471 | virtual void DoGetSize( int* pWidth | |
472 | ,int* pHeight | |
473 | ) const; | |
474 | virtual void DoGetClientSize( int* pWidth | |
475 | ,int* pHeight | |
476 | ) const; | |
477 | virtual void DoSetSize( int nX | |
478 | ,int nY | |
479 | ,int nWidth | |
480 | ,int nHeight | |
481 | ,int nSizeFlags = wxSIZE_AUTO | |
482 | ); | |
483 | virtual void DoSetClientSize( int nWidth | |
484 | ,int nHeight | |
485 | ); | |
cdf1e714 | 486 | |
4116c221 VZ |
487 | virtual void DoCaptureMouse(void); |
488 | virtual void DoReleaseMouse(void); | |
b9b1d6c8 | 489 | |
cdf1e714 DW |
490 | // move the window to the specified location and resize it: this is called |
491 | // from both DoSetSize() and DoSetClientSize() and would usually just call | |
3e282d33 | 492 | // ::WinSetWindowPos() except for composite controls which will want to arrange |
cdf1e714 | 493 | // themselves inside the given rectangle |
776d87d5 DW |
494 | virtual void DoMoveWindow( int nX |
495 | ,int nY | |
496 | ,int nWidth | |
497 | ,int nHeight | |
498 | ); | |
cdf1e714 DW |
499 | |
500 | #if wxUSE_TOOLTIPS | |
776d87d5 | 501 | virtual void DoSetToolTip(wxToolTip* pTip); |
cdf1e714 DW |
502 | #endif // wxUSE_TOOLTIPS |
503 | ||
3a50d19c DW |
504 | int GetOS2ParentHeight(wxWindowOS2* pParent); |
505 | ||
0e320a79 | 506 | private: |
cdf1e714 | 507 | // common part of all ctors |
776d87d5 | 508 | void Init(void); |
0e320a79 | 509 | |
cdf1e714 | 510 | // the (non-virtual) handlers for the events |
776d87d5 DW |
511 | bool HandleMove( int nX |
512 | ,int nY | |
513 | ); | |
514 | bool HandleJoystickEvent( WXUINT uMsg | |
515 | ,int pX | |
516 | ,int pY | |
517 | ,WXUINT uFlags | |
518 | ); | |
519 | ||
520 | bool HandleNotify( int nIdCtrl | |
521 | ,WXLPARAM lParam | |
522 | ,WXLPARAM* pResult | |
523 | ); | |
a885d89a | 524 | // the helper functions used by HandleChar/KeyXXX methods |
a086de98 DW |
525 | wxKeyEvent CreateKeyEvent( wxEventType evType |
526 | ,int nId | |
527 | ,WXLPARAM lParam = 0 | |
528 | ,WXWPARAM wParam = 0 | |
529 | ) const; | |
a885d89a | 530 | |
018d3030 | 531 | wxWindowList* m_pChildrenDisabled; |
c8b5f745 DW |
532 | HWND m_hWndScrollBarHorz; |
533 | HWND m_hWndScrollBarVert; | |
1b7735e1 | 534 | SWP m_vWinSwp; |
1c84ee88 | 535 | |
018d3030 DW |
536 | DECLARE_DYNAMIC_CLASS(wxWindowOS2); |
537 | DECLARE_NO_COPY_CLASS(wxWindowOS2) | |
538 | DECLARE_EVENT_TABLE() | |
539 | ||
540 | // | |
63415778 | 541 | // Virtual function hiding supression |
018d3030 | 542 | // |
776d87d5 | 543 | inline virtual bool Reparent(wxWindowBase* pNewParent) |
018d3030 | 544 | { return(wxWindowBase::Reparent(pNewParent));} |
a885d89a | 545 | }; // end of wxWindow |
0e320a79 | 546 | |
06519806 DW |
547 | class wxWindowCreationHook |
548 | { | |
549 | public: | |
550 | wxWindowCreationHook(wxWindow* pWinBeingCreated); | |
551 | ~wxWindowCreationHook(); | |
552 | }; // end of CLASS wxWindowCreationHook | |
553 | ||
cdf1e714 DW |
554 | // --------------------------------------------------------------------------- |
555 | // global functions | |
556 | // --------------------------------------------------------------------------- | |
0e320a79 | 557 | |
cdf1e714 | 558 | // kbd code translation |
776d87d5 DW |
559 | WXDLLEXPORT int wxCharCodeOS2ToWX(int nKeySym); |
560 | WXDLLEXPORT int wxCharCodeWXToOS2( int nId | |
8e372bbe | 561 | ,bool* pbIsVirtual = NULL |
776d87d5 | 562 | ); |
2461cfa0 SN |
563 | |
564 | // ---------------------------------------------------------------------------- | |
565 | // global objects | |
566 | // ---------------------------------------------------------------------------- | |
567 | ||
568 | // notice that this hash must be defined after wxWindow declaration as it | |
569 | // needs to "see" its dtor and not just forward declaration | |
570 | #include "wx/hash.h" | |
571 | ||
572 | // pseudo-template HWND <-> wxWindow hash table | |
573 | WX_DECLARE_HASH(wxWindowOS2, wxWindowList, wxWinHashTable); | |
574 | ||
575 | extern wxWinHashTable *wxWinHandleHash; | |
576 | ||
743e24aa | 577 | #endif // _WX_WINDOW_H_ |