Changeset 7972 in orxonox.OLD for branches/gui
- Timestamp:
- May 30, 2006, 10:29:13 AM (18 years ago)
- Location:
- branches/gui/src
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/gui/src/lib/gui/gl_gui/glgui_slider.cc
r7942 r7972 74 74 else 75 75 this->_value = value; 76 printf("VALUE %f\n", _value);76 emit(valueChanged(this->_value)); 77 77 } 78 78 -
branches/gui/src/lib/gui/gl_gui/glgui_slider.h
r7942 r7972 46 46 void stepMinus(); 47 47 48 48 49 virtual void tick(float dt); 49 50 virtual bool processEvent(const Event& event); 50 51 virtual void draw() const; 52 53 DeclareSignal(valueChanged, (float)); 51 54 52 55 protected: -
branches/gui/src/lib/gui/gl_gui/glgui_widget.cc
r7943 r7972 171 171 172 172 173 void GLGuiWidget::connect(GLGuiWidget* sender, Signal& signal, BaseObject* receiver, Slot executor) 174 { 175 sender->connect(signal, receiver, executor); 176 } 177 178 void GLGuiWidget::connect(Signal& signal, BaseObject* receiver, Slot executor) 179 { 180 signal.push_back(SignalConnector(receiver, executor)); 181 } 182 183 173 184 /** 174 185 * @brief connects a Signal to the Gui-Elements' Event. -
branches/gui/src/lib/gui/gl_gui/glgui_widget.h
r7971 r7972 49 49 class GLGuiWidget : public Element2D 50 50 { 51 52 private:53 54 51 public: 55 52 GLGuiWidget(GLGuiWidget* parent = NULL); … … 88 85 void setClickable(bool clickable = true) { this->_clickable = clickable; }; 89 86 87 static void connect(GLGuiWidget* sender, Signal& signal, BaseObject* receiver, Slot executor); 88 void connect(Signal& signal, BaseObject* receiver, Slot executor); 89 90 void disconnect(GLGuiWidget* sender, Signal& signal, BaseObject* receiver); 91 90 92 91 93 /// MATERIAL (looks) … … 118 120 /** @param the Event to process. @returns true if the Event has been consumed*/ 119 121 virtual bool processEvent(const Event& event) { }; 120 121 122 DeclareSignal(testSignal, ());123 124 static void connect(GLGuiWidget* sender, Signal& signal, BaseObject* receiver, Slot executor);125 void connect(Signal& signal, BaseObject* receiver, Slot executor);126 127 void disconnect(GLGuiWidget* sender, Signal& signal, BaseObject* receiver);128 122 129 123 protected: -
branches/gui/src/lib/gui/gl_gui/signal_connector.h
r7971 r7972 36 36 getSignalVector_##SignalName() 37 37 38 /** 39 * @brief defines a Slot, the sink of a Signal. 40 * @param Class the Class the Slot belongs to. 41 * @param function the Function to Connect to. 42 */ 38 43 #define SLOT(Class, function) \ 39 44 createExecutor<Class>(&Class::function) 45 46 /** 47 * @brief emits function 48 */ 49 #define emit(function) function 40 50 41 51 //! A class for Conncting Signals to Objects, inside of the GUI -
branches/gui/src/story_entities/simple_game_menu.cc
r7971 r7972 101 101 102 102 OrxGui::GLGuiSlider* slider = new OrxGui::GLGuiSlider(); 103 slider->connect(slider->SIGNAL(valueChanged), this, SLOT(SimpleGameMenu, TEST)); 103 104 slider->setRange(-1, 10); 104 105 slider->setValue(slider->min()); -
branches/gui/src/story_entities/simple_game_menu.h
r7924 r7972 69 69 void quitMenu(); 70 70 71 void TEST( ) { printf("TEST\n"); }71 void TEST(float val) { printf("TEST %f\n", val); } 72 72 73 73 protected:
Note: See TracChangeset
for help on using the changeset viewer.