- Timestamp:
- Oct 7, 1999, 11:28:02 AM (26 years ago)
- Location:
- trunk/src/user32
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/oslibwin.cpp
r1118 r1159 1 /* $Id: oslibwin.cpp,v 1.1 2 1999-10-04 09:56:00 sandervl Exp $ */1 /* $Id: oslibwin.cpp,v 1.13 1999-10-07 09:28:00 sandervl Exp $ */ 2 2 /* 3 3 * Window API wrappers for OS/2 … … 693 693 //****************************************************************************** 694 694 //****************************************************************************** 695 BOOL OSLibWinShowScrollBar(HWND hwndParent, int scrollBar, BOOL fShow) 696 { 697 HWND hwndScroll; 698 699 if(scrollBar == OSLIB_VSCROLL) { 700 hwndScroll = WinWindowFromID(hwndParent, FID_VERTSCROLL); 695 BOOL OSLibWinShowScrollBar(HWND hwndParent, HWND hwndScroll, int scrollBar, BOOL fShow) 696 { 697 if(hwndScroll == NULL) { 698 dprintf(("OSLibWinShowScrollBar: scrollbar %d (parent %x) not found!", scrollBar, hwndParent)); 699 return FALSE; 701 700 } 702 else hwndScroll = WinWindowFromID(hwndParent, FID_HORZSCROLL); 703 704 if(hwndScroll == NULL) 705 return FALSE; 706 707 if(fShow != WinIsWindowVisible(hwndScroll)) { 708 WinShowWindow(hwndScroll, fShow); 701 702 if(fShow != WinIsWindowVisible(hwndScroll)) 703 { 704 WinSetParent(hwndScroll, fShow ? hwndParent : HWND_OBJECT, FALSE); 705 WinSendMsg(hwndParent, WM_UPDATEFRAME, 706 MPFROMLONG( ( scrollBar == OSLIB_VSCROLL ) ? FCF_VERTSCROLL 707 : FCF_HORZSCROLL), 708 MPVOID ); 709 710 WinShowWindow(hwndScroll, fShow); 709 711 } 710 712 return TRUE; … … 712 714 //****************************************************************************** 713 715 //****************************************************************************** 714 ULONG OSLibWinGetScrollPos(HWND hwndParent, int scrollBar) 715 { 716 HWND hwndScroll; 717 716 HWND OSLibWinQueryScrollBarHandle(HWND hwndParent, int scrollBar) 717 { 718 718 if(scrollBar == OSLIB_VSCROLL) { 719 hwndScroll =WinWindowFromID(hwndParent, FID_VERTSCROLL);719 return WinWindowFromID(hwndParent, FID_VERTSCROLL); 720 720 } 721 else hwndScroll = WinWindowFromID(hwndParent, FID_HORZSCROLL); 722 721 else return WinWindowFromID(hwndParent, FID_HORZSCROLL); 722 } 723 //****************************************************************************** 724 //****************************************************************************** 725 ULONG OSLibWinGetScrollPos(HWND hwndParent, HWND hwndScroll) 726 { 723 727 if(hwndScroll == NULL) 724 728 return 0; … … 728 732 //****************************************************************************** 729 733 //****************************************************************************** 730 ULONG OSLibWinSetScrollPos(HWND hwndParent, int scrollBar, int pos, int fRedraw) 731 { 732 HWND hwndScroll; 734 ULONG OSLibWinSetScrollPos(HWND hwndParent, HWND hwndScroll, int pos, int fRedraw) 735 { 733 736 ULONG oldPos; 734 735 if(scrollBar == OSLIB_VSCROLL) {736 hwndScroll = WinWindowFromID(hwndParent, FID_VERTSCROLL);737 }738 else hwndScroll = WinWindowFromID(hwndParent, FID_HORZSCROLL);739 737 740 738 if(hwndScroll == NULL) … … 750 748 //****************************************************************************** 751 749 //****************************************************************************** 752 BOOL OSLibWinSetScrollRange(HWND hwndParent, int scrollBar, int minpos,750 BOOL OSLibWinSetScrollRange(HWND hwndParent, HWND hwndScroll, int minpos, 753 751 int maxpos, int fRedraw) 754 752 { 755 HWND hwndScroll;756 757 if(scrollBar == OSLIB_VSCROLL) {758 hwndScroll = WinWindowFromID(hwndParent, FID_VERTSCROLL);759 }760 else hwndScroll = WinWindowFromID(hwndParent, FID_HORZSCROLL);761 762 753 if(hwndScroll == NULL) 763 754 return 0; … … 769 760 //****************************************************************************** 770 761 //****************************************************************************** 771 BOOL OSLibWinSetScrollPageSize(HWND hwndParent, int scrollBar, int pagesize,762 BOOL OSLibWinSetScrollPageSize(HWND hwndParent, HWND hwndScroll, int pagesize, 772 763 int totalsize, int fRedraw) 773 764 { 774 HWND hwndScroll;775 776 if(scrollBar == OSLIB_VSCROLL) {777 hwndScroll = WinWindowFromID(hwndParent, FID_VERTSCROLL);778 }779 else hwndScroll = WinWindowFromID(hwndParent, FID_HORZSCROLL);780 781 765 if(hwndScroll == NULL) 782 766 return 0; … … 889 873 //****************************************************************************** 890 874 //****************************************************************************** 875 BOOL OSLibSetWindowID(HWND hwnd, ULONG value) 876 { 877 dprintf(("OSLibSetWindowID hwnd:%x ID:%x", hwnd, value)); 878 return WinSetWindowULong(hwnd, QWS_ID, value); 879 } 880 //****************************************************************************** 881 //****************************************************************************** -
trunk/src/user32/oslibwin.h
r1118 r1159 1 /* $Id: oslibwin.h,v 1. 8 1999-10-04 09:56:00sandervl Exp $ */1 /* $Id: oslibwin.h,v 1.9 1999-10-07 09:28:01 sandervl Exp $ */ 2 2 /* 3 3 * Window API wrappers for OS/2 … … 44 44 BOOL OSLibWinSetWindowULong(HWND hwnd, ULONG offset, ULONG value); 45 45 ULONG OSLibWinGetWindowULong(HWND hwnd, ULONG offset); 46 BOOL OSLibSetWindowID(HWND hwnd, ULONG value); 46 47 47 48 BOOL OSLibPostMessage(HWND hwnd, ULONG msg, ULONG wParam, ULONG lParam); … … 248 249 #define OSLIB_VSCROLL 1 249 250 BOOL OSLibWinEnableScrollBar(HWND hwndParent, int scrollBar, BOOL fEnable); 250 BOOL OSLibWinShowScrollBar(HWND hwndParent, int scrollBar, BOOL fShow); 251 ULONG OSLibWinGetScrollPos(HWND hwndParent, int scrollBar); 252 ULONG OSLibWinSetScrollPos(HWND hwndParent, int scrollBar, int pos, int fRedraw); 253 BOOL OSLibWinSetScrollRange(HWND hwndParent, int scrollBar, int minpos, 251 BOOL OSLibWinShowScrollBar(HWND hwndParent, HWND hwndScroll, int scrollBar, BOOL fShow); 252 HWND OSLibWinQueryScrollBarHandle(HWND hwndParent, int scrollBar); 253 ULONG OSLibWinGetScrollPos(HWND hwndParent, HWND hwndScroll); 254 ULONG OSLibWinSetScrollPos(HWND hwndParent, HWND hwndScroll, int pos, int fRedraw); 255 BOOL OSLibWinSetScrollRange(HWND hwndParent, HWND hwndScroll, int minpos, 254 256 int maxpos, int fRedraw); 255 BOOL OSLibWinSetScrollPageSize(HWND hwndParent, int scrollBar, int pagesize,257 BOOL OSLibWinSetScrollPageSize(HWND hwndParent, HWND hwndScroll, int pagesize, 256 258 int totalsize, int fRedraw); 257 259 -
trunk/src/user32/pmwindow.cpp
r1154 r1159 1 /* $Id: pmwindow.cpp,v 1.1 5 1999-10-06 10:36:39 dengertExp $ */1 /* $Id: pmwindow.cpp,v 1.16 1999-10-07 09:28:01 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Managment Code for OS/2 … … 776 776 PSZ wintext; 777 777 778 if(wndpars->fsStatus & (WPM_CCHTEXT | WPM_TEXT)) { 778 if(wndpars->fsStatus & (WPM_CCHTEXT | WPM_TEXT)) 779 { 779 780 if(wndpars->fsStatus & WPM_CCHTEXT) 780 781 wndpars->cchText = win32wnd->MsgGetTextLength(); 781 782 if(wndpars->fsStatus & WPM_TEXT) 782 783 wndpars->pszText = win32wnd->MsgGetText(); 784 785 wndpars->fsStatus = 0; 786 wndpars->cbCtlData = 0; 787 wndpars->cbPresParams = 0; 788 RestoreOS2TIB(); 783 789 return (MRESULT)TRUE; 784 790 } -
trunk/src/user32/scroll.cpp
r1091 r1159 1 /* $Id: scroll.cpp,v 1. 4 1999-09-29 08:27:15sandervl Exp $ */1 /* $Id: scroll.cpp,v 1.5 1999-10-07 09:28:01 sandervl Exp $ */ 2 2 /* 3 3 * Scrollbar control … … 1554 1554 1555 1555 if(nBar == SB_HORZ || nBar == SB_BOTH) 1556 rc = OSLibWinShowScrollBar(window->getOS2FrameWindowHandle(), OSLIB_HSCROLL, fShow); 1556 rc = OSLibWinShowScrollBar(window->getOS2FrameWindowHandle(), 1557 window->getHorzScrollHandle(), 1558 OSLIB_HSCROLL, fShow); 1557 1559 1558 1560 if(nBar == SB_VERT || ( rc == TRUE && nBar == SB_BOTH)) 1559 rc = OSLibWinShowScrollBar(window->getOS2FrameWindowHandle(), OSLIB_VSCROLL, fShow); 1561 rc = OSLibWinShowScrollBar(window->getOS2FrameWindowHandle(), 1562 window->getVertScrollHandle(), 1563 OSLIB_VSCROLL, fShow); 1560 1564 1561 1565 return rc; -
trunk/src/user32/win32wbase.cpp
r1148 r1159 1 /* $Id: win32wbase.cpp,v 1.2 5 1999-10-06 07:56:37sandervl Exp $ */1 /* $Id: win32wbase.cpp,v 1.26 1999-10-07 09:28:01 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 … … 126 126 horzScrollInfo = NULL; 127 127 vertScrollInfo = NULL; 128 128 hwndHorzScroll = 0; 129 hwndVertScroll = 0; 129 130 } 130 131 //****************************************************************************** … … 160 161 horzScrollInfo = NULL; 161 162 } 163 //TODO: Destroy windows if they're not associated with our window anymore (showwindow false)? 164 // hwndHorzScroll 165 // hwndVertScroll 166 162 167 } 163 168 //****************************************************************************** … … 475 480 #endif 476 481 482 if (cs->style & WS_HSCROLL) 483 { 484 hwndHorzScroll = OSLibWinQueryScrollBarHandle(OS2HwndFrame, OSLIB_HSCROLL); 485 } 486 487 if (cs->style & WS_VSCROLL) { 488 hwndVertScroll = OSLibWinQueryScrollBarHandle(OS2HwndFrame, OSLIB_VSCROLL); 489 } 490 477 491 fakeWinBase.hwndThis = OS2Hwnd; 478 492 fakeWinBase.pWindowClass = windowClass; … … 491 505 } 492 506 } 493 else windowId = (UINT)cs->hMenu; 507 else 508 { 509 setWindowId((DWORD)cs->hMenu); 510 } 494 511 495 512 //Set icon from class … … 1258 1275 case SB_HORZ: 1259 1276 if(horzScrollInfo) { 1260 horzScrollInfo->CurVal = OSLibWinGetScrollPos(OS2HwndFrame, OSLIB_HSCROLL);1277 horzScrollInfo->CurVal = OSLibWinGetScrollPos(OS2HwndFrame, hwndHorzScroll); 1261 1278 return horzScrollInfo; 1262 1279 } … … 1264 1281 case SB_VERT: 1265 1282 if(vertScrollInfo) { 1266 vertScrollInfo->CurVal = OSLibWinGetScrollPos(OS2HwndFrame, OSLIB_VSCROLL);1283 vertScrollInfo->CurVal = OSLibWinGetScrollPos(OS2HwndFrame, hwndVertScroll); 1267 1284 return vertScrollInfo; 1268 1285 } … … 1277 1294 { 1278 1295 SCROLLBAR_INFO *infoPtr; 1296 HWND hwndScroll; 1279 1297 ULONG scrollType; 1280 1298 int new_flags; … … 1286 1304 } 1287 1305 infoPtr = horzScrollInfo; 1306 hwndScroll = hwndHorzScroll; 1288 1307 scrollType = OSLIB_HSCROLL; 1289 1308 break; … … 1293 1312 } 1294 1313 infoPtr = vertScrollInfo; 1314 hwndScroll = hwndVertScroll; 1295 1315 scrollType = OSLIB_VSCROLL; 1296 1316 break; … … 1309 1329 { 1310 1330 infoPtr->Page = info->nPage; 1311 OSLibWinSetScrollPageSize(OS2HwndFrame, scrollType, info->nPage, infoPtr->MaxVal, fRedraw);1331 OSLibWinSetScrollPageSize(OS2HwndFrame, hwndScroll, info->nPage, infoPtr->MaxVal, fRedraw); 1312 1332 } 1313 1333 } … … 1319 1339 { 1320 1340 infoPtr->CurVal = info->nPos; 1321 OSLibWinSetScrollPos(OS2HwndFrame, scrollType, info->nPos, fRedraw);1341 OSLibWinSetScrollPos(OS2HwndFrame, hwndScroll, info->nPos, fRedraw); 1322 1342 } 1323 1343 } … … 1341 1361 infoPtr->MaxVal = info->nMax; 1342 1362 1343 OSLibWinSetScrollRange(OS2HwndFrame, scrollType, info->nMin, info->nMax, fRedraw);1363 OSLibWinSetScrollRange(OS2HwndFrame, hwndScroll, info->nMin, info->nMax, fRedraw); 1344 1364 } 1345 1365 } … … 2381 2401 case GWL_HWNDPARENT: 2382 2402 return SetParent((HWND)value); 2383 2384 2403 case GWL_ID: 2385 2404 oldval = getWindowId(); … … 2460 2479 //****************************************************************************** 2461 2480 //****************************************************************************** 2481 void Win32BaseWindow::setWindowId(DWORD id) 2482 { 2483 windowId = id; 2484 OSLibSetWindowID(OS2HwndFrame, id); 2485 } 2486 //****************************************************************************** 2487 //****************************************************************************** 2462 2488 Win32BaseWindow *Win32BaseWindow::GetWindowFromHandle(HWND hwnd) 2463 2489 { -
trunk/src/user32/win32wbase.h
r1133 r1159 1 /* $Id: win32wbase.h,v 1.1 3 1999-10-04 20:53:46sandervl Exp $ */1 /* $Id: win32wbase.h,v 1.14 1999-10-07 09:28:02 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 … … 114 114 void setWindowProc(WNDPROC newproc) { win32wndproc = newproc; }; 115 115 DWORD getWindowId() { return windowId; }; 116 void setWindowId(DWORD id) { windowId = id; };116 void setWindowId(DWORD id); 117 117 ULONG getWindowHeight() { return rectClient.bottom - rectClient.top; }; 118 118 ULONG getWindowWidth() { return rectClient.right - rectClient.left; }; … … 179 179 SCROLLBAR_INFO *getScrollInfo(int nBar); 180 180 LONG setScrollInfo(int nBar, SCROLLINFO *info, int fRedraw); 181 HWND getVertScrollHandle() { return hwndVertScroll; }; 182 HWND getHorzScrollHandle() { return hwndHorzScroll; }; 181 183 182 184 LRESULT SendMessageA(ULONG msg, WPARAM wParam, LPARAM lParam); … … 252 254 SCROLLBAR_INFO *vertScrollInfo; 253 255 SCROLLBAR_INFO *horzScrollInfo; 256 HWND hwndHorzScroll; //os/2 handle 257 HWND hwndVertScroll; //os/2 handle 254 258 255 259 Win32WndClass *windowClass; -
trunk/src/user32/win32wmdichild.cpp
r1093 r1159 1 /* $Id: win32wmdichild.cpp,v 1. 2 1999-09-29 09:16:32 sandervl Exp $ */1 /* $Id: win32wmdichild.cpp,v 1.3 1999-10-07 09:28:02 sandervl Exp $ */ 2 2 /* 3 3 * Win32 MDI Child Window Class for OS/2 … … 326 326 } 327 327 328 hwnd = ::CreateWindowA(cs->szClass, cs->szTitle, style, 329 cs->x, cs->y, cs->cx, cs->cy, client->getWindowHandle(), 330 (HMENU)wIDmenu, cs->hOwner, cs ); 328 if(!client->IsUnicode()) 329 hwnd = ::CreateWindowA(cs->szClass, cs->szTitle, style, 330 cs->x, cs->y, cs->cx, cs->cy, client->getWindowHandle(), 331 (HMENU)wIDmenu, cs->hOwner, cs ); 332 else 333 hwnd = ::CreateWindowW((LPWSTR)cs->szClass, (LPWSTR)cs->szTitle, style, 334 cs->x, cs->y, cs->cx, cs->cy, client->getWindowHandle(), 335 (HMENU)wIDmenu, cs->hOwner, cs ); 331 336 332 337 /* MDI windows are WS_CHILD so they won't be activated by CreateWindow */ -
trunk/src/user32/window.cpp
r1063 r1159 1 /* $Id: window.cpp,v 1.1 0 1999-09-26 14:44:58sandervl Exp $ */1 /* $Id: window.cpp,v 1.11 1999-10-07 09:28:02 sandervl Exp $ */ 2 2 /* 3 3 * Win32 window apis for OS/2 … … 174 174 //TODO: According to the docs className can be a 16 bits atom 175 175 // Wine seems to assume it's a string though... 176 if(!str icmp(className, MDICLIENTCLASSNAMEA)) {176 if(!strcmpi(className, MDICLIENTCLASSNAMEA)) { 177 177 window = (Win32BaseWindow *) new Win32MDIClientWindow(&cs, classAtom, FALSE); 178 178 } … … 238 238 //TODO: According to the docs className can be a 16 bits atom 239 239 // Wine seems to assume it's a string though... 240 if(!lstrcmp W(className, (LPWSTR)MDICLIENTCLASSNAMEW)) {240 if(!lstrcmpiW(className, (LPWSTR)MDICLIENTCLASSNAMEW)) { 241 241 window = (Win32BaseWindow *) new Win32MDIClientWindow(&cs, classAtom, TRUE); 242 242 } … … 784 784 BOOL rc; 785 785 786 #if 1 786 787 hwnd = Win32BaseWindow::Win32ToOS2Handle(hwnd); 787 788 rc = OSLibWinQueryWindowRect(hwnd, pRect); 788 789 dprintf(("USER32: GetClientRect of %X returned (%d,%d) (%d,%d)\n", hwnd, pRect->left, pRect->top, pRect->right, pRect->bottom)); 789 790 return rc; 791 #else 792 Win32BaseWindow *window; 793 794 window = Win32BaseWindow::GetWindowFromHandle(hwnd); 795 if(!window) { 796 dprintf(("GetClientRect, window %x not found", hwnd)); 797 SetLastError(ERROR_INVALID_WINDOW_HANDLE); 798 return 0; 799 } 800 *pRect = *window->getClientRect(); 801 dprintf(("GetClientRect of %X returned (%d,%d) (%d,%d)\n", hwnd, pRect->left, pRect->top, pRect->right, pRect->bottom)); 802 return TRUE; 803 #endif 790 804 } 791 805 //******************************************************************************
Note:
See TracChangeset
for help on using the changeset viewer.