summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
16f015a)
- Patch by Joachim Priesner : Hide horizontal Listbox scroll bar if no horizontal extent is set. See CORE-1101.
- Patch by Alex Henrie : Simplify if-else statement. Scroll listbox item completely into view on LB_SETCURSEL.
svn path=/trunk/; revision=69625
if (descr->style & WS_VSCROLL)
SetScrollInfo( descr->self, SB_VERT, &info, TRUE );
if (descr->style & WS_VSCROLL)
SetScrollInfo( descr->self, SB_VERT, &info, TRUE );
- if (descr->style & WS_HSCROLL)
+ if (descr->style & WS_HSCROLL && descr->horz_extent)
{
info.nPos = descr->horz_pos;
info.nPage = descr->width;
{
info.nPos = descr->horz_pos;
info.nPage = descr->width;
info.fMask |= SIF_DISABLENOSCROLL;
SetScrollInfo( descr->self, SB_HORZ, &info, TRUE );
}
info.fMask |= SIF_DISABLENOSCROLL;
SetScrollInfo( descr->self, SB_HORZ, &info, TRUE );
}
+ else
+ {
+ if (descr->style & LBS_DISABLENOSCROLL)
+ {
+ info.nMin = 0;
+ info.nMax = 0;
+ info.fMask = SIF_RANGE | SIF_DISABLENOSCROLL;
+ SetScrollInfo( descr->self, SB_HORZ, &info, TRUE );
+ }
+ else
+ {
+ ShowScrollBar( descr->self, SB_HORZ, FALSE );
+ }
+ }
ScrollWindowEx( descr->self, 0, diff, NULL, NULL, 0, NULL,
SW_INVALIDATE | SW_ERASE | SW_SCROLLCHILDREN );
}
ScrollWindowEx( descr->self, 0, diff, NULL, NULL, 0, NULL,
SW_INVALIDATE | SW_ERASE | SW_SCROLLCHILDREN );
}
- if (!scroll) InvalidateRect( descr->self, NULL, TRUE );
+ else
+ InvalidateRect( descr->self, NULL, TRUE );
descr->top_item = index;
LISTBOX_UpdateScroll( descr );
return LB_OKAY;
descr->top_item = index;
LISTBOX_UpdateScroll( descr );
return LB_OKAY;
info.nMin = 0;
info.nMax = descr->horz_extent ? descr->horz_extent - 1 : 0;
info.fMask = SIF_RANGE;
info.nMin = 0;
info.nMax = descr->horz_extent ? descr->horz_extent - 1 : 0;
info.fMask = SIF_RANGE;
+ if (descr->style & LBS_DISABLENOSCROLL)
+ info.fMask |= SIF_DISABLENOSCROLL;
SetScrollInfo( descr->self, SB_HORZ, &info, TRUE );
}
if (descr->horz_pos > extent - descr->width)
SetScrollInfo( descr->self, SB_HORZ, &info, TRUE );
}
if (descr->horz_pos > extent - descr->width)
case LB_SETCURSEL:
if (IS_MULTISELECT(descr)) return LB_ERR;
case LB_SETCURSEL:
if (IS_MULTISELECT(descr)) return LB_ERR;
- LISTBOX_SetCaretIndex( descr, wParam, FALSE );
+ LISTBOX_SetCaretIndex( descr, wParam, TRUE );
ret = LISTBOX_SetSelection( descr, wParam, TRUE, FALSE );
if (ret != LB_ERR) ret = descr->selected_item;
return ret;
ret = LISTBOX_SetSelection( descr, wParam, TRUE, FALSE );
if (ret != LB_ERR) ret = descr->selected_item;
return ret;