-void wxFrame::DoShowWindow(
- int bShowCmd
-)
-{
- HWND hClient;
- HWND hTitlebar = NULLHANDLE;
- HWND hHScroll = NULLHANDLE;
- HWND hVScroll = NULLHANDLE;
- HWND hMenuBar = NULLHANDLE;
- SWP vSwp;
- SWP vSwpTitlebar;
- SWP vSwpVScroll;
- SWP vSwpHScroll;
- SWP vSwpMenu;
-
- //
- // Send anything to initialize the frame
- //
- WinQueryWindowPos(GetHwnd(), &vSwp);
- hClient = WinWindowFromID(GetHwnd(), FID_CLIENT);
- hTitlebar = WinWindowFromID(GetHwnd(), FID_TITLEBAR);
- WinQueryWindowPos(hTitlebar, &vSwpTitlebar);
- hHScroll = WinWindowFromID(GetHwnd(), FID_HORZSCROLL);
- WinQueryWindowPos(hHScroll, &vSwpHScroll);
- hVScroll = WinWindowFromID(GetHwnd(), FID_VERTSCROLL);
- WinQueryWindowPos(hVScroll, &vSwpVScroll);
- hMenuBar = WinWindowFromID(GetHwnd(), FID_MENU);
- WinQueryWindowPos(hMenuBar, &vSwpMenu);
- WinSetWindowPos( hClient
- ,HWND_TOP
- ,SV_CXSIZEBORDER
- ,(SV_CYSIZEBORDER - 1) + vSwpHScroll.cy
- ,vSwp.cx - ((SV_CXSIZEBORDER * 2) + vSwpVScroll.cx)
- ,vSwp.cy - ((SV_CYSIZEBORDER * 2) + 1 + vSwpTitlebar.cy + vSwpMenu.cy + vSwpHScroll.cy)
- ,SWP_SIZE | SWP_MOVE
- );
- ::WinShowWindow(GetHwnd(), (BOOL)bShowCmd);
- ::WinShowWindow(hClient, (BOOL)bShowCmd);
-} // end of wxFrame::DoShowWindow
-
-bool wxFrame::Show(
- bool bShow
-)
-{
- SWP vSwp;
-
- DoShowWindow((int)bShow);
-
- if (bShow)
- {
- wxActivateEvent vEvent(wxEVT_ACTIVATE, TRUE, m_windowId);
-
- ::WinQueryWindowPos(GetHwnd(), &vSwp);
- m_bIconized = vSwp.fl & SWP_MINIMIZE;
- ::WinEnableWindow(GetHwnd(), TRUE);
- vEvent.SetEventObject(this);
- GetEventHandler()->ProcessEvent(vEvent);
- }
- else
- {
- //
- // Try to highlight the correct window (the parent)
- //
- if (GetParent())
- {
- HWND hWndParent = GetHwndOf(GetParent());
-
- ::WinQueryWindowPos(hWndParent, &vSwp);
- m_bIconized = vSwp.fl & SWP_MINIMIZE;
- if (hWndParent)
- ::WinSetWindowPos( hWndParent
- ,HWND_TOP
- ,vSwp.x
- ,vSwp.y
- ,vSwp.cx
- ,vSwp.cy
- ,SWP_ZORDER | SWP_ACTIVATE | SWP_SHOW | SWP_MOVE
- );
- ::WinEnableWindow(hWndParent, TRUE);
- }
- }
- return TRUE;
-} // end of wxFrame::Show
-
-void wxFrame::Iconize(
- bool bIconize
-)
-{
- DoShowWindow(bIconize ? SWP_MINIMIZE : SWP_RESTORE);
-} // end of wxFrame::Iconize
-
-void wxFrame::Maximize(
- bool bMaximize)
-{
- DoShowWindow(bMaximize ? SWP_MAXIMIZE : SWP_RESTORE);
-} // end of wxFrame::Maximize
-
-void wxFrame::Restore()
-{
- DoShowWindow(SWP_RESTORE);
-} // end of wxFrame::Restore
-
-bool wxFrame::IsIconized() const
-{
- SWP vSwp;
- bool bIconic;
-
- ::WinQueryWindowPos(GetHwnd(), &vSwp);
-
- if (vSwp.fl & SWP_MINIMIZE)
- ((wxFrame*)this)->m_bIconized = TRUE;
- else
- ((wxFrame*)this)->m_bIconized = FALSE;
- return m_bIconized;
-} // end of wxFrame::IsIconized
-
-// Is it maximized?
-bool wxFrame::IsMaximized() const
-{
- SWP vSwp;
- bool bIconic;
-
- ::WinQueryWindowPos(GetHwnd(), &vSwp);
- return (vSwp.fl & SWP_MAXIMIZE);
-} // end of wxFrame::IsMaximized
-
-void wxFrame::SetIcon(
- const wxIcon& rIcon
-)