// for modal dialogs
wxList wxModalDialogs;
wxList wxModelessWindows; // Frames and modeless dialogs
-extern wxList wxPendingDelete;
+extern wxList WXDLLEXPORT wxPendingDelete;
#if !USE_SHARED_LIBRARY
IMPLEMENT_DYNAMIC_CLASS(wxDialog, wxPanel)
BEGIN_EVENT_TABLE(wxDialog, wxPanel)
+ EVT_SIZE(wxDialog::OnSize)
EVT_BUTTON(wxID_OK, wxDialog::OnOK)
EVT_BUTTON(wxID_APPLY, wxDialog::OnApply)
EVT_BUTTON(wxID_CANCEL, wxDialog::OnCancel)
return FALSE;
}
-void wxDialog::SetSize(int x, int y, int width, int height, int WXUNUSED(sizeFlags))
-{
- wxWindow::SetSize(x, y, width, height);
-}
-
void wxDialog::SetClientSize(int width, int height)
{
HWND hWnd = (HWND) GetHWND();
TranslateMessage(&msg);
DispatchMessage(&msg);
}
+
+ // If we get crashes (as per George Tasker's message) with nested modal dialogs,
+ // we should try removing the m_modalShowing test
+
if (m_modalShowing && !::PeekMessage(&msg, 0, 0, 0, PM_NOREMOVE))
// dfgg: NB MUST test m_modalShowing again as the message loop could have triggered
// a Show(FALSE) in the mean time!!!
node=disabledWindows.First();
while(node) {
wxWindow* win = (wxWindow*) node->Data();
- HWND hWnd = (HWND) win->GetHWND();
- if (::IsWindow(hWnd) && (wxModalDialogs.Member(win) || wxModelessWindows.Member(win) ))
- ::EnableWindow(hWnd,TRUE);
+ if (wxModalDialogs.Member(win) || wxModelessWindows.Member(win))
+ {
+ HWND hWnd = (HWND) win->GetHWND();
+ if (::IsWindow(hWnd))
+ ::EnableWindow(hWnd,TRUE);
+ }
node=node->Next();
}
}
WXHBRUSH wxDialog::OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor,
WXUINT message, WXWPARAM wParam, WXLPARAM lParam)
{
-#if CTL3D
+#if wxUSE_CTL3D
HBRUSH hbrush = Ctl3dCtlColorEx(message, wParam, lParam);
return (WXHBRUSH) hbrush;
#else
return FALSE;
}
+void wxDialog::OnSize(wxSizeEvent& WXUNUSED(event))
+{
+ // if we're using constraints - do use them
+ #if wxUSE_CONSTRAINTS
+ if ( GetAutoLayout() ) {
+ Layout();
+ }
+ #endif
+}
+
void wxDialog::OnCloseWindow(wxCloseEvent& event)
{
// Compatibility
void wxDialog::OnSysColourChanged(wxSysColourChangedEvent& event)
{
-#if CTL3D
+#if wxUSE_CTL3D
Ctl3dColorChange();
#else
SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE));