1 /*
2 Copyright (C) 2005 Wolfgang Becker <uafr@gmx.de>
3 
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
8 
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 GNU General Public License for more details.
13 
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17 */
18 #ifndef __DIALOG_HPP__
19 #define __DIALOG_HPP__
20 
21 #include <vector>
22 #include "MapPoint.hpp"
23 #include "gui/Component.hpp"
24 #include "gui/Desktop.hpp"
25 #include "gui/Button.hpp"
26 
27 #define BULLDOZE_MONUMENT 1
28 #define BULLDOZE_RIVER    2
29 #define BULLDOZE_SHANTY   3
30 #define EDIT_MARKET       4
31 #define EDIT_PORT         5
32 #define ASK_COAL_SURVEY   6
33 #define ASK_LAUNCH_ROCKET 7
34 #define GAME_STATS        8
35 #define MSG_DIALOG        9
36 
37 extern bool blockingDialogIsOpen;
38 
39 class Dialog;
40 void closeAllDialogs();
41 
42 class Dialog
43 {
44     public:
45         Dialog( int type, std::string message, std::string extraString);
46         Dialog( int type, int x, int y );
47         Dialog( int type );
48         ~Dialog();
49         void closeDialog();
50 
51     private:
52         void askBulldozeMonument();
53         void askBulldozeRiver();
54         void askBulldozeShanty();
55 
56         void editMarket();
57         void editPort();
58 
59         void coalSurvey();
60         void askRocket();
61         void gameStats();
62         void saveGameStats();
63 
64         void msgDialog( std::string message, std::string extraString);
65 
66         void initDialog( int x = -1 , int y = -1 );
67         Desktop* desktop;
68         Component* myDialogComponent;
69         int pointX;
70         int pointY;
71 
72         template<typename T> void setTableRC( const std::string basename, const int row, const int column, const std::string text, const T value );
73 
74         void setParagraphN( const std::string basename, const int number, const std::string text );
75         void setParagraph( const std::string paragraphName, const std::string text );
76         void okayBulldozeRiverButtonClicked( Button* );
77         void okayBulldozeShantyButtonClicked( Button* );
78         void okayBulldozeMonumentButtonClicked( Button* );
79         void okayCoalSurveyButtonClicked( Button* );
80         void okayLaunchRocketButtonClicked( Button* );
81         void closeDialogButtonClicked( Button* );
82         void gotoButtonClicked( Button* );
83         void applyMarketButtonClicked( Button* );
84         void applyPortButtonClicked( Button* );
85         bool iAmBlocking;
86         void registerDialog();
87         void unRegisterDialog();
88 };
89 
90 #endif
91