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