Ignore:
Timestamp:
Sep 29, 1999, 10:27:16 AM (26 years ago)
Author:
sandervl
Message:

Scrollbar changes

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 $ */
    22/*
    33 * Scrollbar control
     
    167167static SCROLLBAR_INFO *SCROLL_GetScrollInfo( HWND hwnd, INT nBar )
    168168{
    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 );
    170183}
    171184
     
    11251138  Win32BaseWindow *window;
    11261139  INT action;
    1127   INT retVal = SCROLL_SetScrollInfo( hwnd, nBar, info, &action );
     1140  INT retVal;
    11281141
    11291142    window = Win32BaseWindow::GetWindowFromHandle(hwnd);
    1130     if(!window) {
     1143    if(!window && nBar != SB_CTL) {
    11311144        dprintf(("SetScrollInfo window not found!"));
    11321145        SetLastError(ERROR_INVALID_WINDOW_HANDLE);
    11331146        return FALSE;
    11341147    }
    1135 
     1148    if(window) {
     1149        return window->setScrollInfo(nBar, (SCROLLINFO *)info, bRedraw);
     1150    }
     1151
     1152    retVal = SCROLL_SetScrollInfo( hwnd, nBar, info, &action );
    11361153    if( action & SA_SSI_HIDE )
    11371154        SCROLL_ShowScrollBar( hwnd, nBar, FALSE, FALSE );
     
    11701187
    11711188    /* Set the page size */
    1172 
    11731189    if (info->fMask & SIF_PAGE)
    11741190    {
     
    11821198
    11831199    /* Set the scroll pos */
    1184 
    11851200    if (info->fMask & SIF_POS)
    11861201    {
     
    11941209
    11951210    /* Set the scroll range */
    1196 
    11971211    if (info->fMask & SIF_RANGE)
    11981212    {
     
    12391253
    12401254    /* Check if the scrollbar should be hidden or disabled */
    1241 
    12421255    if (info->fMask & (SIF_RANGE | SIF_PAGE | SIF_DISABLENOSCROLL))
    12431256    {
     
    12881301                LPSCROLLINFO info /* [IO] (info.fMask [I] specifies which values are to retrieve) */)
    12891302{
    1290   Win32BaseWindow *window;
    12911303  SCROLLBAR_INFO *infoPtr;
    12921304
    1293     window = Win32BaseWindow::GetWindowFromHandle(hwnd);
    1294     if(!window) {
    1295         dprintf(("GetScrollInfo window not found!"));
    1296         SetLastError(ERROR_INVALID_WINDOW_HANDLE);
    1297         return FALSE;
    1298     }
    12991305    if (!(infoPtr = SCROLL_GetScrollInfo( hwnd, nBar ))) return FALSE;
    13001306    if (info->fMask & ~(SIF_ALL | SIF_DISABLENOSCROLL)) return FALSE;
     
    13301336                BOOL bRedraw /* [I] Should scrollbar be redrawn afterwards ? */ )
    13311337{
    1332   Win32BaseWindow *window;
    13331338  SCROLLINFO info;
    13341339  SCROLLBAR_INFO *infoPtr;
     
    13361341
    13371342    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 
    13451343    if (!(infoPtr = SCROLL_GetScrollInfo( hwnd, nBar ))) return 0;
    13461344    oldPos      = infoPtr->CurVal;
     
    13661364                INT nBar /* [I] One of SB_HORZ, SB_VERT, or SB_CTL */)
    13671365{
    1368   Win32BaseWindow *window;
    13691366  SCROLLBAR_INFO *infoPtr;
    13701367
    13711368    dprintf(("GetScrollPos %x %d", hwnd, nBar));
    13721369
    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
    13811373    return infoPtr->CurVal;
    13821374}
     
    13931385                BOOL bRedraw /* [I] Should scrollbar be redrawn afterwards ? */)
    13941386{
    1395   Win32BaseWindow *window;
    13961387  SCROLLINFO info;
    13971388
    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));
    14051390    info.cbSize = sizeof(info);
    14061391    info.nMin   = MinVal;
     
    14551440                LPINT lpMax  /* [O] Where to store maximum value */)
    14561441{
    1457   Win32BaseWindow *window;
    14581442  SCROLLBAR_INFO *infoPtr;
    14591443
    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)
    14681446    {
    14691447        if (lpMin) lpMin = 0;
     
    15661544
    15671545    window = Win32BaseWindow::GetWindowFromHandle(hwnd);
    1568     if(!window) {
     1546    if(!window && nBar != SB_CTL) {
    15691547        dprintf(("ShowScrollBar window not found!"));
    15701548        SetLastError(ERROR_INVALID_WINDOW_HANDLE);
     
    16001578
    16011579    window = Win32BaseWindow::GetWindowFromHandle(hwnd);
    1602     if(!window) {
     1580    if(!window && nBar != SB_CTL) {
    16031581        dprintf(("EnableScrollBar window not found!"));
    16041582        SetLastError(ERROR_INVALID_WINDOW_HANDLE);
Note: See TracChangeset for help on using the changeset viewer.