Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7988 in orxonox.OLD


Ignore:
Timestamp:
May 30, 2006, 6:42:08 PM (18 years ago)
Author:
bensch
Message:

gui: \fixed a bug when clicking a Widget

Location:
branches/gui/src
Files:
3 edited

Legend:

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

    r7985 r7988  
    7070    this->_frontMat.setDiffuse(1.0, 0.0, 0.0);
    7171    this->_borderSize = 1.0;
    72 
    73     this->widgetSignals.resize(SignalCount, SignalConnector());
    7472  }
    7573
     
    123121  {
    124122    assert (!this->_pushed);
    125     this->widgetSignals[Signal_click]("none");
    126123    this->_pushed = true;
    127124
     
    133130    if (this->_pushed)
    134131    {
    135       this->widgetSignals[Signal_release]("none");
    136 
    137132      this->releasing(pos);
    138133      this->_pushed = false;
     
    182177
    183178
    184   /**
    185    * @brief connects a Signal to the Gui-Elements' Event.
    186    * @param sinalType the Type of Signal to set. @see GLGuiSignalType
    187    * @param signal the name of the Signal
    188    */
    189   void GLGuiWidget::connectSignal(SignalType signalType, BaseObject* object, const Executor* signal)
    190   {
    191     if (signalType >= this->widgetSignals.size())
    192       return;
    193 
    194     //    if (this->widgetSignals[signalType] != NULL)
    195     //      PRINTF(2)("Already connected a Signal to '%s::%s' type %s... overwriting\n", this->getClassName(), this->getName(), "TEST");
    196 
    197     this->widgetSignals[signalType] = SignalConnector(object, signal);
    198   }
    199 
    200   /**
    201    * @brief removes a Signal from a Gui-ELements' Event
    202    * @param signalType the type of Signal to remove.
    203    */
    204   void GLGuiWidget::disconnectSignal(SignalType signalType)
    205   {
    206     if (signalType >= this->widgetSignals.size())
    207       return;
    208 
    209     this->widgetSignals[signalType] = SignalConnector();
    210   }
    211 
    212 
    213179  void GLGuiWidget::show()
    214180  {
  • branches/gui/src/lib/gui/gl_gui/glgui_widget.h

    r7985 r7988  
    2424namespace OrxGui
    2525{
    26   typedef enum
    27   {
    28     Signal_click     = 0,
    29     Signal_release,
    30     Signal_rollOn,
    31     Signal_rollOff,
    32     Signal_open,
    33     Signal_close,
    34     Signal_destroy,
    35 
    36     SignalCount,
    37   } SignalType;
    38 
    3926
    4027  class GLGuiCursor;
     
    5542    void show();
    5643    void hide();
    57 
    58     /// INTERCONNECTIVITY
    59     void connectSignal(SignalType signalType, BaseObject* obj, const Executor* signal);
    60     void disconnectSignal(SignalType signalType);
    6144
    6245
     
    152135    float                          _borderSize;
    153136
    154     /// SIGNALS
    155     std::vector<SignalConnector>   widgetSignals;
    156 
    157137    /// EVENTS
    158138    bool                           _focusable;        //!< If this widget can receive focus.
  • branches/gui/src/story_entities/simple_game_menu.cc

    r7985 r7988  
    8989  dnpb->show();
    9090  dnpb->setAbsCoor2D(350, 50);
    91   dnpb->connectSignal(OrxGui::Signal_release, this, createExecutor<SimpleGameMenu>(&SimpleGameMenu::execURL));
     91
    9292
    9393  OrxGui::GLGuiPushButton* rdnpb = new OrxGui::GLGuiPushButton("Quit ORXONOX!!");
    9494  rdnpb->show();
    9595  rdnpb->setAbsCoor2D(200, 180);
    96   rdnpb->connectSignal(OrxGui::Signal_release, this, SLOT(SimpleGameMenu, quitMenu));
     96  rdnpb->connect(SIGNAL(rdnpb, released), this, SLOT(SimpleGameMenu, quitMenu));
    9797
    9898  OrxGui::GLGuiInputLine* input = new OrxGui::GLGuiInputLine();
Note: See TracChangeset for help on using the changeset viewer.