Generate wxWindowCreateEvent when creating windows in wxQt
Send the expected event at the very end of window creation process. Closes https://github.com/wxWidgets/wxWidgets/pull/1119
This commit is contained in:
committed by
Vadim Zeitlin
parent
61b2136bee
commit
34ecc6efc4
@@ -58,9 +58,12 @@ bool wxControl::QtCreateControl( wxWindow *parent, wxWindowID id,
|
||||
|
||||
// Let Qt handle the background:
|
||||
SetBackgroundStyle(wxBG_STYLE_SYSTEM);
|
||||
PostCreation(false);
|
||||
|
||||
return CreateControl( parent, id, pos, size, style, validator, name );
|
||||
if (!CreateControl( parent, id, pos, size, style, validator, name ))
|
||||
return false;
|
||||
|
||||
PostCreation(false);
|
||||
return true;
|
||||
}
|
||||
|
||||
wxSize wxControl::DoGetBestSize() const
|
||||
|
@@ -60,9 +60,12 @@ bool wxDialog::Create( wxWindow *parent, wxWindowID id,
|
||||
|
||||
m_qtWindow = new wxQtDialog( parent, this );
|
||||
|
||||
if ( !wxTopLevelWindow::Create( parent, id, title, pos, size, style, name ) )
|
||||
return false;
|
||||
|
||||
PostCreation();
|
||||
|
||||
return wxTopLevelWindow::Create( parent, id, title, pos, size, style, name );
|
||||
return true;
|
||||
}
|
||||
|
||||
int wxDialog::ShowModal()
|
||||
|
@@ -70,9 +70,11 @@ bool wxFrame::Create( wxWindow *parent, wxWindowID id, const wxString& title,
|
||||
|
||||
GetQMainWindow()->setCentralWidget( new wxQtCentralWidget( parent, this ) );
|
||||
|
||||
PostCreation();
|
||||
if ( !wxFrameBase::Create( parent, id, title, pos, size, style, name ) )
|
||||
return false;
|
||||
|
||||
return wxFrameBase::Create( parent, id, title, pos, size, style, name );
|
||||
PostCreation();
|
||||
return true;
|
||||
}
|
||||
|
||||
void wxFrame::SetMenuBar( wxMenuBar *menuBar )
|
||||
|
@@ -287,6 +287,9 @@ void wxWindowQt::PostCreation(bool generic)
|
||||
SetForegroundColour(wxColour(GetHandle()->palette().foreground().color()));
|
||||
|
||||
GetHandle()->setFont( wxWindowBase::GetFont().GetHandle() );
|
||||
|
||||
wxWindowCreateEvent event(this);
|
||||
HandleWindowEvent(event);
|
||||
}
|
||||
|
||||
void wxWindowQt::AddChild( wxWindowBase *child )
|
||||
|
Reference in New Issue
Block a user