Add wxWindow::MSWAfterReparent() virtual function
Refactor the existing code to extract the part of Reparent() updating the new parent style to an overridable virtual function. No real changes yet.
This commit is contained in:
parent
bc07c9a309
commit
cd637663c8
2 changed files with 12 additions and 2 deletions
|
|
@ -624,6 +624,11 @@ protected:
|
|||
virtual bool DoPopupMenu( wxMenu *menu, int x, int y ) override;
|
||||
#endif // wxUSE_MENUS_NATIVE
|
||||
|
||||
// Called by Reparent() after the window parent changes, i.e. GetParent()
|
||||
// returns the new parent inside this function.
|
||||
virtual void MSWAfterReparent();
|
||||
|
||||
|
||||
// the window handle
|
||||
WXHWND m_hWnd;
|
||||
|
||||
|
|
|
|||
|
|
@ -1683,12 +1683,17 @@ bool wxWindowMSW::Reparent(wxWindowBase *parent)
|
|||
|
||||
::SetParent(hWndChild, hWndParent);
|
||||
|
||||
MSWAfterReparent();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void wxWindowMSW::MSWAfterReparent()
|
||||
{
|
||||
if ( wxHasWindowExStyle(this, WS_EX_CONTROLPARENT) )
|
||||
{
|
||||
EnsureParentHasControlParentStyle(GetParent());
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static inline void SendSetRedraw(HWND hwnd, bool on)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue