Wrap label if necessary in wxInfoBar in wxGTK

Also update the sample to test showing an overlong message in wxInfoBar.

Closes https://github.com/wxWidgets/wxWidgets/pull/1443

See #14121.
This commit is contained in:
Igor Korot
2019-07-26 23:46:36 -05:00
committed by Vadim Zeitlin
parent 43c519e04f
commit 32d8b5954a
4 changed files with 15 additions and 2 deletions

View File

@@ -159,6 +159,7 @@ wxBEGIN_EVENT_TABLE(MyFrame, wxFrame)
#endif // wxUSE_LOG_DIALOG
#if wxUSE_INFOBAR
EVT_MENU(DIALOGS_INFOBAR_SIMPLE, MyFrame::InfoBarSimple)
EVT_MENU(DIALOGS_INFOBAR_SIMPLE_WRAPPED, MyFrame::InfoBarSimpleWrapped)
EVT_MENU(DIALOGS_INFOBAR_ADVANCED, MyFrame::InfoBarAdvanced)
#endif // wxUSE_INFOBAR
@@ -530,6 +531,7 @@ bool MyApp::OnInit()
#if wxUSE_INFOBAR
info_menu->Append(DIALOGS_INFOBAR_SIMPLE, "Simple &info bar\tCtrl-I");
info_menu->Append(DIALOGS_INFOBAR_SIMPLE_WRAPPED, "Simple info bar with wrapped text");
info_menu->Append(DIALOGS_INFOBAR_ADVANCED, "&Advanced info bar\tShift-Ctrl-I");
#endif // wxUSE_INFOBAR
@@ -890,6 +892,11 @@ void MyFrame::InfoBarSimple(wxCommandEvent& WXUNUSED(event))
);
}
void MyFrame::InfoBarSimpleWrapped(wxCommandEvent &WXUNUSED(event))
{
m_infoBarSimple->ShowMessage( "This is very very long message to try the label wrapping on the info bar" );
}
void MyFrame::InfoBarAdvanced(wxCommandEvent& WXUNUSED(event))
{
m_infoBarAdvanced->ShowMessage("Sorry, it didn't work out.", wxICON_WARNING);