diff options
author | glx <glx@openttd.org> | 2008-05-08 21:09:21 +0000 |
---|---|---|
committer | glx <glx@openttd.org> | 2008-05-08 21:09:21 +0000 |
commit | 5c9c8fc1996cf099341a10d072bac16f02a8c0a8 (patch) | |
tree | 08acf33a5e38401f41f022edb4c9ad80f2744550 | |
parent | a8e8329d41fb193d62506cfb044eab174652fc94 (diff) | |
download | openttd-5c9c8fc1996cf099341a10d072bac16f02a8c0a8.tar.xz |
(svn r13020) -Codechange: make industry directory window horizontally resizable and truncate strings
-rw-r--r-- | src/industry_gui.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/industry_gui.cpp b/src/industry_gui.cpp index 261c8d1cd..35aee71d8 100644 --- a/src/industry_gui.cpp +++ b/src/industry_gui.cpp @@ -665,16 +665,16 @@ enum IndustryDirectoryWidgets { /** Widget definition of the industy directory gui */ static const Widget _industry_directory_widgets[] = { { WWT_CLOSEBOX, RESIZE_NONE, 13, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, // IDW_CLOSEBOX -{ WWT_CAPTION, RESIZE_NONE, 13, 11, 495, 0, 13, STR_INDUSTRYDIR_CAPTION, STR_018C_WINDOW_TITLE_DRAG_THIS}, // IDW_CAPTION -{ WWT_STICKYBOX, RESIZE_NONE, 13, 496, 507, 0, 13, 0x0, STR_STICKY_BUTTON}, // IDW_STICKY +{ WWT_CAPTION, RESIZE_RIGHT, 13, 11, 495, 0, 13, STR_INDUSTRYDIR_CAPTION, STR_018C_WINDOW_TITLE_DRAG_THIS}, // IDW_CAPTION +{ WWT_STICKYBOX, RESIZE_LR, 13, 496, 507, 0, 13, 0x0, STR_STICKY_BUTTON}, // IDW_STICKY { WWT_PUSHTXTBTN, RESIZE_NONE, 13, 0, 100, 14, 25, STR_SORT_BY_NAME, STR_SORT_ORDER_TIP}, // IDW_SORTBYNAME { WWT_PUSHTXTBTN, RESIZE_NONE, 13, 101, 200, 14, 25, STR_SORT_BY_TYPE, STR_SORT_ORDER_TIP}, // IDW_SORTBYTYPE { WWT_PUSHTXTBTN, RESIZE_NONE, 13, 201, 300, 14, 25, STR_SORT_BY_PRODUCTION, STR_SORT_ORDER_TIP}, // IDW_SORTBYPROD { WWT_PUSHTXTBTN, RESIZE_NONE, 13, 301, 400, 14, 25, STR_SORT_BY_TRANSPORTED, STR_SORT_ORDER_TIP}, // IDW_SORTBYTRANSPORT -{ WWT_PANEL, RESIZE_NONE, 13, 401, 495, 14, 25, 0x0, STR_NULL}, // IDW_SPACER -{ WWT_PANEL, RESIZE_BOTTOM, 13, 0, 495, 26, 189, 0x0, STR_200A_TOWN_NAMES_CLICK_ON_NAME}, // IDW_INDUSRTY_LIST -{ WWT_SCROLLBAR, RESIZE_BOTTOM, 13, 496, 507, 14, 177, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST}, // IDW_SCROLLBAR -{ WWT_RESIZEBOX, RESIZE_TB, 13, 496, 507, 178, 189, 0x0, STR_RESIZE_BUTTON}, // IDW_RESIZE +{ WWT_PANEL, RESIZE_RIGHT, 13, 401, 495, 14, 25, 0x0, STR_NULL}, // IDW_SPACER +{ WWT_PANEL, RESIZE_RB, 13, 0, 495, 26, 189, 0x0, STR_200A_TOWN_NAMES_CLICK_ON_NAME}, // IDW_INDUSRTY_LIST +{ WWT_SCROLLBAR, RESIZE_LRB, 13, 496, 507, 14, 177, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST}, // IDW_SCROLLBAR +{ WWT_RESIZEBOX, RESIZE_LRTB, 13, 496, 507, 178, 189, 0x0, STR_RESIZE_BUTTON}, // IDW_RESIZE { WIDGETS_END}, }; @@ -831,7 +831,7 @@ static void IndustryDirectoryWndProc(Window *w, WindowEvent *e) /* Drawing the right string */ StringID str = STR_INDUSTRYDIR_ITEM_NOPROD; if (p != 1) str = (p == 5) ? STR_INDUSTRYDIR_ITEM : STR_INDUSTRYDIR_ITEM_TWO; - DrawString(4, 28 + n * 10, str, TC_FROMSTRING); + DrawStringTruncated(4, 28 + n * 10, str, TC_FROMSTRING, w->widget[IDW_INDUSRTY_LIST].right - 4); pos++; if (++n == w->vscroll.cap) break; |