- Timestamp:
- Jun 14, 2001, 1:30:57 PM (24 years ago)
- Location:
- trunk/src/user32
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/USER32.DEF
r5993 r6008 1 ; $Id: USER32.DEF,v 1.5 6 2001-06-13 10:29:44sandervl Exp $1 ; $Id: USER32.DEF,v 1.57 2001-06-14 11:30:55 sandervl Exp $ 2 2 3 3 LIBRARY USER32 INITINSTANCE TERMINSTANCE … … 22 22 _WinQueryPointerClipRect = PMMERGE.5433 23 23 _WinSetPointerClipRect = PMMERGE.5434 24 DspInitSystemDriverName = PMGPI.656 24 25 25 26 ;;;; Present in WGSS50 -
trunk/src/user32/oslibmsg.cpp
r5805 r6008 1 /* $Id: oslibmsg.cpp,v 1.3 8 2001-05-25 19:59:29sandervl Exp $ */1 /* $Id: oslibmsg.cpp,v 1.39 2001-06-14 11:30:55 sandervl Exp $ */ 2 2 /* 3 3 * Window message translation functions for OS/2 … … 273 273 } while (eaten); 274 274 } 275 276 OS2ToWinMsgTranslate((PVOID)teb, &os2msg, pMsg, isUnicode, MSG_REMOVE); 275 if(OS2ToWinMsgTranslate((PVOID)teb, &os2msg, pMsg, isUnicode, MSG_REMOVE) == FALSE) { 276 //dispatch untranslated message immediately 277 WinDispatchMsg(teb->o.odin.hab, &os2msg); 278 //and get the next one 279 return OSLibWinGetMsg(pMsg, hwnd, uMsgFilterMin, uMsgFilterMax, isUnicode); 280 } 281 277 282 memcpy(&teb->o.odin.os2msg, &os2msg, sizeof(QMSG)); 278 283 memcpy(&teb->o.odin.winmsg, pMsg, sizeof(MSG)); -
trunk/src/user32/oslibmsgtranslate.cpp
r5935 r6008 1 /* $Id: oslibmsgtranslate.cpp,v 1.5 3 2001-06-09 14:50:18sandervl Exp $ */1 /* $Id: oslibmsgtranslate.cpp,v 1.54 2001-06-14 11:30:55 sandervl Exp $ */ 2 2 /* 3 3 * Window message translation functions for OS/2 … … 575 575 break; 576 576 default: 577 dprintf(("Unknown/unsupported SC command %d", SHORT1FROMMP(os2Msg->mp1))); 577 578 goto dummymessage; 578 579 } -
trunk/src/user32/oslibwin.cpp
r5993 r6008 1 /* $Id: oslibwin.cpp,v 1.10 0 2001-06-13 10:29:44sandervl Exp $ */1 /* $Id: oslibwin.cpp,v 1.101 2001-06-14 11:30:55 sandervl Exp $ */ 2 2 /* 3 3 * Window API wrappers for OS/2 … … 199 199 i++; 200 200 } 201 else return; //no titlebar -> no frame controls 201 202 } 202 203 if((dwStyle & WS_MINIMIZEBOX_W) || (dwStyle & WS_MAXIMIZEBOX_W) || (dwStyle & WS_SYSMENU_W)) { … … 881 882 else dwWinStyle &= ~WS_MINIMIZED; 882 883 884 if(dwStyle & WS_MAXIMIZE_W) { 885 dwWinStyle |= WS_MAXIMIZED; 886 } 887 else dwWinStyle &= ~WS_MAXIMIZED; 888 883 889 if(dwWinStyle != dwOldWinStyle) { 884 890 WinSetWindowULong(hwndFrame, QWL_STYLE, dwWinStyle); -
trunk/src/user32/pmwindow.cpp
r5993 r6008 1 /* $Id: pmwindow.cpp,v 1.13 5 2001-06-13 10:29:45sandervl Exp $ */1 /* $Id: pmwindow.cpp,v 1.136 2001-06-14 11:30:56 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Managment Code for OS/2 … … 15 15 #define INCL_GPICONTROL /* GPI control Functions */ 16 16 #define INCL_DOSPROCESS 17 #define INCL_DOSMODULEMGR 17 18 #define INCL_WINTRACKRECT 18 19 … … 51 52 //#define USE_CALCVALIDRECT 52 53 53 HMQ hmq = 0; /* Message queue handle */54 HAB hab = 0;55 56 RECTL desktopRectl = {0};57 ULONG ScreenWidth= 0;58 ULONG ScreenHeight= 0;59 ULONG ScreenBitsPerPel = 0;60 BOOL fOS2Look = FALSE;54 HMQ hmq = 0; /* Message queue handle */ 55 HAB hab = 0; 56 RECTL desktopRectl = {0}; 57 ULONG ScreenWidth = 0; 58 ULONG ScreenHeight = 0; 59 ULONG ScreenBitsPerPel = 0; 60 BOOL fOS2Look = FALSE; 61 HBITMAP hbmFrameMenu[3] = {0}; 61 62 62 63 static PFNWP pfnFrameWndProc = NULL; … … 64 65 MRESULT EXPENTRY Win32WindowProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2); 65 66 MRESULT EXPENTRY Win32FrameWindowProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2); 67 void FrameReplaceMenuItem(HWND hwndMenu, ULONG nIndex, ULONG idOld, ULONG idNew, 68 HBITMAP hbmNew); 69 70 VOID APIENTRY DspInitSystemDriverName(PSZ pszDriverName, ULONG lenDriverName); 66 71 67 72 //****************************************************************************** … … 146 151 /* create memory device context */ 147 152 hdc = DevOpenDC(hab, OD_MEMORY, "*", 5L, (PDEVOPENDATA)&dop, NULLHANDLE); 153 154 fOS2Look = PROFILE_GetOdinIniBool(ODINSYSTEM_SECTION, "OS2Look", FALSE); 155 if(fOS2Look) 156 { 157 CHAR szDisplay[30]; 158 HMODULE hModDisplay; 159 160 SYSCOLOR_Init(FALSE); //use OS/2 colors 161 162 DspInitSystemDriverName(szDisplay, sizeof(szDisplay)); 163 DosQueryModuleHandle(szDisplay, &hModDisplay); 164 165 hbmFrameMenu[0] = GpiLoadBitmap(hdc, hModDisplay, SBMP_MINBUTTON, 0, 0); 166 hbmFrameMenu[1] = GpiLoadBitmap(hdc, hModDisplay, SBMP_MAXBUTTON, 0, 0); 167 hbmFrameMenu[2] = GpiLoadBitmap(hdc, hModDisplay, SBMP_RESTOREBUTTON, 0, 0); 168 } 169 148 170 DevQueryCaps(hdc, CAPS_COLOR_BITCOUNT, 1, (PLONG)&ScreenBitsPerPel); 149 171 DevCloseDC(hdc); 150 151 fOS2Look = PROFILE_GetOdinIniBool(ODINSYSTEM_SECTION, "OS2Look", FALSE);152 if(fOS2Look) {153 SYSCOLOR_Init(FALSE); //use OS/2 colors154 }155 172 156 173 dprintf(("InitPM: Desktop (%d,%d) bpp %d", ScreenWidth, ScreenHeight, ScreenBitsPerPel)); … … 164 181 { 165 182 if(fLooks) { 183 CHAR szDisplay[30]; 184 HMODULE hModDisplay; 185 166 186 SYSCOLOR_Init(FALSE); //use OS/2 colors 187 188 if(hbmFrameMenu[0] == 0) 189 { 190 CHAR szDisplay[30]; 191 HMODULE hModDisplay; 192 HDC hdc; /* Device-context handle */ 193 DEVOPENSTRUC dop = {NULL, "DISPLAY", NULL, NULL, NULL, NULL, 194 NULL, NULL, NULL}; 195 196 /* create memory device context */ 197 hdc = DevOpenDC(hab, OD_MEMORY, "*", 5L, (PDEVOPENDATA)&dop, NULLHANDLE); 198 199 DspInitSystemDriverName(szDisplay, sizeof(szDisplay)); 200 DosQueryModuleHandle(szDisplay, &hModDisplay); 201 202 hbmFrameMenu[0] = GpiLoadBitmap(hdc, hModDisplay, SBMP_MINBUTTON, 0, 0); 203 hbmFrameMenu[1] = GpiLoadBitmap(hdc, hModDisplay, SBMP_MAXBUTTON, 0, 0); 204 hbmFrameMenu[2] = GpiLoadBitmap(hdc, hModDisplay, SBMP_RESTOREBUTTON, 0, 0); 205 DevCloseDC(hdc); 206 } 167 207 } 168 208 fOS2Look = fLooks; … … 439 479 440 480 case WM_SYSCOMMAND: 481 dprintf(("OS2: WM_SYSCOMMAND %x", hwnd)); 441 482 win32wnd->DispatchMsgA(pWinMsg); 442 483 break; … … 763 804 win32wnd->MsgPosChanging((LPARAM)&wp); 764 805 806 if(win32wnd->getOldStyle() != win32wnd->getStyle()) { 807 OSLibSetWindowStyle(win32wnd->getOS2FrameWindowHandle(), win32wnd->getOS2WindowHandle(), win32wnd->getStyle(), win32wnd->getExStyle()); 808 if(fOS2Look) { 809 DWORD dwOldStyle = win32wnd->getOldStyle(); 810 DWORD dwStyle = win32wnd->getStyle(); 811 812 if((dwOldStyle & WS_MINIMIZE_W) && !(dwStyle & WS_MINIMIZE_W)) { 813 //SC_RESTORE -> SC_MINIMIZE 814 FrameReplaceMenuItem(WinWindowFromID(hwnd, FID_MINMAX), 0, SC_RESTORE, SC_MINIMIZE, hbmFrameMenu[0]); 815 } 816 else 817 if((dwOldStyle & WS_MAXIMIZE_W) && !(dwStyle & WS_MAXIMIZE_W)) { 818 //SC_RESTORE -> SC_MAXIMIZE 819 FrameReplaceMenuItem(WinWindowFromID(hwnd, FID_MINMAX), MIT_END, SC_RESTORE, SC_MAXIMIZE, hbmFrameMenu[1]); 820 } 821 else 822 if(!(dwOldStyle & WS_MINIMIZE_W) && (dwStyle & WS_MINIMIZE_W)) { 823 //SC_MINIMIZE -> SC_RESTORE 824 FrameReplaceMenuItem(WinWindowFromID(hwnd, FID_MINMAX), 0, SC_MINIMIZE, SC_RESTORE, hbmFrameMenu[2]); 825 } 826 else 827 if(!(dwOldStyle & WS_MAXIMIZE_W) && (dwStyle & WS_MAXIMIZE_W)) { 828 //SC_MAXIMIZE -> SC_RESTORE 829 FrameReplaceMenuItem(WinWindowFromID(hwnd, FID_MINMAX), MIT_END, SC_MAXIMIZE, SC_RESTORE, hbmFrameMenu[2]); 830 } 831 } 832 } 833 765 834 if ((wp.hwndInsertAfter != wpOld.hwndInsertAfter) || 766 835 (wp.x != wpOld.x) || (wp.y != wpOld.y) || (wp.cx != wpOld.cx) || (wp.cy != wpOld.cy) || (wp.flags != wpOld.flags)) … … 1281 1350 break; 1282 1351 1352 case WM_SYSCOMMAND: 1353 dprintf(("PMFRAME: WM_SYSCOMMAND %x", win32wnd->getWindowHandle())); 1354 win32wnd->DispatchMsgA(pWinMsg); 1355 break; 1356 1283 1357 default: 1284 1358 goto RunDefFrameWndProc; … … 1368 1442 //****************************************************************************** 1369 1443 //****************************************************************************** 1444 void FrameReplaceMenuItem(HWND hwndMenu, ULONG nIndex, ULONG idOld, ULONG idNew, 1445 HBITMAP hbmNew) 1446 { 1447 MENUITEM mi; 1448 1449 if (!hwndMenu) 1450 return; 1451 1452 WinEnableWindowUpdate(hwndMenu, FALSE); 1453 1454 if (WinSendMsg(hwndMenu, MM_QUERYITEM, MPFROM2SHORT(idOld, TRUE), MPFROMP(&mi))) 1455 { 1456 WinSendMsg(hwndMenu, MM_REMOVEITEM, (MPARAM)idOld, 0); 1457 mi.afStyle = MIS_BITMAP | MIS_SYSCOMMAND; 1458 mi.afAttribute = 0; 1459 mi.hwndSubMenu = 0; 1460 mi.id = idNew; 1461 mi.hItem = (ULONG)hbmNew; 1462 WinSendMsg(hwndMenu, MM_INSERTITEM, (MPARAM)&mi, 0); 1463 } 1464 WinEnableWindowUpdate(hwndMenu, TRUE); 1465 1466 WinInvalidateRect(hwndMenu, NULL, TRUE); 1467 } 1468 //****************************************************************************** 1469 //****************************************************************************** -
trunk/src/user32/win32wbase.cpp
r6001 r6008 1 /* $Id: win32wbase.cpp,v 1.26 8 2001-06-13 17:28:07sandervl Exp $ */1 /* $Id: win32wbase.cpp,v 1.269 2001-06-14 11:30:56 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 … … 140 140 dwExStyle = 0; 141 141 dwStyle = 0; 142 dwOldStyle = 0; 142 143 win32wndproc = 0; 143 144 hInstance = 0; … … 453 454 454 455 WINPROC_SetProc((HWINDOWPROC *)&win32wndproc, windowClass->getWindowProc(), WINPROC_GetProcType(windowClass->getWindowProc()), WIN_PROC_WINDOW); 455 hInstance = cs->hInstance; 456 dwStyle = cs->style & ~WS_VISIBLE; 457 dwExStyle = cs->dwExStyle; 456 hInstance = cs->hInstance; 457 dwStyle = cs->style & ~WS_VISIBLE; 458 dwOldStyle = dwStyle; 459 dwExStyle = cs->dwExStyle; 458 460 459 461 hwndLinkAfter = ((cs->style & (WS_CHILD|WS_MAXIMIZE)) == WS_CHILD) ? HWND_BOTTOM : HWND_TOP; … … 2262 2264 wasVisible = (getStyle() & WS_VISIBLE) != 0; 2263 2265 2266 dwOldStyle = getStyle(); 2267 2264 2268 switch(nCmdShow) 2265 2269 { … … 2318 2322 case SW_SHOWDEFAULT: /* FIXME: should have its own handler */ 2319 2323 case SW_RESTORE: 2320 //TODO: WIN_RESTORE_MAX flag!!!!!!!!!!!!!!2321 2324 swp |= SWP_SHOWWINDOW | SWP_FRAMECHANGED; 2322 2325 … … 2485 2488 if(getParent()) { 2486 2489 OSLibMapWINDOWPOStoSWP(&wpos, &swp, &swpOld, getParent()->getClientHeight(), 2487 2490 OS2HwndFrame); 2488 2491 } 2489 2492 else OSLibMapWINDOWPOStoSWP(&wpos, &swp, &swpOld, OSLibQueryScreenHeight(), OS2HwndFrame); -
trunk/src/user32/win32wbase.h
r5973 r6008 1 /* $Id: win32wbase.h,v 1.1 19 2001-06-12 17:02:42sandervl Exp $ */1 /* $Id: win32wbase.h,v 1.120 2001-06-14 11:30:57 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 … … 150 150 151 151 DWORD getStyle() { return dwStyle; }; 152 DWORD getOldStyle() { return dwOldStyle; }; 152 153 void setStyle(DWORD newstyle) { dwStyle = newstyle; }; 153 154 DWORD getExStyle() { return dwExStyle; }; … … 347 348 ULONG dwExStyle; //GWL_EXSTYLE 348 349 ULONG dwStyle; //GWL_STYLE 350 ULONG dwOldStyle; //Used to determine which frame control buttons to change (OS/2 mode) 349 351 WNDPROC win32wndproc; //GWL_WNDPROC 350 352 ULONG hInstance; //GWL_HINSTANCE
Note:
See TracChangeset
for help on using the changeset viewer.