]> git.saurik.com Git - wxWidgets.git/blobdiff - interface/wx/popupwin.h
Send EVT_DATAVIEW_ITEM_CONTEXT_MENU events even when not clicking on an item.
[wxWidgets.git] / interface / wx / popupwin.h
index 2db50e0071b14684558506cc9a1500c8557a547a..96c20f6a81f52d8c7588314e9adce7dae25632c3 100644 (file)
@@ -1,9 +1,9 @@
 /////////////////////////////////////////////////////////////////////////////
-// Name:        popupwind.h
+// Name:        popupwin.h
 // Purpose:     interface of wxPoppWindow
 // Author:      wxWidgets team
-// RCS-ID:      $Id:$
-// Licence:     wxWindows license
+// RCS-ID:      $Id$
+// Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
 /**
@@ -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);
+};