Ignore:
Timestamp:
Oct 18, 1999, 12:54:04 PM (26 years ago)
Author:
sandervl
Message:

WS_VISIBLE & scrollbar fixes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/user32/scroll.cpp

    r1342 r1348  
    1 /* $Id: scroll.cpp,v 1.10 1999-10-17 18:09:22 sandervl Exp $ */
     1/* $Id: scroll.cpp,v 1.11 1999-10-18 10:54:03 sandervl Exp $ */
    22/*
    33 * Scrollbar control
     
    692692                                     BOOL arrows, BOOL interior )
    693693{
    694     //HDC hdc = GetDCEx( hwnd, 0,
    695     //                       DCX_CACHE | ((nBar == SB_CTL) ? 0 : DCX_WINDOW) );
    696 HDC hdc;
    697 
    698 return;
    699 //CB: bug: paints in client window!
    700 //    GetClientRect returns wrong window size after GetDC
    701 //    why?!?
     694  Win32BaseWindow *window;
     695  HWND hwndScroll;
     696  HDC hdc;
     697
     698    //SvL: Get scrollbar handle from parent window
     699    window = Win32BaseWindow::GetWindowFromHandle(hwnd);
     700    if(!window && nBar != SB_CTL) {
     701        dprintf(("SCROLL_RefreshScrollBar window %x not found!", hwnd));
     702        SetLastError(ERROR_INVALID_WINDOW_HANDLE);
     703        return;
     704    }
     705    if(nBar == SB_VERT)
     706    {
     707        hwndScroll = Win32BaseWindow::OS2ToWin32Handle(window->getVertScrollHandle());
     708    }
     709    else
     710    if(nBar == SB_HORZ)
     711    {
     712        hwndScroll = Win32BaseWindow::OS2ToWin32Handle(window->getHorzScrollHandle());
     713    }
     714    else hwndScroll = hwnd;
     715
     716    if(hwndScroll == 0)
     717        return;
     718
     719    hdc = GetDCEx( hwndScroll, 0, DCX_CACHE | ((nBar == SB_CTL) ? 0 : DCX_WINDOW));
    702720
    703721    if (!hdc) return;
    704722
    705     SCROLL_DrawScrollBar( hwnd, hdc, nBar, arrows, interior );
    706     ReleaseDC( hwnd, hdc );
     723    SCROLL_DrawScrollBar( hwndScroll, hdc, nBar, arrows, interior );
     724    ReleaseDC( hwndScroll, hdc );
    707725}
    708726/***********************************************************************
     
    13021320  INT retVal;
    13031321
    1304 /* CB: handled here, todo: hide/show
    1305     window = Win32BaseWindow::GetWindowFromHandle(hwnd);
    1306     if(!window && nBar != SB_CTL) {
    1307         dprintf(("SetScrollInfo window not found!"));
    1308         SetLastError(ERROR_INVALID_WINDOW_HANDLE);
    1309         return FALSE;
    1310     }
    1311     if(window) {
    1312         return window->setScrollInfo(nBar, (SCROLLINFO *)info, bRedraw);
    1313     }
    1314 */
    1315 
    13161322    retVal = SCROLL_SetScrollInfo( hwnd, nBar, info, &action );
    13171323    if( action & SA_SSI_HIDE )
Note: See TracChangeset for help on using the changeset viewer.