Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5391 in orxonox.OLD for trunk/src/lib/gui


Ignore:
Timestamp:
Oct 16, 2005, 1:37:41 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: more gui-definitions

Location:
trunk/src/lib/gui/gl_gui
Files:
8 edited

Legend:

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

    r5364 r5391  
    2323 * standard constructor
    2424*/
    25 GLGuiBox::GLGuiBox ()
     25GLGuiBox::GLGuiBox (GLGuiBoxType type)
    2626{
    2727  this->init();
    2828
     29  this->setType (type);
    2930}
    3031
  • trunk/src/lib/gui/gl_gui/glgui_box.h

    r5364 r5391  
    1212// FORWARD DECLARATION
    1313
     14typedef enum
     15{
     16  GLGuiBox_H,
     17  GLGuiBox_V,
     18} GLGuiBoxType;
     19
    1420//! This is BOX part of the openglGUI class
    1521/**
     
    1925
    2026 public:
    21   GLGuiBox();
     27  GLGuiBox(GLGuiBoxType type = GLGuiBox_H);
    2228  virtual ~GLGuiBox();
    2329
    2430  void init();
     31  void setType(GLGuiBoxType type) { this->type = type; };
    2532
    2633  virtual void draw();
    2734
    2835 private:
     36   GLGuiBoxType         type;
    2937
    3038};
  • trunk/src/lib/gui/gl_gui/glgui_checkbutton.h

    r5366 r5391  
    2424  void init();
    2525
     26  bool    isActive() { return this->bActive; };
     27  void    setActivity(bool bActive);
     28
    2629  virtual void draw();
    2730
    2831 private:
     32   bool             bActive;
    2933
    3034};
  • trunk/src/lib/gui/gl_gui/glgui_container.h

    r5364 r5391  
    2525  void init();
    2626
     27  void add(GLGuiWidget* widget);
     28
     29  void setBorderWidth(float borderwidth);
     30
    2731  void hideAll();
    2832  void showAll();
     33
    2934
    3035  virtual void draw();
  • trunk/src/lib/gui/gl_gui/glgui_handler.cc

    r5388 r5391  
    4646void GLGuiHandler::activate()
    4747{
    48 //  EventHandler::getInstance()->setState(ES_MENU);
     48  EventHandler::getInstance()->pushState(ES_MENU);
    4949
    5050}
     
    5252void GLGuiHandler::deactivate()
    5353{
     54  EventHandler::getInstance()->popState();
    5455
    5556}
  • trunk/src/lib/gui/gl_gui/glgui_menu.h

    r5366 r5391  
    1111
    1212// FORWARD DECLARATION
    13 
     13template<class T>  class tList;
    1414//! This is Menu part of the openglGUI class
    1515/**
     
    2424  void init();
    2525
     26  void addItem(const char* itemName);
     27  void removeItem(const char* itemName);
     28  void removeItem(unsigned int itemNumber);
     29  void selectItem(const char* itemName);
     30  void selectItem(unsigned int itemNumber);
     31
    2632  virtual void draw();
    2733
    2834 private:
     35   tList<char>*           itemList;
    2936
    3037};
  • trunk/src/lib/gui/gl_gui/glgui_widget.cc

    r5387 r5391  
    3939
    4040
     41bool GLGuiWidget::focusOverWidget(float x, float y)
     42{
     43  if (this->getAbsCoor2D().x < x && this->getAbsCoor2D().x+ this->getSizeX2D() > x &&
     44      this->getAbsCoor2D().y < y && this->getAbsCoor2D().y+ this->getSizeX2D() > y)
     45    return true;
     46  else
     47    return false;
     48}
     49
     50
    4151/**
    4252 * initializes the GUI-element
  • trunk/src/lib/gui/gl_gui/glgui_widget.h

    r5387 r5391  
    11/*!
    2 * @file glgui_widget.h
    3 * The gl_widget of the openglGUI
    4 */
     2 * @file glgui_widget.h
     3 * The gl_widget of the openglGUI
     4 */
    55
    66#ifndef _GLGUI_WIDGET_H
     
    99#include "element_2d.h"
    1010#include "glincl.h"
     11#include "event.h"
    1112
    1213// FORWARD DECLARATION
    1314class Material;
     15class Signal; //!< @todo create this!!
     16
     17typedef enum
     18{
     19  GLGuiSignal_click     = 0,
     20  GLGuiSignal_release   = 1,
     21  GLGuiSignal_rollOn    = 2,
     22  GLGuiSignal_rollOff   = 3,
     23  GLGuiSignal_open      = 4,
     24  GLGuiSignal_close     = 5,
     25  GLGuiSignal_destroy   = 6,
     26
     27  GLGuiSignalCount      = 7,
     28} GLGuiSignalType;
    1429
    1530//! if the Element should be visible by default.
     
    3045    void hide();
    3146
     47    void connectSignal(GLGuiSignalType signalType, Signal* signal);
     48    void disconnectSignal(GLGuiSignalType);
     49    bool focusOverWidget(float x, float y);
     50
     51    // if something was clickt on the GUI-widget.
     52    virtual void click(const Event& event) {};
     53    virtual void release(const Event& event) {};
     54
     55    virtual void receiveFocus() {};
     56    virtual void removeFocus() {};
    3257
    3358    virtual void update() = 0;
     
    4065    GLuint                frontModel;
    4166
     67    Signal*               widgetSignals[GLGuiSignalCount];
     68
    4269  private:
    4370    bool                  focusable;        //!< If this widget can receive focus.
Note: See TracChangeset for help on using the changeset viewer.