Hide the page before adjusting its size, otherwise it might get painted
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28687 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -613,6 +613,16 @@ bool wxNotebook::InsertPage(size_t nPage,
|
|||||||
tcItem.pszText = (wxChar *)strText.c_str(); // const_cast
|
tcItem.pszText = (wxChar *)strText.c_str(); // const_cast
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// hide the page: unless it is selected, it shouldn't be shown (and if it
|
||||||
|
// is selected it will be shown later)
|
||||||
|
HWND hwnd = GetWinHwnd(pPage);
|
||||||
|
SetWindowLong(hwnd, GWL_STYLE, GetWindowLong(hwnd, GWL_STYLE) & ~WS_VISIBLE);
|
||||||
|
|
||||||
|
// this updates internal flag too -- otherwise it would get out of sync
|
||||||
|
// with the real state
|
||||||
|
pPage->Show(false);
|
||||||
|
|
||||||
|
|
||||||
// fit the notebook page to the tab control's display area: this should be
|
// fit the notebook page to the tab control's display area: this should be
|
||||||
// done before adding it to the notebook or TabCtrl_InsertItem() will
|
// done before adding it to the notebook or TabCtrl_InsertItem() will
|
||||||
// change the notebooks size itself!
|
// change the notebooks size itself!
|
||||||
@@ -638,16 +648,6 @@ bool wxNotebook::InsertPage(size_t nPage,
|
|||||||
AdjustPageSize(pPage);
|
AdjustPageSize(pPage);
|
||||||
}
|
}
|
||||||
|
|
||||||
// hide the page: unless it is selected, it shouldn't be shown (and if it
|
|
||||||
// is selected it will be shown later)
|
|
||||||
HWND hwnd = GetWinHwnd(pPage);
|
|
||||||
SetWindowLong(hwnd, GWL_STYLE, GetWindowLong(hwnd, GWL_STYLE) & ~WS_VISIBLE);
|
|
||||||
|
|
||||||
// this updates internal flag too -- otherwise it would get out of sync
|
|
||||||
// with the real state
|
|
||||||
pPage->Show(false);
|
|
||||||
|
|
||||||
|
|
||||||
// now deal with the selection
|
// now deal with the selection
|
||||||
// ---------------------------
|
// ---------------------------
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user