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
9ef713df
Commit
9ef713df
authored
Feb 07, 2014
by
Maciej Suminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Right click on an item when there is nothing selected - enables the context menu.
parent
63e4defd
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
9 deletions
+10
-9
selection_tool.cpp
pcbnew/tools/selection_tool.cpp
+10
-9
No files found.
pcbnew/tools/selection_tool.cpp
View file @
9ef713df
...
@@ -112,6 +112,16 @@ int SELECTION_TOOL::Main( TOOL_EVENT& aEvent )
...
@@ -112,6 +112,16 @@ int SELECTION_TOOL::Main( TOOL_EVENT& aEvent )
selectSingle
(
evt
->
Position
()
);
selectSingle
(
evt
->
Position
()
);
}
}
// right click? if there is any object - show the context menu
else
if
(
evt
->
IsClick
(
BUT_RIGHT
)
)
{
if
(
m_selection
.
Empty
()
)
selectSingle
(
evt
->
Position
()
);
if
(
!
m_selection
.
Empty
()
)
SetContextMenu
(
&
m_menu
,
CMENU_NOW
);
}
// double click? Display the properties window
// double click? Display the properties window
else
if
(
evt
->
IsDblClick
(
BUT_LEFT
)
)
else
if
(
evt
->
IsDblClick
(
BUT_LEFT
)
)
{
{
...
@@ -310,9 +320,6 @@ void SELECTION_TOOL::clearSelection()
...
@@ -310,9 +320,6 @@ void SELECTION_TOOL::clearSelection()
m_selection
.
clear
();
m_selection
.
clear
();
getEditFrame
<
PCB_EDIT_FRAME
>
()
->
SetCurItem
(
NULL
);
getEditFrame
<
PCB_EDIT_FRAME
>
()
->
SetCurItem
(
NULL
);
// Do not show the context menu when there is nothing selected
SetContextMenu
(
&
m_menu
,
CMENU_OFF
);
}
}
...
@@ -509,9 +516,6 @@ void SELECTION_TOOL::select( BOARD_ITEM* aItem )
...
@@ -509,9 +516,6 @@ void SELECTION_TOOL::select( BOARD_ITEM* aItem )
{
{
// Set as the current item, so the information about selection is displayed
// Set as the current item, so the information about selection is displayed
getEditFrame
<
PCB_EDIT_FRAME
>
()
->
SetCurItem
(
aItem
,
true
);
getEditFrame
<
PCB_EDIT_FRAME
>
()
->
SetCurItem
(
aItem
,
true
);
// Now the context menu should be enabled
SetContextMenu
(
&
m_menu
,
CMENU_BUTTON
);
}
}
else
if
(
m_selection
.
Size
()
==
2
)
// Check only for 2, so it will not be
else
if
(
m_selection
.
Size
()
==
2
)
// Check only for 2, so it will not be
{
// called for every next selected item
{
// called for every next selected item
...
@@ -539,10 +543,7 @@ void SELECTION_TOOL::deselect( BOARD_ITEM* aItem )
...
@@ -539,10 +543,7 @@ void SELECTION_TOOL::deselect( BOARD_ITEM* aItem )
// If there is nothing selected, disable the context menu
// If there is nothing selected, disable the context menu
if
(
m_selection
.
Empty
()
)
if
(
m_selection
.
Empty
()
)
{
SetContextMenu
(
&
m_menu
,
CMENU_OFF
);
getEditFrame
<
PCB_EDIT_FRAME
>
()
->
SetCurItem
(
NULL
);
getEditFrame
<
PCB_EDIT_FRAME
>
()
->
SetCurItem
(
NULL
);
}
}
}
...
...
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