Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8016 in orxonox.OLD for branches


Ignore:
Timestamp:
May 31, 2006, 11:09:27 AM (18 years ago)
Author:
bensch
Message:

box scales with its children

Location:
branches/gui/src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/gui/src/lib/graphics/importer/model.h

    r7193 r8016  
    2525#include "base_object.h"
    2626#include "vector.h"
    27 
    28 using namespace std;
    2927
    3028
  • branches/gui/src/lib/gui/gl_gui/glgui_box.cc

    r8004 r8016  
    5050
    5151    this->children.push_back(widget);
    52     this->addChild2D(widget);
     52    widget->setParentWidget(this);
    5353
    5454    this->resize();
  • branches/gui/src/lib/gui/gl_gui/glgui_widget.cc

    r8008 r8016  
    3434    this->init();
    3535
    36     if (parent != NULL)
    37       parent->addChild2D(this);
     36    this->setParentWidget(parent);
    3837  }
    3938
     
    7271  }
    7372
     73
     74  void GLGuiWidget::setParentWidget(GLGuiWidget* parent)
     75  {
     76    this->_parent = parent;
     77
     78    if (parent != NULL)
     79      parent->addChild2D(this);
     80  }
    7481
    7582  /** @brief gives focus to this widget */
     
    115122  {
    116123    this->backRect().setSize(this->getSize2D());
     124    if (this->parent() != NULL)
     125      this->parent()->resize();
    117126  }
    118127
  • branches/gui/src/lib/gui/gl_gui/glgui_widget.h

    r8008 r8016  
    4444
    4545
     46    void setParentWidget(GLGuiWidget* parent);
     47    GLGuiWidget* parent() const { return this->_parent; }
     48
    4649    /// FOCUS
    4750    /** @brief gives focus to this widget */
     
    5962    /** @returns the currently focused Widget (NULL if none is selected) */
    6063    static GLGuiWidget* focused() { return GLGuiWidget::_focused; };
    61 
    6264
    6365
     
    132134
    133135  private:
     136    GLGuiWidget*                   _parent;           //!< The parent of this Widget.
     137
    134138    /// LOOKS
    135139    Material                       _backMat;
     
    147151    bool                           _pushed;
    148152
     153
    149154    static GLGuiWidget*            _selected;         //!< The currently selected Widget.
    150155    static GLGuiWidget*            _focused;          //!< The currently Focused Widget.
  • branches/gui/src/lib/lang/base_object.h

    r7779 r8016  
    1212#include "class_id.h"
    1313#include "debug.h"
    14 #ifndef NULL
    15 #define NULL     0    //!< NULL
    16 #endif
     14#include <string>
    1715
    18 #include <string>
    1916#include "stdincl.h"
    2017
  • branches/gui/src/story_entities/simple_game_menu.cc

    r8013 r8016  
    117117  OrxGui::GLGuiBox* imageSelector = new OrxGui::GLGuiBox();
    118118  {
    119 
    120119    image = new OrxGui::GLGuiImage();
    121     image->setWidgetSize(200, 200);
     120    image->setWidgetSize(300, 300);
    122121    image->setAbsCoor2D(300, 300);
    123122    imageSelector->pack(image);
Note: See TracChangeset for help on using the changeset viewer.