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