Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4071 in orxonox.OLD for orxonox/trunk/src/lib/gui/gui/gui_gtk.cc


Ignore:
Timestamp:
May 5, 2005, 11:30:32 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk/gui: new isOption-tag of Widgets: optionType

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/lib/gui/gui/gui_gtk.cc

    r4069 r4071  
    222222    return this;
    223223
    224   if (this->isOption < 0 && static_cast<Packer*>(this)->down)
     224  if (this->optionType < GUI_NOTHING && static_cast<Packer*>(this)->down)
    225225    {
    226226      Widget* tmp = static_cast<Packer*>(this)->down->findWidgetByName(name, depth+1);
     
    243243{
    244244  function(this);
    245   if (this->isOption < 0)
     245  if (this->optionType < GUI_NOTHING)
    246246    {
    247247      static_cast<Packer*>(this)->down->walkThrough(function, depth+1);
     
    261261{
    262262  function(this, data);
    263   if (this->isOption < 0)
     263  if (this->optionType < GUI_NOTHING)
    264264    {
    265265      static_cast<Packer*>(this)->down->walkThrough(function, data, depth+1);
     
    275275void Widget::listOptionsAndGroups(Widget* widget)
    276276{
    277   if (widget->isOption < 0 && static_cast<Packer*>(widget)->groupName)
     277  if (widget->optionType < GUI_NOTHING && static_cast<Packer*>(widget)->groupName)
    278278    PRINT(0)("[%s]\n", static_cast<Packer*>(widget)->groupName);
    279   if (widget->isOption >= 1)
     279  if (widget->optionType > GUI_NOTHING)
    280280    {
    281281      Widget::listOptions(widget);
     
    289289void Widget::listOptions(Widget* widget)
    290290{
    291   if(widget->isOption >= 1)
     291  if(widget->optionType > GUI_NOTHING)
    292292    PRINT(0)("  %s is %s\n", static_cast<Option*>(widget)->title, static_cast<Option*>(widget)->save());
    293293}
     
    301301{
    302302 
    303   if (widget->isOption >= 1)
     303  if (widget->optionType > GUI_NOTHING)
    304304    {
    305305      int* count =(int*)data;
     
    320320Widget* Widget::findOptionByNumber(int* number, unsigned int depth)
    321321{
    322   if (isOption > 0)
     322  if (optionType > GUI_NOTHING)
    323323    {
    324324      --*number;
     
    328328        }
    329329    }
    330   if (this->isOption < 0 && static_cast<Packer*>(this)->down)
     330  if (this->optionType < GUI_NOTHING && static_cast<Packer*>(this)->down)
    331331    {
    332332      Widget* tmp = static_cast<Packer*>(this)->down->findOptionByNumber(number, depth+1);
     
    346346void Widget::listGroups(Widget* widget)
    347347{
    348   if (widget->isOption < 0 && static_cast<Packer*>(widget)->groupName)
     348  if (widget->optionType < GUI_NOTHING && static_cast<Packer*>(widget)->groupName)
    349349    PRINT(0)("[%s]\n", static_cast<Packer*>(widget)->groupName);
    350350}
     
    358358{
    359359  int* count = (int*)data;
    360   if (widget->isOption < 0 && static_cast<Packer*>(widget)->groupName)
     360  if (widget->optionType < GUI_NOTHING && static_cast<Packer*>(widget)->groupName)
    361361    PRINT(0)("%d: [%s]\n", ++*count, static_cast<Packer*>(widget)->groupName);
    362362}
     
    369369Widget* Widget::findGroupByNumber(int* number, unsigned int depth)
    370370{
    371   if (isOption < 0 && static_cast<Packer*>(this)->groupName)
     371  if (optionType < GUI_NOTHING && static_cast<Packer*>(this)->groupName)
    372372    {
    373373      --*number;
     
    377377        }
    378378    }
    379   if (this->isOption < 0 && static_cast<Packer*>(this)->down)
     379  if (this->optionType < GUI_NOTHING && static_cast<Packer*>(this)->down)
    380380    {
    381381      Widget* tmp = static_cast<Packer*>(this)->down->findGroupByNumber(number, depth+1);
     
    395395void Widget::setOptions(Widget* widget)
    396396{
    397   if (widget->isOption >= 1)
     397  if (widget->optionType > GUI_NOTHING)
    398398    static_cast<Option*>(widget)->redraw();
    399399}
     
    406406void Widget::redrawOptions(Widget* widget)
    407407{
    408   if (widget->isOption >= 1)
     408  if (widget->optionType > GUI_NOTHING)
    409409    static_cast<Option*>(widget)->redraw();
    410410}
     
    415415void Widget::flagCheck(Widget* widget, void* flagName)
    416416{
    417   if (widget->isOption>=1)
     417  if (widget->optionType > GUI_NOTHING)
    418418    {     
    419419      Option* option =(Option*)widget;
     
    567567Container::Container(void)
    568568{
    569   this->isOption = -1;
     569  this->optionType = GUI_CONTAINER;
    570570}
    571571
     
    814814EventBox::EventBox(const char* eventBoxName)
    815815{
    816   this->isOption = -1;
    817 
    818816#ifdef HAVE_GTK2
    819817  this->widget = gtk_event_box_new();
     
    842840Box::Box(char boxtype)
    843841{
    844   this->isOption = -2;
     842  this->optionType = GUI_BOX;
    845843
    846844#ifdef HAVE_GTK2
     
    10551053Button::Button(char* buttonName)
    10561054{
    1057   isOption = 0;
     1055  this->optionType = GUI_NOTHING;
    10581056
    10591057#ifdef HAVE_GTK2
     
    11151113CheckButton::CheckButton(const char* buttonName)
    11161114{
    1117   this->isOption = 1;
     1115  this->optionType = GUI_BOOL;
    11181116
    11191117#ifdef HAVE_GTK2
     
    12051203Slider::Slider(const char* slidername, int start, int end)
    12061204{
    1207   this->isOption = 2;
     1205  this->optionType = GUI_INT;
    12081206
    12091207  this->start = start;
     
    13291327void Menu::init(void)
    13301328{
    1331   this->isOption = 2;
     1329  this->optionType = GUI_INT;
    13321330  this->firstItem = NULL;
    13331331
     
    14431441OptionLabel::OptionLabel(const char* label, const char* value)
    14441442{
    1445   this->isOption = 5;
     1443  this->optionType = GUI_CHAR_ARRAY;
    14461444  cValue = NULL;
    14471445
     
    15331531Label:: Label(const char* text)
    15341532{
    1535   this->isOption = 0;
     1533  this->optionType = GUI_NOTHING;
    15361534 
    15371535#ifdef HAVE_GTK2
     
    16291627ProgressBar::ProgressBar(const char* label)
    16301628{
    1631   this->isOption = 0;
     1629  this->optionType = GUI_NOTHING;
    16321630  this->progress = 0.0;
    16331631  this->totalSize = 0.0;
     
    17281726void Image::init(const char* name)
    17291727{
    1730   isOption = 0;
     1728  optionType = GUI_NOTHING;
    17311729
    17321730  if (this->title)
     
    17461744FileDialog::FileDialog(const char* fileDialogName)
    17471745{
    1748   this->isOption = 0;
     1746  this->optionType = GUI_NOTHING;
    17491747  this->isOpen = false;
    17501748  this->changeOption = NULL;
Note: See TracChangeset for help on using the changeset viewer.