wxWindow::OnSysColourChanged(rEvent);
} // end of wxFrame::OnSysColourChanged
+// Pass TRUE to show full screen, FALSE to restore.
+bool wxFrame::ShowFullScreen(
+ bool bShow
+, long lStyle
+)
+{
+ /*
+ // TODO
+ if (show)
+ {
+ if (IsFullScreen())
+ return FALSE;
+
+ m_fsIsShowing = TRUE;
+ m_fsStyle = style;
+
+ wxToolBar *theToolBar = GetToolBar();
+ wxStatusBar *theStatusBar = GetStatusBar();
+
+ int dummyWidth;
+
+ if (theToolBar)
+ theToolBar->GetSize(&dummyWidth, &m_fsToolBarHeight);
+ if (theStatusBar)
+ theStatusBar->GetSize(&dummyWidth, &m_fsStatusBarHeight);
+
+ // zap the toolbar, menubar, and statusbar
+
+ if ((style & wxFULLSCREEN_NOTOOLBAR) && theToolBar)
+ {
+ theToolBar->SetSize(-1,0);
+ theToolBar->Show(FALSE);
+ }
+
+ if (style & wxFULLSCREEN_NOMENUBAR)
+ SetMenu((HWND)GetHWND(), (HMENU) NULL);
+
+ // Save the number of fields in the statusbar
+ if ((style & wxFULLSCREEN_NOSTATUSBAR) && theStatusBar)
+ {
+ m_fsStatusBarFields = theStatusBar->GetFieldsCount();
+ SetStatusBar((wxStatusBar*) NULL);
+ delete theStatusBar;
+ }
+ else
+ m_fsStatusBarFields = 0;
+
+ // zap the frame borders
+
+ // save the 'normal' window style
+ m_fsOldWindowStyle = GetWindowLong((HWND)GetHWND(), GWL_STYLE);
+
+ // save the old position, width & height, maximize state
+ m_fsOldSize = GetRect();
+ m_fsIsMaximized = IsMaximized();
+
+ // decide which window style flags to turn off
+ LONG newStyle = m_fsOldWindowStyle;
+ LONG offFlags = 0;
+
+ if (style & wxFULLSCREEN_NOBORDER)
+ offFlags |= WS_BORDER;
+ if (style & wxFULLSCREEN_NOCAPTION)
+ offFlags |= (WS_CAPTION | WS_SYSMENU);
+
+ newStyle &= (~offFlags);
+
+ // change our window style to be compatible with full-screen mode
+ SetWindowLong((HWND)GetHWND(), GWL_STYLE, newStyle);
+
+ // resize to the size of the desktop
+ int width, height;
+
+ RECT rect;
+ ::GetWindowRect(GetDesktopWindow(), &rect);
+ width = rect.right - rect.left;
+ height = rect.bottom - rect.top;
+
+ SetSize(width, height);
+
+ // now flush the window style cache and actually go full-screen
+ SetWindowPos((HWND)GetHWND(), HWND_TOP, 0, 0, width, height, SWP_FRAMECHANGED);
+
+ wxSizeEvent event(wxSize(width, height), GetId());
+ GetEventHandler()->ProcessEvent(event);
+
+ return TRUE;
+ }
+ else
+ {
+ if (!IsFullScreen())
+ return FALSE;
+
+ m_fsIsShowing = FALSE;
+
+ wxToolBar *theToolBar = GetToolBar();
+
+ // restore the toolbar, menubar, and statusbar
+ if (theToolBar && (m_fsStyle & wxFULLSCREEN_NOTOOLBAR))
+ {
+ theToolBar->SetSize(-1, m_fsToolBarHeight);
+ theToolBar->Show(TRUE);
+ }
+
+ if ((m_fsStyle & wxFULLSCREEN_NOSTATUSBAR) && (m_fsStatusBarFields > 0))
+ {
+ CreateStatusBar(m_fsStatusBarFields);
+ PositionStatusBar();
+ }
+
+ if ((m_fsStyle & wxFULLSCREEN_NOMENUBAR) && (m_hMenu != 0))
+ SetMenu((HWND)GetHWND(), (HMENU)m_hMenu);
+
+ Maximize(m_fsIsMaximized);
+ SetWindowLong((HWND)GetHWND(),GWL_STYLE, m_fsOldWindowStyle);
+ SetWindowPos((HWND)GetHWND(),HWND_TOP,m_fsOldSize.x, m_fsOldSize.y,
+ m_fsOldSize.width, m_fsOldSize.height, SWP_FRAMECHANGED);
+
+ return TRUE;
+ }
+*/
+ return TRUE;
+} // end of wxFrame::ShowFullScreen
+
//
// Frame window
//
wxAssociateWinWithHandle(hwnd, this);
- m_fnOldWndProc = (WXFARPROC) ::WinSubclassWindow(hwnd, wxWndProc);
- ::WinSetWindowULong(hwnd, QWS_USER, wxWndProc);
+ m_fnOldWndProc = (WXFARPROC) ::WinSubclassWindow(hwnd, (PFNWP)wxWndProc);
+ ::WinSetWindowULong(hwnd, QWS_USER, (ULONG)wxWndProc);
} // end of wxWindow::SubclassWin
void wxWindow::UnsubclassWin()
//
WXDWORD wxWindow::Determine3DEffects(
WXDWORD dwDefaultBorderStyle
-, YBool* pbWant3D
+, bool* pbWant3D
) const
{
- WXDWORD dwStyle = 0L;
-
+ WXDWORD dwStyle = 0L;
+
//
// Native PM does not have any specialize 3D effects like WIN32 does
//
if (::WinGetKeyState(HWND_DESKTOP, VK_SHIFT) != 0)
nState |= VK_SHIFT;
- if (::WinGetKeyState(HWND_DESKTOP, VK_CTRL) != 0;
+ if (::WinGetKeyState(HWND_DESKTOP, VK_CTRL) != 0);
nState |= VK_CTRL;
wxMouseEvent rEvent(wxEVT_LEAVE_WINDOW);
,vPoint.y
,nState
);
- (void)GetEventHandler()->ProcessEvent(event);
+ (void)GetEventHandler()->ProcessEvent(rEvent);
}
}
UpdateWindowUI();
RECTL vOs2Rect;
vOs2Rect.xLeft = pRect->x;
- vOS2Rect.yTop = pRect->y;
+ vOs2Rect.yTop = pRect->y;
vOs2Rect.xRight = pRect->x + pRect->width;
vOs2Rect.yBottom = pRect->y + pRect->height;
wxDropTarget* pDropTarget
)
{
- if (m_dropTarget != 0)
+ if (m_dropTarget != 0)
{
m_dropTarget->Revoke(m_hWnd);
delete m_dropTarget;
HWND hWnd = GetHwnd();
if (hWnd && bAccept)
- ::DragAcceptDroppedFiles(hWnd, NULL, NULL, DO_COPY, 0L);
+ ::DrgAcceptDroppedFiles(hWnd, NULL, NULL, DO_COPY, 0L);
} // end of wxWindow::DragAcceptFiles
// ----------------------------------------------------------------------------
{
wxWindowBase::DoSetToolTip(pTooltip);
- if (m_pTooltip)
+ if (m_tooltip)
m_tooltip->SetWindow(this);
} // end of wxWindow::DoSetToolTip
// ---------------------------------------------------------------------------
// Get total size
-void wxWindow::DoGetSize(
+void wxWindow::DoGetSize(
int* pWidth
, int* pHeight
) const
{
RECTL vRect2;
- ::WinQueryWindowRect(hParentWnd, vRect2);
+ ::WinQueryWindowRect(hParentWnd, &vRect2);
vPoint.x -= vRect.xLeft;
vPoint.y -= vRect.yBottom;
}
if (pX)
*pX = vPoint.x;
- if y)
+ if (pY)
*pY = vPoint.y;
} // end of wxWindow::DoGetPosition
) const
{
HWND hWnd = GetHwnd();
- RECTL vRect;
+ SWP vSwp;
+
+ ::WinQueryWindowPos(hWnd, &vSwp);
- ::WinQueryWindowPos(hWnd, &vRect);
-
if (pX)
- *pX -= vRect.xLeft;
+ *pX -= vSwp.x;
if (pY)
- *pY -= vRect.yBottom;
+ *pY -= vSwp.y;
} // end of wxWindow::DoScreenToClient
void wxWindow::DoClientToScreen(
) const
{
HWND hWnd = GetHwnd();
- RECTL vRect;
+ SWP vSwp;
- ::WinQueryWindowPos(hWnd, &vRect);
+ ::WinQueryWindowPos(hWnd, &vSwp);
if (pX)
- *pX += vRect.xLeft;
+ *pX += vSwp.x;
if (pY)
- *pY += vRect.yBottom;
+ *pY += vSwp.y;
} // end of wxWindow::DoClientToScreen
//
hWndClient = ::WinWindowFromID(GetHwnd(), FID_CLIENT);
::WinQueryWindowRect(hWndClient, &vRect);
- if (pX)
+ if (pWidth)
*pWidth = vRect.xRight;
- if (pY)
+ if (pHeight)
*pHeight = vRect.yTop;
} // end of wxWindow::DoGetClientSize
, int nHeight
)
{
- ::WinSetWindowPos(
- if ( !::MoveWindow( GetHwnd()
- ,HWND_TOP
- ,(LONG)nX
- ,(LONG)nY
- ,(LONG)nWidth
- ,(LONG)nHeight
- ,SWP_SIZE | SWP_MOVE
- ,
- ))
+ if ( !::WinSetWindowPos( GetHwnd()
+ ,HWND_TOP
+ ,(LONG)nX
+ ,(LONG)nY
+ ,(LONG)nWidth
+ ,(LONG)nHeight
+ ,SWP_SIZE | SWP_MOVE
+ ))
{
wxLogLastError("MoveWindow");
}
int nCurrentY;
int nCurrentWidth;
int nCurrentHeight;
- wxSize size(-1, -1);
+ wxSize vSize(-1, -1);
GetPosition( &nCurrentX
,&nCurrentY
//
// ... and don't do anything (avoiding flicker) if it's already ok
//
- if ( nX == nCurrentX &&
+ if ( nX == nCurrentX &&
nY == nCurrentY &&
- nWidth == nCurrentWidth &&
+ nWidth == nCurrentWidth &&
nHeight == nCurrentHeight
)
{
if (nX == -1 && !(nSizeFlags & wxSIZE_ALLOW_MINUS_ONE))
nX = nCurrentX;
- if (y == -1 && !(nSizeFlags & wxSIZE_ALLOW_MINUS_ONE))
+ if (nY == -1 && !(nSizeFlags & wxSIZE_ALLOW_MINUS_ONE))
nY = nCurrentY;
AdjustForParentClientOrigin( nX
RECT vRect2;
RECT vRect3;
- hWndClient = ::WinWindowFromID(GetHwnd(), FID_CLIENT);
+ hClientWnd = ::WinWindowFromID(GetHwnd(), FID_CLIENT);
::WinQueryWindowRect(hClientWnd, &vRect2);
if (pParent)
if (pParent)
{
vPoint.x -= vRect3.xLeft;
- vPoint.y -= vRect3.xBottom;
+ vPoint.y -= vRect3.yBottom;
}
DoMoveWindow( vPoint.x
if (!(nSizeFlags & wxSIZE_NO_ADJUSTMENTS) && pParent)
{
wxPoint vPoint(pParent->GetClientAreaOrigin());
- rX += vPoint.x;
+ rX += vPoint.x;
rY += vPoint.y;
}
}
hPs = ::WinGetPS(GetHwnd());
- if(!GipQueryFontMetrics(hPs, sizeof(FONTMETIRCS), &vFontMetrics);
+ if(!GpiQueryFontMetrics(hPs, sizeof(FONTMETRICS), &vFontMetrics))
return (0);
else
return(vFontMetrics.lMaxAscender + vFontMetrics.lMaxDescender);
int wxWindow::GetCharWidth() const
{
+ HPS hPs;
+ FONTMETRICS vFontMetrics;
+
hPs = ::WinGetPS(GetHwnd());
- if(!GipQueryFontMetrics(hPs, sizeof(FONTMETIRCS), &vFontMetrics);
+ if(!GpiQueryFontMetrics(hPs, sizeof(FONTMETRICS), &vFontMetrics))
return (0);
else
return(vFontMetrics.lAveCharWidth);
::WinReleasePS(hPs);
} // end of wxWindow::GetCharWidth
-void wxWindow::GetTextExtent(
+void wxWindow::GetTextExtent(
const wxString& rString
, int* pX
, int* pY