Browse Source

Remove gui test event

master
Krisjanis Rijnieks 9 years ago
parent
commit
9a073b255a
  1. 9
      src/Application/Application.cpp
  2. 2
      src/Application/Application.h
  3. 7
      src/Application/Gui.cpp
  4. 3
      src/Application/Gui.h

9
src/Application/Application.cpp

@ -15,7 +15,6 @@ Application::Application(){
ofAddListener(ofEvents().keyReleased, this, &Application::onKeyReleased);
ofAddListener(ofEvents().mousePressed, this, &Application::onMousePressed);
ofAddListener(Gui::instance()->event, this, &Application::onGuiEvent);
ofAddListener(Gui::instance()->jointPressedEvent, this, &Application::onJointPressed);
ofAddListener(Gui::instance()->surfacePressedEvent, this, &Application::onSurfacePressed);
ofAddListener(Gui::instance()->backgroundPressedEvent, this, &Application::onBackgroundPressed);
@ -116,13 +115,7 @@ void Application::onKeyReleased(ofKeyEventArgs & args){
}
}
void Application::onMousePressed(ofMouseEventArgs & args){
Gui::instance()->notifyEvent(args);
}
void Application::onGuiEvent(GuiEvent & e){
cout << "GUI EVENT: " << e.args.x << ", " << e.args.y << ", " << e.type << endl;
}
void Application::onMousePressed(ofMouseEventArgs & args){}
void Application::onJointPressed(GuiJointEvent & e){
_state->onJointPressed(this, e);

2
src/Application/Application.h

@ -44,8 +44,8 @@ class Application : public KeyListener {
// We use this to pass mouse events into the GUI layer
void onMousePressed(ofMouseEventArgs & args);
// Then we catch GUI events with this one and create commands
void onGuiEvent(GuiEvent & e);
void onJointPressed(GuiJointEvent & e);
void onSurfacePressed(GuiSurfaceEvent & e);
void onBackgroundPressed(GuiBackgroundEvent & e);

7
src/Application/Gui.cpp

@ -12,13 +12,6 @@ Gui * Gui::instance(){
return _instance;
}
void Gui::notifyEvent(ofMouseEventArgs & args){
GuiEvent e;
e.args = args;
e.type = GuiEventType::SURFACE_HIT;
ofNotifyEvent(event, e, this);
}
void Gui::notifyJointPressed(ofMouseEventArgs & args, int jointIndex){
GuiJointEvent e;
e.args = args;

3
src/Application/Gui.h

@ -37,9 +37,6 @@ class Gui {
public:
static Gui * instance();
ofEvent <GuiEvent> event;
void notifyEvent(ofMouseEventArgs & args);
// TODO: combine the following events into one
ofEvent <GuiJointEvent> jointPressedEvent;
ofEvent <GuiJointEvent> jointReleasedEvent;

Loading…
Cancel
Save