Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4058 in orxonox.OLD for orxonox/trunk/src/lib/gui


Ignore:
Timestamp:
May 5, 2005, 2:16:53 AM (20 years ago)
Author:
bensch
Message:

orxonox/trunk: menus now show something useFull…

Location:
orxonox/trunk/src/lib/gui/gui
Files:
5 edited

Legend:

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

    r4056 r4058  
    3737
    3838// GUI-modules
    39 GuiFlags* flags = NULL;
    40 GuiVideo* video = NULL;
    41 GuiAudio* audio = NULL;
    42 GuiExec* exec = NULL;
     39GuiFlags* flags   = NULL;
     40GuiVideo* video   = NULL;
     41GuiAudio* audio   = NULL;
     42GuiExec* exec     = NULL;
    4343GuiBanner* banner = NULL;
    44 GuiKeys* keys = NULL;
     44GuiKeys* keys     = NULL;
    4545GuiUpdate* update = NULL;
    4646
     
    5656  initGUI(argc, argv);
    5757
    58   orxonoxGUI = new Window( "grafical orxonox loader, "PACKAGE_VERSION);
     58  orxonoxGUI = new Window( "grafical " PACKAGE_NAME " loader, "PACKAGE_VERSION);
    5959  {
    6060    Box* windowBox = new Box ('h');
     
    100100  // Merging changes to the Options from appended flags.
    101101  for (int optCount = 1; optCount < argc; optCount++)
    102     orxonoxGUI->walkThrough(Widget::flagCheck, argv[optCount], 0);
     102    Window::mainWindow->walkThrough(Widget::flagCheck, argv[optCount], 0);
    103103
    104104  flags->setTextFromFlags(Window::mainWindow);
    105   orxonoxGUI->showall();
     105  Window::mainWindow->showall();
     106 
     107  Window::mainWindow->walkThrough(Widget::redrawOptions, 1);
    106108
    107109  //// Handling special Cases. ///
  • orxonox/trunk/src/lib/gui/gui/gui_exec.cc

    r4056 r4058  
    6767      execBox->fill(this->saveSettings);
    6868      verboseMode = new Menu("verbose mode", "nothing", "error", "warning", "info", "lastItem");
    69       verboseMode->setFlagName("verbose", "v", 0);
     69      verboseMode->setFlagName("verbose", "v", 2);
    7070      verboseMode->saveability();
    7171      execBox->fill(verboseMode);
  • orxonox/trunk/src/lib/gui/gui/gui_gtk.cc

    r4056 r4058  
    395395  return NULL;
    396396}
    397  
    398 /** 
     397
     398/**
    399399    \brief This is for setting the option of "widget"
    400400    \param widget specifies the widget that should be set.
    401401*/
    402402void Widget::setOptions(Widget* widget)
     403{
     404  if (widget->isOption >= 1)
     405    static_cast<Option*>(widget)->redraw();
     406}
     407
     408/**
     409   \brief redraws all the Widgets down from widget
     410   \param widget The topmost Widget
     411   \param data ...
     412*/
     413void Widget::redrawOptions(Widget* widget)
    403414{
    404415  if (widget->isOption >= 1)
     
    916927
    917928/**
     929   \param defaultValue new defaultValue for this option
     930*/
     931void Option::setDefaultValue(int defaultValue)
     932{
     933  this->value = this->defaultValue = defaultValue;
     934}
     935
     936/**
    918937   \brief This sets The FlagName of an Option and defines its default Values
    919938   !! Options will be saved if flagname is different from NULL !!
     
    928947  strcpy(this->flagName, flagname);
    929948
    930   this->defaultValue = defaultvalue;
     949  this->setDefaultValue(defaultvalue);
    931950
    932951  if (this->flagNameShort)
     
    956975  this->flagNameShort = new char [strlen(flagnameshort)+1];
    957976  strcpy(this->flagNameShort, flagnameshort);
    958   this->defaultValue = defaultvalue;
     977  this->setDefaultValue(defaultvalue);
    959978  //  cout << "Set Flagname of " << this->title << " to " << flagname << endl;
    960979}
  • orxonox/trunk/src/lib/gui/gui/gui_gtk.h

    r4054 r4058  
    7171  Widget* findGroupByNumber(int* number, unsigned int depth);
    7272  static void setOptions(Widget* widget);
     73  static void redrawOptions(Widget* widget);
    7374  static void flagCheck(Widget* widget, void* flagName);
    7475 
     
    241242
    242243  bool isSaveable(void);
     244  void setDefaultValue(int defaultValue);
    243245  void setFlagName(const char* flagname, int defaultvalue);
    244246  void setFlagName(const char* flagname, const char* flagnameshort, int defaultvalue);
  • orxonox/trunk/src/lib/gui/gui/gui_video.cc

    r4056 r4058  
    4646  this->getResolutions(this->resolution);
    4747  this->resolution->saveability();
     48  this->resolution->setFlagName("resolution", "r", 0);
    4849  this->videoBox->fill(this->resolution);
    4950  this->wireframe = new CheckButton("WireFrame-mode");
     
    99100
    100101  this->textureDetail = new Menu("Texture Detail", "low", "medium", "high", "lastItem");
     102  this->textureDetail->setDefaultValue(1);
    101103  this->textureDetail->saveability();
    102104  this->advancedBox->fill(this->textureDetail);
     
    104106  this->modelDetailLabel = new Label("Model Detail");
    105107  this->advancedBox->fill(this->modelDetailLabel);
    106   this->modelDetail = new Menu("Model Detail", "low", "medium", "high", "lastItem");
     108  this->modelDetail = new Menu("Model Detail", "low", "high", "lastItem");
     109  this->modelDetail->setDefaultValue(1);
    107110  this->modelDetail->saveability();
    108111  this->advancedBox->fill(this->modelDetail);
     
    111114  this->advancedBox->fill(this->antiAliasingLabel);
    112115  this->antiAliasing = new Menu("Anti Aliasing", "0", "1", "2", "4", "8",  "lastItem");
     116  this->antiAliasing->setDefaultValue(2);
    113117  this->antiAliasing->saveability();
    114118  this->advancedBox->fill(this->antiAliasing);
     
    117121  this->advancedBox->fill(this->filterMethodLabel);
    118122  this->filterMethod = new Menu("Filtering Method", "none", "linear", "bilinear", "trilinear", "anisortopic", "lastItem");
     123  this->filterMethod->setDefaultValue(1);
    119124  this->filterMethod->saveability();
    120125  this->advancedBox->fill(this->filterMethod);
Note: See TracChangeset for help on using the changeset viewer.