Changeset 1333 for trunk/src/user32/win32wbase.cpp
- Timestamp:
- Oct 17, 1999, 2:17:46 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/win32wbase.cpp
r1322 r1333 1 /* $Id: win32wbase.cpp,v 1.4 7 1999-10-16 14:51:42 sandervlExp $ */1 /* $Id: win32wbase.cpp,v 1.48 1999-10-17 12:17:45 cbratschi Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 … … 40 40 #include "pmframe.h" 41 41 #include "win32wdesktop.h" 42 #include "pmwindow.h" 42 43 #include <wprocess.h> 43 44 … … 85 86 //****************************************************************************** 86 87 //****************************************************************************** 88 Win32BaseWindow::Win32BaseWindow(HWND os2Handle,VOID* win32WndProc) : GenericObject(&windows,OBJTYPE_WINDOW) 89 { 90 Init(); 91 OS2Hwnd = OS2HwndFrame = os2Handle; 92 dwStyle = WS_VISIBLE; 93 setWindowProc((WNDPROC)win32WndProc); 94 fIsSubclassedOS2Wnd = TRUE; 95 fFirstShow = FALSE; 96 97 //CB: replace by a secure method 98 99 if(OSLibWinSetWindowULong(OS2Hwnd, OFFSET_WIN32WNDPTR, (ULONG)this) == FALSE) { 100 dprintf(("WM_CREATE: WinSetWindowULong %X failed!!", OS2Hwnd)); 101 SetLastError(ERROR_OUTOFMEMORY); //TODO: Better error 102 return; 103 } 104 if(OSLibWinSetWindowULong(OS2Hwnd, OFFSET_WIN32PM_MAGIC, WIN32PM_MAGIC) == FALSE) { 105 dprintf(("WM_CREATE: WinSetWindowULong2 %X failed!!", OS2Hwnd)); 106 SetLastError(ERROR_OUTOFMEMORY); //TODO: Better error 107 return; 108 } 109 110 OSLibWinQueryWindowRect(OS2Hwnd,&rectWindow); 111 rectClient = rectWindow; 112 rectClient.bottom -= rectClient.top; 113 rectClient.top = 0; 114 rectClient.right -= rectClient.left; 115 rectClient.left = 0; 116 117 setOldWndProc(SubclassWithDefHandler(OS2Hwnd)); 118 } 119 //****************************************************************************** 120 //****************************************************************************** 87 121 Win32BaseWindow::Win32BaseWindow(CREATESTRUCTA *lpCreateStructA, ATOM classAtom, BOOL isUnicode) 88 122 : GenericObject(&windows, OBJTYPE_WINDOW), ChildWindow() … … 97 131 { 98 132 isUnicode = FALSE; 133 fIsSubclassedOS2Wnd = FALSE; 99 134 fFirstShow = TRUE; 100 135 fIsDialog = FALSE; … … 200 235 horzScrollInfo = NULL; 201 236 } 202 //TODO: Destroy windows if they're not associated with our window anymore (showwindow false)?203 // hwndHorzScroll204 // hwndVertScroll205 206 237 } 207 238 //****************************************************************************** … … 584 615 } 585 616 617 //CB: switch off -> OS/2 scrollbars 618 subclassScrollBars(dwStyle & WS_HSCROLL,dwStyle & WS_VSCROLL); 619 586 620 fakeWinBase.hwndThis = OS2Hwnd; 587 621 fakeWinBase.pWindowClass = windowClass; … … 690 724 Win32BaseWindow *child; 691 725 726 if (isSubclassedOS2Wnd) OSLibWinSubclassWindow(OS2Hwnd,pOldWndProc); 727 692 728 //According to the SDK, WM_PARENTNOTIFY messages are sent to the parent (this window) 693 729 //before any window destruction has begun … … 699 735 } 700 736 SendInternalMessageA(WM_DESTROY, 0, 0); 737 738 if (hwndHorzScroll && OSLibWinQueryWindow(hwndHorzScroll,QWOS_PARENT) == OSLIB_HWND_OBJECT) OSLibWinDestroyWindow(hwndHorzScroll); 739 if (hwndVertScroll && OSLibWinQueryWindow(hwndVertScroll,QWOS_PARENT) == OSLIB_HWND_OBJECT) OSLibWinDestroyWindow(hwndVertScroll); 701 740 702 741 fIsDestroyed = TRUE; … … 1007 1046 break; 1008 1047 case BUTTON_LEFTDBLCLICK: 1009 if (windowClass ->getClassLongA(GCL_STYLE) & CS_DBLCLKS)1048 if (windowClass && windowClass->getClassLongA(GCL_STYLE) & CS_DBLCLKS) 1010 1049 { 1011 1050 win32msg = WM_LBUTTONDBLCLK; … … 1026 1065 break; 1027 1066 case BUTTON_RIGHTDBLCLICK: 1028 if (windowClass ->getClassLongA(GCL_STYLE) & CS_DBLCLKS)1067 if (windowClass && windowClass->getClassLongA(GCL_STYLE) & CS_DBLCLKS) 1029 1068 { 1030 1069 win32msg = WM_RBUTTONDBLCLK; … … 1045 1084 break; 1046 1085 case BUTTON_MIDDLEDBLCLICK: 1047 if (windowClass ->getClassLongA(GCL_STYLE) & CS_DBLCLKS)1086 if (windowClass && windowClass->getClassLongA(GCL_STYLE) & CS_DBLCLKS) 1048 1087 { 1049 1088 win32msg = WM_MBUTTONDBLCLK; … … 1186 1225 case SB_HORZ: 1187 1226 if(horzScrollInfo) { 1188 horzScrollInfo->CurVal = OSLibWinGetScrollPos(OS2HwndFrame, hwndHorzScroll);1227 //CB:horzScrollInfo->CurVal = OSLibWinGetScrollPos(OS2HwndFrame, hwndHorzScroll); 1189 1228 return horzScrollInfo; 1190 1229 } … … 1192 1231 case SB_VERT: 1193 1232 if(vertScrollInfo) { 1194 vertScrollInfo->CurVal = OSLibWinGetScrollPos(OS2HwndFrame, hwndVertScroll);1233 //CB:vertScrollInfo->CurVal = OSLibWinGetScrollPos(OS2HwndFrame, hwndVertScroll); 1195 1234 return vertScrollInfo; 1196 1235 } … … 1208 1247 ULONG scrollType; 1209 1248 int new_flags; 1249 1250 //CB: handled internally 1251 return 0; 1210 1252 1211 1253 switch(nBar) { … … 1327 1369 return infoPtr->CurVal; 1328 1370 } 1371 /***********************************************************************/ 1372 /***********************************************************************/ 1373 VOID Win32BaseWindow::subclassScrollBars(BOOL subHorz,BOOL subVert) 1374 { 1375 SCROLL_SubclassScrollBars(subHorz ? hwndHorzScroll:0,subVert ? hwndVertScroll:0); 1376 } 1329 1377 /*********************************************************************** 1330 1378 * NC_HandleSysCommand … … 1567 1615 int rc; 1568 1616 1569 if (!windowClass ->getBackgroundBrush()) return 0;1617 if (!windowClass || !windowClass->getBackgroundBrush()) return 0; 1570 1618 1571 1619 rc = GetClipBox( (HDC)wParam, &rect ); … … 1625 1673 { 1626 1674 LRESULT result = 0; 1675 if (!windowClass) return result; 1627 1676 int index = GCL_HICON; 1628 1677
Note:
See TracChangeset
for help on using the changeset viewer.