]> git.vomp.tv Git - vompclient-marten.git/blob - vinfo.cc
Initial import
[vompclient-marten.git] / vinfo.cc
1 /*
2     Copyright 2004-2005 Chris Tallon
3
4     This file is part of VOMP.
5
6     VOMP is free software; you can redistribute it and/or modify
7     it under the terms of the GNU General Public License as published by
8     the Free Software Foundation; either version 2 of the License, or
9     (at your option) any later version.
10
11     VOMP is distributed in the hope that it will be useful,
12     but WITHOUT ANY WARRANTY; without even the implied warranty of
13     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14     GNU General Public License for more details.
15
16     You should have received a copy of the GNU General Public License
17     along with VOMP; if not, write to the Free Software
18     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19 */
20
21 #include "vinfo.h"
22
23 VInfo::VInfo()
24 {
25   mainText = NULL;
26   exitable = 0;
27
28   setBackgroundColour(0, 0, 100, 255);
29   setTitleBarOn(1);
30   setTitleBarColour(0, 0, 200, 255);
31 }
32
33 VInfo::~VInfo()
34 {
35   if (mainText) delete[] mainText;
36 }
37
38 void VInfo::setExitable()
39 {
40   exitable = 1;
41 }
42
43 void VInfo::setMainText(char* takeText)
44 {
45   int length = strlen(takeText);
46   mainText = new char[length + 1];
47   strcpy(mainText, takeText);
48 }
49
50 void VInfo::draw()
51 {
52   View::draw();
53
54   if (mainText) drawPara(mainText, 10, 45, 255, 255, 255);
55 }
56
57 int VInfo::handleCommand(int command)
58 {
59   switch(command)
60   {
61     case Remote::OK:
62     case Remote::BACK:
63     {
64       if (exitable) return 4;
65     }
66   }
67
68   return 1;
69 }