From 193bb8764a930db53c034ebc61f9034c940ac00c Mon Sep 17 00:00:00 2001 From: Krisjanis Rijnieks Date: Fri, 16 May 2014 08:27:53 +0200 Subject: [PATCH] Add hide cursor on start and show on edit modes --- example/bin/data/surfaces.xml | 50 +++++++++++++++++------------------ src/ofxSurfaceManagerGui.cpp | 7 +++++ 2 files changed, 32 insertions(+), 25 deletions(-) diff --git a/example/bin/data/surfaces.xml b/example/bin/data/surfaces.xml index 7a9e22f..388c4c5 100644 --- a/example/bin/data/surfaces.xml +++ b/example/bin/data/surfaces.xml @@ -16,36 +16,36 @@ - 0.500000000 - 0.000000000 + 0.101999998 + 0.335999995 - 0.000000000 - 1.000000000 + 0.328000009 + 0.689999998 - 1.000000000 - 1.000000000 + 0.705999970 + 0.393999994 image - none + image1.jpg - 162.000000000 - 23.000000000 + 160.000000000 + 28.000000000 - 219.000000000 - 183.000000000 + 260.000000000 + 209.000000000 - 22.000000000 - 196.000000000 + 42.000000000 + 206.000000000 @@ -104,30 +104,30 @@ - 487.148498535 - 299.815002441 + 527.148498535 + 277.815002441 - 280.170959473 - 483.102355957 + 320.170959473 + 461.102355957 - 252.250427246 - 248.424682617 + 285.250427246 + 209.424682617 - 0.063067839 - 0.981202126 + 0.031067841 + 0.511202157 - 0.064178742 - 0.652164280 + 0.450178742 + 0.116164304 - 0.925386906 - 0.977848232 + 0.543386877 + 0.609848201 diff --git a/src/ofxSurfaceManagerGui.cpp b/src/ofxSurfaceManagerGui.cpp index cce3909..655f03e 100644 --- a/src/ofxSurfaceManagerGui.cpp +++ b/src/ofxSurfaceManagerGui.cpp @@ -6,6 +6,7 @@ ofxSurfaceManagerGui::ofxSurfaceManagerGui() guiMode = ofxGuiMode::NONE; bDrag = false; registerMouseEvents(); + ofHideCursor(); } ofxSurfaceManagerGui::~ofxSurfaceManagerGui() @@ -182,6 +183,12 @@ void ofxSurfaceManagerGui::setMode(int newGuiMode) throw std::runtime_error("Trying to set invalid mode."); } + if ( newGuiMode == ofxGuiMode::NONE ) { + ofHideCursor(); + } else { + ofShowCursor(); + } + guiMode = newGuiMode; if ( guiMode == ofxGuiMode::SOURCE_SELECTION ) {