Browse Source

Add hide cursor on start and show on edit modes

master
Krisjanis Rijnieks 11 years ago
parent
commit
193bb8764a
  1. 50
      example/bin/data/surfaces.xml
  2. 7
      src/ofxSurfaceManagerGui.cpp

50
example/bin/data/surfaces.xml

@ -16,36 +16,36 @@
</vertices> </vertices>
<texCoords> <texCoords>
<texCoord> <texCoord>
<x>0.500000000</x> <x>0.101999998</x>
<y>0.000000000</y> <y>0.335999995</y>
</texCoord> </texCoord>
<texCoord> <texCoord>
<x>0.000000000</x> <x>0.328000009</x>
<y>1.000000000</y> <y>0.689999998</y>
</texCoord> </texCoord>
<texCoord> <texCoord>
<x>1.000000000</x> <x>0.705999970</x>
<y>1.000000000</y> <y>0.393999994</y>
</texCoord> </texCoord>
</texCoords> </texCoords>
<source> <source>
<source-type>image</source-type> <source-type>image</source-type>
<source-name>none</source-name> <source-name>image1.jpg</source-name>
</source> </source>
</surface> </surface>
<surface> <surface>
<vertices> <vertices>
<vertex> <vertex>
<x>162.000000000</x> <x>160.000000000</x>
<y>23.000000000</y> <y>28.000000000</y>
</vertex> </vertex>
<vertex> <vertex>
<x>219.000000000</x> <x>260.000000000</x>
<y>183.000000000</y> <y>209.000000000</y>
</vertex> </vertex>
<vertex> <vertex>
<x>22.000000000</x> <x>42.000000000</x>
<y>196.000000000</y> <y>206.000000000</y>
</vertex> </vertex>
</vertices> </vertices>
<texCoords> <texCoords>
@ -104,30 +104,30 @@
<surface> <surface>
<vertices> <vertices>
<vertex> <vertex>
<x>487.148498535</x> <x>527.148498535</x>
<y>299.815002441</y> <y>277.815002441</y>
</vertex> </vertex>
<vertex> <vertex>
<x>280.170959473</x> <x>320.170959473</x>
<y>483.102355957</y> <y>461.102355957</y>
</vertex> </vertex>
<vertex> <vertex>
<x>252.250427246</x> <x>285.250427246</x>
<y>248.424682617</y> <y>209.424682617</y>
</vertex> </vertex>
</vertices> </vertices>
<texCoords> <texCoords>
<texCoord> <texCoord>
<x>0.063067839</x> <x>0.031067841</x>
<y>0.981202126</y> <y>0.511202157</y>
</texCoord> </texCoord>
<texCoord> <texCoord>
<x>0.064178742</x> <x>0.450178742</x>
<y>0.652164280</y> <y>0.116164304</y>
</texCoord> </texCoord>
<texCoord> <texCoord>
<x>0.925386906</x> <x>0.543386877</x>
<y>0.977848232</y> <y>0.609848201</y>
</texCoord> </texCoord>
</texCoords> </texCoords>
<source> <source>

7
src/ofxSurfaceManagerGui.cpp

@ -6,6 +6,7 @@ ofxSurfaceManagerGui::ofxSurfaceManagerGui()
guiMode = ofxGuiMode::NONE; guiMode = ofxGuiMode::NONE;
bDrag = false; bDrag = false;
registerMouseEvents(); registerMouseEvents();
ofHideCursor();
} }
ofxSurfaceManagerGui::~ofxSurfaceManagerGui() ofxSurfaceManagerGui::~ofxSurfaceManagerGui()
@ -182,6 +183,12 @@ void ofxSurfaceManagerGui::setMode(int newGuiMode)
throw std::runtime_error("Trying to set invalid mode."); throw std::runtime_error("Trying to set invalid mode.");
} }
if ( newGuiMode == ofxGuiMode::NONE ) {
ofHideCursor();
} else {
ofShowCursor();
}
guiMode = newGuiMode; guiMode = newGuiMode;
if ( guiMode == ofxGuiMode::SOURCE_SELECTION ) { if ( guiMode == ofxGuiMode::SOURCE_SELECTION ) {

Loading…
Cancel
Save