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