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