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
e50d18bc
Commit
e50d18bc
authored
Dec 18, 2011
by
jean-pierre charras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor enhancement and minor code cleaning.
parent
018ffe7e
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
74 additions
and
47 deletions
+74
-47
busentry.cpp
eeschema/busentry.cpp
+4
-29
menubar.cpp
eeschema/menubar.cpp
+1
-1
onrightclick.cpp
eeschema/onrightclick.cpp
+23
-16
sch_bus_entry.cpp
eeschema/sch_bus_entry.cpp
+34
-0
sch_bus_entry.h
eeschema/sch_bus_entry.h
+12
-0
wxEeschemaStruct.h
include/wxEeschemaStruct.h
+0
-1
No files found.
eeschema/busentry.cpp
View file @
e50d18bc
...
...
@@ -72,37 +72,12 @@ void SCH_EDIT_FRAME::SetBusEntryShape( wxDC* DC, SCH_BUS_ENTRY* BusEntry, int en
if
(
BusEntry
->
m_Flags
==
0
)
SaveCopyInUndoList
(
BusEntry
,
UR_CHANGED
);
BusEntry
->
Draw
(
DrawPanel
,
DC
,
wxPoint
(
0
,
0
),
g_XorMode
);
wxSize
size
=
BusEntry
->
GetSize
();
switch
(
entry_shape
)
{
case
'\\'
:
s_LastShape
=
'\\'
;
size
.
y
=
100
;
BusEntry
->
SetSize
(
size
);
break
;
case
'/'
:
s_LastShape
=
'/'
;
size
.
y
=
-
100
;
BusEntry
->
SetSize
(
size
);
break
;
}
s_LastShape
=
entry_shape
==
'/'
?
'/'
:
'\\'
;
BusEntry
->
Draw
(
DrawPanel
,
DC
,
wxPoint
(
0
,
0
),
g_XorMode
);
BusEntry
->
SetBusEntryShape
(
s_LastShape
);
GetScreen
()
->
TestDanglingEnds
();
BusEntry
->
Draw
(
DrawPanel
,
DC
,
wxPoint
(
0
,
0
),
g_XorMode
);
OnModify
(
);
}
int
SCH_EDIT_FRAME
::
GetBusEntryShape
(
SCH_BUS_ENTRY
*
BusEntry
)
{
int
entry_shape
=
'\\'
;
if
(
BusEntry
->
GetSize
().
y
<
0
)
entry_shape
=
'/'
;
return
entry_shape
;
OnModify
(
);
}
eeschema/menubar.cpp
View file @
e50d18bc
...
...
@@ -310,7 +310,7 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
// Wire to Bus entry
text
=
AddHotkeyName
(
_
(
"Wire to Bus &Entry"
),
s_Schematic_Hokeys_Descr
,
HK_ADD_WIRE_ENTRY
,
IS_ACCELERATOR
);
// addan accelerator, not a shortcut
HK_ADD_WIRE_ENTRY
,
IS_ACCELERATOR
);
// add
an accelerator, not a shortcut
AddMenuItem
(
placeMenu
,
ID_WIRETOBUS_ENTRY_BUTT
,
text
,
HELP_PLACE_WIRE2BUS_ENTRY
,
KiBitmap
(
add_line2bus_xpm
)
);
...
...
eeschema/onrightclick.cpp
View file @
e50d18bc
...
...
@@ -62,6 +62,7 @@ static void AddMenusForComponent( wxMenu* PopMenu, SCH_COMPONENT* Component );
static
void
AddMenusForComponentField
(
wxMenu
*
PopMenu
,
SCH_FIELD
*
Field
);
static
void
AddMenusForMarkers
(
wxMenu
*
aPopMenu
,
SCH_MARKER
*
aMarker
,
SCH_EDIT_FRAME
*
aFrame
);
static
void
AddMenusForBitmap
(
wxMenu
*
aPopMenu
,
SCH_BITMAP
*
aBitmap
);
static
void
AddMenusForBusEntry
(
wxMenu
*
aPopMenu
,
SCH_BUS_ENTRY
*
aBusEntry
);
...
...
@@ -149,22 +150,7 @@ bool SCH_EDIT_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu )
break
;
case
SCH_BUS_ENTRY_T
:
if
(
!
flags
)
{
wxString
msg
=
AddHotkeyName
(
_
(
"Move Bus Entry"
),
s_Schematic_Hokeys_Descr
,
HK_MOVE_COMPONENT_OR_ITEM
);
AddMenuItem
(
PopMenu
,
ID_SCH_MOVE_ITEM
,
msg
,
KiBitmap
(
move_xpm
)
);
}
if
(
GetBusEntryShape
(
(
SCH_BUS_ENTRY
*
)
item
)
==
'\\'
)
AddMenuItem
(
PopMenu
,
ID_POPUP_SCH_ENTRY_SELECT_SLASH
,
_
(
"Set Bus Entry /"
),
KiBitmap
(
change_entry_orient_xpm
)
);
else
AddMenuItem
(
PopMenu
,
ID_POPUP_SCH_ENTRY_SELECT_ANTISLASH
,
_
(
"Set Bus Entry
\\
"
),
KiBitmap
(
change_entry_orient_xpm
)
);
AddMenuItem
(
PopMenu
,
ID_POPUP_SCH_DELETE
,
_
(
"Delete Bus Entry"
),
KiBitmap
(
delete_bus_xpm
)
);
AddMenusForBusEntry
(
PopMenu
,
(
SCH_BUS_ENTRY
*
)
item
);
break
;
case
SCH_MARKER_T
:
...
...
@@ -748,3 +734,24 @@ void AddMenusForBitmap( wxMenu* aPopMenu, SCH_BITMAP * aBitmap )
AddMenuItem
(
aPopMenu
,
ID_POPUP_SCH_DELETE
,
msg
,
KiBitmap
(
delete_xpm
)
);
}
}
void
AddMenusForBusEntry
(
wxMenu
*
aPopMenu
,
SCH_BUS_ENTRY
*
aBusEntry
)
{
wxString
msg
;
if
(
!
aBusEntry
->
GetFlags
()
)
{
msg
=
AddHotkeyName
(
_
(
"Move Bus Entry"
),
s_Schematic_Hokeys_Descr
,
HK_MOVE_COMPONENT_OR_ITEM
);
AddMenuItem
(
aPopMenu
,
ID_SCH_MOVE_ITEM
,
msg
,
KiBitmap
(
move_xpm
)
);
}
if
(
aBusEntry
->
GetBusEntryShape
()
==
'\\'
)
AddMenuItem
(
aPopMenu
,
ID_POPUP_SCH_ENTRY_SELECT_SLASH
,
_
(
"Set Bus Entry Shape /"
),
KiBitmap
(
change_entry_orient_xpm
)
);
else
AddMenuItem
(
aPopMenu
,
ID_POPUP_SCH_ENTRY_SELECT_ANTISLASH
,
_
(
"Set Bus Entry Shape
\\
"
),
KiBitmap
(
change_entry_orient_xpm
)
);
msg
=
AddHotkeyName
(
_
(
"Delete Bus Entry"
),
s_Schematic_Hokeys_Descr
,
HK_DELETE
);
AddMenuItem
(
aPopMenu
,
ID_POPUP_SCH_DELETE
,
msg
,
KiBitmap
(
delete_xpm
)
);
}
eeschema/sch_bus_entry.cpp
View file @
e50d18bc
...
...
@@ -296,3 +296,37 @@ void SCH_BUS_ENTRY::doPlot( PLOTTER* aPlotter )
aPlotter
->
move_to
(
m_pos
);
aPlotter
->
finish_to
(
m_End
()
);
}
/* SetBusEntryShape:
* Set the shape of the bus entry.
* aShape = ascii code '/' or '\'
*/
void
SCH_BUS_ENTRY
::
SetBusEntryShape
(
int
aShape
)
{
switch
(
aShape
)
{
case
'\\'
:
if
(
m_size
.
y
<
0
)
m_size
.
y
=
-
m_size
.
y
;
break
;
case
'/'
:
if
(
m_size
.
y
>
0
)
m_size
.
y
=
-
m_size
.
y
;
break
;
}
}
/* GetBusEntryShape:
* return the shape of the bus entry, as an ascii code '/' or '\'
*/
int
SCH_BUS_ENTRY
::
GetBusEntryShape
()
const
{
int
shape
=
'\\'
;
if
(
GetSize
().
y
<
0
)
shape
=
'/'
;
return
shape
;
}
eeschema/sch_bus_entry.h
View file @
e50d18bc
...
...
@@ -64,6 +64,18 @@ public:
wxPoint
m_End
()
const
;
/**
* function GetBusEntryShape
* @return the shape of the bus entry, as an ascii code '/' or '\'
*/
int
GetBusEntryShape
()
const
;
/**
* function SetBusEntryShape
* @param aShape = the shape of the bus entry, as an ascii code '/' or '\'
*/
void
SetBusEntryShape
(
int
aShape
);
int
GetWidth
()
const
{
return
m_width
;
}
void
SetWidth
(
int
aWidth
)
{
m_width
=
aWidth
;
}
...
...
include/wxEeschemaStruct.h
View file @
e50d18bc
...
...
@@ -761,7 +761,6 @@ private:
// Bus Entry
SCH_BUS_ENTRY
*
CreateBusEntry
(
wxDC
*
DC
,
int
entry_type
);
void
SetBusEntryShape
(
wxDC
*
DC
,
SCH_BUS_ENTRY
*
BusEntry
,
int
entry_type
);
int
GetBusEntryShape
(
SCH_BUS_ENTRY
*
BusEntry
);
/**
* Function AddNoConnect
...
...
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