From 55b09483df5c0af6d4eeafc8401ea7cffd035935 Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Tue, 28 Jul 2015 11:11:18 +0200 Subject: [PATCH] Picker tool captures cursor by default. --- pcbnew/tools/picker_tool.cpp | 2 ++ pcbnew/tools/picker_tool.h | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/pcbnew/tools/picker_tool.cpp b/pcbnew/tools/picker_tool.cpp index 574f317aef..50ccbf86c5 100644 --- a/pcbnew/tools/picker_tool.cpp +++ b/pcbnew/tools/picker_tool.cpp @@ -83,6 +83,7 @@ void PICKER_TOOL::reset() { m_cursorSnapping = true; m_cursorVisible = true; + m_cursorCapture = true; m_autoPanning = true; m_picking = false; @@ -96,5 +97,6 @@ void PICKER_TOOL::setControls() controls->ShowCursor( m_cursorVisible ); controls->SetSnapping( m_cursorSnapping ); + controls->CaptureCursor( m_cursorCapture ); controls->SetAutoPan( m_autoPanning ); } diff --git a/pcbnew/tools/picker_tool.h b/pcbnew/tools/picker_tool.h index ea4f5cf700..6512d95d03 100644 --- a/pcbnew/tools/picker_tool.h +++ b/pcbnew/tools/picker_tool.h @@ -65,6 +65,12 @@ public: */ inline void SetAutoPanning( bool aEnable ) { m_autoPanning = aEnable; } + /** + * Function SetAutoPanning() + * Toggles cursor capture mode for the period when the tool is active. + */ + inline void SetCursorCapture( bool aEnable ) { m_cursorCapture = aEnable; } + /** * Function GetPoint() * Returns picked point. @@ -99,6 +105,7 @@ private: // Tool settings. bool m_cursorSnapping; bool m_cursorVisible; + bool m_cursorCapture; bool m_autoPanning; ///> Optional mouse click event handler.