From 553dcd02a7810676b1305e51272b928b0f54fb50 Mon Sep 17 00:00:00 2001 From: alberth Date: Sun, 3 May 2009 08:13:14 +0000 Subject: [PATCH] (svn r16207) -Codechange: Added and applied BuyCompanyWidgets enum. -Doc: Small fixes and additions to documentation. --- src/company_gui.cpp | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/company_gui.cpp b/src/company_gui.cpp index 3d05b9782c..f49f7a4757 100644 --- a/src/company_gui.cpp +++ b/src/company_gui.cpp @@ -28,7 +28,7 @@ #include "table/strings.h" enum { - FIRST_GUI_CALL = INT_MAX, ///< default value to specify thuis is the first call of the resizable gui + FIRST_GUI_CALL = INT_MAX, ///< default value to specify this is the first call of the resizable gui }; static void DoShowCompanyFinances(CompanyID company, bool show_small, bool show_stickied, int top = FIRST_GUI_CALL, int left = FIRST_GUI_CALL); @@ -1381,7 +1381,7 @@ static void DoSelectCompanyManagerFace(Window *parent, bool adv, int top, int le } -/* Names of the widgets. Keep them in the same order as in the widget array */ +/** Names of the widgets of the #CompanyWindow. Keep them in the same order as in the widget array */ enum CompanyWindowWidgets { CW_WIDGET_CLOSEBOX = 0, CW_WIDGET_CAPTION, @@ -1726,7 +1726,14 @@ void ShowCompany(CompanyID company) AllocateWindowDescFront(&_company_desc, company); } - +/** widget numbers of the #BuyCompanyWindow. */ +enum BuyCompanyWidgets { + BCW_CLOSEBOX, + BCW_CAPTION, + BCW_BACKGROUND, + BCW_NO, + BCW_YES, +}; struct BuyCompanyWindow : Window { BuyCompanyWindow(const WindowDesc *desc, WindowNumber window_number) : Window(desc, window_number) @@ -1751,11 +1758,11 @@ struct BuyCompanyWindow : Window { virtual void OnClick(Point pt, int widget) { switch (widget) { - case 3: + case BCW_NO: delete this; break; - case 4: + case BCW_YES: DoCommandP(0, this->window_number, 0, CMD_BUY_COMPANY | CMD_MSG(STR_ERROR_CAN_T_BUY_COMPANY)); break; }