1 /*
2 Solar Conquest
3 Copyright (C) 2006 Greg Beaman
4
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 */
19
20 #define MENU_ITEM_NONE 0
21 #define MENU_ITEM_SCREENBUTTON 1
22 #define MENU_ITEM_FUNCBUTTON 2
23 #define MENU_ITEM_TEXTBOX 3
24 #define MENU_ITEM_NUMBERBOX 4
25 #define MENU_ITEM_IPADDRBOX 5
26 #define MENU_ITEM_LISTBOX 6
27 #define MENU_ITEM_TEXT 7
28 #define MENU_ITEM_BARCHART 8
29 #define MENU_ITEM_BIGTEXT 9
30
31 class CMenuItem
32 {
33 protected:
34 int x,y;
35 int width;
36 int height;
37 int id;
38
39 public:
40 char caption[MAX_STRING_SIZE];
41
42 int itemType;
43
44 CMenuItem* nextItem;
45
46 // virtual CMenuItem();
47 virtual ~CMenuItem();
48
49 virtual void SetText(char* text);
50 virtual void DrawItem(bool selected);
51 virtual void DrawItemText(bool selected);
52
53 virtual int GetX();
54 virtual int GetY();
55 virtual int GetWidth();
56 virtual int GetHeight();
57 virtual int GetId();
58 };
59
~CMenuItem()60 CMenuItem::~CMenuItem()
61 {
62 }
63
DrawItem(bool selected)64 void CMenuItem::DrawItem(bool selected)
65 {
66 }
DrawItemText(bool selected)67 void CMenuItem::DrawItemText(bool selected) {}
68
SetText(char * text)69 void CMenuItem::SetText(char* text)
70 {
71 if (strlen(text) < MAX_STRING_SIZE)
72 strcpy(caption,text);
73 }
74
GetX()75 int CMenuItem::GetX() { return x; }
GetY()76 int CMenuItem::GetY() { return y; }
GetWidth()77 int CMenuItem::GetWidth() { return width; }
GetHeight()78 int CMenuItem::GetHeight() { return height; }
GetId()79 int CMenuItem::GetId() { return id; }