From c66c8042ad988f4b848fd8a967c1c1c5bc37610f Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 28 Nov 2011 12:47:23 +0000 Subject: [PATCH] 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 --- samples/toolbar/toolbar.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/toolbar/toolbar.cpp b/samples/toolbar/toolbar.cpp index 6f8327a911..53b7e27c59 100644 --- a/samples/toolbar/toolbar.cpp +++ b/samples/toolbar/toolbar.cpp @@ -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); -- 2.45.2