Corrected handling of wxTB_HORZ_TEXT in the toolbar sample.

The value of flag could be lost when toolbar was recreated without using text
at all.

Closes #13572.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69854 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2011-11-28 12:47:23 +00:00
parent 1165fdbbe2
commit c66c8042ad

View File

@ -925,12 +925,12 @@ void MyFrame::OnChangeToolTip(wxCommandEvent& WXUNUSED(event))
void MyFrame::OnToolbarStyle(wxCommandEvent& event)
{
long style = GetToolBar()->GetWindowStyle();
style &= ~(wxTB_NOICONS | wxTB_TEXT);
style &= ~(wxTB_NOICONS | wxTB_HORZ_TEXT);
switch ( event.GetId() )
{
case IDM_TOOLBAR_SHOW_TEXT:
style |= wxTB_NOICONS | wxTB_TEXT;
style |= wxTB_NOICONS | (m_horzText ? wxTB_HORZ_TEXT : wxTB_TEXT);
break;
case IDM_TOOLBAR_SHOW_ICONS:
@ -938,7 +938,7 @@ void MyFrame::OnToolbarStyle(wxCommandEvent& event)
break;
case IDM_TOOLBAR_SHOW_BOTH:
style |= wxTB_TEXT;
style |= (m_horzText ? wxTB_HORZ_TEXT : wxTB_TEXT);
}
GetToolBar()->SetWindowStyle(style);