From 6d090da1e9e618b60f176cc27fc8a79eadde44b4 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 19 Mar 2011 11:57:06 +0000 Subject: [PATCH] Document wxPopupTransientWindow. Also fix a typo in a comment in the real class declaration. Closes #13044. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67244 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/popupwin.h | 2 +- interface/wx/popupwin.h | 48 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+), 1 deletion(-) diff --git a/include/wx/popupwin.h b/include/wx/popupwin.h index 971c761b98..da479f31ba 100644 --- a/include/wx/popupwin.h +++ b/include/wx/popupwin.h @@ -106,7 +106,7 @@ public: // called when a mouse is pressed while the popup is shown: return true // from here to prevent its normal processing by the popup (which consists - // in dismissing it if the mouse is cilcked outside it) + // in dismissing it if the mouse is clicked outside it) virtual bool ProcessLeftDown(wxMouseEvent& event); // Overridden to grab the input on some plaforms diff --git a/interface/wx/popupwin.h b/interface/wx/popupwin.h index 9ffd2c106c..96c20f6a81 100644 --- a/interface/wx/popupwin.h +++ b/interface/wx/popupwin.h @@ -49,3 +49,51 @@ public: const wxSize& sizePopup); }; +/** + @class wxPopupTransientWindow + + A wxPopupWindow which disappears automatically when the user clicks mouse + outside it or if it loses focus in any other way. + + This window can be useful for implementing custom combobox-like controls + for example. + + @library{wxcore} + @category{managedwnd} + + @see wxPopupWindow +*/ + +class wxPopupTransientWindow : public wxPopupWindow +{ +public: + /** + Constructor. + */ + wxPopupTransientWindow(wxWindow *parent, int flags = wxBORDER_NONE); + + /** + Popup the window (this will show it too). + + If @a winFocus is non-@NULL, it will be kept focused while this window + is shown, otherwise this window itself will receive focus. In any case, + the popup will disappear automatically if it loses focus because of a + user action. + + @see Dismiss() + */ + virtual void Popup(wxWindow *focus = NULL); + + /** + Hide the window. + */ + virtual void Dismiss(); + + /** + Called when a mouse is pressed while the popup is shown. + + Return @true from here to prevent its normal processing by the popup + (which consists in dismissing it if the mouse is clicked outside it). + */ + virtual bool ProcessLeftDown(wxMouseEvent& event); +}; -- 2.45.2