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.
34 setTitleBarColour(DrawStyle::TITLEBARBACKGROUND);
36 MessageQueue::getInstance()->addReceiver(this);
41 MessageQueue::getInstance()->removeReceiver(this);
44 void VInfo::setExitable()
49 void VInfo::setDropThrough()
54 void VInfo::setMainText(const char* takeText)
57 mainTextType = NORMAL;
60 void VInfo::setOneLiner(const char* takeText)
63 mainTextType = ONELINER;
66 void VInfo::setOneLiner(const std::string& takeText)
69 mainTextType = ONELINER;
78 if (mainTextType == NORMAL)
80 drawPara(mainText.c_str() /* FIXME */, 10, 45, DrawStyle::LIGHTTEXT);
83 if (mainTextType == ONELINER)
85 if (titleBarOn) drawTextCentre(mainText, area.w / 2, 75, DrawStyle::LIGHTTEXT);
86 else drawTextCentre(mainText, area.w / 2, 55, DrawStyle::LIGHTTEXT);
91 int VInfo::handleCommand(int command)
93 if (dropThrough) return BoxStack::DROP_THROUGH;
100 if (exitable) return BoxStack::DELETE_ME;
104 return BoxStack::ABANDON_COMMAND;
107 void VInfo::okButton()
109 okbutton.setPosition((area.w / 2) - 30, area.h - 50);
110 okbutton.setText(tr("OK"));
111 okbutton.setActive(1);
115 void VInfo::processMessage(Message* m)
117 if (m->message == Message::MOUSE_LBDOWN)
119 Input::sendInputKey(Input::OK);