Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3312 in orxonox.OLD


Ignore:
Timestamp:
Jan 1, 2005, 12:27:16 PM (19 years ago)
Author:
bensch
Message:

orxonox/branches/updater: now it is possible to change the options without the grafical Interface through the GUI, but it is very lousy. Try it\!

Location:
orxonox/branches/updater/src/gui
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • orxonox/branches/updater/src/gui/orxonox_gui.cc

    r3305 r3312  
    173173            }
    174174          PRINT(0)("\n\n:: %s ::\n", option->title);
     175          option->changeOption();
    175176
    176177          // here follows the rest.... this will be nasty.
  • orxonox/branches/updater/src/gui/orxonox_gui_gtk.cc

    r3305 r3312  
    11621162void Button::changeOption(void)
    11631163{
    1164  
     1164  // This will possibly be used for ACTIONS !
    11651165}
    11661166
     
    12451245#ifdef HAVE_GTK2
    12461246  this->value = (int)gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (this->widget));
     1247#else /* HAVE_GTK2 */
     1248  char tmpChar[20];
     1249  cout << "\nPlease give me a new value for " << this->title << " [0,1](defualt:" << this->defaultValue << "): ";
     1250  cin >> tmpChar;
     1251
     1252  if ((this->value = atoi(tmpChar))=!0)
     1253    this->value = 1;
    12471254#endif /* HAVE_GTK2 */
    12481255  cout << this->title << " set to: " << this->value << endl;
     
    12971304  static_cast<Option*>(this)->init();
    12981305
     1306  this->start = start;
     1307  this->end = end;
    12991308#ifdef HAVE_GTK2
    13001309 widget = gtk_hscale_new_with_range (start, end, 5);
     
    13551364#ifdef HAVE_GTK2
    13561365  this->value = (int)gtk_range_get_value(GTK_RANGE(this->widget));
     1366#else /* HAVE_GTK2 */
     1367  char tmpChar[20];
     1368  cout << "\nPlease give me a new value for " << this->title << " [" <<this->start << "-" << this->end << "](defualt:" << this->defaultValue << "): ";
     1369  cin >> tmpChar;
     1370
     1371  if ((this->value = atoi(tmpChar))> this->end)
     1372    this->value = this->end;
     1373  if (this->value <= this->start)
     1374    this->value = this->start;
    13571375#endif /* HAVE_GTK2 */
    13581376  cout << this->title << " set to: " << this->value << endl;
     
    14701488#ifdef HAVE_GTK2
    14711489  this->value = (int)gtk_option_menu_get_history (GTK_OPTION_MENU (this->widget));
     1490#else /* HAVE_GTK2 */
     1491  char tmpChar[20];
     1492  cout << "\nPlease give me a new value for " << this->title << " (defualt:" << this->defaultValue << "): ";
     1493  cin >> tmpChar;
     1494  this->value = atoi(tmpChar);
     1495
    14721496#endif /* HAVE_GTK2 */
    14731497  cout << this->title << " set to: " << this->value << endl;
     
    15711595#ifdef HAVE_GTK2
    15721596  this->cValue = (char*)gtk_label_get_text (GTK_LABEL(this->widget));
     1597#else /* HAVE_GTK2 */
     1598  cout << "\nPlease give me a new input for " << this->title << ": ";
     1599  cin >> this->cValue;
    15731600#endif /* HAVE_GTK2 */
    15741601  cout << this->title << " set to: " << this->cValue << endl;
  • orxonox/branches/updater/src/gui/orxonox_gui_gtk.h

    r3305 r3312  
    281281class Slider : public Option
    282282{
    283  public:
    284   Slider(char* slidername,int start, int end);
     283 private:
     284  int start;
     285  int end;
     286 public:
     287  Slider(char* slidername, int start, int end);
    285288  ~Slider(void);
    286289  void init(int start, int end);
Note: See TracChangeset for help on using the changeset viewer.