X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6a3f8b4f1f1c802df93ce7bc05588536cb7a4dad..fb5117ce44fad7b0a856e5ac1d82e53c389f3248:/interface/wx/infobar.h?ds=sidebyside diff --git a/interface/wx/infobar.h b/interface/wx/infobar.h index 91360cf2d1..19d737cf5e 100644 --- a/interface/wx/infobar.h +++ b/interface/wx/infobar.h @@ -4,7 +4,7 @@ // Author: Vadim Zeitlin // RCS-ID: $Id$ // Copyright: (c) 2009 Vadim Zeitlin -// Licence: wxWindows license +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// /** @@ -52,7 +52,7 @@ void MyFrame::SomeMethod() { - m_infoBar->ShowMessage("Something happend", wxICON_INFORMATION); + m_infoBar->ShowMessage("Something happened", wxICON_INFORMATION); } @endcode @@ -64,14 +64,14 @@ native implementation requires a recent -- as of this writing -- GTK+ 2.18 version. - @library{wxadv} + @library{wxcore} @category{miscwnd} @see wxStatusBar, wxMessageDialog @since 2.9.1 */ -class wxInfoBar : public wxWindow +class wxInfoBar : public wxControl { public: /** @@ -107,7 +107,7 @@ public: The id of the info bar window, usually unused as currently no events are generated by this class. */ - wxInfoBar(wxWindow *parent, wxWindowID winid = wxID_ANY); + bool Create(wxWindow *parent, wxWindowID winid = wxID_ANY); /** Add a button to be shown in the info bar. @@ -123,9 +123,10 @@ public: itself closes the window whenever a button in it is clicked so if you wish the info bar to be hidden when the button is clicked, simply call @c event.Skip() in the button handler to let the base class handler do - it. On the other hand, if you don't skip the event, the info bar will - remain opened so make sure to do it for at least some buttons to allow - the user to close it. + it (calling Dismiss() explicitly works too, of course). On the other + hand, if you don't skip the event, the info bar will remain opened so + make sure to do it for at least some buttons to allow the user to close + it. Notice that the generic wxInfoBar implementation handles the button events itself and so they are not propagated to the info bar parent and @@ -143,6 +144,14 @@ public: */ void AddButton(wxWindowID btnid, const wxString& label = wxString()); + /** + Hide the info bar window. + + This method hides the window and lays out the parent window to account + for its disappearance (unlike a simple Hide()). + */ + void Dismiss(); + /** Remove a button previously added by AddButton(). @@ -191,17 +200,17 @@ public: Either or both of the parameters can be set to wxSHOW_EFFECT_NONE to disable using effects entirely. - Notice that if you place the bar at the bottom of the window you should - reverse the effects used for showing and hiding for better appearance. + By default, the info bar uses wxSHOW_EFFECT_SLIDE_TO_BOTTOM effect for + showing itself and wxSHOW_EFFECT_SLIDE_TO_TOP for hiding if it is the + first element of the containing sizer and reverse effects if it's the + last one. If it is neither the first nor the last element, no effect is + used to avoid the use of an inappropriate one and this function must be + called if an effect is desired. @param showEffect - The effect to use when showing the bar. By default, - wxSHOW_EFFECT_SLIDE_TO_BOTTOM which is appropriate for the bars - placed at the top of the window. + The effect to use when showing the bar. @param hideEffect - The effect to use when hiding the bar. By default, - wxSHOW_EFFECT_SLIDE_TO_TOP which is appropriate for the bars placed - at the top of the window. + The effect to use when hiding the bar. */ void SetShowHideEffects(wxShowEffect showEffect, wxShowEffect hideEffect);