]> git.saurik.com Git - wxWidgets.git/blob - src/os2/popupwin.cpp
Made the #if wxUSE_UNICODE check correctly...
[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 IMPLEMENT_DYNAMIC_CLASS(wxPopupWindow, wxWindow)
34
35 // ============================================================================
36 // implementation
37 // ============================================================================
38
39 bool wxPopupWindow::Create(
40 wxWindow* pParent
41 , int nFlags
42 )
43 {
44 return wxPopupWindowBase::Create(pParent) &&
45 wxWindow::Create( pParent
46 ,-1
47 ,wxDefaultPosition
48 ,wxDefaultSize
49 ,nFlags | wxPOPUP_WINDOW
50 );
51 } // end of wxPopupWindow::Create
52
53 void wxPopupWindow::DoGetPosition(
54 int* pnX
55 , int* pnY
56 ) const
57 {
58 //
59 // The position of a "top level" window such as this should be in
60 // screen coordinates, not in the client ones which MSW gives us
61 // (because we are a child window)
62 //
63 wxPopupWindowBase::DoGetPosition(pnX, pnY);
64 GetParent()->ClientToScreen(pnX, pnY);
65 } // end of wxPopupWindow::DoGetPosition
66
67 WXHWND wxPopupWindow::OS2GetParent() const
68 {
69 // we must be a child of the desktop to be able to extend beyond the parent
70 // window client area (like the comboboxes drop downs do)
71 //
72 return (WXHWND)HWND_DESKTOP;
73 } // end of wxPopupWindow::OS2GetParent
74
75 WXDWORD wxPopupWindow::OS2GetStyle(
76 long lFlags
77 , WXDWORD* dwExstyle
78 ) const
79 {
80 WXDWORD dwStyle = wxWindow::OS2GetStyle( lFlags & wxBORDER_MASK
81 ,dwExstyle
82 );
83
84 return dwStyle;
85 } // end of wxPopupWindow::OS2GetStyle
86
87