]> git.saurik.com Git - wxWidgets.git/blame - src/os2/popupwin.cpp
[1231183] 'cleanup: mismatched indentation' and other cleanings.
[wxWidgets.git] / src / os2 / popupwin.cpp
CommitLineData
63ebec23
DW
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>
65571936 9// License: wxWindows licence
63ebec23
DW
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
6670f564
WS
37bool wxPopupWindow::Create( wxWindow* pParent,
38 int nFlags )
63ebec23
DW
39{
40 return wxPopupWindowBase::Create(pParent) &&
41 wxWindow::Create( pParent
42 ,-1
43 ,wxDefaultPosition
44 ,wxDefaultSize
45 ,nFlags | wxPOPUP_WINDOW
46 );
47} // end of wxPopupWindow::Create
48
6670f564
WS
49void wxPopupWindow::DoGetPosition( int* pnX,
50 int* pnY ) const
63ebec23
DW
51{
52 //
53 // The position of a "top level" window such as this should be in
54 // screen coordinates, not in the client ones which MSW gives us
55 // (because we are a child window)
56 //
57 wxPopupWindowBase::DoGetPosition(pnX, pnY);
58 GetParent()->ClientToScreen(pnX, pnY);
59} // end of wxPopupWindow::DoGetPosition
60
47df2b8c
DW
61WXHWND wxPopupWindow::OS2GetParent() const
62{
63 // we must be a child of the desktop to be able to extend beyond the parent
64 // window client area (like the comboboxes drop downs do)
65 //
66 return (WXHWND)HWND_DESKTOP;
67} // end of wxPopupWindow::OS2GetParent
68
6670f564
WS
69WXDWORD wxPopupWindow::OS2GetStyle( long lFlags,
70 WXDWORD* dwExstyle ) const
63ebec23 71{
6670f564
WS
72 WXDWORD dwStyle = wxWindow::OS2GetStyle( lFlags & wxBORDER_MASK
73 ,dwExstyle
74 );
63ebec23
DW
75
76 return dwStyle;
77} // end of wxPopupWindow::OS2GetStyle