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
24a317ce
Commit
24a317ce
authored
Dec 03, 2013
by
Maciej Suminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
The Selection Tool is always active. Removed entries for toolbar menu and hotkeys for the tool.
parent
7d788109
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
32 additions
and
33 deletions
+32
-33
tool_dispatcher.cpp
common/tool/tool_dispatcher.cpp
+0
-5
tool_manager.cpp
common/tool/tool_manager.cpp
+3
-2
menubar_pcbframe.cpp
pcbnew/menubar_pcbframe.cpp
+0
-5
pcbframe.cpp
pcbnew/pcbframe.cpp
+0
-2
pcbnew_id.h
pcbnew/pcbnew_id.h
+0
-1
common_actions.cpp
pcbnew/tools/common_actions.cpp
+1
-2
common_actions.h
pcbnew/tools/common_actions.h
+3
-3
pcb_tools.cpp
pcbnew/tools/pcb_tools.cpp
+6
-1
selection_tool.cpp
pcbnew/tools/selection_tool.cpp
+15
-12
selection_tool.h
pcbnew/tools/selection_tool.h
+4
-0
No files found.
common/tool/tool_dispatcher.cpp
View file @
24a317ce
...
@@ -280,11 +280,6 @@ void TOOL_DISPATCHER::DispatchWxCommand( const wxCommandEvent& aEvent )
...
@@ -280,11 +280,6 @@ void TOOL_DISPATCHER::DispatchWxCommand( const wxCommandEvent& aEvent )
toolName
=
"pcbnew.InteractiveRouter"
;
toolName
=
"pcbnew.InteractiveRouter"
;
activateTool
=
true
;
activateTool
=
true
;
break
;
break
;
case
ID_SELECTION_TOOL
:
toolName
=
"pcbnew.InteractiveSelection"
;
activateTool
=
true
;
break
;
}
}
// do nothing if the legacy view is active
// do nothing if the legacy view is active
...
...
common/tool/tool_manager.cpp
View file @
24a317ce
...
@@ -97,7 +97,7 @@ struct TOOL_MANAGER::TOOL_STATE
...
@@ -97,7 +97,7 @@ struct TOOL_MANAGER::TOOL_STATE
TOOL_MANAGER
::
TOOL_MANAGER
()
:
TOOL_MANAGER
::
TOOL_MANAGER
()
:
m_model
(
NULL
),
m_view
(
NULL
)
m_model
(
NULL
),
m_view
(
NULL
)
,
m_viewControls
(
NULL
),
m_editFrame
(
NULL
)
{
{
m_actionMgr
=
new
ACTION_MANAGER
(
this
);
m_actionMgr
=
new
ACTION_MANAGER
(
this
);
}
}
...
@@ -476,6 +476,7 @@ bool TOOL_MANAGER::ProcessEvent( TOOL_EVENT& aEvent )
...
@@ -476,6 +476,7 @@ bool TOOL_MANAGER::ProcessEvent( TOOL_EVENT& aEvent )
if
(
m_view
->
IsDirty
()
)
if
(
m_view
->
IsDirty
()
)
{
{
PCB_EDIT_FRAME
*
f
=
static_cast
<
PCB_EDIT_FRAME
*>
(
GetEditFrame
()
);
PCB_EDIT_FRAME
*
f
=
static_cast
<
PCB_EDIT_FRAME
*>
(
GetEditFrame
()
);
if
(
f
->
IsGalCanvasActive
()
)
f
->
GetGalCanvas
()
->
Refresh
();
// fixme: ugly hack, provide a method in TOOL_DISPATCHER.
f
->
GetGalCanvas
()
->
Refresh
();
// fixme: ugly hack, provide a method in TOOL_DISPATCHER.
}
}
...
...
pcbnew/menubar_pcbframe.cpp
View file @
24a317ce
...
@@ -310,11 +310,6 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
...
@@ -310,11 +310,6 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
editMenu
->
AppendSeparator
();
editMenu
->
AppendSeparator
();
AddMenuItem
(
editMenu
,
ID_SELECTION_TOOL
,
_
(
"Select Tool"
),
_
(
"Interactive selection and drag&drop tool."
),
KiBitmap
(
tools_xpm
)
);
AddMenuItem
(
editMenu
,
ID_PNS_ROUTER_TOOL
,
AddMenuItem
(
editMenu
,
ID_PNS_ROUTER_TOOL
,
_
(
"Interactive router"
),
_
(
"Interactive router"
),
_
(
"Interactive router drag&drop tool."
),
_
(
"Interactive router drag&drop tool."
),
...
...
pcbnew/pcbframe.cpp
View file @
24a317ce
...
@@ -121,8 +121,6 @@ BEGIN_EVENT_TABLE( PCB_EDIT_FRAME, PCB_BASE_FRAME )
...
@@ -121,8 +121,6 @@ BEGIN_EVENT_TABLE( PCB_EDIT_FRAME, PCB_BASE_FRAME )
// menu Config
// menu Config
/* Tom's hacks start */
/* Tom's hacks start */
EVT_MENU
(
ID_SELECTION_TOOL
,
PCB_EDIT_FRAME
::
onGenericCommand
)
EVT_TOOL
(
ID_SELECTION_TOOL
,
PCB_EDIT_FRAME
::
onGenericCommand
)
EVT_MENU
(
ID_PNS_ROUTER_TOOL
,
PCB_EDIT_FRAME
::
onGenericCommand
)
EVT_MENU
(
ID_PNS_ROUTER_TOOL
,
PCB_EDIT_FRAME
::
onGenericCommand
)
EVT_TOOL
(
ID_PNS_ROUTER_TOOL
,
PCB_EDIT_FRAME
::
onGenericCommand
)
EVT_TOOL
(
ID_PNS_ROUTER_TOOL
,
PCB_EDIT_FRAME
::
onGenericCommand
)
/* Tom's hacks end */
/* Tom's hacks end */
...
...
pcbnew/pcbnew_id.h
View file @
24a317ce
...
@@ -370,7 +370,6 @@ enum pcbnew_ids
...
@@ -370,7 +370,6 @@ enum pcbnew_ids
ID_FOOTPRINT_WIZARD_SELECT_WIZARD
,
ID_FOOTPRINT_WIZARD_SELECT_WIZARD
,
ID_FOOTPRINT_WIZARD_EXPORT_TO_BOARD
,
ID_FOOTPRINT_WIZARD_EXPORT_TO_BOARD
,
ID_SELECTION_TOOL
,
ID_PNS_ROUTER_TOOL
ID_PNS_ROUTER_TOOL
};
};
...
...
pcbnew/tools/common_actions.cpp
View file @
24a317ce
...
@@ -27,8 +27,7 @@
...
@@ -27,8 +27,7 @@
// Selection tool actions
// Selection tool actions
TOOL_ACTION
COMMON_ACTIONS
::
selectionActivate
(
"pcbnew.InteractiveSelection"
,
TOOL_ACTION
COMMON_ACTIONS
::
selectionActivate
(
"pcbnew.InteractiveSelection"
,
AS_GLOBAL
,
'S'
,
AS_GLOBAL
,
0
,
""
,
""
);
// No description, it is not supposed to be shown anywhere
"Selection tool"
,
"Allows to select items"
);
// Edit tool actions
// Edit tool actions
TOOL_ACTION
COMMON_ACTIONS
::
editActivate
(
"pcbnew.InteractiveEdit"
,
TOOL_ACTION
COMMON_ACTIONS
::
editActivate
(
"pcbnew.InteractiveEdit"
,
...
...
pcbnew/tools/common_actions.h
View file @
24a317ce
...
@@ -35,12 +35,12 @@
...
@@ -35,12 +35,12 @@
class
COMMON_ACTIONS
class
COMMON_ACTIONS
{
{
public
:
public
:
/// Activation of the move tool
static
TOOL_ACTION
editActivate
;
/// Activation of the selection tool
/// Activation of the selection tool
static
TOOL_ACTION
selectionActivate
;
static
TOOL_ACTION
selectionActivate
;
/// Activation of the edit tool
static
TOOL_ACTION
editActivate
;
/// Rotation of selected objects
/// Rotation of selected objects
static
TOOL_ACTION
rotate
;
static
TOOL_ACTION
rotate
;
...
...
pcbnew/tools/pcb_tools.cpp
View file @
24a317ce
...
@@ -48,7 +48,6 @@ void PCB_EDIT_FRAME::setupTools()
...
@@ -48,7 +48,6 @@ void PCB_EDIT_FRAME::setupTools()
// Register tool actions
// Register tool actions
m_toolManager
->
RegisterAction
(
&
COMMON_ACTIONS
::
editActivate
);
m_toolManager
->
RegisterAction
(
&
COMMON_ACTIONS
::
editActivate
);
m_toolManager
->
RegisterAction
(
&
COMMON_ACTIONS
::
selectionActivate
);
m_toolManager
->
RegisterAction
(
&
COMMON_ACTIONS
::
rotate
);
m_toolManager
->
RegisterAction
(
&
COMMON_ACTIONS
::
rotate
);
m_toolManager
->
RegisterAction
(
&
COMMON_ACTIONS
::
flip
);
m_toolManager
->
RegisterAction
(
&
COMMON_ACTIONS
::
flip
);
m_toolManager
->
RegisterAction
(
&
COMMON_ACTIONS
::
properties
);
m_toolManager
->
RegisterAction
(
&
COMMON_ACTIONS
::
properties
);
...
@@ -57,6 +56,12 @@ void PCB_EDIT_FRAME::setupTools()
...
@@ -57,6 +56,12 @@ void PCB_EDIT_FRAME::setupTools()
m_toolManager
->
RegisterTool
(
new
SELECTION_TOOL
);
m_toolManager
->
RegisterTool
(
new
SELECTION_TOOL
);
m_toolManager
->
RegisterTool
(
new
ROUTER_TOOL
);
m_toolManager
->
RegisterTool
(
new
ROUTER_TOOL
);
m_toolManager
->
RegisterTool
(
new
EDIT_TOOL
);
m_toolManager
->
RegisterTool
(
new
EDIT_TOOL
);
m_toolManager
->
SetEnvironment
(
NULL
,
m_galCanvas
->
GetView
(),
m_galCanvas
->
GetViewControls
(),
this
);
// Run the selection tool, it is supposed to be always active
m_toolManager
->
InvokeTool
(
"pcbnew.InteractiveSelection"
);
}
}
...
...
pcbnew/tools/selection_tool.cpp
View file @
24a317ce
...
@@ -66,6 +66,8 @@ SELECTION_TOOL::~SELECTION_TOOL()
...
@@ -66,6 +66,8 @@ SELECTION_TOOL::~SELECTION_TOOL()
void
SELECTION_TOOL
::
Reset
()
void
SELECTION_TOOL
::
Reset
()
{
{
clearSelection
();
// Reinsert the VIEW_GROUP, in case it was removed from the VIEW
// Reinsert the VIEW_GROUP, in case it was removed from the VIEW
getView
()
->
Remove
(
m_selection
.
group
);
getView
()
->
Remove
(
m_selection
.
group
);
getView
()
->
Add
(
m_selection
.
group
);
getView
()
->
Add
(
m_selection
.
group
);
...
@@ -77,12 +79,6 @@ void SELECTION_TOOL::Reset()
...
@@ -77,12 +79,6 @@ void SELECTION_TOOL::Reset()
int
SELECTION_TOOL
::
Main
(
TOOL_EVENT
&
aEvent
)
int
SELECTION_TOOL
::
Main
(
TOOL_EVENT
&
aEvent
)
{
{
KIGFX
::
VIEW
*
view
=
getView
();
assert
(
getModel
<
BOARD
>
(
PCB_T
)
!=
NULL
);
view
->
Add
(
m_selection
.
group
);
// Main loop: keep receiving events
// Main loop: keep receiving events
while
(
OPT_TOOL_EVENT
evt
=
Wait
()
)
while
(
OPT_TOOL_EVENT
evt
=
Wait
()
)
{
{
...
@@ -94,8 +90,8 @@ int SELECTION_TOOL::Main( TOOL_EVENT& aEvent )
...
@@ -94,8 +90,8 @@ int SELECTION_TOOL::Main( TOOL_EVENT& aEvent )
{
{
if
(
!
m_selection
.
Empty
()
)
// Cancel event deselects items...
if
(
!
m_selection
.
Empty
()
)
// Cancel event deselects items...
clearSelection
();
clearSelection
();
else
// ...unless there is nothing selected
break
;
// then exit the tool
// This tool never exits
}
}
// single click? Select single object
// single click? Select single object
...
@@ -142,8 +138,8 @@ int SELECTION_TOOL::Main( TOOL_EVENT& aEvent )
...
@@ -142,8 +138,8 @@ int SELECTION_TOOL::Main( TOOL_EVENT& aEvent )
}
}
}
}
m_selection
.
group
->
Clear
();
// This tool is supposed to be active forever
view
->
Remove
(
m_selection
.
group
);
assert
(
false
);
return
0
;
return
0
;
}
}
...
@@ -188,6 +184,7 @@ void SELECTION_TOOL::clearSelection()
...
@@ -188,6 +184,7 @@ void SELECTION_TOOL::clearSelection()
{
{
KIGFX
::
VIEW_GROUP
::
const_iter
it
,
it_end
;
KIGFX
::
VIEW_GROUP
::
const_iter
it
,
it_end
;
// Restore the initial properties
for
(
it
=
m_selection
.
group
->
Begin
(),
it_end
=
m_selection
.
group
->
End
();
it
!=
it_end
;
++
it
)
for
(
it
=
m_selection
.
group
->
Begin
(),
it_end
=
m_selection
.
group
->
End
();
it
!=
it_end
;
++
it
)
{
{
BOARD_ITEM
*
item
=
static_cast
<
BOARD_ITEM
*>
(
*
it
);
BOARD_ITEM
*
item
=
static_cast
<
BOARD_ITEM
*>
(
*
it
);
...
@@ -196,8 +193,7 @@ void SELECTION_TOOL::clearSelection()
...
@@ -196,8 +193,7 @@ void SELECTION_TOOL::clearSelection()
item
->
ClearSelected
();
item
->
ClearSelected
();
}
}
m_selection
.
group
->
Clear
();
m_selection
.
Clear
();
m_selection
.
items
.
clear
();
// Do not show the context menu when there is nothing selected
// Do not show the context menu when there is nothing selected
SetContextMenu
(
&
m_menu
,
CMENU_OFF
);
SetContextMenu
(
&
m_menu
,
CMENU_OFF
);
...
@@ -609,3 +605,10 @@ bool SELECTION_TOOL::containsSelected( const VECTOR2I& aPoint ) const
...
@@ -609,3 +605,10 @@ bool SELECTION_TOOL::containsSelected( const VECTOR2I& aPoint ) const
return
false
;
return
false
;
}
}
void
SELECTION_TOOL
::
SELECTION
::
Clear
()
{
items
.
clear
();
group
->
Clear
();
}
pcbnew/tools/selection_tool.h
View file @
24a317ce
...
@@ -78,6 +78,10 @@ public:
...
@@ -78,6 +78,10 @@ public:
{
{
return
items
.
size
();
return
items
.
size
();
}
}
/// Clears both the VIEW_GROUP and set of selected items. Please note that it does not
/// change properties of selected items (e.g. selection flag).
void
Clear
();
};
};
/// @copydoc TOOL_INTERACTIVE::Reset()
/// @copydoc TOOL_INTERACTIVE::Reset()
...
...
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