summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoralberth <alberth@openttd.org>2009-05-03 08:13:14 +0000
committeralberth <alberth@openttd.org>2009-05-03 08:13:14 +0000
commit553dcd02a7810676b1305e51272b928b0f54fb50 (patch)
treebb6a68e1ca8e7eaeb0fec10ed48e9409ac85be31
parent3b96c0313b0439b951c526f3357f161b6a05aa15 (diff)
downloadopenttd-553dcd02a7810676b1305e51272b928b0f54fb50.tar.xz
(svn r16207) -Codechange: Added and applied BuyCompanyWidgets enum.
-Doc: Small fixes and additions to documentation.
-rw-r--r--src/company_gui.cpp17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/company_gui.cpp b/src/company_gui.cpp
index 3d05b9782..f49f7a475 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<CompanyWindow>(&_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;
}