diff options
| author | Tim Redfern <tim@getdrop.com> | 2018-04-24 22:32:17 +0100 |
|---|---|---|
| committer | Tim Redfern <tim@getdrop.com> | 2018-04-24 22:32:17 +0100 |
| commit | c0e32ef7278e108614186ff51f8e4260313a0e9e (patch) | |
| tree | 7777c8f98da5f204e56b938d7ba1740994ae6850 /gui/src | |
| parent | 82f4504bb849a60a74df906064a426b1c5759f09 (diff) | |
bugfix
Diffstat (limited to 'gui/src')
| -rw-r--r-- | gui/src/main.cpp | 3 | ||||
| -rw-r--r-- | gui/src/ofApp.cpp | 24 | ||||
| -rw-r--r-- | gui/src/ofApp.h | 4 |
3 files changed, 25 insertions, 6 deletions
diff --git a/gui/src/main.cpp b/gui/src/main.cpp index 14f4f21..a171351 100644 --- a/gui/src/main.cpp +++ b/gui/src/main.cpp @@ -68,6 +68,9 @@ int main(int argc, char *argv[]){ #ifdef PREVIEW_WINDOW ofAddListener(previewWindow->events().draw,mainApp.get(),&ofApp::draw); #endif + ofAddListener(guiWindow->events().mousePressed,mainApp.get(),&ofApp::guiMousePressed); + ofAddListener(guiWindow->events().mouseDragged,mainApp.get(),&ofApp::guiMouseDragged); + ofAddListener(guiWindow->events().mouseReleased,mainApp.get(),&ofApp::guiMouseReleased); ofRunApp(mainWindow, mainApp); ofRunMainLoop(); diff --git a/gui/src/ofApp.cpp b/gui/src/ofApp.cpp index 570dfb3..08a77a8 100644 --- a/gui/src/ofApp.cpp +++ b/gui/src/ofApp.cpp @@ -336,29 +336,41 @@ void ofApp::mouseMoved(int x, int y ){ //-------------------------------------------------------------- void ofApp::mouseDragged(int x, int y, int button){ - sets[selected_set].mouseDragged(x,y,button); + +} + +void ofApp::guiMouseDragged(ofMouseEventArgs &args){ + sets[selected_set].mouseDragged(args.x,args.y,args.button); } //-------------------------------------------------------------- void ofApp::mousePressed(int x, int y, int button){ +} + +void ofApp::guiMousePressed(ofMouseEventArgs &args){ if (commandPressed){ - if (y<200){ - sets[0].mousePressed(x,y,OF_MOUSE_BUTTON_4); + if (args.y<200){ + sets[0].mousePressed(args.x,args.y,OF_MOUSE_BUTTON_4); } else { - sets[1].mousePressed(x,y,OF_MOUSE_BUTTON_4); + sets[1].mousePressed(args.x,args.y,OF_MOUSE_BUTTON_4); } } else { - sets[selected_set].mousePressed(x,y,button); + sets[selected_set].mousePressed(args.x,args.y,args.button); } } //-------------------------------------------------------------- void ofApp::mouseReleased(int x, int y, int button){ - sets[selected_set].mouseReleased(x,y,button); + +} + +void ofApp::guiMouseReleased(ofMouseEventArgs &args){ + sets[selected_set].mouseReleased(args.x,args.y,args.button); } + //-------------------------------------------------------------- void ofApp::mouseEntered(int x, int y){ diff --git a/gui/src/ofApp.h b/gui/src/ofApp.h index 7224b96..a7d1c06 100644 --- a/gui/src/ofApp.h +++ b/gui/src/ofApp.h @@ -103,6 +103,10 @@ class ofApp : public ofBaseApp, public ofxMidiListener{ void guiWindowResized(ofResizeEventArgs &resizeargs); void guiDragEvent(ofDragInfo &dragInfo); + void guiMouseDragged(ofMouseEventArgs &args); + void guiMousePressed(ofMouseEventArgs &args); + void guiMouseReleased(ofMouseEventArgs &args); + void keyPressed(ofKeyEventArgs &keyargs); void keyReleased(int key); void mouseMoved(int x, int y ); |
