From b0c89ddf397e8b240839b09d27ea8d683ba9c880 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Fri, 15 Jun 2001 13:34:06 +0000 Subject: [PATCH] Moved metafile helpers from utilsexc.cpp to utils.cpp -- seemed more appropriate! git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10583 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/utils.cpp | 38 ++++++++++++++++++++++++++++++++++++++ src/msw/utilsexc.cpp | 37 ------------------------------------- 2 files changed, 38 insertions(+), 37 deletions(-) diff --git a/src/msw/utils.cpp b/src/msw/utils.cpp index 171942f093..215806852d 100644 --- a/src/msw/utils.cpp +++ b/src/msw/utils.cpp @@ -1184,6 +1184,44 @@ WXWORD WXDLLEXPORT wxGetWindowId(WXHWND hWnd) #endif // wxUSE_GUI +#if wxUSE_GUI + +// ---------------------------------------------------------------------------- +// Metafile helpers +// ---------------------------------------------------------------------------- + +extern void PixelToHIMETRIC(LONG *x, LONG *y) +{ + ScreenHDC hdcRef; + + int iWidthMM = GetDeviceCaps(hdcRef, HORZSIZE), + iHeightMM = GetDeviceCaps(hdcRef, VERTSIZE), + iWidthPels = GetDeviceCaps(hdcRef, HORZRES), + iHeightPels = GetDeviceCaps(hdcRef, VERTRES); + + *x *= (iWidthMM * 100); + *x /= iWidthPels; + *y *= (iHeightMM * 100); + *y /= iHeightPels; +} + +extern void HIMETRICToPixel(LONG *x, LONG *y) +{ + ScreenHDC hdcRef; + + int iWidthMM = GetDeviceCaps(hdcRef, HORZSIZE), + iHeightMM = GetDeviceCaps(hdcRef, VERTSIZE), + iWidthPels = GetDeviceCaps(hdcRef, HORZRES), + iHeightPels = GetDeviceCaps(hdcRef, VERTRES); + + *x *= iWidthPels; + *x /= (iWidthMM * 100); + *y *= iHeightPels; + *y /= (iHeightMM * 100); +} + +#endif // wxUSE_GUI + #if 0 //------------------------------------------------------------------------ // wild character routines diff --git a/src/msw/utilsexc.cpp b/src/msw/utilsexc.cpp index 0f9349287b..628d647ac2 100644 --- a/src/msw/utilsexc.cpp +++ b/src/msw/utilsexc.cpp @@ -768,40 +768,3 @@ long wxExecute(char **argv, bool sync, wxProcess *handler) return wxExecute(command, sync, handler); } -#if wxUSE_GUI - -// ---------------------------------------------------------------------------- -// Metafile helpers -// ---------------------------------------------------------------------------- - -extern void PixelToHIMETRIC(LONG *x, LONG *y) -{ - ScreenHDC hdcRef; - - int iWidthMM = GetDeviceCaps(hdcRef, HORZSIZE), - iHeightMM = GetDeviceCaps(hdcRef, VERTSIZE), - iWidthPels = GetDeviceCaps(hdcRef, HORZRES), - iHeightPels = GetDeviceCaps(hdcRef, VERTRES); - - *x *= (iWidthMM * 100); - *x /= iWidthPels; - *y *= (iHeightMM * 100); - *y /= iHeightPels; -} - -extern void HIMETRICToPixel(LONG *x, LONG *y) -{ - ScreenHDC hdcRef; - - int iWidthMM = GetDeviceCaps(hdcRef, HORZSIZE), - iHeightMM = GetDeviceCaps(hdcRef, VERTSIZE), - iWidthPels = GetDeviceCaps(hdcRef, HORZRES), - iHeightPels = GetDeviceCaps(hdcRef, VERTRES); - - *x *= iWidthPels; - *x /= (iWidthMM * 100); - *y *= iHeightPels; - *y /= (iHeightMM * 100); -} - -#endif // wxUSE_GUI -- 2.47.2