Only compile PopupWindow if corresponding define is set.
[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 #if wxUSE_POPUPWIN
32 #include "wx/popupwin.h"
33
34 // ============================================================================
35 // implementation
36 // ============================================================================
37
38 bool wxPopupWindow::Create( wxWindow* pParent,
39 int nFlags )
40 {
41 return wxPopupWindowBase::Create(pParent) &&
42 wxWindow::Create( pParent
43 ,-1
44 ,wxDefaultPosition
45 ,wxDefaultSize
46 ,nFlags | wxPOPUP_WINDOW
47 );
48 } // end of wxPopupWindow::Create
49
50 void wxPopupWindow::DoGetPosition( int* pnX,
51 int* pnY ) const
52 {
53 //
54 // The position of a "top level" window such as this should be in
55 // screen coordinates, not in the client ones which MSW gives us
56 // (because we are a child window)
57 //
58 wxPopupWindowBase::DoGetPosition(pnX, pnY);
59 GetParent()->ClientToScreen(pnX, pnY);
60 } // end of wxPopupWindow::DoGetPosition
61
62 WXHWND wxPopupWindow::OS2GetParent() const
63 {
64 // we must be a child of the desktop to be able to extend beyond the parent
65 // window client area (like the comboboxes drop downs do)
66 //
67 return (WXHWND)HWND_DESKTOP;
68 } // end of wxPopupWindow::OS2GetParent
69
70 WXDWORD wxPopupWindow::OS2GetStyle( long lFlags,
71 WXDWORD* dwExstyle ) const
72 {
73 WXDWORD dwStyle = wxWindow::OS2GetStyle( lFlags & wxBORDER_MASK
74 ,dwExstyle
75 );
76
77 return dwStyle;
78 } // end of wxPopupWindow::OS2GetStyle
79 #endif