remove requested button rather than last one, return true from successful Create(), and a non-pch build fix

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62328 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Paul Cornett
2009-10-08 05:03:42 +00:00
parent d5e7ffcf7a
commit ff7485d88b

View File

@@ -3,7 +3,7 @@
// Purpose: wxInfoBar implementation for GTK // Purpose: wxInfoBar implementation for GTK
// Author: Vadim Zeitlin // Author: Vadim Zeitlin
// Created: 2009-09-27 // Created: 2009-09-27
// RCS-ID: $Id: wxhead.cpp,v 1.10 2009-06-29 10:23:04 zeitlin Exp $ // RCS-ID: $Id$
// Copyright: (c) 2009 Vadim Zeitlin <vadim@wxwidgets.org> // Copyright: (c) 2009 Vadim Zeitlin <vadim@wxwidgets.org>
// Licence: wxWindows licence // Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
@@ -31,6 +31,7 @@
#endif // WX_PRECOMP #endif // WX_PRECOMP
#include "wx/vector.h" #include "wx/vector.h"
#include "wx/stockitem.h"
#include "wx/gtk/private.h" #include "wx/gtk/private.h"
#include "wx/gtk/private/messagetype.h" #include "wx/gtk/private/messagetype.h"
@@ -143,7 +144,7 @@ bool wxInfoBar::Create(wxWindow *parent, wxWindowID winid)
GTKConnectWidget("response", G_CALLBACK(wxgtk_infobar_response)); GTKConnectWidget("response", G_CALLBACK(wxgtk_infobar_response));
GTKConnectWidget("close", G_CALLBACK(wxgtk_infobar_close)); GTKConnectWidget("close", G_CALLBACK(wxgtk_infobar_close));
return false; return true;
} }
wxInfoBar::~wxInfoBar() wxInfoBar::~wxInfoBar()
@@ -253,6 +254,8 @@ void wxInfoBar::RemoveButton(wxWindowID btnid)
for ( wxInfoBarGTKImpl::Buttons::reverse_iterator i = buttons.rbegin(); for ( wxInfoBarGTKImpl::Buttons::reverse_iterator i = buttons.rbegin();
i != buttons.rend(); i != buttons.rend();
++i ) ++i )
{
if (i->id == btnid)
{ {
gtk_widget_destroy(i->button); gtk_widget_destroy(i->button);
buttons.erase(i.base()); buttons.erase(i.base());
@@ -262,6 +265,7 @@ void wxInfoBar::RemoveButton(wxWindowID btnid)
return; return;
} }
}
wxFAIL_MSG( wxString::Format("button with id %d not found", btnid) ); wxFAIL_MSG( wxString::Format("button with id %d not found", btnid) );
} }