Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kicad-source-mirror
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
kicad-source-mirror
Commits
5249b1a6
Commit
5249b1a6
authored
Oct 15, 2013
by
Maciej Suminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Renamed TOOL_MOUSE_BUTTONS constants to avoid name conflict with Windows MB_RIGHT constant.
parent
853b32df
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
30 additions
and
30 deletions
+30
-30
tool_dispatcher.cpp
common/tool/tool_dispatcher.cpp
+3
-3
tool_event.cpp
common/tool/tool_event.cpp
+4
-4
tool_manager.cpp
common/tool/tool_manager.cpp
+1
-1
tool_event.h
include/tool/tool_event.h
+10
-10
tool_interactive.h
include/tool/tool_interactive.h
+4
-4
router_tool.cpp
pcbnew/router/router_tool.cpp
+2
-2
move_tool.cpp
pcbnew/tools/move_tool.cpp
+2
-2
selection_tool.cpp
pcbnew/tools/selection_tool.cpp
+4
-4
No files found.
common/tool/tool_dispatcher.cpp
View file @
5249b1a6
...
...
@@ -89,9 +89,9 @@ struct TOOL_DISPATCHER::BUTTON_STATE
TOOL_DISPATCHER
::
TOOL_DISPATCHER
(
TOOL_MANAGER
*
aToolMgr
,
PCB_BASE_FRAME
*
aEditFrame
)
:
m_toolMgr
(
aToolMgr
),
m_editFrame
(
aEditFrame
)
{
m_buttons
.
push_back
(
new
BUTTON_STATE
(
MB
_LEFT
,
wxEVT_LEFT_DOWN
,
wxEVT_LEFT_UP
)
);
m_buttons
.
push_back
(
new
BUTTON_STATE
(
MB
_RIGHT
,
wxEVT_RIGHT_DOWN
,
wxEVT_RIGHT_UP
)
);
m_buttons
.
push_back
(
new
BUTTON_STATE
(
MB
_MIDDLE
,
wxEVT_MIDDLE_DOWN
,
wxEVT_MIDDLE_UP
)
);
m_buttons
.
push_back
(
new
BUTTON_STATE
(
BUT
_LEFT
,
wxEVT_LEFT_DOWN
,
wxEVT_LEFT_UP
)
);
m_buttons
.
push_back
(
new
BUTTON_STATE
(
BUT
_RIGHT
,
wxEVT_RIGHT_DOWN
,
wxEVT_RIGHT_UP
)
);
m_buttons
.
push_back
(
new
BUTTON_STATE
(
BUT
_MIDDLE
,
wxEVT_MIDDLE_DOWN
,
wxEVT_MIDDLE_UP
)
);
ResetState
();
}
...
...
common/tool/tool_event.cpp
View file @
5249b1a6
...
...
@@ -98,10 +98,10 @@ const std::string TOOL_EVENT::Format() const
const
FlagString
buttons
[]
=
{
{
MB
_NONE
,
"none"
},
{
MB
_LEFT
,
"left"
},
{
MB
_RIGHT
,
"right"
},
{
MB
_MIDDLE
,
"middle"
},
{
BUT
_NONE
,
"none"
},
{
BUT
_LEFT
,
"left"
},
{
BUT
_RIGHT
,
"right"
},
{
BUT
_MIDDLE
,
"middle"
},
{
0
,
""
}
};
...
...
common/tool/tool_manager.cpp
View file @
5249b1a6
...
...
@@ -433,7 +433,7 @@ bool TOOL_MANAGER::ProcessEvent( TOOL_EVENT& aEvent )
// or immediately (CMENU_NOW) mode. The latter is used for clarification lists.
if
(
st
->
contextMenuTrigger
!=
CMENU_OFF
)
{
if
(
st
->
contextMenuTrigger
==
CMENU_BUTTON
&&
!
aEvent
.
IsClick
(
MB
_RIGHT
)
)
if
(
st
->
contextMenuTrigger
==
CMENU_BUTTON
&&
!
aEvent
.
IsClick
(
BUT
_RIGHT
)
)
break
;
st
->
pendingWait
=
true
;
...
...
include/tool/tool_event.h
View file @
5249b1a6
...
...
@@ -93,12 +93,12 @@ enum TOOL_ACTIONS
enum
TOOL_MOUSE_BUTTONS
{
MB
_NONE
=
0x0
,
MB
_LEFT
=
0x1
,
MB
_RIGHT
=
0x2
,
MB
_MIDDLE
=
0x4
,
MB_BUTTON_MASK
=
MB_LEFT
|
MB_RIGHT
|
MB
_MIDDLE
,
MB
_ANY
=
0xffffffff
BUT
_NONE
=
0x0
,
BUT
_LEFT
=
0x1
,
BUT
_RIGHT
=
0x2
,
BUT
_MIDDLE
=
0x4
,
BUT_BUTTON_MASK
=
BUT_LEFT
|
BUT_RIGHT
|
BUT
_MIDDLE
,
BUT
_ANY
=
0xffffffff
};
enum
TOOL_MODIFIERS
...
...
@@ -158,7 +158,7 @@ public:
{
if
(
aCategory
==
TC_MOUSE
)
{
m_mouseButtons
=
aExtraParam
&
MB
_BUTTON_MASK
;
m_mouseButtons
=
aExtraParam
&
BUT
_BUTTON_MASK
;
}
else
if
(
aCategory
==
TC_KEYBOARD
)
{
...
...
@@ -227,18 +227,18 @@ public:
return
m_mouseButtons
;
}
bool
IsClick
(
int
aButtonMask
=
MB
_ANY
)
const
bool
IsClick
(
int
aButtonMask
=
BUT
_ANY
)
const
{
return
(
m_actions
==
TA_MOUSE_CLICK
)
&&
(
(
m_mouseButtons
&
aButtonMask
)
==
aButtonMask
);
}
bool
IsDrag
(
int
aButtonMask
=
MB
_ANY
)
const
bool
IsDrag
(
int
aButtonMask
=
BUT
_ANY
)
const
{
return
(
m_actions
==
TA_MOUSE_DRAG
)
&&
(
(
m_mouseButtons
&
aButtonMask
)
==
aButtonMask
);
}
bool
IsMouseUp
(
int
aButtonMask
=
MB
_ANY
)
const
bool
IsMouseUp
(
int
aButtonMask
=
BUT
_ANY
)
const
{
return
(
m_actions
==
TA_MOUSE_UP
)
&&
(
(
m_mouseButtons
&
aButtonMask
)
==
aButtonMask
);
}
...
...
include/tool/tool_interactive.h
View file @
5249b1a6
...
...
@@ -111,10 +111,10 @@ protected:
const
TOOL_EVENT
evCommand
(
int
aCommandId
=
-
1
);
const
TOOL_EVENT
evCommand
(
std
::
string
aCommandStr
=
""
);
const
TOOL_EVENT
evMotion
();
const
TOOL_EVENT
evClick
(
int
aButton
=
MB
_ANY
);
const
TOOL_EVENT
evDrag
(
int
aButton
=
MB
_ANY
);
const
TOOL_EVENT
evButtonUp
(
int
aButton
=
MB
_ANY
);
const
TOOL_EVENT
evButtonDown
(
int
aButton
=
MB
_ANY
);
const
TOOL_EVENT
evClick
(
int
aButton
=
BUT
_ANY
);
const
TOOL_EVENT
evDrag
(
int
aButton
=
BUT
_ANY
);
const
TOOL_EVENT
evButtonUp
(
int
aButton
=
BUT
_ANY
);
const
TOOL_EVENT
evButtonDown
(
int
aButton
=
BUT
_ANY
);
private
:
void
goInternal
(
TOOL_STATE_FUNC
&
aState
,
const
TOOL_EVENT_LIST
&
aConditions
);
...
...
pcbnew/router/router_tool.cpp
View file @
5249b1a6
...
...
@@ -323,7 +323,7 @@ void ROUTER_TOOL::startRouting()
updateEndItem
(
*
evt
);
m_router
->
Move
(
m_endSnapPoint
,
m_endItem
);
}
else
if
(
evt
->
IsClick
(
MB
_LEFT
)
)
else
if
(
evt
->
IsClick
(
BUT
_LEFT
)
)
{
updateEndItem
(
*
evt
);
...
...
@@ -396,7 +396,7 @@ int ROUTER_TOOL::Main( TOOL_EVENT& aEvent )
break
;
// Finish
else
if
(
evt
->
IsMotion
()
)
updateStartItem
(
*
evt
);
else
if
(
evt
->
IsClick
(
MB
_LEFT
)
)
else
if
(
evt
->
IsClick
(
BUT
_LEFT
)
)
{
updateStartItem
(
*
evt
);
startRouting
();
...
...
pcbnew/tools/move_tool.cpp
View file @
5249b1a6
...
...
@@ -118,7 +118,7 @@ int MOVE_TOOL::Main( TOOL_EVENT& aEvent )
}
}
else
if
(
evt
->
IsMotion
()
||
evt
->
IsDrag
(
MB
_LEFT
)
)
else
if
(
evt
->
IsMotion
()
||
evt
->
IsDrag
(
BUT
_LEFT
)
)
{
if
(
dragging
)
{
...
...
@@ -143,7 +143,7 @@ int MOVE_TOOL::Main( TOOL_EVENT& aEvent )
selection
.
group
->
ViewUpdate
(
VIEW_ITEM
::
GEOMETRY
);
dragPosition
=
evt
->
Position
();
}
else
if
(
evt
->
IsMouseUp
(
MB_LEFT
)
||
evt
->
IsClick
(
MB
_LEFT
)
)
else
if
(
evt
->
IsMouseUp
(
BUT_LEFT
)
||
evt
->
IsClick
(
BUT
_LEFT
)
)
break
;
// Finish
}
...
...
pcbnew/tools/selection_tool.cpp
View file @
5249b1a6
...
...
@@ -103,11 +103,11 @@ int SELECTION_TOOL::Main( TOOL_EVENT& aEvent )
}
// single click? Select single object
if
(
evt
->
IsClick
(
MB
_LEFT
)
)
if
(
evt
->
IsClick
(
BUT
_LEFT
)
)
selectSingle
(
evt
->
Position
()
);
// drag with LMB? Select multiple objects (or at least draw a selection box) or drag them
if
(
evt
->
IsDrag
(
MB
_LEFT
)
)
if
(
evt
->
IsDrag
(
BUT
_LEFT
)
)
{
if
(
m_selection
.
Empty
()
||
m_additive
)
{
...
...
@@ -299,7 +299,7 @@ bool SELECTION_TOOL::selectMultiple()
break
;
}
if
(
evt
->
IsDrag
(
MB
_LEFT
)
)
if
(
evt
->
IsDrag
(
BUT
_LEFT
)
)
{
if
(
!
m_additive
)
clearSelection
();
...
...
@@ -311,7 +311,7 @@ bool SELECTION_TOOL::selectMultiple()
m_selArea
->
ViewUpdate
(
VIEW_ITEM
::
GEOMETRY
);
}
if
(
evt
->
IsMouseUp
(
MB
_LEFT
)
)
if
(
evt
->
IsMouseUp
(
BUT
_LEFT
)
)
{
// End drawing the selection box
m_selArea
->
ViewSetVisible
(
false
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment