Changeset 1091 for trunk/src/user32/scroll.cpp
- Timestamp:
- Sep 29, 1999, 10:27:16 AM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/scroll.cpp
r1064 r1091 1 /* $Id: scroll.cpp,v 1. 3 1999-09-26 15:25:55 sandervl Exp $ */1 /* $Id: scroll.cpp,v 1.4 1999-09-29 08:27:15 sandervl Exp $ */ 2 2 /* 3 3 * Scrollbar control … … 167 167 static SCROLLBAR_INFO *SCROLL_GetScrollInfo( HWND hwnd, INT nBar ) 168 168 { 169 return SCROLL_GetPtrScrollInfo( hwnd, nBar ); 169 Win32BaseWindow *window; 170 171 window = Win32BaseWindow::GetWindowFromHandle(hwnd); 172 if(!window && nBar != SB_CTL) { 173 dprintf(("SCROLL_GetScrollInfo window %x not found!", hwnd)); 174 SetLastError(ERROR_INVALID_WINDOW_HANDLE); 175 return NULL; 176 } 177 178 if (window) { 179 return window->getScrollInfo(nBar); 180 } 181 182 return SCROLL_GetPtrScrollInfo( hwnd, nBar ); 170 183 } 171 184 … … 1125 1138 Win32BaseWindow *window; 1126 1139 INT action; 1127 INT retVal = SCROLL_SetScrollInfo( hwnd, nBar, info, &action );1140 INT retVal; 1128 1141 1129 1142 window = Win32BaseWindow::GetWindowFromHandle(hwnd); 1130 if(!window ) {1143 if(!window && nBar != SB_CTL) { 1131 1144 dprintf(("SetScrollInfo window not found!")); 1132 1145 SetLastError(ERROR_INVALID_WINDOW_HANDLE); 1133 1146 return FALSE; 1134 1147 } 1135 1148 if(window) { 1149 return window->setScrollInfo(nBar, (SCROLLINFO *)info, bRedraw); 1150 } 1151 1152 retVal = SCROLL_SetScrollInfo( hwnd, nBar, info, &action ); 1136 1153 if( action & SA_SSI_HIDE ) 1137 1154 SCROLL_ShowScrollBar( hwnd, nBar, FALSE, FALSE ); … … 1170 1187 1171 1188 /* Set the page size */ 1172 1173 1189 if (info->fMask & SIF_PAGE) 1174 1190 { … … 1182 1198 1183 1199 /* Set the scroll pos */ 1184 1185 1200 if (info->fMask & SIF_POS) 1186 1201 { … … 1194 1209 1195 1210 /* Set the scroll range */ 1196 1197 1211 if (info->fMask & SIF_RANGE) 1198 1212 { … … 1239 1253 1240 1254 /* Check if the scrollbar should be hidden or disabled */ 1241 1242 1255 if (info->fMask & (SIF_RANGE | SIF_PAGE | SIF_DISABLENOSCROLL)) 1243 1256 { … … 1288 1301 LPSCROLLINFO info /* [IO] (info.fMask [I] specifies which values are to retrieve) */) 1289 1302 { 1290 Win32BaseWindow *window;1291 1303 SCROLLBAR_INFO *infoPtr; 1292 1304 1293 window = Win32BaseWindow::GetWindowFromHandle(hwnd);1294 if(!window) {1295 dprintf(("GetScrollInfo window not found!"));1296 SetLastError(ERROR_INVALID_WINDOW_HANDLE);1297 return FALSE;1298 }1299 1305 if (!(infoPtr = SCROLL_GetScrollInfo( hwnd, nBar ))) return FALSE; 1300 1306 if (info->fMask & ~(SIF_ALL | SIF_DISABLENOSCROLL)) return FALSE; … … 1330 1336 BOOL bRedraw /* [I] Should scrollbar be redrawn afterwards ? */ ) 1331 1337 { 1332 Win32BaseWindow *window;1333 1338 SCROLLINFO info; 1334 1339 SCROLLBAR_INFO *infoPtr; … … 1336 1341 1337 1342 dprintf(("SetScrollPos %x %d %d %d", hwnd, nBar, nPos, bRedraw)); 1338 window = Win32BaseWindow::GetWindowFromHandle(hwnd);1339 if(!window) {1340 dprintf(("SetScrollPos window not found!"));1341 SetLastError(ERROR_INVALID_WINDOW_HANDLE);1342 return FALSE;1343 }1344 1345 1343 if (!(infoPtr = SCROLL_GetScrollInfo( hwnd, nBar ))) return 0; 1346 1344 oldPos = infoPtr->CurVal; … … 1366 1364 INT nBar /* [I] One of SB_HORZ, SB_VERT, or SB_CTL */) 1367 1365 { 1368 Win32BaseWindow *window;1369 1366 SCROLLBAR_INFO *infoPtr; 1370 1367 1371 1368 dprintf(("GetScrollPos %x %d", hwnd, nBar)); 1372 1369 1373 window = Win32BaseWindow::GetWindowFromHandle(hwnd); 1374 if(!window) { 1375 dprintf(("GetScrollPos window not found!")); 1376 SetLastError(ERROR_INVALID_WINDOW_HANDLE); 1377 return 0; 1378 } 1379 1380 if (!(infoPtr = SCROLL_GetScrollInfo( hwnd, nBar ))) return 0; 1370 infoPtr = SCROLL_GetScrollInfo( hwnd, nBar ); 1371 if (!infoPtr) return 0; 1372 1381 1373 return infoPtr->CurVal; 1382 1374 } … … 1393 1385 BOOL bRedraw /* [I] Should scrollbar be redrawn afterwards ? */) 1394 1386 { 1395 Win32BaseWindow *window;1396 1387 SCROLLINFO info; 1397 1388 1398 window = Win32BaseWindow::GetWindowFromHandle(hwnd); 1399 if(!window) { 1400 dprintf(("SetScrollRange window not found!")); 1401 SetLastError(ERROR_INVALID_WINDOW_HANDLE); 1402 return FALSE; 1403 } 1404 1389 dprintf(("SetScrollRange %x %x %d %d %d", hwnd, nBar, MinVal, MaxVal, bRedraw)); 1405 1390 info.cbSize = sizeof(info); 1406 1391 info.nMin = MinVal; … … 1455 1440 LPINT lpMax /* [O] Where to store maximum value */) 1456 1441 { 1457 Win32BaseWindow *window;1458 1442 SCROLLBAR_INFO *infoPtr; 1459 1443 1460 window = Win32BaseWindow::GetWindowFromHandle(hwnd); 1461 if(!window) { 1462 dprintf(("GetScrollRange window not found!")); 1463 SetLastError(ERROR_INVALID_WINDOW_HANDLE); 1464 return FALSE; 1465 } 1466 1467 if (!(infoPtr = SCROLL_GetScrollInfo( hwnd, nBar ))) 1444 infoPtr = SCROLL_GetScrollInfo( hwnd, nBar ); 1445 if (!infoPtr) 1468 1446 { 1469 1447 if (lpMin) lpMin = 0; … … 1566 1544 1567 1545 window = Win32BaseWindow::GetWindowFromHandle(hwnd); 1568 if(!window ) {1546 if(!window && nBar != SB_CTL) { 1569 1547 dprintf(("ShowScrollBar window not found!")); 1570 1548 SetLastError(ERROR_INVALID_WINDOW_HANDLE); … … 1600 1578 1601 1579 window = Win32BaseWindow::GetWindowFromHandle(hwnd); 1602 if(!window ) {1580 if(!window && nBar != SB_CTL) { 1603 1581 dprintf(("EnableScrollBar window not found!")); 1604 1582 SetLastError(ERROR_INVALID_WINDOW_HANDLE);
Note:
See TracChangeset
for help on using the changeset viewer.