- Timestamp:
- Oct 17, 2004, 5:18:58 PM (20 years ago)
- Location:
- orxonox/trunk/gui
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/gui/orxonox_gui.cc
r2587 r2588 48 48 /* ORXONOXGUI */ 49 49 50 /** 51 * Initializes the Gui 52 */ 50 53 OrxonoxGui::OrxonoxGui (int argc, char *argv[]) 51 54 { 52 /**53 * Initializes the Gui54 */55 55 gtk_init (&argc, &argv); 56 56 gtk_rc_parse( "rc" ); … … 99 99 100 100 /* WIDGET */ 101 101 /** 102 * Initializes a widget. 103 * Nothing to do here. 104 */ 102 105 void Widget::init() 103 106 { … … 105 108 } 106 109 110 /** 111 * Connect any signal to any given Sub-widget 112 */ 107 113 void Widget::connectSignal (char* event, gint (*signal)(GtkWidget*, GdkEvent*, void *)) 108 114 { 109 /**110 * Connect any signal to any given Sub-widget111 */112 115 g_signal_connect (G_OBJECT (this->widget), event, G_CALLBACK (signal), NULL); 113 116 } 114 117 118 /** 119 * Connect a signal with additionally passing the whole Object 120 */ 115 121 void Widget::connectSignal (char* event, gint (*signal)( GtkWidget*, Widget *)) 116 122 { 117 /**118 * Connect a signal with additionally passing the whole Object119 */120 123 g_signal_connect (G_OBJECT (this->widget), event, G_CALLBACK (signal), this); 121 124 } 122 125 126 /** 127 * Connect a signal with additionally passing a whole external Object 128 */ 123 129 void Widget::connectSignal (char* event, void* extObj, gint (*signal)(GtkWidget*, GdkEvent*, void *)) 124 130 { 125 /**126 * Connect a signal with additionally passing a whole external Object127 */128 131 g_signal_connect (G_OBJECT (this->widget), event, G_CALLBACK (signal), extObj); 129 132 } 133 134 135 /** 136 * Function to Shows a specific widget. 137 */ 130 138 void Widget::show() 131 139 { 132 /** 133 * Function to Show any Widget 134 */ 135 gtk_widget_show (widget); 136 } 137 140 gtk_widget_show (this->widget); 141 } 142 143 /** 144 * Moves through all the Widgets downwards from this and executes the function on them. 145 \param function must be of type void and takes a Widget* as an Input. 146 147 */ 138 148 void Widget::walkThrough (void (*function)(Widget*)) 139 149 { 140 /**141 * Moves Through all the Widgets downwards from this and executes the function on them.142 * function must be of type void and takes a Widget* as an Input.143 */144 150 function(this); 145 151 switch (this->is_option) … … 158 164 159 165 166 /** 167 * This is for listing the option of "widget" 168 \param widget specifies the widget that should be listed 169 */ 160 170 void Widget::listOptions (Widget* widget) 161 171 { 162 /**163 * This is for listing the option of "widget"164 */165 172 if (widget->is_option >= 1) 166 173 cout << static_cast<Option*>(widget)->option_name <<" is : " << static_cast<Option*>(widget)->value <<endl; 167 174 } 168 175 176 /** 177 * This is for setting the option of "widget" 178 \param widget specifies the widget that should be set. 179 */ 169 180 void Widget::setOptions (Widget* widget) 170 181 { 171 /**172 * This is for setting the option of "widget"173 */174 182 if (widget->is_option >= 1) 175 183 static_cast<Option*>(widget)->redraw();// <<" is : " << static_cast<Option*>(this)->value <<endl; … … 177 185 178 186 /* CONTAINERS*/ 187 188 /** 189 * Initializes a Container. 190 * nothing to do here 191 */ 179 192 void Container::init (void) 180 193 { 181 194 return; 182 195 } 196 197 /** 198 * Fills a Container with lowerWidget. 199 * It does this by filling up the down pointer only if down points to NULL. 200 \param lowerWidget the Widget that should be filled into the Container. 201 */ 183 202 void Container::fill (Widget *lowerWidget) 184 203 { 185 /**186 * fills any given Container with a lowerwidet187 */188 204 if (this->down == NULL) 189 205 { … … 199 215 /* WINDOW */ 200 216 217 /** 218 * Creating a new Window without a Name 219 */ 201 220 Window::Window (void) 202 221 { 203 /** 204 * Creating a Window 205 */ 206 this->init(); 207 } 208 222 this->init(); 223 } 224 225 /** 226 * Creating a Window with a name 227 \param windowName the name the window should get. 228 */ 209 229 Window::Window (char* windowName) 210 230 { 211 /**212 * Creating a Window with passing a name213 */214 231 this->init(); 215 232 this->setTitle (windowName); 216 233 } 217 234 235 /** 236 * Destoying a Window (very BAD implemented). 237 * For now it just hides the window. 238 */ 218 239 Window::~Window () 219 240 { 220 /**221 * Destoying a Window (very BAD implemented)222 */223 241 gtk_widget_hide (widget); 224 225 } 226 242 } 243 244 /** 245 *initializes a new Window 246 */ 227 247 void Window::init() 228 248 { 229 /**230 *initializes a new Window231 */232 249 is_option = -1; 233 250 next = NULL; … … 241 258 } 242 259 260 /** 261 * Shows all Widgets that are included within this->widget. 262 */ 243 263 void Window::showall () 244 264 { 245 /**246 * Shows all Widgets that are included within this Widget247 */248 265 gtk_widget_show_all (widget); 249 266 } 250 267 268 /** 269 * Set The Window-title to title 270 \param title title the Window should get. 271 */ 251 272 void Window::setTitle (char* title) 252 273 { 253 /**254 * Set The Window title to title255 */256 274 gtk_window_set_title (GTK_WINDOW (widget), title); 257 275 } 258 276 259 277 /** 278 * Quits the orxonox_GUI. 279 * This can be called as a Signal and is therefor static 280 \param widget The widget that called this function 281 \param event the event that happened to execute this function 282 \param data some data passed with the Signal 283 */ 260 284 gint Window::orxonox_gui_quit (GtkWidget *widget, GdkEvent *event, gpointer data) 261 285 { 262 /**263 * Quits the orxonox_GUI264 */265 286 if (exec->shouldsave()) 266 287 exec->writeToFile (orxonoxGUI); … … 273 294 /* FRAME */ 274 295 296 /** 297 * Creates a new Frame without a name 298 */ 275 299 Frame::Frame (void) 276 300 { 277 /** 278 * Creates a new Frame without a name 279 */ 280 this->init(); 281 } 301 this->init(); 302 } 303 304 /** 305 * Creates a new Frame with name title 306 */ 282 307 Frame::Frame (char* title) 283 308 { 284 /**285 * Creates a new Frame with name title286 */287 309 this->init(); 288 310 this->setTitle(title); 289 311 } 312 313 /** 314 * Destroys given Frame (not implemented yet) 315 */ 290 316 Frame::~Frame () 291 317 { 292 /** 293 * Destroys given Frame (not implemented yet) 294 */ 295 } 296 318 } 319 320 /** 321 * Initializes a new Frame with default settings 322 */ 297 323 void Frame::init() 298 324 { … … 304 330 } 305 331 332 /** 333 * Sets the Frames name to title 334 \param title The title the Frame should get. 335 */ 306 336 void Frame::setTitle (char* title) 307 337 { 308 /**309 * Sets the Frames name to title310 */311 338 gtk_frame_set_label (GTK_FRAME (widget), title); 312 339 } 313 340 314 341 // EVENTBOX // 342 343 /** 344 * Creates a new EventBox with default settings. 345 */ 315 346 EventBox::EventBox () 316 347 { 317 348 this->init(); 318 349 } 319 350 /** 351 * Creates a new EventBox with name title 352 \param title title the Eventbox should get (only data-structure-internal) 353 */ 320 354 EventBox::EventBox (char* title) 321 355 { 322 /**323 * Creates a new EventBox with name title324 */325 356 this->init(); 326 357 this->setTitle(title); 327 358 328 359 } 360 361 /** 362 * Initializes a new EventBox 363 */ 329 364 void EventBox::init(void) 330 365 { … … 337 372 } 338 373 339 374 /** 375 * Sets the Title of the EventBox (not implemented) 376 \param title Name the EventBox should get (only datastructure-internal). 377 */ 340 378 void EventBox::setTitle (char* title) 341 379 { 342 /** 343 * Sets the EventBoxes name to title 344 */ 345 // gtk_frame_set_label (GTK_FRAME (widget), title); 346 } 380 381 } 382 383 /** 384 * Destructs an EventBox (not Implemented) 385 */ 347 386 EventBox::~EventBox () 348 387 { … … 352 391 /* BOX */ 353 392 393 /** 394 * Creates a new horizontal Box 395 */ 354 396 Box::Box (void) 355 397 { 356 /**357 * Creates a new horizontal Box358 */359 398 this->init('h'); 360 399 } 400 401 /** 402 * Creates a new Box of type boxtype 403 \param boxtype if 'v' the Box will be vertically, if 'h' the Box will be horizontally 404 */ 361 405 Box::Box (char boxtype) 362 406 { 363 /**364 * Creates a new Box if boxtype is 'v' it will be vertically, if 'h' it will be horizontally365 */366 407 this->init(boxtype); 367 408 } 409 410 /** 411 * Destroys given Box (not implemented yet) 412 */ 368 413 Box::~Box () 369 414 { 370 /** 371 * Destroys given Frame (not implemented yet) 372 */ 373 } 374 415 } 416 417 /** 418 * Initializes a new Box with type boxtype 419 \param boxtype see Box(char boxtype) 420 */ 375 421 void Box::init(char boxtype) 376 422 { … … 388 434 } 389 435 390 436 /** 437 * Fills a box with a given Widget. 438 * It does this by apending the first one to its down-pointer and all its following ones to the preceding next-pointer. The last one will receive a NULL pointer as Next 439 \param lowerWidget the next Widget that should be appendet to this Box 440 */ 391 441 void Box::fill (Widget *lowerWidget) 392 442 { … … 411 461 /* IMAGE */ 412 462 463 /** 464 * Creates a new Image 465 \param imagename the location of the Image on the Hard Disc 466 */ 413 467 Image::Image (char* imagename) 414 468 { 469 this->init(); 470 widget = gtk_image_new_from_file (imagename); 471 } 472 473 /** 474 * Initializes a new Image 475 */ 476 void Image::init() 477 { 415 478 is_option = 0; 416 479 next = NULL; 417 widget = gtk_image_new_from_file (imagename);418 }419 void Image::init()420 {421 422 480 } 423 481 424 482 425 483 /* OPTION */ 484 485 /** 486 * Initializes a new Option: nothing to do here 487 */ 426 488 void Option::init() 427 489 { 428 490 return; 429 491 } 492 493 /** 494 * This sets The FlagName of an Option and defines its default Values 495 !! Options will be saved if flagname is different from "" !! 496 \param flagname the Name that will be displayed in the output 497 \param defaultvalue the default Value for this Option (see definition of defaultvalue 498 */ 430 499 void Option::setFlagName (char* flagname, int defaultvalue) 431 500 { … … 435 504 } 436 505 506 /** 507 * see Option::setFlagName (char* flagname, int defaultvalue) 508 \param flagname the Name that will be displayed in the output 509 \param defaultvalue the default Value for this Option (see definition of defaultvalue 510 \param flagnameshort a short flagname to be displayed in the output 511 */ 437 512 void Option::setFlagName (char* flagname, char* flagnameshort, int defaultvalue) 438 513 { 439 /**440 * \brief Sets the Flagname of an Option. If it is set different then "" this Option will be saved to the Configurationfile441 */442 514 flag_name = flagname; 443 515 flag_name_short = flagnameshort; … … 448 520 449 521 /* BUTTON */ 522 523 /** 524 * Creates a new Button with a buttonname 525 \param buttonname sets the Name of the Button 526 */ 450 527 Button::Button(char* buttonname) 451 528 { 452 /**453 * Creates a new Button with name buttonname454 */455 529 this->init(); 456 530 this->setTitle(buttonname); 457 531 } 458 532 533 /** 534 * Initializes a new Button 535 */ 459 536 void Button::init(void) 460 537 { … … 469 546 } 470 547 548 /** 549 * Sets a new name to the Button 550 \param title The name the Button should get 551 */ 471 552 void Button::setTitle (char *title) 472 553 { … … 475 556 } 476 557 558 /** 559 * redraws the Button 560 * not implemented yet 561 */ 477 562 void Button::redraw () 478 563 { … … 480 565 481 566 /* CHECKBUTTON */ 567 568 /** 569 * Creates a new CheckButton with an ame 570 \param buttonname The name the CheckButton should display. 571 */ 482 572 CheckButton::CheckButton (char* buttonname) 483 573 { 484 /**485 * Creates a new CheckButton with name buttonname486 */487 574 this->init(); 488 575 this->setTitle(buttonname); … … 490 577 this->connectSignal ("clicked", this->OptionChange); 491 578 } 579 580 /** 581 * Destructs a CheckButton (not Implemented yet). 582 */ 492 583 CheckButton::~CheckButton() 493 584 { 494 585 } 495 586 587 /** 588 * Initiali a new CheckButton with default settings 589 */ 496 590 void CheckButton::init(void) 497 591 { … … 505 599 widget = gtk_check_button_new_with_label (""); 506 600 } 601 602 /** 603 * Sets a new Title to a CheckButton 604 \param title The new Name the CheckButton should display. 605 */ 507 606 void CheckButton::setTitle(char* title) 508 607 { … … 511 610 } 512 611 612 613 /** 614 * Signal OptionChange writes the Value from the CheckButton to its Object-Database. 615 \param widget The widget(CheckButton) that has a changed Value 616 \param checkbutton the CheckButton-Object that should receive the change. 617 */ 513 618 gint CheckButton::OptionChange (GtkWidget *widget, Widget* checkbutton) 514 619 { 515 /**516 * Writes value, if changed on the checkbutton, to the object.517 */518 620 static_cast<CheckButton*>(checkbutton)->value = (int)gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON ((CheckButton*)checkbutton->widget)); 519 621 flags->setTextFromFlags(orxonoxGUI); … … 521 623 } 522 624 625 /** 626 * Redraws the CheckButton (if option has changed). 627 * Example: if new settings are loaded the Button must be redrawn for the GUI to display that Change 628 */ 523 629 void CheckButton::redraw () 524 630 { … … 527 633 528 634 /* SLIDER */ 635 636 /** 637 * Creates a new Slider 638 \param slidername The data-structure-name of the slider. 639 \param start The minimal Value of the slider. 640 \param end The maximal Value of the slider. 641 */ 529 642 Slider::Slider (char* slidername, int start, int end) 530 643 { 531 /**532 * Creates a new Slider with name slidername a beginning value of start and an end value of end.533 */534 644 this->init(start, end); 535 645 this->setValue(start); … … 538 648 } 539 649 650 /** 651 * Destructs a Slider (not implemented yet) 652 */ 540 653 Slider::~Slider() 541 654 { 542 655 } 543 656 657 /** 658 * Initializes a Slider with start and end Values 659 * params: see Slider::Slider (char* slidername, int start, int end) 660 */ 544 661 void Slider::init(int start, int end) 545 662 { … … 553 670 widget = gtk_hscale_new_with_range (start, end, 5); 554 671 } 672 673 /** 674 * Sets a new Title to the Slider 675 \param title The new Name of the slider 676 */ 555 677 void Slider::setTitle(char* title) 556 678 { 557 679 option_name = title; 558 680 } 681 682 /** 683 * Setting a new value to the Slider. 684 * Maybe you also require a Slider::redraw() for this to display 685 */ 559 686 void Slider::setValue(int value) 560 687 { … … 562 689 } 563 690 691 /** 692 * Signal OptionChange writes the Value from the Slider to its Object-Database. 693 \param widget The widget(Slider) that has a changed Value 694 \param slider the Slider-Object that should receive the change. 695 */ 564 696 gint Slider::OptionChange (GtkWidget *widget, Widget* slider) 565 697 { 566 /**567 * Writes value, if changed on the slider, to the object.568 */569 698 static_cast<Slider*>(slider)->value = (int)gtk_range_get_value (GTK_RANGE ((Slider*)slider->widget)); 570 699 flags->setTextFromFlags(orxonoxGUI); … … 572 701 } 573 702 703 /** 704 * Redraws the widget 705 * Example: see void CheckButton::redraw () 706 */ 574 707 void Slider::redraw () 575 708 { … … 577 710 } 578 711 712 /* MENU */ 713 714 /** 715 * Creates a Menu-Item-list out of multiple input. 716 * !! Consider, that the last input argument has to be "lastItem" for this to work!! 717 \param menuname The Database-Name of this Menu 718 \param ... items to be added to this Menu. !! Consider, that the last input argument has to be "lastItem" for this to work!! 719 */ 579 720 Menu::Menu (char* menuname, ...) 580 721 { 581 /**582 * Creates an Menu-Item-list out of multiple input. Consider, that the last input argument has to be "lastItem" for this to work.583 */584 722 this->init(); 585 723 this->setTitle(menuname); … … 598 736 } 599 737 738 /** 739 * Initializes a new Menu with no items 740 */ 600 741 void Menu::init(void) 601 742 { … … 611 752 } 612 753 754 /** 755 * Sets the Database-Name of this Menu 756 \param title Database-Name to be set. 757 */ 613 758 void Menu::setTitle(char* title) 614 759 { … … 616 761 } 617 762 763 /** 764 * appends a new Item to the Menu-List. 765 \param itemName the itemName to be appendet. 766 */ 618 767 void Menu::addItem (char* itemName) 619 768 { … … 622 771 } 623 772 624 gint Menu::OptionChange (GtkWidget *widget, Widget* menu) 625 { 626 /** 627 * Writes value, if changed on the Menu, to the object. 628 */ 773 /** 774 * Signal OptionChange writes the Value from the Menu to its Object-Database. 775 \param widget The widget(Menu) that has a changed Value 776 \param menu the Menu-Object that should receive the change. 777 */gint Menu::OptionChange (GtkWidget *widget, Widget* menu) 778 { 629 779 static_cast<Menu*>(menu)->value = (int)gtk_option_menu_get_history (GTK_OPTION_MENU (menu->widget)); 630 780 flags->setTextFromFlags(orxonoxGUI); … … 632 782 } 633 783 784 /** 785 * Redraws the widget 786 * Example: see void CheckButton::redraw () 787 */ 634 788 void Menu::redraw () 635 789 { … … 637 791 } 638 792 793 /** 794 * Creates a new default Label with no Text. 795 * You migth consider adding Label::setTitle with this. 796 */ 639 797 Label:: Label () 640 798 { … … 642 800 } 643 801 802 /** 803 * Creates a new Label with a Text. 804 \param text The text to be displayed. 805 */ 644 806 Label:: Label (char* text) 645 807 { … … 650 812 } 651 813 814 /** 815 * Destructs a Label 816 */ 652 817 Label::~Label () 653 818 {} 654 819 820 /** 821 * initializes a new Label 822 */ 655 823 void Label::init(void) 656 824 { … … 661 829 gtk_label_set_line_wrap (GTK_LABEL(widget), TRUE); 662 830 } 663 831 832 /** 833 * Sets a new Text to a Label. 834 \param text The text to be inserted into the Label. 835 */ 664 836 void Label::setText (char * text) 665 837 { … … 667 839 } 668 840 841 /** 842 * get the Text of a Label 843 \return The Text the Label holds. 844 */ 669 845 char* Label::getText () 670 846 { -
orxonox/trunk/gui/orxonox_gui.h
r2587 r2588 1 /*! 2 \file orxonox_gui.h 3 \brief Contains all Widgets and the Creation of the Gui 4 */ 5 1 6 #ifndef _ORXONOX_GUI_H 2 7 #define _ORXONOX_GUI_H … … 19 24 #include <gtk/gtkeventbox.h> 20 25 26 //! Class that creates the OrxonoxGui 21 27 class OrxonoxGui 22 28 { … … 27 33 }; 28 34 35 //! This is the topmost object that can be displayed all others are derived from it. 36 29 37 class Widget 30 38 { 31 39 private: 32 40 public: 33 Widget* next; 34 GtkWidget* widget; 41 Widget* next; //!< next always points to the next Widget in the list. Every Widget has a next one, or has NULL as next 42 GtkWidget* widget; //!< widget is the gtk_widget that the specific Object Contains. 35 43 virtual void init(void); 36 int is_option; 44 int is_option; //!< with this Paramenter one can set the IsOption type: -2:Container, -1: Box, 0: not an Option, 1: Bool-option, 2: int-option 37 45 38 46 void connectSignal (char* event, gint (*signal)(GtkWidget*, GdkEvent*, void *)); … … 48 56 49 57 50 58 //! This is a Container Class, it can contain one sub-Widget: down. 59 /** 60 * A Container is a Widget that can hold a subWidget in addition to a next-Widget. 61 * The Container can by itself not be displayed created or used. 62 * The derived classes of Container can be displayed 63 */ 51 64 class Container : public Widget 52 65 { … … 58 71 public: 59 72 void init(void); 60 Widget* down; 61 void setBorderWidth (int borderwidth);62 virtual void setTitle (char* title) = 0;73 Widget* down; //!< this points to the Widget below this. 74 // void setBorderWidth (int borderwidth); 75 // virtual void setTitle (char* title) = 0; 63 76 void fill (Widget *lowerWidget); 64 77 }; 65 78 79 //! Window is the class that creates new Windows, and handels them 80 /** 81 * A Window is a class derived from Container that contains a window-widget. 82 * It has the ability to hold one sub-object 83 */ 66 84 class Window : public Container 67 85 { … … 73 91 74 92 void setTitle (char* title); 75 void showall (); 93 void showall (); 76 94 static gint orxonox_gui_quit (GtkWidget *widget, GdkEvent *event, gpointer data); 77 95 }; 78 96 97 //! Frame is the class that handles frames 98 /** 99 * A Frame is an object, that has a border and if you like a name on it. 100 * It can contain a Widget, which means that you can insert anything you like inside of a frame 101 */ 79 102 class Frame :public Container 80 103 { … … 88 111 }; 89 112 113 //! EventBox is a Container that can Handle all Events happening inside of it. 114 /** 115 * Example: if you have a picture, and you want it to catch mouse-clicks, you have to pack it inside a EventBox 116 */ 90 117 class EventBox : public Container 91 118 { … … 99 126 }; 100 127 128 //! A Box can contain multiple Widgets 129 /** 130 * A Box can Contain multiple Widgets, that are ordered either horizontally or vertically 131 * I defined the standartbox to be horizontally. 132 * A Box is always filled left->right (horizontally) or up->down (vertically) 133 */ 101 134 class Box : public Widget 102 135 { … … 107 140 void init(char boxtype); 108 141 109 Widget* down; 142 Widget* down; //!< the Lower Widget of a Box. 110 143 void fill (Widget* lowerWidget); 111 144 112 145 }; 113 146 147 //! Image is the keeper of one Image 148 /** 149 * Images are mighty cool. 150 * Images can help you lighten up the Programming process, and will give everyone a better impression of the Software. 151 */ 114 152 class Image : public Widget 115 153 { … … 120 158 }; 121 159 160 //! An Option is a Widget that contains something that may change its state. 161 /** 162 * Options are the essence of a GUI, they: Configure, Start, Quit, Execute, and make it worth something 163 */ 122 164 class Option : public Widget 123 165 { … … 126 168 void init(void); 127 169 128 int value; 129 char* option_name; 130 char* flag_name; 131 char* flag_name_short; 132 int default_value; 170 int value; //!< every option has a value either true or false (0,1) or something else like 25 for 25% of the volume 171 char* option_name; //!< options have a name, that can be displayed around them 172 char* flag_name; //!< options have a flag name that will be appendet if you start the Program from the GUI. 173 char* flag_name_short; //!< like flag_name but shorter 174 int default_value; //!< A default value is good, for hiding a option if it is not needed. (hidden if value == default_value) 133 175 134 176 void setFlagName (char* flagname, int defaultvalue); 135 177 void setFlagName (char* flagname, char* flagnameshort, int defaultvalue); 136 virtual void redraw () = 0; 137 }; 138 178 virtual void redraw () = 0; //!< A Option must be able to redraw itself. 179 }; 180 181 //! Buttons can be pressed, and released. 182 /** 183 * Buttons are mainly there for executing some action like Starting the Programm, or Quiting it. 184 */ 139 185 class Button : public Option 140 186 { … … 149 195 }; 150 196 197 //! CheckButtons are a key in configuring bool Variables 198 /** CheckButtons can configure bool Variables like wireframe on/off, enable_sound etc. 199 */ 151 200 class CheckButton : public Option 152 201 { … … 162 211 }; 163 212 213 //! Sliders are Options that can be modified in their value 214 /** 215 * good for volume, brightness, etc. 216 */ 164 217 class Slider : public Option 165 218 { … … 176 229 }; 177 230 231 //! A Menu is an Option that has a dropdown menu, where you can chose between different Items 178 232 class Menu : public Option 179 233 { … … 195 249 }; 196 250 251 //! A label is a Widget, that displays a text 197 252 class Label : public Widget 198 253 { -
orxonox/trunk/gui/orxonox_gui_audio.cc
r2581 r2588 26 26 #include "orxonox_gui_audio.h" 27 27 28 /** 29 \brief Creates an Audio-Frame 30 */ 28 31 OrxonoxGuiAudio::OrxonoxGuiAudio () 29 32 { … … 48 51 } 49 52 53 /** 54 \brief Return the Frame 55 \return Returns the Audio-frame 56 */ 50 57 Frame* OrxonoxGuiAudio::getFrame () 51 58 { -
orxonox/trunk/gui/orxonox_gui_audio.h
r2018 r2588 1 /*! 2 \file orxonox_gui_audio.h 3 \brief File that holds the class that creates the Audio-Options. 4 */ 5 1 6 #ifndef _ORXONOX_GUI_AUDIO_H 2 7 #define _ORXONOX_GUI_AUDIO_H … … 4 9 #include "orxonox_gui.h" 5 10 11 //! Class that creates the Audio-Options. 6 12 class OrxonoxGuiAudio 7 13 { -
orxonox/trunk/gui/orxonox_gui_banner.cc
r2581 r2588 27 27 #include <iostream.h> 28 28 29 /** 30 \brief Creates a new BannerEventBox and its content. 31 */ 29 32 OrxonoxGuiBanner::OrxonoxGuiBanner () 30 33 { … … 36 39 } 37 40 41 /** 42 \brief Destructs it. 43 */ 38 44 OrxonoxGuiBanner::~OrxonoxGuiBanner () 39 45 { 40 46 } 41 47 48 /** 49 \brief Opens up our LOGO-Window.\n 50 it creates a new one if it has not yet been opened.\n 51 it shows it if it has been created 52 */ 42 53 void OrxonoxGuiBanner::logoWindowNew() 43 54 { … … 65 76 } 66 77 } 78 79 /** 80 \brief Hides Window through ~Window(); 81 */ 67 82 void OrxonoxGuiBanner::logoWindowClose() 68 83 { … … 71 86 } 72 87 73 74 88 /** 89 \brief Returns an EventBox 90 \return The EventBox, that holds the Banner. 91 */ 75 92 EventBox* OrxonoxGuiBanner::getEventBox () 76 93 { … … 78 95 } 79 96 97 /** 98 \brief opens up the banner-window.\n 99 this is the Signal that does it. !!SIGNALS ARE STATIC!! 100 \param widget the widget that did it! 101 \param event the event that did it! 102 \param banner the Object that holds the banner-logo-window 103 */ 80 104 gint LogoWindowOpen (GtkWidget* widget, GdkEvent* event, void* banner) 81 105 { 82 //cout << data->is_option<<"\n";83 106 static_cast<OrxonoxGuiBanner*>(banner)->logoWindowNew(); 84 107 } 85 108 109 /** 110 \brief closes the banner-window.\n 111 this is the Signal that does it. !!SIGNALS ARE STATIC!! 112 \param widget the widget that did it! 113 \param event the event that did it! 114 \param banner the Object that holds the banner-logo-window 115 */ 86 116 gint LogoWindowClose (GtkWidget *widget, GdkEvent* event, void* banner) 87 117 { -
orxonox/trunk/gui/orxonox_gui_banner.h
r2581 r2588 1 /*! 2 \file orxonox_gui_banner.h 3 \brief File that holds the class that creates the Banner-Image.\n 4 This is Commercial :-) 5 */ 6 1 7 #ifndef _ORXONOX_GUI_BANNER_H 2 8 #define _ORXONOX_GUI_BANNER_H … … 4 10 #include "orxonox_gui.h" 5 11 12 //! Class that creates the Banner-Image 6 13 class OrxonoxGuiBanner 7 14 { … … 9 16 Frame* bannerFrame; 10 17 Box* bannerBox; 11 EventBox* bannerEventBox; 18 EventBox* bannerEventBox; //!< an Image needs an EventBox to catch klicks 12 19 Image* bannerImage; 13 20 Label* bannerLabel; … … 25 32 EventBox* getEventBox (); 26 33 }; 34 27 35 gint LogoWindowOpen (GtkWidget *widget, GdkEvent* event, void* banner); 28 36 gint LogoWindowClose (GtkWidget *widget, GdkEvent* event, void* banner); -
orxonox/trunk/gui/orxonox_gui_exec.cc
r2584 r2588 28 28 #include <string> 29 29 30 /** 31 \brief Creates the Exec-Frame 32 \param orxonoxGUI ExecFrame needs to know where to get the Options from 33 */ 30 34 OrxonoxGuiExec::OrxonoxGuiExec (Window* orxonoxGUI) 31 35 { … … 54 58 } 55 59 60 /** 61 \brief Return the Frame 62 \return Returns the Exec-frame 63 */ 56 64 Frame* OrxonoxGuiExec::getFrame () 57 65 { … … 61 69 /* FILE HANDLING */ 62 70 71 /** 72 \brief Sets the location of the configuration File.\n 73 * The name will be parsed from ~/ to /home/[username] on unix and c:/Documents and Settings/username/Settings/ on Windows 74 \param filename the location of the configFile 75 */ 63 76 void OrxonoxGuiExec::setFilename (char* filename) 64 77 { … … 78 91 } 79 92 93 /** 94 \brief checks if a option should be saved. 95 \return 1 if it should 0 if not/ 96 */ 80 97 int OrxonoxGuiExec::shouldsave () 81 98 { … … 83 100 } 84 101 102 /** 103 \brief Saves the configuration-file to the Disk.\n 104 this Function only opens and closes the file, in between OrxonoxGuiExec::writeFileText (Widget* widget) will execute the real writing process. 105 \param widget from which Widget on should be saved. 106 */ 85 107 void OrxonoxGuiExec::writeToFile (Widget* widget) 86 108 { … … 91 113 } 92 114 115 /** 116 \brief Actually writes into the configuration file to the disk. 117 \param widget from which Widget on should be saved. 118 */ 93 119 void OrxonoxGuiExec::writeFileText (Widget* widget) 94 120 { … … 121 147 } 122 148 149 /** 150 \brief Reads in Configuration Data. 151 \param widget from which Widget on should be saved. 152 */ 123 153 void OrxonoxGuiExec::readFromFile (Widget* widget) 124 154 { … … 150 180 } 151 181 182 /** 183 \brief Maps Confugurations to the Options. 184 \param widget which widget downwards 185 \param variableName the name of the Variable that should be set up. 186 \param variableValue the Value of the Variable that should be set up 187 */ 152 188 void OrxonoxGuiExec::readFileText (Widget* widget, char* variableName, int variableValue) 153 189 { … … 170 206 } 171 207 172 208 /** 209 \brief Starts ORXONOX. (not really implemented yet, but the function is there.\n 210 This is a Signal and can be executed through Widget::signal_connect 211 \param widget the widget that executed the start command 212 \param data additional data 213 */ 173 214 gint startOrxonox (GtkWidget *widget, Widget* data) 174 215 { 175 /**176 * Starts Orxonox.177 */178 216 cout << "Starting Orxonox" <<endl; 179 217 } -
orxonox/trunk/gui/orxonox_gui_exec.h
r2053 r2588 1 /*! 2 \file orxonox_gui_exec.h 3 \brief File that holds the class that creates the execute-Options. 4 */ 5 1 6 #ifndef _ORXONOX_GUI_EXEC_H 2 7 #define _ORXONOX_GUI_EXEC_H … … 6 11 using namespace std; 7 12 13 //! Class that creates the execute-Options. 8 14 class OrxonoxGuiExec 9 15 { -
orxonox/trunk/gui/orxonox_gui_flags.cc
r2581 r2588 27 27 #include <iostream.h> 28 28 29 29 /** 30 \brief Creates the Flags-Frame 31 \param widget The Widget from which the data will be parsed 32 */ 30 33 OrxonoxGuiFlags::OrxonoxGuiFlags (Widget* widget) 31 34 { … … 43 46 } 44 47 48 /** 49 \brief Function to return the Frame that holds the Flagtext. 50 \returns Frame that holds the Flagtext. 51 */ 45 52 Frame* OrxonoxGuiFlags::getFrame () 46 53 { … … 48 55 } 49 56 57 /** 58 \brief Sets the Flags from widget downwards. 59 \param widget the Widget from which on to scan for deeper Options and their settings. 60 */ 50 61 void OrxonoxGuiFlags::setTextFromFlags (Widget* widget) 51 62 { … … 56 67 } 57 68 69 /** 70 \brief this actually sets the flagtext, and appends it to flagText 71 \param widget like OrxonoxGuiFlags::setTextFromFlags(widget) 72 */ 58 73 void OrxonoxGuiFlags::FlagsText(Widget* widget) 59 74 { … … 89 104 FlagsText (widget->next); 90 105 } 91 92 -
orxonox/trunk/gui/orxonox_gui_flags.h
r2018 r2588 1 /*! 2 \file orxonox_gui_flags.h 3 \brief File that holds the class that creates the flags-Text. 4 */ 5 1 6 #ifndef _ORXONOX_GUI_FLAGS_H 2 7 #define _ORXONOX_GUI_FLAGS_H … … 4 9 #include "orxonox_gui.h" 5 10 11 //! Class that creates the flags-Text. 6 12 class OrxonoxGuiFlags 7 13 { -
orxonox/trunk/gui/orxonox_gui_video.cc
r2581 r2588 28 28 29 29 30 31 30 OrxonoxGuiVideo::OrxonoxGuiVideo () 32 31 { … … 44 43 } 45 44 45 /** 46 \brief Return the Frame 47 \return Returns the Video-frame 48 */ 46 49 Frame* OrxonoxGuiVideo::getFrame () 47 50 { -
orxonox/trunk/gui/orxonox_gui_video.h
r2018 r2588 1 /*! 2 \file orxonox_gui_video.h 3 \brief File that holds the class that creates the Video-Options. 4 */ 1 5 #ifndef _ORXONOX_GUI_VIDEO_H 2 6 #define _ORXONOX_GUI_VIDEO_H … … 4 8 #include "orxonox_gui.h" 5 9 10 //! Class that creates the Video-Options. 6 11 class OrxonoxGuiVideo 7 12 {
Note: See TracChangeset
for help on using the changeset viewer.