1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: msw/popupwin.cpp
3 // Purpose: implements wxPopupWindow for MSW
4 // Author: Vadim Zeitlin
8 // Copyright: (c) 2002 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
9 // License: wxWindows license
10 ///////////////////////////////////////////////////////////////////////////////
12 // ============================================================================
14 // ============================================================================
16 // ----------------------------------------------------------------------------
18 // ----------------------------------------------------------------------------
21 #pragma implementation "popup.h"
24 // For compilers that support precompilation, includes "wx.h".
25 #include "wx/wxprec.h"
34 #include "wx/popupwin.h"
36 // ============================================================================
38 // ============================================================================
40 bool wxPopupWindow
::Create(wxWindow
*parent
, int flags
)
42 return wxPopupWindowBase
::Create(parent
) &&
43 wxWindow
::Create(parent
, -1,
44 wxDefaultPosition
, wxDefaultSize
,
45 flags
| wxPOPUP_WINDOW
);
48 void wxPopupWindow
::DoGetPosition(int *x
, int *y
) const
50 // the position of a "top level" window such as this should be in
51 // screen coordinates, not in the client ones which MSW gives us
52 // (because we are a child window)
53 wxPopupWindowBase
::DoGetPosition(x
, y
);
55 GetParent()->ClientToScreen(x
, y
);
58 WXDWORD wxPopupWindow
::MSWGetStyle(long flags
, WXDWORD
*exstyle
) const
60 // we only hnour the border flags
61 WXDWORD style
= wxWindow
::MSWGetStyle(flags
& wxBORDER_MASK
, exstyle
);
63 // and we mustn't have WS_CHILD style or we would be limited to the parents
70 // a popup window floats on top of everything
71 *exstyle
|= WS_EX_TOPMOST
| WS_EX_TOOLWINDOW
;