/*
orxonox - the future of 3D-vertical-scrollers
Copyright (C) 2004 orx
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
### File Specific:
main-programmer: Benjamin Grauer
*/
#include "orxonox_gui_flags.h"
/**
\brief Creates the Flags-Frame
\param widget The Widget from which the data will be parsed
*/
OrxonoxGuiFlags::OrxonoxGuiFlags (Widget* widget)
{
flagText = (char*) malloc (1024);
flagsFrame = new Frame ("Orxonox-Startup-Flags:");
flagsBox = new Box ('v');
flagsLabel = new Label ();
flagsLabel->setSize (260,60);
flagsBox->fill (flagsLabel);
shortFlags = new CheckButton ("shortFlags");
flagsBox->fill (shortFlags);
flagsFrame->fill (flagsBox);
}
/**
\brief Function to return the Frame that holds the Flagtext.
\returns Frame that holds the Flagtext.
*/
Widget* OrxonoxGuiFlags::getWidget ()
{
return flagsFrame;
}
/**
\brief Sets the Flags from widget downwards.
\param widget the Widget from which on to scan for deeper Options and their settings.
*/
void OrxonoxGuiFlags::setTextFromFlags (Widget* widget)
{
sprintf (flagText, "");
strcat (flagText, "orxonox");
FlagsText (widget);
flagsLabel->setText (flagText);
}
/**
\brief this actually sets the flagtext, and appends it to flagText
\param widget like OrxonoxGuiFlags::setTextFromFlags(widget)
*/
void OrxonoxGuiFlags::FlagsText(Widget* widget)
{
if (widget->isOption >= 1)
if (static_cast