]>
git.saurik.com Git - wxWidgets.git/blob - interface/wx/popupwin.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: interface of wxPopupWindow
4 // Author: wxWidgets team
5 // Licence: wxWindows licence
6 /////////////////////////////////////////////////////////////////////////////
11 A special kind of top level window used for popup menus,
12 combobox popups and such.
17 @see wxDialog, wxFrame
20 class wxPopupWindow
: public wxNonOwnedWindow
32 wxPopupWindow(wxWindow
*parent
, int flags
= wxBORDER_NONE
);
35 Create method for two-step creation
37 bool Create(wxWindow
*parent
, int flags
= wxBORDER_NONE
);
40 Move the popup window to the right position, i.e.\ such that it is
43 The popup is positioned at ptOrigin + size if it opens below and to the
44 right (default), at ptOrigin - sizePopup if it opens above and to the
48 Must be given in screen coordinates!
50 The size of the popup window
52 virtual void Position(const wxPoint
& ptOrigin
,
53 const wxSize
& sizePopup
);
57 @class wxPopupTransientWindow
59 A wxPopupWindow which disappears automatically when the user clicks mouse
60 outside it or if it loses focus in any other way.
62 This window can be useful for implementing custom combobox-like controls
71 class wxPopupTransientWindow
: public wxPopupWindow
77 wxPopupTransientWindow();
82 wxPopupTransientWindow(wxWindow
*parent
, int flags
= wxBORDER_NONE
);
85 Popup the window (this will show it too).
87 If @a winFocus is non-@NULL, it will be kept focused while this window
88 is shown, otherwise this window itself will receive focus. In any case,
89 the popup will disappear automatically if it loses focus because of a
94 virtual void Popup(wxWindow
*focus
= NULL
);
99 virtual void Dismiss();
102 Called when a mouse is pressed while the popup is shown.
104 Return @true from here to prevent its normal processing by the popup
105 (which consists in dismissing it if the mouse is clicked outside it).
107 virtual bool ProcessLeftDown(wxMouseEvent
& event
);
111 This is called when the popup is disappeared because of anything
112 else but direct call to Dismiss().
114 virtual void OnDismiss();