MSW fixes for the last change: call Realize() after changing the toolbar; hide/show the window when removing/adding it back as it isn't done by Remove/InsertTool() under MSW unlike under GTK (should it?)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@52842 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2008-03-27 00:32:41 +00:00
parent ec96848003
commit b3514fd617

View File

@ -518,6 +518,7 @@ MyFrame::MyFrame(wxFrame* parent,
m_horzText = false;
m_useCustomDisabled = false;
m_showTooltips = true;
m_searchTool = NULL;
m_rows = 1;
m_nPrint = 1;
@ -588,7 +589,7 @@ MyFrame::MyFrame(wxFrame* parent,
toolMenu->Append(IDM_TOOLBAR_DELETEPRINT, _T("&Delete print button\tCtrl-D"));
toolMenu->Append(IDM_TOOLBAR_INSERTPRINT, _T("&Insert print button\tCtrl-I"));
toolMenu->Append(IDM_TOOLBAR_TOGGLEHELP, _T("Toggle &help button\tCtrl-T"));
toolMenu->Append(IDM_TOOLBAR_TOGGLESEARCH, _T("Toggle &search field\tCtrl-F"));
toolMenu->AppendCheckItem(IDM_TOOLBAR_TOGGLESEARCH, _T("Toggle &search field\tCtrl-F"));
toolMenu->AppendSeparator();
toolMenu->Append(IDM_TOOLBAR_TOGGLERADIOBTN1, _T("Toggle &1st radio button\tCtrl-1"));
toolMenu->Append(IDM_TOOLBAR_TOGGLERADIOBTN2, _T("Toggle &2nd radio button\tCtrl-2"));
@ -874,16 +875,21 @@ void MyFrame::OnToggleSearch(wxCommandEvent& WXUNUSED(event))
}
else // tool already exists
{
wxControl * const win = m_searchTool->GetControl();
if ( m_searchTool->GetToolBar() )
{
// attached now, remove it
win->Hide();
tb->RemoveTool(m_searchTool->GetId());
}
else // tool exists in detached state, attach it back
{
tb->InsertTool(searchPos, m_searchTool);
win->Show();
}
}
tb->Realize();
}
void MyFrame::OnUpdateCopyAndCut(wxUpdateUIEvent& event)