]> git.saurik.com Git - wxWidgets.git/blob - src/os2/popupwin.cpp
Fix for crash when opening empty node
[wxWidgets.git] / src / os2 / popupwin.cpp
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: os2/popupwin.cpp
3 // Purpose: implements wxPopupWindow for OS2
4 // Author: Dave Webster
5 // Modified by:
6 // Created: 13.05.02
7 // RCS-ID: $Id$
8 // Copyright: (c) 2002 Dave Webster <dwebster@bhmi.com>
9 // License: wxWindows licence
10 ///////////////////////////////////////////////////////////////////////////////
11
12 // ============================================================================
13 // declarations
14 // ============================================================================
15
16 // ----------------------------------------------------------------------------
17 // headers
18 // ----------------------------------------------------------------------------
19
20 // For compilers that support precompilation, includes "wx.h".
21 #include "wx/wxprec.h"
22
23
24 #ifndef WX_PRECOMP
25 #endif //WX_PRECOMP
26
27 #if wxUSE_POPUPWIN
28 #include "wx/popupwin.h"
29
30 // ============================================================================
31 // implementation
32 // ============================================================================
33
34 bool wxPopupWindow::Create( wxWindow* pParent,
35 int nFlags )
36 {
37 return wxPopupWindowBase::Create(pParent) &&
38 wxWindow::Create( pParent
39 ,-1
40 ,wxDefaultPosition
41 ,wxDefaultSize
42 ,nFlags | wxPOPUP_WINDOW
43 );
44 } // end of wxPopupWindow::Create
45
46 void wxPopupWindow::DoGetPosition( int* pnX,
47 int* pnY ) const
48 {
49 //
50 // The position of a "top level" window such as this should be in
51 // screen coordinates, not in the client ones which MSW gives us
52 // (because we are a child window)
53 //
54 wxPopupWindowBase::DoGetPosition(pnX, pnY);
55 GetParent()->ClientToScreen(pnX, pnY);
56 } // end of wxPopupWindow::DoGetPosition
57
58 WXHWND wxPopupWindow::OS2GetParent() const
59 {
60 // we must be a child of the desktop to be able to extend beyond the parent
61 // window client area (like the comboboxes drop downs do)
62 //
63 return (WXHWND)HWND_DESKTOP;
64 } // end of wxPopupWindow::OS2GetParent
65
66 WXDWORD wxPopupWindow::OS2GetStyle( long lFlags,
67 WXDWORD* dwExstyle ) const
68 {
69 WXDWORD dwStyle = wxWindow::OS2GetStyle( lFlags & wxBORDER_MASK
70 ,dwExstyle
71 );
72
73 return dwStyle;
74 } // end of wxPopupWindow::OS2GetStyle
75 #endif