Manually select the coresponding tab before floating a panel

Doing this forces the window to be drawn before reparenting it. It fixes the possibility of creating an empty floating window if the selected tab wasn't corespoinding to the window.
This commit is contained in:
aldelaro5 2016-09-11 18:52:48 -04:00
parent b3d49c7335
commit 6029c946f5
1 changed files with 3 additions and 1 deletions

View File

@ -297,9 +297,11 @@ void CFrame::DoFloatNotebookPage(wxWindowID Id)
wxAuiNotebook* nb = GetNotebookFromId(i); wxAuiNotebook* nb = GetNotebookFromId(i);
if (nb->GetPageIndex(Win) != wxNOT_FOUND) if (nb->GetPageIndex(Win) != wxNOT_FOUND)
{ {
nb->RemovePage(nb->GetPageIndex(Win)); // Set the selected tab manually so the window is drawn before reparenting the window
nb->SetSelection(nb->GetPageIndex(Win));
// Create the parent frame and reparent the window // Create the parent frame and reparent the window
CreateParentFrame(Win->GetId() + IDM_LOG_WINDOW_PARENT - IDM_LOG_WINDOW, Win->GetName(), Win); CreateParentFrame(Win->GetId() + IDM_LOG_WINDOW_PARENT - IDM_LOG_WINDOW, Win->GetName(), Win);
nb->RemovePage(nb->GetPageIndex(Win));
if (nb->GetPageCount() == 0) if (nb->GetPageCount() == 0)
AddRemoveBlankPage(); AddRemoveBlankPage();
} }