diff options
author | peter1138 <peter1138@openttd.org> | 2008-01-18 10:36:55 +0000 |
---|---|---|
committer | peter1138 <peter1138@openttd.org> | 2008-01-18 10:36:55 +0000 |
commit | 68707808c015db1cda0723882ffce99977d4593c (patch) | |
tree | 4a7f2fbd16bbc5ad48c890141c722273c2efea2e /src/industry_gui.cpp | |
parent | b7f50533c29ea74e9973ac641ec677eb69411d5d (diff) | |
download | openttd-68707808c015db1cda0723882ffce99977d4593c.tar.xz |
(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.
Diffstat (limited to 'src/industry_gui.cpp')
-rw-r--r-- | src/industry_gui.cpp | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/industry_gui.cpp b/src/industry_gui.cpp index b4621df00..393fd114c 100644 --- a/src/industry_gui.cpp +++ b/src/industry_gui.cpp @@ -781,10 +781,6 @@ static void IndustryDirectoryWndProc(Window *w, WindowEvent *e) { switch (e->event) { case WE_PAINT: { - int n; - uint p; - static const uint16 _indicator_positions[4] = {88, 187, 284, 387}; - if (_industry_sort_dirty) { _industry_sort_dirty = false; MakeSortedIndustryList(); @@ -793,10 +789,10 @@ static void IndustryDirectoryWndProc(Window *w, WindowEvent *e) SetVScrollCount(w, _num_industry_sort); DrawWindowWidgets(w); - DoDrawString(_industry_sort_order & 1 ? DOWNARROW : UPARROW, _indicator_positions[_industry_sort_order >> 1], 15, TC_BLACK); + DrawSortButtonState(w, IDW_SORTBYNAME + (_industry_sort_order >> 1), _industry_sort_order & 1 ? SBS_DOWN : SBS_UP); - p = w->vscroll.pos; - n = 0; + uint p = w->vscroll.pos; + int n = 0; while (p < _num_industry_sort) { const Industry* i = _industry_sort[p]; |