]> git.saurik.com Git - wxWidgets.git/blob - src/os2/popupwin.cpp
configure fix for OS/2 from Dave Parsons and David Webster
[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 #ifdef __GNUG__
21 #pragma implementation "popup.h"
22 #endif
23
24 // For compilers that support precompilation, includes "wx.h".
25 #include "wx/wxprec.h"
26
27
28 #ifndef WX_PRECOMP
29 #endif //WX_PRECOMP
30
31 #include "wx/popupwin.h"
32
33 // ============================================================================
34 // implementation
35 // ============================================================================
36
37 bool wxPopupWindow::Create(
38 wxWindow* pParent
39 , int nFlags
40 )
41 {
42 return wxPopupWindowBase::Create(pParent) &&
43 wxWindow::Create( pParent
44 ,-1
45 ,wxDefaultPosition
46 ,wxDefaultSize
47 ,nFlags | wxPOPUP_WINDOW
48 );
49 } // end of wxPopupWindow::Create
50
51 void wxPopupWindow::DoGetPosition(
52 int* pnX
53 , int* pnY
54 ) const
55 {
56 //
57 // The position of a "top level" window such as this should be in
58 // screen coordinates, not in the client ones which MSW gives us
59 // (because we are a child window)
60 //
61 wxPopupWindowBase::DoGetPosition(pnX, pnY);
62 GetParent()->ClientToScreen(pnX, pnY);
63 } // end of wxPopupWindow::DoGetPosition
64
65 WXHWND wxPopupWindow::OS2GetParent() const
66 {
67 // we must be a child of the desktop to be able to extend beyond the parent
68 // window client area (like the comboboxes drop downs do)
69 //
70 return (WXHWND)HWND_DESKTOP;
71 } // end of wxPopupWindow::OS2GetParent
72
73 WXDWORD wxPopupWindow::OS2GetStyle(
74 long lFlags
75 , WXDWORD* dwExstyle
76 ) const
77 {
78 WXDWORD dwStyle = wxWindow::OS2GetStyle( lFlags & wxBORDER_MASK
79 ,dwExstyle
80 );
81
82 return dwStyle;
83 } // end of wxPopupWindow::OS2GetStyle
84
85