From PS@chocolat.demon.co.uk Sun Jan 8 23:42:29 1995 Received: from festival.ed.ac.uk (festival.edinburgh.ac.uk) by aiai.ed.ac.uk; Sun, 8 Jan 95 23:42:25 GMT Received: from chocolat.demon.co.uk by festival.ed.ac.uk id aa17877; 8 Jan 95 23:41 GMT Date: Sun, 08 Jan 1995 23:22:34 GMT From: Paul Shirley Reply-To: PS@chocolat.demon.co.uk Message-Id: <944@chocolat.demon.co.uk> To: J.Smart@ed.ac.uk Subject: WIN32S Patches X-Mailer: PCElm 1.10 Lines: 128 Status: REO I've been working on getting wxWindows running under WIN32S, these are diffs for files in src\msw. I've define a new symbol __win32s__ to control some of it... I can't work out what symbols would get defined for WIN32S compilation (... yes too lazy to read the manual...) I'm working on makefiles to rebuild the utils at the moment. Can I suggest a new 'lib32' directory for all win32s libs (including the utils) as it A:lets me keep win16 libs as well B: simplifies the makefiles. I've built ANIMATE, MINIMAL & HELLO. Apart from the -ve slider problem in ANIMATE it seems to work. WXBUILDER starts up with a file error I will investigate but superficially it looks like it works. Anyway here are the diffs ( done with 'diff -c2' ) ------------------------------------------------------------------------ *** old\wx_main.cc Sun Oct 23 12:31:42 1994 --- wx_main.cc Wed Jan 4 03:18:06 1995 *************** *** 118,122 **** // If running on a Pen Windows system, register this app so all // EDIT controls in dialogs are replaced by HEDIT controls. ! if ((hPenWin = GetSystemMetrics (SM_PENWINDOWS)) != (HANDLE) NULL) { // We do this fancy GetProcAddress simply because we don't --- 118,122 ---- // If running on a Pen Windows system, register this app so all // EDIT controls in dialogs are replaced by HEDIT controls. ! if ((hPenWin = (HANDLE)GetSystemMetrics (SM_PENWINDOWS)) != (HANDLE) NULL) { // We do this fancy GetProcAddress simply because we don't *************** *** 346,350 **** // RegisterPenApp will automatically change that control to // an HEDIT. ! if ((hPenWin = GetSystemMetrics(SM_PENWINDOWS)) != (HANDLE)NULL) { // We do this fancy GetProcAddress simply because we don't // know if we're running Pen Windows. --- 346,350 ---- // RegisterPenApp will automatically change that control to // an HEDIT. ! if ((hPenWin = (HANDLE)GetSystemMetrics(SM_PENWINDOWS)) != (HANDLE)NULL) { // We do this fancy GetProcAddress simply because we don't // know if we're running Pen Windows. ------------------------------------------------------------------------ *** old\wx_item.cc Fri Nov 4 10:35:04 1994 --- wx_item.cc Wed Jan 4 05:38:40 1995 *************** *** 2661,2665 **** HDC dc = GetWindowDC(hWnd); GetTextMetrics(dc, &lpTextMetric); ! int extentX = (int)(::GetTextExtent(dc, (LPSTR)s, strlen(s)) + lpTextMetric.tmAveCharWidth); ReleaseDC(hWnd, dc); if (extentX > existingExtent) --- 2661,2669 ---- HDC dc = GetWindowDC(hWnd); GetTextMetrics(dc, &lpTextMetric); ! // int extentX = (int)(::GetTextExtent(dc, (LPSTR)s, strlen(s)) + lpTextMetric.tmAveCharWidth); ! //Patched for WIN32S ! SIZE tSize; ! ::GetTextExtentPoint(dc, (LPSTR)s, strlen(s), &tSize); ! int extentX = tSize.cx + lpTextMetric.tmAveCharWidth; ReleaseDC(hWnd, dc); if (extentX > existingExtent) *************** *** 2677,2681 **** int len = (int)SendMessage(hWnd, LB_GETTEXT, i, (LONG)wxBuffer); wxBuffer[len] = 0; ! int extentX = (int)(::GetTextExtent(dc, (LPSTR)wxBuffer, len) + lpTextMetric.tmAveCharWidth); if (extentX > largestExtent) largestExtent = extentX; --- 2681,2689 ---- int len = (int)SendMessage(hWnd, LB_GETTEXT, i, (LONG)wxBuffer); wxBuffer[len] = 0; ! // int extentX = (int)(::GetTextExtent(dc, (LPSTR)wxBuffer, len) + lpTextMetric.tmAveCharWidth); ! //Patch for WIN32s ! SIZE tSize; ! ::GetTextExtentPoint(dc, (LPSTR)wxBuffer, len, &tSize); ! int extentX = tSize.cx + lpTextMetric.tmAveCharWidth; if (extentX > largestExtent) largestExtent = extentX; ------------------------------------------------------------------------ *** old\wx_utils.cc Mon Oct 31 10:12:02 1994 --- wx_utils.cc Wed Jan 4 04:56:00 1995 *************** *** 225,229 **** Bool DirExists(const char *dir) { ! #ifdef WIN32 // Need to be modified later, by testing the running OS. // Currently, this works only on NT (_findfirst is not a Win32s function) --- 225,230 ---- Bool DirExists(const char *dir) { ! //PS hack to make it compile for WIN32S ! #if defined(WIN32) && !defined(__win32s__) // Need to be modified later, by testing the running OS. // Currently, this works only on NT (_findfirst is not a Win32s function) *************** *** 243,247 **** #endif ! #ifdef WIN32 #ifdef __NT__ if (FindFirstFile((LPTSTR)dir,(LPWIN32_FIND_DATA)&fileInfo)==INVALID_HANDLE_VALUE) --- 244,248 ---- #endif ! #if (defined WIN32) && !(defined __win32s__) #ifdef __NT__ if (FindFirstFile((LPTSTR)dir,(LPWIN32_FIND_DATA)&fileInfo)==INVALID_HANDLE_VALUE) ------------------------------------------------------------------------ -- Paul Shirley: SemiProfessional Coffee & Chocolate Taster