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 class CBigTextItem : public CMenuItem
21 {
22 public:
23 char text[MAX_TEXTVALUE_SIZE];
24
25 CBigTextItem(int iid, int px, int py);
26 virtual ~CBigTextItem();
27
28 void DrawItem(bool selected);
29 void DrawItemText(bool selected);
30 void SetText(char* ntext);
31 };
32
CBigTextItem(int iid,int px,int py)33 CBigTextItem::CBigTextItem(int iid, int px, int py)
34 {
35 id = iid;
36
37 x = px;
38 y = py;
39 itemType = MENU_ITEM_BIGTEXT;
40 strcpy(caption,"");
41
42 width = 0;
43 height = 0;
44
45 nextItem = NULL;
46 };
47
~CBigTextItem()48 CBigTextItem::~CBigTextItem()
49 {
50 }
51
DrawItem(bool selected)52 void CBigTextItem::DrawItem(bool selected)
53 {
54 }
55
DrawItemText(bool selected)56 void CBigTextItem::DrawItemText(bool selected)
57 {
58 g_MainFont->RenderText(x,y,1,1,text);
59 }
60
SetText(char * ntext)61 void CBigTextItem::SetText(char* ntext)
62 {
63 if (strlen(ntext) < MAX_TEXTVALUE_SIZE)
64 strcpy(text,ntext);
65 }
66