(svn r23531) -Codechange: document and rename widgets to be consistent and understandable

This commit is contained in:
truebrain
2011-12-16 16:27:45 +00:00
parent 98e3f0e14d
commit 000ff60e25
36 changed files with 1713 additions and 1714 deletions

View File

@@ -50,10 +50,10 @@ static const NWidgetPart _nested_engine_preview_widgets[] = {
NWidget(WWT_CAPTION, COLOUR_LIGHT_BLUE), SetDataTip(STR_ENGINE_PREVIEW_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
EndContainer(),
NWidget(WWT_PANEL, COLOUR_LIGHT_BLUE),
NWidget(WWT_EMPTY, INVALID_COLOUR, EPW_QUESTION), SetMinimalSize(300, 0), SetPadding(8, 8, 8, 8), SetFill(1, 0),
NWidget(WWT_EMPTY, INVALID_COLOUR, WID_EP_QUESTION), SetMinimalSize(300, 0), SetPadding(8, 8, 8, 8), SetFill(1, 0),
NWidget(NWID_HORIZONTAL, NC_EQUALSIZE), SetPIP(85, 10, 85),
NWidget(WWT_PUSHTXTBTN, COLOUR_LIGHT_BLUE, EPW_NO), SetDataTip(STR_QUIT_NO, STR_NULL), SetFill(1, 0),
NWidget(WWT_PUSHTXTBTN, COLOUR_LIGHT_BLUE, EPW_YES), SetDataTip(STR_QUIT_YES, STR_NULL), SetFill(1, 0),
NWidget(WWT_PUSHTXTBTN, COLOUR_LIGHT_BLUE, WID_EP_NO), SetDataTip(STR_QUIT_NO, STR_NULL), SetFill(1, 0),
NWidget(WWT_PUSHTXTBTN, COLOUR_LIGHT_BLUE, WID_EP_YES), SetDataTip(STR_QUIT_YES, STR_NULL), SetFill(1, 0),
EndContainer(),
NWidget(NWID_SPACER), SetMinimalSize(0, 8),
EndContainer(),
@@ -69,7 +69,7 @@ struct EnginePreviewWindow : Window {
virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize)
{
if (widget != EPW_QUESTION) return;
if (widget != WID_EP_QUESTION) return;
EngineID engine = this->window_number;
SetDParam(0, GetEngineCategoryName(engine));
@@ -80,7 +80,7 @@ struct EnginePreviewWindow : Window {
virtual void DrawWidget(const Rect &r, int widget) const
{
if (widget != EPW_QUESTION) return;
if (widget != WID_EP_QUESTION) return;
EngineID engine = this->window_number;
SetDParam(0, GetEngineCategoryName(engine));
@@ -100,10 +100,10 @@ struct EnginePreviewWindow : Window {
virtual void OnClick(Point pt, int widget, int click_count)
{
switch (widget) {
case EPW_YES:
case WID_EP_YES:
DoCommandP(0, this->window_number, 0, CMD_WANT_ENGINE_PREVIEW);
/* FALL THROUGH */
case EPW_NO:
case WID_EP_NO:
delete this;
break;
}