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
77d8b2d8
Commit
77d8b2d8
authored
Jul 09, 2014
by
Maciej Suminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Context menu for the Placement Tool.
parent
f0ff744e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
2 deletions
+26
-2
router_tool.cpp
pcbnew/router/router_tool.cpp
+1
-1
placement_tool.cpp
pcbnew/tools/placement_tool.cpp
+10
-1
selection_tool.cpp
pcbnew/tools/selection_tool.cpp
+6
-0
selection_tool.h
pcbnew/tools/selection_tool.h
+9
-0
No files found.
pcbnew/router/router_tool.cpp
View file @
77d8b2d8
...
...
@@ -220,7 +220,7 @@ public:
Add
(
ACT_CustomTrackWidth
);
AppendSeparator
(
);
AppendSeparator
(
);
Add
(
ACT_RouterOptions
);
}
};
...
...
pcbnew/tools/placement_tool.cpp
View file @
77d8b2d8
...
...
@@ -54,7 +54,16 @@ bool PLACEMENT_TOOL::Init()
return
false
;
}
// TODO create a context menu and add it to the selection tool
// Create a context menu and make it available through selection tool
CONTEXT_MENU
*
menu
=
new
CONTEXT_MENU
;
menu
->
Add
(
COMMON_ACTIONS
::
alignTop
);
menu
->
Add
(
COMMON_ACTIONS
::
alignBottom
);
menu
->
Add
(
COMMON_ACTIONS
::
alignLeft
);
menu
->
Add
(
COMMON_ACTIONS
::
alignRight
);
menu
->
AppendSeparator
();
menu
->
Add
(
COMMON_ACTIONS
::
distributeHorizontally
);
menu
->
Add
(
COMMON_ACTIONS
::
distributeVertically
);
m_selectionTool
->
AddSubMenu
(
menu
,
wxString
(
"Placement"
)
);
setTransitions
();
...
...
pcbnew/tools/selection_tool.cpp
View file @
77d8b2d8
...
...
@@ -198,6 +198,12 @@ void SELECTION_TOOL::AddMenuItem( const TOOL_ACTION& aAction )
}
void
SELECTION_TOOL
::
AddSubMenu
(
CONTEXT_MENU
*
aMenu
,
const
wxString
&
aLabel
)
{
m_menu
.
AppendSubMenu
(
aMenu
,
aLabel
);
}
void
SELECTION_TOOL
::
toggleSelection
(
BOARD_ITEM
*
aItem
)
{
if
(
aItem
->
IsSelected
()
)
...
...
pcbnew/tools/selection_tool.h
View file @
77d8b2d8
...
...
@@ -122,6 +122,15 @@ public:
*/
void
AddMenuItem
(
const
TOOL_ACTION
&
aAction
);
/**
* Function AddSubMenu()
*
* Adds a submenu to the selection tool right-click context menu.
* @param aMenu is the submenu to be added.
* @param aLabel is the label of added submenu.
*/
void
AddSubMenu
(
CONTEXT_MENU
*
aMenu
,
const
wxString
&
aLabel
);
/**
* Function EditModules()
* Toggles edit module mode. When enabled, one may select parts of modules individually
...
...
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