Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7874 in orxonox.OLD for branches/gui/src


Ignore:
Timestamp:
May 26, 2006, 3:54:11 PM (19 years ago)
Author:
bensch
Message:

fixed the Shell

Location:
branches/gui/src/lib
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/gui/src/lib/graphics/render2D/element_2d.cc

    r7846 r7874  
    6262  this->toCoordinate = NULL;
    6363  this->toDirection = NULL;
     64
     65  this->size = Vector2D(0,0);
    6466  this->toSize = NULL;
    65   this->setSize2D(1, 1);
    6667
    6768
     
    847848    if (unlikely(this->toSize != NULL))
    848849    {
    849       Vector2D shiftSize = (*this->toSize - Vector2D(this->sizeX, this->sizeY)) *fabsf(dt)*bias;
     850      Vector2D shiftSize = (*this->toSize - this->size) *fabsf(dt)*bias;
    850851      if (likely((shiftSize).len() >= .001))//PNODE_ITERATION_DELTA))
    851852      {
    852         this->sizeX += shiftSize.x;
    853         this->sizeY += shiftSize.y;
     853        this->size += shiftSize;
    854854      }
    855855      else
  • branches/gui/src/lib/graphics/render2D/element_2d.h

    r7843 r7874  
    125125    inline const PNode* getBindNode() const { return this->bindNode; };
    126126
    127     inline void setSize2D(float x, float y) { this->sizeX = x, this->sizeY = y; };
     127    inline void setSize2D(float x, float y) { this->size = Vector2D(x, y); };
    128128    void setSizeSoft2D(float x, float y, float bias = 1.0);
    129     inline void setSizeX2D(float x) { this->sizeX = x; };
    130     inline void setSizeY2D(float y) { this->sizeY = y; };
    131     inline float getSizeX2D() const { return this->sizeX; };
    132     inline float getSizeY2D() const { return this->sizeY; };
     129    inline void setSizeX2D(float x) { this->size.x = x; };
     130    inline void setSizeY2D(float y) { this->size.y = y; };
     131    inline float getSizeX2D() const { return this->size.x; };
     132    inline float getSizeY2D() const { return this->size.y; };
    133133
    134134  public:
     
    238238  private:
    239239    const PNode*            bindNode;           //!< a node over which to display this 2D-element
    240     float                   sizeX;              //!< The size of the rendered item in x-direction
    241     float                   sizeY;              //!< The size of the rendered Item in y-direction
     240    Vector2D                size;               //!< The size of the rendered item
    242241    Vector2D*               toSize;             //!< The Size to iterate to.
    243242
  • branches/gui/src/lib/graphics/text_engine/text.cc

    r7873 r7874  
    243243    if(this->font->getGlyphArray()[this->text[i]] != NULL)
    244244      width += this->font->getGlyphArray()[this->text[i]]->advance;
    245   this->setSizeX2D(width *this->getSize());
     245  this->setSizeX2D(width * this->getSize());
     246  printf("%s:: %f\n", this->text.c_str(), width * this->getSize());
    246247}
    247248
  • branches/gui/src/lib/gui/gl_gui/glgui_button.cc

    r7873 r7874  
    3131    this->setLabel(label);
    3232
     33    this->label.setFont("fonts/final_frontier.ttf", 100);
     34    this->label.setSize(10);
    3335    this->label.setText("TEST");
    3436  }
     
    6062    this->label.setText(label);
    6163    this->label.setRelCoor2D(5, 5);
     64    printf("SIZE OF TEXT %s %f\n", label.c_str(), this->label.getSizeX2D());
    6265    this->setSize2D(this->label.getSizeX2D(), this->label.getSizeY2D()+10);
     66    printf("SIZE OF BUTTON %f\n", this->getSizeX2D());
     67
    6368  }
    6469
  • branches/gui/src/lib/shell/shell_input.cc

    r7868 r7874  
    305305        this->historyMoveUp();
    306306        this->pressedKey = event.type;
     307        this->pressedEvent = event.type;
    307308      }
    308309      else if (event.type == SDLK_DOWN)
     
    310311        this->historyMoveDown();
    311312        this->pressedKey = event.type;
     313        this->pressedEvent = event.type;
    312314      }
    313315      else if (event.type == SDLK_TAB)
     
    320322        this->delayed = this->repeatDelay;
    321323        this->pressedKey = SDLK_BACKSPACE;
     324        this->pressedEvent = SDLK_BACKSPACE;
    322325        this->removeCharacters(1);
    323326      }
     
    326329        this->executeCommand();
    327330        this->pressedKey = event.type;
     331        this->pressedEvent = event.type;
    328332      }
    329333      // any other keyboard key
Note: See TracChangeset for help on using the changeset viewer.