]> git.saurik.com Git - wxWidgets.git/blobdiff - interface/wx/popupwin.h
Document that HasFocus() is new in 2.9.
[wxWidgets.git] / interface / wx / popupwin.h
index b2dad633b686dec97b4ebeac599555852ef1d1e5..f7e6aec56e176759f54d3ca868883ba9260d1cee 100644 (file)
@@ -1,9 +1,9 @@
 /////////////////////////////////////////////////////////////////////////////
 // Name:        popupwin.h
-// Purpose:     interface of wxPoppWindow
+// Purpose:     interface of wxPopupWindow
 // Author:      wxWidgets team
 // RCS-ID:      $Id$
-// Licence:     wxWindows license
+// Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
 /**
@@ -22,6 +22,11 @@ class wxPopupWindow: public wxNonOwnedWindow
 {
 public:
 
+    /**
+      Default constructor
+    */
+    wxPopupWindow();
+    
     /**
       Constructor
     */
@@ -49,3 +54,64 @@ 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:
+    /**
+        Default constructor.
+    */
+    wxPopupTransientWindow();
+
+    /**
+        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);
+
+protected:
+    /**
+       This is called when the popup is disappeared because of anything
+       else but direct call to Dismiss().
+    */
+    virtual void OnDismiss();
+    
+};