(svn r11915) -Codechange: Add a function to draw a sort button's up/down arrow. Arrows are now drawn in a consistent position based on the widget, instead of randomly positioned by pixel.

This commit is contained in:
peter1138
2008-01-18 10:36:55 +00:00
parent b7f50533c2
commit 68707808c0
11 changed files with 38 additions and 28 deletions

View File

@@ -466,9 +466,9 @@ static void GroupWndProc(Window *w, WindowEvent *e)
DrawStringRightAligned(187, y1 + 1, STR_GROUP_TINY_NUM, (gv->group_sel == g->index) ? TC_WHITE : TC_BLACK);
}
/* Draw Matrix Vehicle according to the vehicle list built before */
DoDrawString(gv->l.flags & VL_DESC ? DOWNARROW : UPARROW, 269, 15, TC_BLACK);
DrawSortButtonState(w, GRP_WIDGET_SORT_BY_ORDER, gv->l.flags & VL_DESC ? SBS_DOWN : SBS_UP);
/* Draw Matrix Vehicle according to the vehicle list built before */
max = min(w->vscroll2.pos + w->vscroll2.cap, gv->l.list_length);
for (i = w->vscroll2.pos ; i < max ; ++i) {
const Vehicle* v = gv->sort_list[i];