Ignore:
Timestamp:
Oct 12, 1999, 8:14:56 PM (26 years ago)
Author:
sandervl
Message:

Lots of changes again

File:
1 edited

Legend:

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

    r1203 r1258  
    1 /* $Id: listbox.cpp,v 1.2 1999-10-08 21:24:40 cbratschi Exp $ */
     1/* $Id: listbox.cpp,v 1.3 1999-10-12 18:14:55 sandervl Exp $ */
    22/*
    33 * Listbox controls
     
    186186    {
    187187        info.nMin  = 0;
    188         info.nMax  = (descr->nb_items - 1) / descr->page_size;
     188        info.nMax = (descr->nb_items - 1) / descr->page_size;
    189189        info.nPos  = descr->top_item / descr->page_size;
    190190        info.nPage = descr->width / descr->column_width;
     
    201201    {
    202202        info.nMin  = 0;
    203         info.nMax  = descr->nb_items - 1;
    204         info.nPos  = descr->top_item;
     203        info.nMax = descr->nb_items - 1;
     204//        info.nPos  = descr->top_item;
     205        info.nPos = descr->selected_item - 1;
    205206        info.nPage = LISTBOX_GetCurrentPageSize( hwnd, descr );
    206207        info.fMask = SIF_RANGE | SIF_POS | SIF_PAGE;
    207208        if (descr->style & LBS_DISABLENOSCROLL)
    208209            info.fMask |= SIF_DISABLENOSCROLL;
    209         SetScrollInfo( hwnd, SB_VERT, &info, TRUE );
     210
     211        if(info.nMax > (INT)info.nPage) {
     212            ShowScrollBar(hwnd, SB_VERT, TRUE);
     213            EnableScrollBar(hwnd, SB_VERT, ESB_ENABLE_BOTH);           
     214            SetScrollInfo( hwnd, SB_VERT, &info, TRUE );
     215        }
     216        else {
     217            ShowScrollBar(hwnd, SB_VERT, FALSE);
     218            EnableScrollBar(hwnd, SB_VERT, ESB_DISABLE_BOTH);           
     219        }
    210220
    211221        if (descr->horz_extent)
     
    25502560            LISTBOX_HandleMouseMove( hwnd, descr, (INT16)LOWORD(lParam),
    25512561                                     (INT16)HIWORD(lParam) );
    2552         return 0;
     2562        return 1; //SvL: Bugfix -> PMWINDOW expects non-zero return value if
     2563                  //               we want to restore the default mouse cursor
     2564
    25532565    case WM_LBUTTONUP:
    25542566        return LISTBOX_HandleLButtonUp( hwnd, descr );
Note: See TracChangeset for help on using the changeset viewer.