Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3147 in orxonox.OLD for orxonox/trunk


Ignore:
Timestamp:
Dec 11, 2004, 3:08:34 PM (20 years ago)
Author:
bensch
Message:

orxonox/trunk/gui: typo, toDo and so on

Location:
orxonox/trunk/gui
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/gui/orxonox_gui.cc

    r3144 r3147  
    2222   main-programmer: Benjamin Grauer
    2323
     24   ToDO:
     25   way to start gui without GTK (textmode)
     26   curl interface to Download cool stuff
     27
     28   make Windows grab Focus if it is open and release it when closed (only child-windows)
     29   chain all the windows when starting the GUI (DANGER: performance!!)
     30
     31   widgets save themselve
     32   good way to step through all the Widgets
     33   ... many more ...
    2434*/
    2535
    26 #include <iostream.h>
     36#include <gtk/gtkmain.h>
    2737
    2838#include "orxonox_gui.h"
     
    5666OrxonoxGui::OrxonoxGui (int argc, char *argv[])
    5767{
     68 
    5869  gtk_init (&argc, &argv);
    5970  gtk_rc_parse( "rc" );
  • orxonox/trunk/gui/orxonox_gui.h

    r3144 r3147  
    1111#endif
    1212
     13#include <iostream>
     14using namespace std;
     15
    1316#include "orxonox_gui_gtk.h"
    1417
    1518#include <stdlib.h>
    16 #include <gtk/gtkmain.h>
    17 #include <gtk/gtkwindow.h>
    18 #include <gtk/gtkframe.h>
    19 #include <gtk/gtkhbox.h>
    20 #include <gtk/gtkvbox.h>
    21 #include <gtk/gtkbutton.h>
    22 #include <gtk/gtkcheckbutton.h>
    23 #include <gtk/gtkhscale.h>
    24 #include <gtk/gtkoptionmenu.h>
    25 #include <gtk/gtkmenu.h>
    26 #include <gtk/gtkmenuitem.h>
    27 #include <gtk/gtklabel.h>
    28 #include <gtk/gtkimage.h>
    29 #include <gtk/gtkeventbox.h>
    3019
    3120//! Class that creates the OrxonoxGui
  • orxonox/trunk/gui/orxonox_gui_banner.cc

    r2622 r3147  
    2525
    2626#include "orxonox_gui_banner.h"
    27 #include <iostream.h>
    2827
    2928/**
  • orxonox/trunk/gui/orxonox_gui_exec.cc

    r2740 r3147  
    125125{
    126126  int counter = 0;
    127   while (counter < depth && ((widget->is_option>0
     127  while (counter < depth && ((widget->isOption>0
    128128                              && (static_cast<Option*>(widget)->saveable) )
    129                              || (widget->is_option<0
     129                             || (widget->isOption<0
    130130                                 && strcmp (static_cast<Packer*>(widget)->getGroupName(), ""))))
    131131    {
     
    135135 
    136136  // check if it is a Packer, and if it is, check if it has a name and if there is something in it.
    137   if (widget->is_option <0)
     137  if (widget->isOption <0)
    138138    {
    139139      if (strcmp (static_cast<Packer*>(widget)->getGroupName(), ""))
     
    148148        }
    149149    }
    150   //  if (widget->is_option == 0)
     150  //  if (widget->isOption == 0)
    151151  //    printf ("%s\n",widget->label);
    152   if (widget->is_option >= 1)
     152  if (widget->isOption >= 1)
    153153    if  (static_cast<Option*>(widget)->saveable)
    154154      {
     
    219219void OrxonoxGuiExec::readFileText (Widget* widget, char* variableName, int variableValue, int depth)
    220220{
    221   if (widget->is_option >= 1)
     221  if (widget->isOption >= 1)
    222222    if (!strcmp (static_cast<Option*>(widget)->label, variableName))
    223223        static_cast<Option*>(widget)->value = variableValue;
    224224
    225   if (widget->is_option < 0)
     225  if (widget->isOption < 0)
    226226    {
    227227      readFileText (static_cast<Packer*>(widget)->down, variableName, variableValue, depth+1);
     
    246246    }
    247247
    248   if (widget->is_option < 0)
     248  if (widget->isOption < 0)
    249249    {
    250250      if (!strcmp(groupName, static_cast<Packer*>(widget)->getGroupName()))
  • orxonox/trunk/gui/orxonox_gui_flags.cc

    r3146 r3147  
    2525
    2626#include "orxonox_gui_flags.h"
    27 #include <iostream.h>
    2827
    2928/**
     
    7473void OrxonoxGuiFlags::FlagsText(Widget* widget)
    7574{
    76   if (widget->is_option >= 1)
     75  if (widget->isOption >= 1)
    7776    if  (static_cast<Option*>(widget)->value != static_cast<Option*>(widget)->default_value && (strcmp (static_cast<Option*>(widget)->flag_name, "") || strcmp (static_cast<Option*>(widget)->flag_name_short, "")))
    7877      {
     
    8786            strcat (flagText, static_cast<Option*>(widget)->flag_name);
    8887          }
    89         if (static_cast<Option*>(widget)->is_option == 2)
     88        if (static_cast<Option*>(widget)->isOption == 2)
    9089          {
    9190            sprintf (flagText, "%s=%i", flagText, static_cast<Option*>(widget)->value);
    9291          }
    9392      }
    94   switch (widget->is_option)
     93  switch (widget->isOption)
    9594    {
    9695    case -1:
  • orxonox/trunk/gui/orxonox_gui_gtk.cc

    r3146 r3147  
     1/*
     2   orxonox - the future of 3D-vertical-scrollers
     3
     4   Copyright (C) 2004 orx
     5
     6   This program 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, or (at your option)
     9   any later version.
     10
     11   This program 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.
     15
     16   You should have received a copy of the GNU General Public License
     17   along with this program; if not, write to the Free Software Foundation,
     18   Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 
     19
     20
     21   ### File Specific:
     22   main-programmer: Benjamin Grauer
     23
     24*/
     25
     26
    127#include <iostream>
    228
    329#include "orxonox_gui_gtk.h"
     30
     31
    432using namespace std;
     33
    534// temporarily.
    635#include "orxonox_gui_flags.h"
     
    2150  this->hide();
    2251  //  cout << "check if Packer: "<<this->label <<"\n";
    23   if (this->is_option < 0)
     52  if (this->isOption < 0)
    2453    {
    2554      //  cout << "get Down "<<this->label <<"\n";
     
    109138{
    110139  function(this);
    111   if (this->is_option < 0)
     140  if (this->isOption < 0)
    112141    {
    113142      static_cast<Packer*>(this)->down->walkThrough (function);
     
    124153void Widget::listOptions (Widget* widget)
    125154{
    126   if (widget->is_option >= 1)
     155  if (widget->isOption >= 1)
    127156    cout << static_cast<Option*>(widget)->label <<" is : " << static_cast<Option*>(widget)->value <<endl;
    128157}
     
    134163void Widget::setOptions (Widget* widget)
    135164{
    136   if (widget->is_option >= 1)
     165  if (widget->isOption >= 1)
    137166    static_cast<Option*>(widget)->redraw();// <<" is : " << static_cast<Option*>(this)->value <<endl;
    138167}
     
    183212void Container::init (void)
    184213{
    185   is_option = -1;
     214  isOption = -1;
    186215
    187216  static_cast<Packer*>(this)->init();
     
    282311  label=title;
    283312  gtk_window_set_title (GTK_WINDOW (widget), title);
     313}
     314
     315/**
     316   \brief opens up a Window and fixes the Focus to it
     317*/
     318void Window::open()
     319{
     320  isOpen = true;
     321  gtk_grab_add(widget);
     322}
     323
     324/**
     325   \brief closes up a Window and removes the Focus from it
     326*/
     327void Window::close()
     328{
     329  isOpen = false;
     330  gtk_grab_remove(widget);
    284331}
    285332
     
    365412void EventBox::init(void)
    366413{
    367   is_option = -1;
     414  isOption = -1;
    368415
    369416  static_cast<Container*>(this)->init();
     
    408455void Box::init(char boxtype)
    409456{
    410   is_option = -2;
     457  isOption = -2;
    411458
    412459  static_cast<Packer*>(this)->init();
     
    461508void Image::init()
    462509{
    463   is_option = 0;
     510  isOption = 0;
    464511
    465512  static_cast<Widget*>(this)->init();
     
    531578void Button::init(void)
    532579{
    533   is_option = 0;
     580  isOption = 0;
    534581
    535582  static_cast<Option*>(this)->init();
     
    575622void CheckButton::init(void)
    576623{
    577   is_option = 1;
     624  isOption = 1;
    578625
    579626  static_cast<Option*>(this)->init();
     
    640687void Slider::init(int start, int end)
    641688{
    642   is_option = 2;
     689  isOption = 2;
    643690
    644691  static_cast<Option*>(this)->init();
     
    717764void Menu::init(void)
    718765{
    719   is_option = 2;
     766  isOption = 2;
    720767
    721768  static_cast<Option*>(this)->init();
     
    790837void Label::init(void)
    791838{
    792   is_option = 0;
     839  isOption = 0;
    793840
    794841  static_cast<Widget*>(this)->init();
  • orxonox/trunk/gui/orxonox_gui_gtk.h

    r3146 r3147  
    22#ifndef _ORXONOX_GUI_GTK_H
    33#define _ORXONOX_GUI_GTK_H
     4
    45#include <gtk/gtkmain.h>
    56#include <gtk/gtkwindow.h>
     
    1718#include <gtk/gtkeventbox.h>
    1819
    19 
    2020//! This is the topmost object that can be displayed all others are derived from it.
    2121class Widget
     
    2828  GtkWidget* widget; //!< widget is the gtk_widget that the specific Object Contains.
    2929  void init(void);
    30   int is_option; //!< with this Paramenter one can set the option-type: -2:Container, -1: Box, 0: not an Option, 1: Bool-option, 2: int-option, 3:float option, 4:char option, 5: char* option
     30  int isOption; //!< with this Paramenter one can set the option-type: -2:Container, -1: Box, 0: not an Option, 1: Bool-option, 2: int-option, 3:float option, 4:char option, 5: char* option
    3131  /**
    32      \briefdefines is_option states
     32     \briefdefines isOption states
    3333  */
    3434  enum option { containerType = -2, boxType = -1, nothingType = 0, boolType = 1, intType = 2};
     
    9696  void setTitle (char* title);
    9797  void showall ();
     98  void open();
     99  void close();
    98100  static gint orxonox_gui_quit (GtkWidget *widget, GdkEvent *event, gpointer data);
    99101};
  • orxonox/trunk/gui/orxonox_gui_keys.cc

    r2819 r3147  
    2525
    2626#include "orxonox_gui_keys.h"
    27 #include <iostream.h>
    2827
    2928/**
Note: See TracChangeset for help on using the changeset viewer.