]>
git.saurik.com Git - wxWidgets.git/blob - interface/wx/popupwin.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: interface of wxPoppWindow
4 // Author: wxWidgets team
6 // Licence: wxWindows licence
7 /////////////////////////////////////////////////////////////////////////////
12 A special kind of top level window used for popup menus,
13 combobox popups and such.
18 @see wxDialog, wxFrame
21 class wxPopupWindow
: public wxNonOwnedWindow
28 wxPopupWindow(wxWindow
*parent
, int flags
= wxBORDER_NONE
);
31 Create method for two-step creation
33 bool Create(wxWindow
*parent
, int flags
= wxBORDER_NONE
);
36 Move the popup window to the right position, i.e. such that it is
39 The popup is positioned at ptOrigin + size if it opens below and to the
40 right (default), at ptOrigin - sizePopup if it opens above and to the
44 Must be given in screen coordinates!
46 The size of the popup window
48 virtual void Position(const wxPoint
& ptOrigin
,
49 const wxSize
& sizePopup
);
53 @class wxPopupTransientWindow
55 A wxPopupWindow which disappears automatically when the user clicks mouse
56 outside it or if it loses focus in any other way.
58 This window can be useful for implementing custom combobox-like controls
67 class wxPopupTransientWindow
: public wxPopupWindow
73 wxPopupTransientWindow(wxWindow
*parent
, int flags
= wxBORDER_NONE
);
76 Popup the window (this will show it too).
78 If @a winFocus is non-@NULL, it will be kept focused while this window
79 is shown, otherwise this window itself will receive focus. In any case,
80 the popup will disappear automatically if it loses focus because of a
85 virtual void Popup(wxWindow
*focus
= NULL
);
90 virtual void Dismiss();
93 Called when a mouse is pressed while the popup is shown.
95 Return @true from here to prevent its normal processing by the popup
96 (which consists in dismissing it if the mouse is clicked outside it).
98 virtual bool ProcessLeftDown(wxMouseEvent
& event
);