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