]>
git.saurik.com Git - wxWidgets.git/blob - src/msw/popupwin.cpp
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 #include "wx/msw/private.h" // for WS_CHILD and WS_POPUP
38 // ============================================================================
40 // ============================================================================
42 bool wxPopupWindow::Create(wxWindow
*parent
, int flags
)
44 return wxPopupWindowBase::Create(parent
) &&
45 wxWindow::Create(parent
, -1,
46 wxDefaultPosition
, wxDefaultSize
,
47 flags
| wxPOPUP_WINDOW
);
50 void wxPopupWindow::DoGetPosition(int *x
, int *y
) const
52 // the position of a "top level" window such as this should be in
53 // screen coordinates, not in the client ones which MSW gives us
54 // (because we are a child window)
55 wxPopupWindowBase::DoGetPosition(x
, y
);
57 GetParent()->ClientToScreen(x
, y
);
60 WXDWORD
wxPopupWindow::MSWGetStyle(long flags
, WXDWORD
*exstyle
) const
62 // we only hnour the border flags
63 WXDWORD style
= wxWindow::MSWGetStyle(flags
& wxBORDER_MASK
, exstyle
);
65 // and we mustn't have WS_CHILD style or we would be limited to the parents
72 // a popup window floats on top of everything
73 *exstyle
|= WS_EX_TOPMOST
| WS_EX_TOOLWINDOW
;