Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8004 in orxonox.OLD for branches/gui


Ignore:
Timestamp:
May 31, 2006, 12:35:02 AM (18 years ago)
Author:
bensch
Message:

gui: box works pretty good now

Location:
branches/gui/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/gui/src/lib/gui/gl_gui/glgui_box.cc

    r8003 r8004  
    103103  void GLGuiBox::resize()
    104104  {
    105     float height = 0.0f;
     105    float height = this->borderSize();
    106106    float width = 0.0f;
    107107    std::vector<GLGuiWidget*>::iterator widget;
     
    110110    for (widget = this->children.begin(); widget != this->children.end(); ++widget)
    111111    {
    112       (*widget)->setAbsCoor2D(0, height);
     112      (*widget)->setRelCoor2D(this->borderSize(), height);
    113113      height += (*widget)->getSizeY2D();
    114114      width = fmax(width, (*widget)->getSizeX2D());
    115115    }
    116116
     117    width += this->borderSize() * 2.0;
     118    height += this->borderSize(); /* *2 done further up */
     119
     120    printf("%f %f\n", width, height);
     121    this->setSize2D(width, height);
    117122    GLGuiWidget::resize();
    118123    // resize everything.
  • branches/gui/src/story_entities/simple_game_menu.cc

    r8003 r8004  
    9090    ///
    9191    OrxGui::GLGuiButton* dnpb = new OrxGui::GLGuiCheckButton("Push the button");
    92     dnpb->show();
    93     dnpb->setAbsCoor2D(350, 50);
    9492
    9593    box->pack(dnpb);
    9694
    9795    OrxGui::GLGuiPushButton* rdnpb = new OrxGui::GLGuiPushButton("Quit ORXONOX!!");
    98     rdnpb->show();
    99     rdnpb->setAbsCoor2D(200, 180);
    10096    rdnpb->connect(SIGNAL(rdnpb, released), this, SLOT(SimpleGameMenu, quitMenu));
    10197
     
    105101    input->setText("input some text here");
    106102    input->connect(SIGNAL(input, textChanged), this, SLOT(SimpleGameMenu, TEST));
    107     input->show();
    108     input->setAbsCoor2D(200, 230);
    109103    box->pack(input);
    110104
    111105    OrxGui::GLGuiSlider* slider = new OrxGui::GLGuiSlider();
    112106    slider->connect(SIGNAL(slider, valueChanged), this, SLOT(SimpleGameMenu, TEST));
    113     slider->connect(SIGNAL(slider, valueChanged), dnpb, SLOT(OrxGui::GLGuiWidget, setBackgroundColor));
     107    slider->connect(SIGNAL(slider, valueChanged), box, SLOT(OrxGui::GLGuiWidget, setBackgroundColor));
    114108    slider->setRange(0, 1);
    115109    slider->setValue(slider->min());
    116     slider->show();
    117     slider->setAbsCoor2D(200, 270);
    118110    box->pack(slider);
    119111  }
    120112  box->setAbsCoor2D(50, 200);
     113  box->showAll();
    121114  /////
    122115}
Note: See TracChangeset for help on using the changeset viewer.