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
ac7bdfc7
Commit
ac7bdfc7
authored
Oct 13, 2014
by
Maciej Suminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pcbnew: Fixed 'Find Item' (GAL canvas).
parent
18c9a62c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
46 additions
and
0 deletions
+46
-0
common_actions.cpp
pcbnew/tools/common_actions.cpp
+7
-0
common_actions.h
pcbnew/tools/common_actions.h
+3
-0
selection_tool.cpp
pcbnew/tools/selection_tool.cpp
+30
-0
selection_tool.h
pcbnew/tools/selection_tool.h
+6
-0
No files found.
pcbnew/tools/common_actions.cpp
View file @
ac7bdfc7
...
@@ -40,6 +40,10 @@ TOOL_ACTION COMMON_ACTIONS::selectionClear( "pcbnew.InteractiveSelection.Clear",
...
@@ -40,6 +40,10 @@ TOOL_ACTION COMMON_ACTIONS::selectionClear( "pcbnew.InteractiveSelection.Clear",
AS_GLOBAL
,
0
,
AS_GLOBAL
,
0
,
""
,
""
);
// No description, it is not supposed to be shown anywhere
""
,
""
);
// No description, it is not supposed to be shown anywhere
TOOL_ACTION
COMMON_ACTIONS
::
find
(
"pcbnew.InteractiveSelection.Find"
,
AS_GLOBAL
,
0
,
"Find an item"
,
"Searches the document for an item"
);
TOOL_ACTION
COMMON_ACTIONS
::
findMove
(
"pcbnew.InteractiveSelection.FindMove"
,
TOOL_ACTION
COMMON_ACTIONS
::
findMove
(
"pcbnew.InteractiveSelection.FindMove"
,
AS_GLOBAL
,
'T'
);
AS_GLOBAL
,
'T'
);
...
@@ -489,6 +493,9 @@ boost::optional<TOOL_EVENT> COMMON_ACTIONS::TranslateLegacyId( int aId )
...
@@ -489,6 +493,9 @@ boost::optional<TOOL_EVENT> COMMON_ACTIONS::TranslateLegacyId( int aId )
case
ID_TB_OPTIONS_SELECT_CURSOR
:
case
ID_TB_OPTIONS_SELECT_CURSOR
:
return
COMMON_ACTIONS
::
switchCursor
.
MakeEvent
();
return
COMMON_ACTIONS
::
switchCursor
.
MakeEvent
();
case
ID_FIND_ITEMS
:
return
COMMON_ACTIONS
::
find
.
MakeEvent
();
case
ID_POPUP_PCB_GET_AND_MOVE_MODULE_REQUEST
:
case
ID_POPUP_PCB_GET_AND_MOVE_MODULE_REQUEST
:
return
COMMON_ACTIONS
::
findMove
.
MakeEvent
();
return
COMMON_ACTIONS
::
findMove
.
MakeEvent
();
...
...
pcbnew/tools/common_actions.h
View file @
ac7bdfc7
...
@@ -217,6 +217,9 @@ public:
...
@@ -217,6 +217,9 @@ public:
static
TOOL_ACTION
showHelp
;
static
TOOL_ACTION
showHelp
;
static
TOOL_ACTION
toBeDone
;
static
TOOL_ACTION
toBeDone
;
/// Find an item
static
TOOL_ACTION
find
;
/// Find an item and start moving
/// Find an item and start moving
static
TOOL_ACTION
findMove
;
static
TOOL_ACTION
findMove
;
...
...
pcbnew/tools/selection_tool.cpp
View file @
ac7bdfc7
...
@@ -34,6 +34,7 @@
...
@@ -34,6 +34,7 @@
#include <wxPcbStruct.h>
#include <wxPcbStruct.h>
#include <collectors.h>
#include <collectors.h>
#include <confirm.h>
#include <confirm.h>
#include <dialog_find.h>
#include <class_draw_panel_gal.h>
#include <class_draw_panel_gal.h>
#include <view/view_controls.h>
#include <view/view_controls.h>
...
@@ -176,6 +177,11 @@ int SELECTION_TOOL::Main( TOOL_EVENT& aEvent )
...
@@ -176,6 +177,11 @@ int SELECTION_TOOL::Main( TOOL_EVENT& aEvent )
selectSingle
(
getView
()
->
ToWorld
(
getViewControls
()
->
GetMousePosition
()
)
);
selectSingle
(
getView
()
->
ToWorld
(
getViewControls
()
->
GetMousePosition
()
)
);
}
}
else
if
(
evt
->
IsAction
(
&
COMMON_ACTIONS
::
find
)
)
{
find
(
*
evt
);
}
else
if
(
evt
->
IsAction
(
&
COMMON_ACTIONS
::
findMove
)
)
else
if
(
evt
->
IsAction
(
&
COMMON_ACTIONS
::
findMove
)
)
{
{
findMove
(
*
evt
);
findMove
(
*
evt
);
...
@@ -391,6 +397,7 @@ void SELECTION_TOOL::setTransitions()
...
@@ -391,6 +397,7 @@ void SELECTION_TOOL::setTransitions()
Go
(
&
SELECTION_TOOL
::
Main
,
COMMON_ACTIONS
::
selectionActivate
.
MakeEvent
()
);
Go
(
&
SELECTION_TOOL
::
Main
,
COMMON_ACTIONS
::
selectionActivate
.
MakeEvent
()
);
Go
(
&
SELECTION_TOOL
::
SingleSelection
,
COMMON_ACTIONS
::
selectionSingle
.
MakeEvent
()
);
Go
(
&
SELECTION_TOOL
::
SingleSelection
,
COMMON_ACTIONS
::
selectionSingle
.
MakeEvent
()
);
Go
(
&
SELECTION_TOOL
::
ClearSelection
,
COMMON_ACTIONS
::
selectionClear
.
MakeEvent
()
);
Go
(
&
SELECTION_TOOL
::
ClearSelection
,
COMMON_ACTIONS
::
selectionClear
.
MakeEvent
()
);
Go
(
&
SELECTION_TOOL
::
find
,
COMMON_ACTIONS
::
find
.
MakeEvent
()
);
Go
(
&
SELECTION_TOOL
::
findMove
,
COMMON_ACTIONS
::
findMove
.
MakeEvent
()
);
Go
(
&
SELECTION_TOOL
::
findMove
,
COMMON_ACTIONS
::
findMove
.
MakeEvent
()
);
}
}
...
@@ -455,6 +462,29 @@ int SELECTION_TOOL::ClearSelection( TOOL_EVENT& aEvent )
...
@@ -455,6 +462,29 @@ int SELECTION_TOOL::ClearSelection( TOOL_EVENT& aEvent )
}
}
void
SELECTION_TOOL
::
findCallback
(
BOARD_ITEM
*
aItem
)
{
clearSelection
();
if
(
aItem
)
toggleSelection
(
aItem
);
m_frame
->
GetGalCanvas
()
->
ForceRefresh
();
}
int
SELECTION_TOOL
::
find
(
TOOL_EVENT
&
aEvent
)
{
DIALOG_FIND
dlg
(
m_frame
);
dlg
.
EnableWarp
(
false
);
dlg
.
SetCallback
(
boost
::
bind
(
&
SELECTION_TOOL
::
findCallback
,
this
,
_1
)
);
dlg
.
ShowModal
();
setTransitions
();
return
0
;
}
int
SELECTION_TOOL
::
findMove
(
TOOL_EVENT
&
aEvent
)
int
SELECTION_TOOL
::
findMove
(
TOOL_EVENT
&
aEvent
)
{
{
MODULE
*
module
=
m_frame
->
GetModuleByName
();
MODULE
*
module
=
m_frame
->
GetModuleByName
();
...
...
pcbnew/tools/selection_tool.h
View file @
ac7bdfc7
...
@@ -187,6 +187,12 @@ private:
...
@@ -187,6 +187,12 @@ private:
*/
*/
bool
selectMultiple
();
bool
selectMultiple
();
///> Find dialog callback.
void
findCallback
(
BOARD_ITEM
*
aItem
);
///> Find an item.
int
find
(
TOOL_EVENT
&
aEvent
);
///> Find an item and start moving.
///> Find an item and start moving.
int
findMove
(
TOOL_EVENT
&
aEvent
);
int
findMove
(
TOOL_EVENT
&
aEvent
);
...
...
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