- Show(FALSE);
-
- if ( !IsModal() )
- wxModelessWindows.DeleteObject(this);
-
- // If this is the last top-level window, exit.
- if ( wxTheApp && (wxTopLevelWindows.Number() == 0) )
- {
- wxTheApp->SetTopWindow(NULL);
-
- if ( wxTheApp->GetExitOnFrameDelete() )
- {
- ::PostQuitMessage(0);
- }
- }
-}
-
-// ----------------------------------------------------------------------------
-// kbd handling
-// ----------------------------------------------------------------------------
-
-// By default, pressing escape cancels the dialog
-void wxDialog::OnCharHook(wxKeyEvent& event)
-{
- if (GetHWND())
- {
- // "Esc" works as an accelerator for the "Cancel" button, but it
- // shouldn't close the dialog which doesn't have any cancel button
- if ( (event.m_keyCode == WXK_ESCAPE) && FindWindow(wxID_CANCEL) )
- {
- wxCommandEvent cancelEvent(wxEVT_COMMAND_BUTTON_CLICKED, wxID_CANCEL);
- cancelEvent.SetEventObject( this );
- GetEventHandler()->ProcessEvent(cancelEvent);
-
- // ensure that there is another message for this window so the
- // ShowModal loop will exit and won't get stuck in GetMessage().
- ::PostMessage(GetHwnd(), WM_NULL, 0, 0);
-
- return;
- }
- }
-
- // We didn't process this event.
- event.Skip();
-}
-
-// ----------------------------------------------------------------------------
-// Windows dialog boxes can't be iconized
-// ----------------------------------------------------------------------------
-
-void wxDialog::Iconize(bool WXUNUSED(iconize))
-{
-}
-
-bool wxDialog::IsIconized() const
-{
- return FALSE;
-}
-
-// ----------------------------------------------------------------------------
-// size/position handling
-// ----------------------------------------------------------------------------
-
-void wxDialog::DoSetClientSize(int width, int height)
-{
- HWND hWnd = (HWND) GetHWND();
- RECT rect;
- ::GetClientRect(hWnd, &rect);
-
- RECT rect2;
- GetWindowRect(hWnd, &rect2);
-
- // Find the difference between the entire window (title bar and all)
- // and the client area; add this to the new client size to move the
- // window
- int actual_width = rect2.right - rect2.left - rect.right + width;
- int actual_height = rect2.bottom - rect2.top - rect.bottom + height;
-
- MoveWindow(hWnd, rect2.left, rect2.top, actual_width, actual_height, TRUE);
-
- wxSizeEvent event(wxSize(actual_width, actual_height), m_windowId);
- event.SetEventObject( this );
- GetEventHandler()->ProcessEvent(event);
-}
-
-void wxDialog::DoGetPosition(int *x, int *y) const
-{
- RECT rect;
- GetWindowRect(GetHwnd(), &rect);
-
- if ( x )
- *x = rect.left;
- if ( y )
- *y = rect.top;