]> git.saurik.com Git - wxWidgets.git/blame - src/os2/popupwin.cpp
wxGTK1 : wx/private/eventloopsourcesmanager.h was missing in evtloop.cpp
[wxWidgets.git] / src / os2 / popupwin.cpp
CommitLineData
63ebec23 1///////////////////////////////////////////////////////////////////////////////
80fdcdb9 2// Name: src/os2/popupwin.cpp
63ebec23
DW
3// Purpose: implements wxPopupWindow for OS2
4// Author: Dave Webster
5// Modified by:
6// Created: 13.05.02
63ebec23 7// Copyright: (c) 2002 Dave Webster <dwebster@bhmi.com>
526954c5 8// Licence: wxWindows licence
63ebec23
DW
9///////////////////////////////////////////////////////////////////////////////
10
11// ============================================================================
12// declarations
13// ============================================================================
14
15// ----------------------------------------------------------------------------
16// headers
17// ----------------------------------------------------------------------------
18
63ebec23
DW
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
496959eb 26#if wxUSE_POPUPWIN
63ebec23
DW
27#include "wx/popupwin.h"
28
29// ============================================================================
30// implementation
31// ============================================================================
32
6670f564
WS
33bool wxPopupWindow::Create( wxWindow* pParent,
34 int nFlags )
63ebec23
DW
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
6670f564
WS
45void wxPopupWindow::DoGetPosition( int* pnX,
46 int* pnY ) const
63ebec23
DW
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
47df2b8c
DW
57WXHWND 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
6670f564
WS
65WXDWORD wxPopupWindow::OS2GetStyle( long lFlags,
66 WXDWORD* dwExstyle ) const
63ebec23 67{
6670f564
WS
68 WXDWORD dwStyle = wxWindow::OS2GetStyle( lFlags & wxBORDER_MASK
69 ,dwExstyle
70 );
63ebec23
DW
71
72 return dwStyle;
73} // end of wxPopupWindow::OS2GetStyle
496959eb 74#endif