Changeset 1348 for trunk/src


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

WS_VISIBLE & scrollbar fixes

Location:
trunk/src/user32
Files:
4 edited

Legend:

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

    r1333 r1348  
    1 /* $Id: listbox.cpp,v 1.7 1999-10-17 12:17:42 cbratschi Exp $ */
     1/* $Id: listbox.cpp,v 1.8 1999-10-18 10:54:03 sandervl Exp $ */
    22/*
    33 * Listbox controls
     
    204204        info.fMask = SIF_RANGE | SIF_POS | SIF_PAGE;
    205205        info.nMin  = 0;
    206 //        info.nMax = descr->nb_items - info.nPage;
    207206        info.nMax = descr->nb_items;
    208207
     
    210209            info.fMask |= SIF_DISABLENOSCROLL;
    211210
    212         if(info.nMax > (INT)info.nPage) {
    213             ShowScrollBar(hwnd, SB_VERT, TRUE);
    214             EnableScrollBar(hwnd, SB_VERT, ESB_ENABLE_BOTH);
    215             SetScrollInfo( hwnd, SB_VERT, &info, TRUE );
    216         }
    217         else {
    218             ShowScrollBar(hwnd, SB_VERT, FALSE);
    219             EnableScrollBar(hwnd, SB_VERT, ESB_DISABLE_BOTH);
    220         }
     211        SetScrollInfo( hwnd, SB_VERT, &info, TRUE );
    221212
    222213        if (descr->horz_extent)
  • 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 )
  • trunk/src/user32/user32.cpp

    r1336 r1348  
    1 /* $Id: user32.cpp,v 1.43 1999-10-17 15:46:08 sandervl Exp $ */
     1/* $Id: user32.cpp,v 1.44 1999-10-18 10:54:04 sandervl Exp $ */
    22
    33/*
     
    687687//******************************************************************************
    688688//******************************************************************************
    689 HWND WIN32API GetCapture(void)
    690 {
    691 #ifdef DEBUG
    692     WriteLog("USER32:  GetCapture\n");
    693 #endif
    694     return Win32Window::OS2ToWin32Handle(O32_GetCapture());
    695 }
    696 //******************************************************************************
    697 //******************************************************************************
    698689UINT WIN32API GetDoubleClickTime(void)
    699690{
     
    735726BOOL WIN32API ReleaseCapture(void)
    736727{
    737 #ifdef DEBUG
    738     WriteLog("USER32:  ReleaseCapture\n");
    739 #endif
     728    dprintf(("USER32:  ReleaseCapture"));
    740729    return O32_ReleaseCapture();
    741730}
    742731//******************************************************************************
    743732//******************************************************************************
     733HWND WIN32API GetCapture(void)
     734{
     735 HWND hwnd;
     736
     737    hwnd = Win32Window::OS2ToWin32Handle(O32_GetCapture());
     738    dprintf(("USER32: GetCapture returned %x", hwnd));
     739    return hwnd;
     740}
     741//******************************************************************************
     742//******************************************************************************
    744743HWND WIN32API SetCapture( HWND hwnd)
    745744{
    746745#ifdef DEBUG
    747     WriteLog("USER32:  SetCapture\n");
     746    WriteLog("USER32: SetCapture %x", hwnd);
    748747#endif
    749748    hwnd = Win32Window::Win32ToOS2Handle(hwnd);
  • trunk/src/user32/win32wbase.cpp

    r1346 r1348  
    1 /* $Id: win32wbase.cpp,v 1.52 1999-10-17 20:18:45 sandervl Exp $ */
     1/* $Id: win32wbase.cpp,v 1.53 1999-10-18 10:54:04 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    607607  {
    608608        hwndHorzScroll = OSLibWinQueryScrollBarHandle(OS2HwndFrame, OSLIB_HSCROLL);
    609 //        OSLibWinShowScrollBar(OS2HwndFrame, hwndHorzScroll, OSLIB_HSCROLL, FALSE, TRUE);
     609        OSLibWinShowScrollBar(OS2HwndFrame, hwndHorzScroll, OSLIB_HSCROLL, FALSE, TRUE);
    610610  }
    611611
    612612  if (dwStyle & WS_VSCROLL) {
    613613        hwndVertScroll = OSLibWinQueryScrollBarHandle(OS2HwndFrame, OSLIB_VSCROLL);
    614 //        OSLibWinShowScrollBar(OS2HwndFrame, hwndVertScroll, OSLIB_VSCROLL, FALSE, TRUE);
     614        OSLibWinShowScrollBar(OS2HwndFrame, hwndVertScroll, OSLIB_VSCROLL, FALSE, TRUE);
    615615  }
    616616
     
    643643  }
    644644
    645   //Subclass frame
    646 //  if(isFrameWindow() && (HAS_3DFRAME(dwExStyle) ||
    647 //     (!HAS_DLGFRAME(dwStyle, dwExStyle) && (dwStyle & (WS_DLGFRAME|WS_BORDER|WS_THICKFRAME)) == WS_BORDER)))
    648 //  {
    649         pOldFrameProc = FrameSubclassFrameWindow(this);
    650         if (isChild()) FrameSetBorderSize(this,TRUE);
    651 //  }
     645  // Subclass frame
     646  pOldFrameProc = FrameSubclassFrameWindow(this);
     647  if (isChild()) FrameSetBorderSize(this,TRUE);
    652648
    653649  /* Send the WM_CREATE message
     
    19481944    }
    19491945
    1950 #if 0
    1951     if(showstate & SWPOS_SHOW && (getStyle() & WS_VISIBLE) == 0) {
    1952         SetWindowLongA(GWL_STYLE, getStyle() | WS_VISIBLE);
    1953     }
    1954 #endif
     1946    if(showstate & SWPOS_SHOW) {
     1947            setStyle(getStyle() | WS_VISIBLE);
     1948    }
     1949    else    setStyle(getStyle() & ~WS_VISIBLE);
     1950
    19551951    BOOL rc = OSLibWinShowWindow(OS2HwndFrame, showstate);
    19561952    return rc;
     
    24862482           STYLESTRUCT ss;
    24872483
     2484                if(dwExStyle == value)
     2485                    return value;
     2486
    24882487                ss.styleOld = dwExStyle;
    24892488                ss.styleNew = value;
     
    24972496        {
    24982497           STYLESTRUCT ss;
     2498
     2499                if(dwStyle == value)
     2500                    return value;
    24992501
    25002502                ss.styleOld = dwStyle;
     
    26712673            return window->getWindowHandle();
    26722674    }
    2673     else    return hwnd;    //OS/2 window handle
     2675    else    return 0;
     2676//    else    return hwnd;    //OS/2 window handle
    26742677}
    26752678//******************************************************************************
Note: See TracChangeset for help on using the changeset viewer.