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
1dd0adf7
Commit
1dd0adf7
authored
Nov 20, 2012
by
jean-pierre charras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Eeschema: item drag command: Fix issue for overlapping items (from a Younes Manton's idea)
Added: display info when clicking on labels.
parent
b5302db7
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
120 additions
and
2 deletions
+120
-2
block.cpp
eeschema/block.cpp
+21
-2
sch_text.cpp
eeschema/sch_text.cpp
+96
-0
sch_text.h
eeschema/sch_text.h
+2
-0
schedit.cpp
eeschema/schedit.cpp
+1
-0
No files found.
eeschema/block.cpp
View file @
1dd0adf7
...
...
@@ -186,12 +186,24 @@ void SCH_EDIT_FRAME::HandleBlockPlace( wxDC* DC )
m_canvas
->
Refresh
();
}
/*
* HandleBlockEnd is called when:
* a block is defined
* or a schematic iten should be dragged
* When the block is defined, all items inside the block should be collected
* When a schematic iten should be dragged, only this item should be collected
*
* In all cases, connected items are collected when a drag command is activated
*/
bool
SCH_EDIT_FRAME
::
HandleBlockEnd
(
wxDC
*
DC
)
{
bool
nextcmd
=
false
;
bool
zoom_command
=
false
;
BLOCK_SELECTOR
*
block
=
&
GetScreen
()
->
m_BlockLocate
;
bool
currItemOnly
=
false
;
if
(
block
->
GetCommand
()
==
BLOCK_DRAG
&&
GetScreen
()
->
GetCurItem
()
!=
NULL
)
currItemOnly
=
true
;
if
(
block
->
GetCount
()
)
{
...
...
@@ -242,7 +254,14 @@ bool SCH_EDIT_FRAME::HandleBlockEnd( wxDC* DC )
case
BLOCK_MOVE
:
case
BLOCK_COPY
:
GetScreen
()
->
UpdatePickList
();
if
(
currItemOnly
)
{
ITEM_PICKER
picker
;
picker
.
SetItem
(
GetScreen
()
->
GetCurItem
()
);
block
->
PushItem
(
picker
);
}
else
GetScreen
()
->
UpdatePickList
();
// fall through
case
BLOCK_PRESELECT_MOVE
:
/* Move with preselection list*/
...
...
eeschema/sch_text.cpp
View file @
1dd0adf7
...
...
@@ -36,6 +36,7 @@
#include <drawtxt.h>
#include <wxEeschemaStruct.h>
#include <plot_common.h>
#include <base_units.h>
#include <general.h>
#include <protos.h>
...
...
@@ -729,6 +730,101 @@ void SCH_TEXT::Plot( PLOTTER* aPlotter )
aPlotter
->
PlotPoly
(
Poly
,
NO_FILL
);
}
/*
* Display the type, shape, size and some other props to the Message panel
*/
void
SCH_TEXT
::
DisplayInfo
(
EDA_DRAW_FRAME
*
frame
)
{
wxString
msg
;
frame
->
ClearMsgPanel
();
switch
(
Type
()
)
{
case
SCH_TEXT_T
:
msg
=
_
(
"Graphic text"
);
break
;
case
SCH_LABEL_T
:
msg
=
_
(
"Label"
);
break
;
case
SCH_GLOBAL_LABEL_T
:
msg
=
_
(
"Global label"
);
break
;
case
SCH_HIERARCHICAL_LABEL_T
:
msg
=
_
(
"Hierarchical label"
);
break
;
case
SCH_SHEET_PIN_T
:
msg
=
_
(
"Hierarchical Sheet Pin"
);
break
;
default
:
return
;
}
frame
->
AppendMsgPanel
(
msg
,
wxEmptyString
,
DARKCYAN
);
switch
(
GetOrientation
()
)
{
case
0
:
// horizontal text
msg
=
_
(
"Horizontal"
);
break
;
case
1
:
// Vert Orientation UP
msg
=
_
(
"Vertical up"
);
break
;
case
2
:
// invert horizontal text
msg
=
_
(
"Horizontal invert"
);
break
;
case
3
:
// Vert Orientation Down
msg
=
_
(
"Vertical down"
);;
break
;
default
:
msg
=
wxT
(
"???"
);
break
;
}
frame
->
AppendMsgPanel
(
_
(
"Orientation"
),
msg
,
BROWN
);
wxString
textStyle
[]
=
{
_
(
"Normal"
),
_
(
"Italic"
),
_
(
"Bold"
),
_
(
"Bold Italic"
)
};
int
style
=
0
;
if
(
m_Italic
)
style
=
1
;
if
(
m_Bold
)
style
+=
2
;
frame
->
AppendMsgPanel
(
_
(
"Style"
),
textStyle
[
style
],
BROWN
);
// Display electricat type if it is relevant
if
(
(
Type
()
==
SCH_GLOBAL_LABEL_T
)
||
(
Type
()
==
SCH_HIERARCHICAL_LABEL_T
)
||
(
Type
()
==
SCH_SHEET_PIN_T
)
)
{
switch
(
GetShape
()
)
{
case
NET_INPUT
:
msg
=
_
(
"Input"
);
break
;
case
NET_OUTPUT
:
msg
=
_
(
"Output"
);
break
;
case
NET_BIDI
:
msg
=
_
(
"Bidirectional"
);
break
;
case
NET_TRISTATE
:
msg
=
_
(
"Tri-State"
);
break
;
case
NET_UNSPECIFIED
:
msg
=
_
(
"Passive"
);
break
;
default
:
msg
=
wxT
(
"???"
);
break
;
}
frame
->
AppendMsgPanel
(
_
(
"Type"
),
msg
,
BLUE
);
}
// Display text size (X or Y value, with are the same value in Eeschema)
msg
=
ReturnStringFromValue
(
g_UserUnit
,
m_Size
.
x
,
true
);
frame
->
AppendMsgPanel
(
_
(
"Size"
),
msg
,
RED
);
}
#if defined(DEBUG)
...
...
eeschema/sch_text.h
View file @
1dd0adf7
...
...
@@ -212,6 +212,8 @@ public:
virtual
EDA_ITEM
*
Clone
()
const
;
void
DisplayInfo
(
EDA_DRAW_FRAME
*
frame
);
// Virtual function
#if defined(DEBUG)
void
Show
(
int
nestLevel
,
std
::
ostream
&
os
)
const
;
// override
#endif
...
...
eeschema/schedit.cpp
View file @
1dd0adf7
...
...
@@ -913,6 +913,7 @@ void SCH_EDIT_FRAME::OnDragItem( wxCommandEvent& aEvent )
// Fall thru if item is not on bus layer.
case
SCH_COMPONENT_T
:
case
SCH_LABEL_T
:
case
SCH_GLOBAL_LABEL_T
:
case
SCH_HIERARCHICAL_LABEL_T
:
case
SCH_SHEET_T
:
...
...
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