Ignore:
Timestamp:
Jun 9, 2001, 4:50:26 PM (24 years ago)
Author:
sandervl
Message:

reference count (window + class objects) rewrite

File:
1 edited

Legend:

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

    r5769 r5935  
    1 /* $Id: scroll.cpp,v 1.38 2001-05-20 10:44:04 sandervl Exp $ */
     1/* $Id: scroll.cpp,v 1.39 2001-06-09 14:50:19 sandervl Exp $ */
    22/*
    33 * Scrollbar control
     
    2121#include "oslibwin.h"
    2222#include "initterm.h"
    23 #include "pmframe.h"
    2423
    2524#define DBG_LOCALLOG    DBG_scroll
     
    8483        case SB_HORZ:
    8584        case SB_VERT:
    86           win32wnd = Win32BaseWindow::GetWindowFromHandle(hwnd);
    87           if (!win32wnd) return NULL;
    88           return win32wnd->getScrollInfo(nBar);
     85        {
     86            SCROLLBAR_INFO *pInfo;
     87            win32wnd = Win32BaseWindow::GetWindowFromHandle(hwnd);
     88
     89            if (!win32wnd) return NULL;
     90            pInfo = win32wnd->getScrollInfo(nBar);
     91            RELEASE_WNDOBJ(win32wnd);
     92            return pInfo;
     93        }
    8994
    9095        case SB_CTL:
     
    133138          lprect->left--;
    134139          lprect->right++;
    135         } else if (win32wnd->getStyle() & WS_VSCROLL)
     140        }
     141        else
     142        if (win32wnd->getStyle() & WS_VSCROLL)
    136143            lprect->right++;
     144        RELEASE_WNDOBJ(win32wnd);
    137145        vertical = FALSE;
    138146        break;
     
    154162          lprect->top--;
    155163          lprect->bottom++;
    156         } else if (win32wnd->getStyle() & WS_HSCROLL)
     164        }
     165        else
     166        if (win32wnd->getStyle() & WS_HSCROLL)
    157167          lprect->bottom++;
     168        RELEASE_WNDOBJ(win32wnd);
    158169        vertical = TRUE;
    159170        break;
     
    14921503                    BOOL fShow  /* [I] TRUE = show, FALSE = hide  */)
    14931504{
    1494     Win32BaseWindow *win32wnd = Win32BaseWindow::GetWindowFromHandle(hwnd);
    14951505    BOOL fShowH = (nBar == SB_HORZ) ? fShow : 0;
    14961506    BOOL fShowV = (nBar == SB_VERT) ? fShow : 0;
     1507    DWORD dwStyle;
    14971508
    14981509    dprintf(("ShowScrollBar %04x %d %d\n", hwnd, nBar, fShow));
    1499     if (!win32wnd) return FALSE;
     1510    if (!IsWindow(hwnd)) return FALSE;
     1511
     1512    dwStyle = GetWindowLongA(hwnd, GWL_STYLE);
    15001513
    15011514    //CB: does Win32 send a WM_STYLECHANGED message?
     
    15101523        if (fShow)
    15111524        {
    1512             fShowH = !(win32wnd->getStyle() & WS_HSCROLL);
    1513             win32wnd->setStyle(win32wnd->getStyle() | WS_HSCROLL);
     1525            fShowH = !(dwStyle & WS_HSCROLL);
     1526            SetWindowLongA(hwnd, GWL_STYLE, dwStyle | WS_HSCROLL);
    15141527        }
    15151528        else  /* hide it */
    15161529        {
    1517             fShowH = (win32wnd->getStyle() & WS_HSCROLL);
    1518             win32wnd->setStyle(win32wnd->getStyle() & ~WS_HSCROLL);
     1530            fShowH = (dwStyle & WS_HSCROLL);
     1531            SetWindowLongA(hwnd, GWL_STYLE, dwStyle & ~WS_HSCROLL);
    15191532        }
    15201533        if( nBar == SB_HORZ )
     
    15281541        if (fShow)
    15291542        {
    1530             fShowV = !(win32wnd->getStyle() & WS_VSCROLL);
    1531             win32wnd->setStyle(win32wnd->getStyle() | WS_VSCROLL);
     1543            fShowV = !(dwStyle & WS_VSCROLL);
     1544            SetWindowLongA(hwnd, GWL_STYLE, dwStyle | WS_VSCROLL);
    15321545        }
    15331546        else  /* hide it */
    15341547        {
    1535             fShowV = (win32wnd->getStyle() & WS_VSCROLL);
    1536             win32wnd->setStyle(win32wnd->getStyle() & ~WS_VSCROLL);
     1548            fShowV = (dwStyle & WS_VSCROLL);
     1549            SetWindowLongA(hwnd, GWL_STYLE, dwStyle & ~WS_VSCROLL);
    15371550        }
    15381551        if ( nBar == SB_VERT )
Note: See TracChangeset for help on using the changeset viewer.