From e9f584ac210913a404e246184c8d3c1f52428b63 Mon Sep 17 00:00:00 2001 From: truebrain Date: Fri, 16 Dec 2011 16:27:45 +0000 Subject: (svn r23531) -Codechange: document and rename widgets to be consistent and understandable --- src/cheat_gui.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/cheat_gui.cpp') diff --git a/src/cheat_gui.cpp b/src/cheat_gui.cpp index 093d36b59..5af16a4be 100644 --- a/src/cheat_gui.cpp +++ b/src/cheat_gui.cpp @@ -187,7 +187,7 @@ static const NWidgetPart _nested_cheat_widgets[] = { NWidget(WWT_SHADEBOX, COLOUR_GREY), NWidget(WWT_STICKYBOX, COLOUR_GREY), EndContainer(), - NWidget(WWT_PANEL, COLOUR_GREY, CW_PANEL), SetDataTip(0x0, STR_CHEATS_TOOLTIP), EndContainer(), + NWidget(WWT_PANEL, COLOUR_GREY, WID_C_PANEL), SetDataTip(0x0, STR_CHEATS_TOOLTIP), EndContainer(), }; /** GUI for the cheats. */ @@ -202,7 +202,7 @@ struct CheatWindow : Window { virtual void DrawWidget(const Rect &r, int widget) const { - if (widget != CW_PANEL) return; + if (widget != WID_C_PANEL) return; int y = r.top + WD_FRAMERECT_TOP + this->header_height; DrawStringMultiLine(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_LEFT, r.top + WD_FRAMERECT_TOP, y, STR_CHEATS_WARNING, TC_FROMSTRING, SA_CENTER); @@ -265,7 +265,7 @@ struct CheatWindow : Window { virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { - if (widget != CW_PANEL) return; + if (widget != WID_C_PANEL) return; uint width = 0; for (int i = 0; i != lengthof(_cheats_ui); i++) { @@ -316,7 +316,7 @@ struct CheatWindow : Window { virtual void OnClick(Point pt, int widget, int click_count) { - const NWidgetBase *wid = this->GetWidget(CW_PANEL); + const NWidgetBase *wid = this->GetWidget(WID_C_PANEL); uint btn = (pt.y - wid->pos_y - WD_FRAMERECT_TOP - this->header_height) / (FONT_HEIGHT_NORMAL + WD_PAR_VSEP_NORMAL); uint x = pt.x - wid->pos_x; bool rtl = _current_text_dir == TD_RTL; -- cgit v1.2.3-54-g00ecf