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