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
d39df052
Commit
d39df052
authored
Feb 23, 2011
by
jean-pierre charras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Eeschema: fix crash when starting ERC.
Fix other issues.
parent
0132ceb3
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
111 additions
and
122 deletions
+111
-122
drawpanel.cpp
common/drawpanel.cpp
+1
-1
libedit_onleftclick.cpp
eeschema/libedit_onleftclick.cpp
+22
-25
libedit_onrightclick.cpp
eeschema/libedit_onrightclick.cpp
+2
-2
onrightclick.cpp
eeschema/onrightclick.cpp
+1
-1
sch_screen.cpp
eeschema/sch_screen.cpp
+2
-1
modedit_onclick.cpp
pcbnew/modedit_onclick.cpp
+23
-26
onleftclick.cpp
pcbnew/onleftclick.cpp
+59
-65
onrightclick.cpp
pcbnew/onrightclick.cpp
+1
-1
No files found.
common/drawpanel.cpp
View file @
d39df052
...
@@ -572,7 +572,7 @@ void EDA_DRAW_PANEL::DrawGrid( wxDC* aDC )
...
@@ -572,7 +572,7 @@ void EDA_DRAW_PANEL::DrawGrid( wxDC* aDC )
if
(
org
.
y
<
m_ClipBox
.
GetY
()
)
if
(
org
.
y
<
m_ClipBox
.
GetY
()
)
org
.
y
+=
wxRound
(
gridSize
.
y
);
org
.
y
+=
wxRound
(
gridSize
.
y
);
#if ( defined( __WXMAC__ ) ||
0
)
#if ( defined( __WXMAC__ ) ||
1
)
// Use a pixel based draw to display grid. There are a lot of calls, so the cost is
// Use a pixel based draw to display grid. There are a lot of calls, so the cost is
// high and grid is slowly drawn on some platforms. Please note that this should
// high and grid is slowly drawn on some platforms. Please note that this should
// always be enabled until the bitmap based solution below is fixed.
// always be enabled until the bitmap based solution below is fixed.
...
...
eeschema/libedit_onleftclick.cpp
View file @
d39df052
...
@@ -25,38 +25,35 @@ void LIB_EDIT_FRAME::OnLeftClick( wxDC* DC, const wxPoint& aPosition )
...
@@ -25,38 +25,35 @@ void LIB_EDIT_FRAME::OnLeftClick( wxDC* DC, const wxPoint& aPosition )
if
(
m_component
==
NULL
)
// No component loaded !
if
(
m_component
==
NULL
)
// No component loaded !
return
;
return
;
if
(
m_ID_current_state
==
0
)
if
(
DrawEntry
&&
DrawEntry
->
m_Flags
)
{
{
if
(
DrawEntry
&&
DrawEntry
->
m_Flags
)
switch
(
DrawEntry
->
Type
()
)
{
{
switch
(
DrawEntry
->
Type
()
)
case
LIB_PIN_T
:
{
PlacePin
(
DC
);
case
LIB_PIN_T
:
DrawEntry
=
NULL
;
PlacePin
(
DC
);
break
;
DrawEntry
=
NULL
;
break
;
default
:
default
:
EndDrawGraphicItem
(
DC
);
EndDrawGraphicItem
(
DC
);
break
;
break
;
}
}
}
else
}
{
else
DrawEntry
=
m_component
->
LocateDrawItem
(
m_unit
,
m_convert
,
TYPE_NOT_INIT
,
aPosition
);
{
DrawEntry
=
m_component
->
LocateDrawItem
(
m_unit
,
m_convert
,
TYPE_NOT_INIT
,
aPosition
);
if
(
DrawEntry
==
NULL
)
if
(
DrawEntry
==
NULL
)
{
{
DrawEntry
=
m_component
->
LocateDrawItem
(
m_unit
,
m_convert
,
TYPE_NOT_INIT
,
DrawEntry
=
m_component
->
LocateDrawItem
(
m_unit
,
m_convert
,
TYPE_NOT_INIT
,
GetScreen
()
->
GetCrossHairPosition
()
);
GetScreen
()
->
GetCrossHairPosition
()
);
}
}
if
(
DrawEntry
)
if
(
DrawEntry
)
DrawEntry
->
DisplayInfo
(
this
);
DrawEntry
->
DisplayInfo
(
this
);
else
else
DisplayCmpDoc
();
DisplayCmpDoc
();
}
}
}
if
(
m_ID_current_state
)
if
(
m_ID_current_state
)
...
...
eeschema/libedit_onrightclick.cpp
View file @
d39df052
...
@@ -50,13 +50,13 @@ bool LIB_EDIT_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu )
...
@@ -50,13 +50,13 @@ bool LIB_EDIT_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu )
_
(
"Cancel"
),
cancel_xpm
);
_
(
"Cancel"
),
cancel_xpm
);
PopMenu
->
AppendSeparator
();
PopMenu
->
AppendSeparator
();
}
}
else
if
(
m_ID_current_state
)
else
if
(
m_ID_current_state
&&
m_ID_current_state
!=
ID_LIBEDIT_NO_TOOL
)
{
// If a tool is active, put menu "end tool"
{
// If a tool is active, put menu "end tool"
ADD_MENUITEM
(
PopMenu
,
ID_POPUP_LIBEDIT_CANCEL_EDITING
,
ADD_MENUITEM
(
PopMenu
,
ID_POPUP_LIBEDIT_CANCEL_EDITING
,
_
(
"End Tool"
),
cancel_tool_xpm
);
_
(
"End Tool"
),
cancel_tool_xpm
);
PopMenu
->
AppendSeparator
();
PopMenu
->
AppendSeparator
();
}
}
if
(
DrawEntry
)
if
(
DrawEntry
)
DrawEntry
->
DisplayInfo
(
this
);
DrawEntry
->
DisplayInfo
(
this
);
...
...
eeschema/onrightclick.cpp
View file @
d39df052
...
@@ -79,7 +79,7 @@ bool SCH_EDIT_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu )
...
@@ -79,7 +79,7 @@ bool SCH_EDIT_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu )
}
}
// If Command in progress: add "cancel" and "end tool" menu
// If Command in progress: add "cancel" and "end tool" menu
if
(
m_ID_current_state
)
if
(
m_ID_current_state
&&
m_ID_current_state
!=
ID_SCH_NO_TOOL
)
{
{
if
(
DrawStruct
&&
DrawStruct
->
m_Flags
)
if
(
DrawStruct
&&
DrawStruct
->
m_Flags
)
{
{
...
...
eeschema/sch_screen.cpp
View file @
d39df052
...
@@ -273,7 +273,6 @@ bool SCH_SCREEN::SchematicCleanUp( EDA_DRAW_PANEL* aCanvas, wxDC* aDC )
...
@@ -273,7 +273,6 @@ bool SCH_SCREEN::SchematicCleanUp( EDA_DRAW_PANEL* aCanvas, wxDC* aDC )
* segment can be flagged */
* segment can be flagged */
DrawList
->
m_Flags
|=
TstDrawList
->
m_Flags
;
DrawList
->
m_Flags
|=
TstDrawList
->
m_Flags
;
EraseStruct
(
TstDrawList
,
this
);
EraseStruct
(
TstDrawList
,
this
);
aCanvas
->
Refresh
();
TstDrawList
=
GetDrawItems
();
TstDrawList
=
GetDrawItems
();
Modify
=
true
;
Modify
=
true
;
}
}
...
@@ -292,6 +291,8 @@ bool SCH_SCREEN::SchematicCleanUp( EDA_DRAW_PANEL* aCanvas, wxDC* aDC )
...
@@ -292,6 +291,8 @@ bool SCH_SCREEN::SchematicCleanUp( EDA_DRAW_PANEL* aCanvas, wxDC* aDC )
TestDanglingEnds
(
aCanvas
,
aDC
);
TestDanglingEnds
(
aCanvas
,
aDC
);
if
(
aCanvas
&&
Modify
)
aCanvas
->
Refresh
();
return
Modify
;
return
Modify
;
}
}
...
...
pcbnew/modedit_onclick.cpp
View file @
d39df052
...
@@ -26,36 +26,33 @@ void WinEDA_ModuleEditFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
...
@@ -26,36 +26,33 @@ void WinEDA_ModuleEditFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
BOARD_ITEM
*
item
=
GetCurItem
();
BOARD_ITEM
*
item
=
GetCurItem
();
DrawPanel
->
CrossHairOff
(
DC
);
DrawPanel
->
CrossHairOff
(
DC
);
if
(
m_ID_current_state
==
0
)
if
(
item
&&
item
->
m_Flags
)
// Command in progress
{
{
if
(
item
&&
item
->
m_Flags
)
// Command in progress
switch
(
item
->
Type
()
)
{
{
switch
(
item
->
Type
()
)
case
TYPE_TEXTE_MODULE
:
{
PlaceTexteModule
(
(
TEXTE_MODULE
*
)
item
,
DC
);
case
TYPE_TEXTE_MODULE
:
break
;
PlaceTexteModule
(
(
TEXTE_MODULE
*
)
item
,
DC
);
break
;
case
TYPE_EDGE_MODULE
:
case
TYPE_EDGE_MODULE
:
SaveCopyInUndoList
(
GetBoard
()
->
m_Modules
,
UR_MODEDIT
);
SaveCopyInUndoList
(
GetBoard
()
->
m_Modules
,
UR_MODEDIT
);
Place_EdgeMod
(
(
EDGE_MODULE
*
)
item
);
Place_EdgeMod
(
(
EDGE_MODULE
*
)
item
);
break
;
break
;
case
TYPE_PAD
:
case
TYPE_PAD
:
PlacePad
(
(
D_PAD
*
)
item
,
DC
);
PlacePad
(
(
D_PAD
*
)
item
,
DC
);
break
;
break
;
default
:
default
:
{
{
wxString
msg
;
wxString
msg
;
msg
.
Printf
(
wxT
(
"WinEDA_ModEditFrame::OnLeftClick err: \
msg
.
Printf
(
wxT
(
"WinEDA_ModEditFrame::OnLeftClick err:Struct %d, m_Flag %X"
),
m_Flags != 0
\n
Struct @%p, type %d m_Flag %X"
),
item
->
Type
(),
item
->
m_Flags
);
item
,
item
->
Type
(),
item
->
m_Flags
);
DisplayError
(
this
,
msg
);
DisplayError
(
this
,
msg
);
item
->
m_Flags
=
0
;
item
->
m_Flags
=
0
;
break
;
break
;
}
}
}
}
}
}
}
...
@@ -199,7 +196,7 @@ bool WinEDA_ModuleEditFrame::OnRightClick( const wxPoint& MousePos, wxMenu* PopM
...
@@ -199,7 +196,7 @@ bool WinEDA_ModuleEditFrame::OnRightClick( const wxPoint& MousePos, wxMenu* PopM
}
}
// End command in progress.
// End command in progress.
if
(
m_ID_current_state
)
if
(
m_ID_current_state
&&
m_ID_current_state
!=
ID_MODEDIT_NO_TOOL
)
{
{
if
(
item
&&
item
->
m_Flags
)
if
(
item
&&
item
->
m_Flags
)
ADD_MENUITEM
(
PopMenu
,
ID_POPUP_CANCEL_CURRENT_COMMAND
,
_
(
"Cancel"
),
cancel_xpm
);
ADD_MENUITEM
(
PopMenu
,
ID_POPUP_CANCEL_CURRENT_COMMAND
,
_
(
"Cancel"
),
cancel_xpm
);
...
...
pcbnew/onleftclick.cpp
View file @
d39df052
...
@@ -21,89 +21,83 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* aDC, const wxPoint& aPosition )
...
@@ -21,89 +21,83 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* aDC, const wxPoint& aPosition )
BOARD_ITEM
*
DrawStruct
=
GetCurItem
();
BOARD_ITEM
*
DrawStruct
=
GetCurItem
();
bool
exit
=
false
;
bool
exit
=
false
;
if
(
(
m_ID_current_state
==
0
)
||
(
DrawStruct
&&
DrawStruct
->
m_Flags
)
)
if
(
DrawStruct
&&
DrawStruct
->
m_Flags
)
// Command in progress
{
{
DrawPanel
->
m_AutoPAN_Request
=
false
;
DrawPanel
->
m_AutoPAN_Request
=
false
;
DrawPanel
->
m_IgnoreMouseEvents
=
true
;
DrawPanel
->
CrossHairOff
(
aDC
);
if
(
DrawStruct
&&
DrawStruct
->
m_Flags
)
// "POPUP" in progress
switch
(
DrawStruct
->
Type
()
)
{
{
DrawPanel
->
m_IgnoreMouseEvents
=
true
;
case
TYPE_ZONE_CONTAINER
:
DrawPanel
->
CrossHairOff
(
aDC
);
if
(
DrawStruct
->
IsNew
()
)
{
DrawPanel
->
m_AutoPAN_Request
=
true
;
Begin_Zone
(
aDC
);
}
else
End_Move_Zone_Corner_Or_Outlines
(
aDC
,
(
ZONE_CONTAINER
*
)
DrawStruct
);
exit
=
true
;
break
;
switch
(
DrawStruct
->
Type
()
)
case
TYPE_TRACK
:
case
TYPE_VIA
:
if
(
DrawStruct
->
m_Flags
&
IS_DRAGGED
)
{
{
case
TYPE_ZONE_CONTAINER
:
PlaceDraggedOrMovedTrackSegment
(
(
TRACK
*
)
DrawStruct
,
aDC
);
if
(
DrawStruct
->
IsNew
()
)
{
DrawPanel
->
m_AutoPAN_Request
=
true
;
Begin_Zone
(
aDC
);
}
else
End_Move_Zone_Corner_Or_Outlines
(
aDC
,
(
ZONE_CONTAINER
*
)
DrawStruct
);
exit
=
true
;
exit
=
true
;
break
;
}
break
;
case
TYPE_TRACK
:
case
TYPE_TEXTE
:
case
TYPE_VIA
:
Place_Texte_Pcb
(
(
TEXTE_PCB
*
)
DrawStruct
,
aDC
);
if
(
DrawStruct
->
m_Flags
&
IS_DRAGGED
)
exit
=
true
;
{
break
;
PlaceDraggedOrMovedTrackSegment
(
(
TRACK
*
)
DrawStruct
,
aDC
);
exit
=
true
;
}
break
;
case
TYPE_TEXT
E
:
case
TYPE_TEXTE_MODUL
E
:
Place_Texte_Pcb
(
(
TEXTE_PCB
*
)
DrawStruct
,
aDC
);
PlaceTexteModule
(
(
TEXTE_MODULE
*
)
DrawStruct
,
aDC
);
exit
=
true
;
exit
=
true
;
break
;
break
;
case
TYPE_TEXTE_MODULE
:
case
TYPE_PAD
:
PlaceTexteModule
(
(
TEXTE_MODULE
*
)
DrawStruct
,
aDC
);
PlacePad
(
(
D_PAD
*
)
DrawStruct
,
aDC
);
exit
=
true
;
exit
=
true
;
break
;
break
;
case
TYPE_PAD
:
case
TYPE_MODULE
:
PlacePad
(
(
D_PAD
*
)
DrawStruct
,
aDC
);
Place_Module
(
(
MODULE
*
)
DrawStruct
,
aDC
);
exit
=
true
;
exit
=
true
;
break
;
break
;
case
TYPE_MODUL
E
:
case
TYPE_MIR
E
:
Place_Module
(
(
MODULE
*
)
DrawStruct
,
aDC
);
Place_Mire
(
(
MIREPCB
*
)
DrawStruct
,
aDC
);
exit
=
true
;
exit
=
true
;
break
;
break
;
case
TYPE_MIRE
:
case
TYPE_DRAWSEGMENT
:
Place_Mire
(
(
MIREPCB
*
)
DrawStruct
,
aDC
);
Place_DrawItem
(
(
DRAWSEGMENT
*
)
DrawStruct
,
aDC
);
exit
=
true
;
exit
=
true
;
break
;
break
;
case
TYPE_DRAWSEGMENT
:
case
TYPE_DIMENSION
:
Place_DrawItem
(
(
DRAWSEGMENT
*
)
DrawStruct
,
aDC
);
// see above.
exit
=
true
;
break
;
break
;
case
TYPE_DIMENSION
:
default
:
// see above.
DisplayError
(
this
,
break
;
wxT
(
"WinEDA_PcbFrame::OnLeftClick() err: DrawType %d m_Flags != 0"
),
DrawStruct
->
Type
()
);
exit
=
true
;
break
;
}
default
:
DrawPanel
->
m_IgnoreMouseEvents
=
false
;
if
(
m_ID_current_state
==
0
)
DrawPanel
->
CrossHairOn
(
aDC
);
{
DisplayError
(
this
,
wxT
(
"WinEDA_PcbFrame::OnLeftClick() err: DrawType %d m_Flags != 0"
),
DrawStruct
->
Type
()
);
exit
=
true
;
}
break
;
}
DrawPanel
->
m_IgnoreMouseEvents
=
false
;
if
(
exit
)
DrawPanel
->
CrossHairOn
(
aDC
)
;
return
;
if
(
exit
)
return
;
}
else
if
(
!
wxGetKeyState
(
WXK_SHIFT
)
&&
!
wxGetKeyState
(
WXK_ALT
)
else
if
(
!
wxGetKeyState
(
WXK_SHIFT
)
&&
!
wxGetKeyState
(
WXK_ALT
)
&&
!
wxGetKeyState
(
WXK_CONTROL
)
)
&&
!
wxGetKeyState
(
WXK_CONTROL
)
)
{
{
...
...
pcbnew/onrightclick.cpp
View file @
d39df052
...
@@ -51,7 +51,7 @@ bool WinEDA_PcbFrame::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
...
@@ -51,7 +51,7 @@ bool WinEDA_PcbFrame::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
DrawPanel
->
CrossHairOff
(
&
dc
);
DrawPanel
->
CrossHairOff
(
&
dc
);
if
(
m_ID_current_state
)
if
(
m_ID_current_state
&&
m_ID_current_state
!=
ID_PCB_NO_TOOL
)
{
{
if
(
item
&&
item
->
m_Flags
)
if
(
item
&&
item
->
m_Flags
)
{
{
...
...
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