2 Copyright 2004-2005 Chris Tallon
4 This file is part of VOMP.
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.
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.
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
35 setTitleBarColour(DrawStyle::TITLEBARBACKGROUND);
37 MessageQueue::getInstance()->addReceiver(this);
42 MessageQueue::getInstance()->removeReceiver(this);
43 if (mainText) delete[] mainText;
46 void VInfo::setExitable()
51 void VInfo::setDropThrough()
56 void VInfo::setMainText(const char* takeText)
58 if (mainText) delete[] mainText;
59 int length = strlen(takeText);
60 mainText = new char[length + 1];
61 strcpy(mainText, takeText);
62 mainTextType = NORMAL;
65 void VInfo::setOneLiner(const char* takeText)
67 if (mainText) delete[] mainText;
68 int length = strlen(takeText);
69 mainText = new char[length + 1];
70 strcpy(mainText, takeText);
71 mainTextType = ONELINER;
80 if (mainTextType == NORMAL)
82 drawPara(mainText, 10, 45, DrawStyle::LIGHTTEXT);
85 if (mainTextType == ONELINER)
87 if (titleBarOn) drawTextCentre(mainText, area.w / 2, 75, DrawStyle::LIGHTTEXT);
88 else drawTextCentre(mainText, area.w / 2, 55, DrawStyle::LIGHTTEXT);
93 int VInfo::handleCommand(int command)
95 if (dropThrough) return BoxStack::DROP_THROUGH;
102 if (exitable) return BoxStack::DELETE_ME;
106 return BoxStack::ABANDON_COMMAND;
109 void VInfo::okButton()
111 okbutton.setPosition((area.w / 2) - 30, area.h - 50);
112 okbutton.setText(tr("OK"));
113 okbutton.setActive(1);
117 void VInfo::processMessage(Message* m)
119 if (m->message == Message::MOUSE_LBDOWN)
121 Input::sendInputKey(Input::OK);