KiCad PCB EDA Suite
SELECTION_TOOL Class Reference

#include <selection_tool.h>

Inheritance diagram for SELECTION_TOOL:
EE_SELECTION_TOOL GERBVIEW_SELECTION_TOOL PCB_SELECTION_TOOL PL_SELECTION_TOOL

Public Member Functions

 SELECTION_TOOL ()
 
 ~SELECTION_TOOL ()
 

Protected Member Functions

void setModifiersState (bool aShiftState, bool aCtrlState, bool aAltState)
 Set the configuration of m_additive, m_subtractive, m_exclusive_or, m_skip_heuristics from the state of modifier keys SHIFT, CTRL, ALT and depending on the OS. More...
 

Protected Attributes

bool m_additive
 
bool m_subtractive
 
bool m_exclusive_or
 
bool m_multiple
 
bool m_skip_heuristics
 
bool m_highlight_modifier
 
bool m_drag_additive
 
bool m_drag_subtractive
 
bool m_canceledMenu
 
wxTimer m_disambiguateTimer
 
VECTOR2I m_originalCursor
 

Detailed Description

Definition at line 32 of file selection_tool.h.

Constructor & Destructor Documentation

◆ SELECTION_TOOL()

SELECTION_TOOL::SELECTION_TOOL ( )

Definition at line 27 of file selection_tool.cpp.

27  :
28  m_additive( false ),
29  m_subtractive( false ),
30  m_exclusive_or( false ),
31  m_multiple( false ),
32  m_skip_heuristics( false ),
33  m_highlight_modifier( false ),
34  m_drag_additive( false ),
35  m_drag_subtractive( false ),
36  m_canceledMenu( false )
37 {
38 }
bool m_highlight_modifier

◆ ~SELECTION_TOOL()

SELECTION_TOOL::~SELECTION_TOOL ( )
inline

Definition at line 36 of file selection_tool.h.

36 {};

Member Function Documentation

◆ setModifiersState()

void SELECTION_TOOL::setModifiersState ( bool  aShiftState,
bool  aCtrlState,
bool  aAltState 
)
protected

Set the configuration of m_additive, m_subtractive, m_exclusive_or, m_skip_heuristics from the state of modifier keys SHIFT, CTRL, ALT and depending on the OS.

Definition at line 40 of file selection_tool.cpp.

41 {
42  // Set the configuration of m_additive, m_subtractive, m_exclusive_or from the state of
43  // modifier keys SHIFT and CTRL
44 
45  // ALT key cannot be used on MSW because of a conflict with the system menu
46 
47  m_subtractive = aCtrlState && aShiftState;
48  m_additive = !aCtrlState && aShiftState;
49  m_exclusive_or = false;
50  m_highlight_modifier = aCtrlState && !aShiftState;
51 
52  // Drag is more forgiving and allows either Ctrl+Drag or Shift+Drag to add to the selection
53  // Note, however that we cannot provide disambiguation at the same time as the box selection
54  m_drag_additive = ( aCtrlState || aShiftState ) && !aAltState;
55  m_drag_subtractive = aCtrlState && aShiftState && !aAltState;
56 
57  // While the ALT key has some conflicts under MSW (and some flavors of Linux WMs), it remains
58  // useful for users who only use tap-click rather than holding the button. We disable it for
59  // windows because it flashes the disambiguation menu without showing data
60 #ifndef __WINDOWS__
61  m_skip_heuristics = aAltState;
62 #else
63  m_skip_heuristics = false;
64 #endif
65 
66 }
bool m_highlight_modifier

References m_additive, m_drag_additive, m_drag_subtractive, m_exclusive_or, m_highlight_modifier, m_skip_heuristics, and m_subtractive.

Referenced by PL_SELECTION_TOOL::Main(), GERBVIEW_SELECTION_TOOL::Main(), EE_SELECTION_TOOL::Main(), PCB_SELECTION_TOOL::Main(), EE_SELECTION_TOOL::OnIdle(), and PCB_SELECTION_TOOL::OnIdle().

Member Data Documentation

◆ m_additive

◆ m_canceledMenu

◆ m_disambiguateTimer

wxTimer SELECTION_TOOL::m_disambiguateTimer
protected

◆ m_drag_additive

bool SELECTION_TOOL::m_drag_additive
protected

◆ m_drag_subtractive

bool SELECTION_TOOL::m_drag_subtractive
protected

◆ m_exclusive_or

◆ m_highlight_modifier

bool SELECTION_TOOL::m_highlight_modifier
protected

Definition at line 53 of file selection_tool.h.

Referenced by PCB_SELECTION_TOOL::Main(), and setModifiersState().

◆ m_multiple

◆ m_originalCursor

◆ m_skip_heuristics

◆ m_subtractive


The documentation for this class was generated from the following files: