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
514de91e
Commit
514de91e
authored
Aug 08, 2009
by
charras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More about undo/redo in pcbnew
parent
148a574e
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
73 additions
and
72 deletions
+73
-72
id.h
include/id.h
+23
-19
wxPcbStruct.h
include/wxPcbStruct.h
+1
-1
board_undo_redo.cpp
pcbnew/board_undo_redo.cpp
+11
-1
edit.cpp
pcbnew/edit.cpp
+0
-36
pcbframe.cpp
pcbnew/pcbframe.cpp
+5
-2
via_edit.cpp
pcbnew/via_edit.cpp
+33
-13
No files found.
include/id.h
View file @
514de91e
...
...
@@ -569,15 +569,6 @@ enum main_id {
ID_POPUP_PCB_SELECT_WIDTH6
,
ID_POPUP_PCB_SELECT_WIDTH7
,
ID_POPUP_PCB_SELECT_WIDTH8
,
ID_POPUP_PCB_SELECT_VIASIZE
,
ID_POPUP_PCB_SELECT_VIASIZE1
,
ID_POPUP_PCB_SELECT_VIASIZE2
,
ID_POPUP_PCB_SELECT_VIASIZE3
,
ID_POPUP_PCB_SELECT_VIASIZE4
,
ID_POPUP_PCB_SELECT_VIASIZE5
,
ID_POPUP_PCB_SELECT_VIASIZE6
,
ID_POPUP_PCB_SELECT_VIASIZE7
,
ID_POPUP_PCB_SELECT_VIASIZE8
,
ID_POPUP_PCB_EDIT_TRACKSEG
,
ID_POPUP_PCB_EDIT_TRACK_MNU
,
ID_POPUP_PCB_EDIT_NET
,
...
...
@@ -613,13 +604,6 @@ enum main_id {
ID_POPUP_PCB_MOVE_TRACK_NODE
,
ID_POPUP_PCB_BREAK_TRACK
,
ID_POPUP_PCB_PLACE_MOVED_TRACK_NODE
,
ID_POPUP_PCB_VIA_EDITING
,
ID_POPUP_PCB_VIA_HOLE_TO_DEFAULT
,
ID_POPUP_PCB_VIA_HOLE_TO_VALUE
,
ID_POPUP_PCB_VIA_HOLE_ENTER_VALUE
,
ID_POPUP_PCB_VIA_HOLE_EXPORT
,
ID_POPUP_PCB_VIA_HOLE_RESET_TO_DEFAULT
,
ID_POPUP_PCB_VIA_HOLE_EXPORT_TO_OTHERS
,
ID_POPUP_PCB_DRAG_TRACK_SEGMENT_KEEP_SLOPE
,
ID_POPUP_PCB_DRAG_TRACK_SEGMENT
,
ID_POPUP_PCB_MOVE_TRACK_SEGMENT
,
...
...
@@ -630,6 +614,26 @@ enum main_id {
ID_POPUP_PCB_UNUSED8
,
ID_POPUP_PCB_END_RANGE
,
// Via edition
ID_POPUP_VIA_EDIT_START_RANGE
,
ID_POPUP_PCB_SELECT_VIASIZE
,
ID_POPUP_PCB_SELECT_VIASIZE1
,
ID_POPUP_PCB_SELECT_VIASIZE2
,
ID_POPUP_PCB_SELECT_VIASIZE3
,
ID_POPUP_PCB_SELECT_VIASIZE4
,
ID_POPUP_PCB_SELECT_VIASIZE5
,
ID_POPUP_PCB_SELECT_VIASIZE6
,
ID_POPUP_PCB_SELECT_VIASIZE7
,
ID_POPUP_PCB_SELECT_VIASIZE8
,
ID_POPUP_PCB_VIA_EDITING
,
ID_POPUP_PCB_VIA_HOLE_TO_DEFAULT
,
ID_POPUP_PCB_VIA_HOLE_TO_VALUE
,
ID_POPUP_PCB_VIA_HOLE_ENTER_VALUE
,
ID_POPUP_PCB_VIA_HOLE_EXPORT
,
ID_POPUP_PCB_VIA_HOLE_RESET_TO_DEFAULT
,
ID_POPUP_PCB_VIA_HOLE_EXPORT_TO_OTHERS
,
ID_POPUP_VIA_EDIT_END_RANGE
,
// reserve a block of MAX_ITEMS_IN_PICKER ids for the item selection popup
ID_POPUP_PCB_ITEM_SELECTION_START
,
ID_POPUP_PCB_ITEM_SELECTION_END
=
MAX_ITEMS_IN_PICKER
+
ID_POPUP_PCB_ITEM_SELECTION_START
,
...
...
include/wxPcbStruct.h
View file @
514de91e
...
...
@@ -356,13 +356,13 @@ public:
// Board handling
void
RemoveStruct
(
BOARD_ITEM
*
Item
,
wxDC
*
DC
);
void
Via_Edit_Control
(
wxDC
*
DC
,
int
command_type
,
SEGVIA
*
via
);
// Hightlight functions:
int
Select_High_Light
(
wxDC
*
DC
);
void
Hight_Light
(
wxDC
*
DC
);
// Track and via edition:
void
Via_Edit_Control
(
wxCommandEvent
&
event
);
void
DisplayTrackSettings
();
/**
...
...
pcbnew/board_undo_redo.cpp
View file @
514de91e
...
...
@@ -164,11 +164,20 @@ void SwapData( BOARD_ITEM* aItem, BOARD_ITEM* aImage )
case
TYPE_TRACK
:
case
TYPE_VIA
:
case
TYPE_ZONE
:
EXCHG
(
(
(
TRACK
*
)
aItem
)
->
m_Start
,
(
(
TRACK
*
)
aImage
)
->
m_Start
);
EXCHG
(
(
(
TRACK
*
)
aItem
)
->
m_End
,
(
(
TRACK
*
)
aImage
)
->
m_End
);
EXCHG
(
(
(
TRACK
*
)
aItem
)
->
m_Width
,
(
(
TRACK
*
)
aImage
)
->
m_Width
);
EXCHG
(
(
(
TRACK
*
)
aItem
)
->
m_Shape
,
(
(
TRACK
*
)
aImage
)
->
m_Shape
);
{
int
itmp
=
((
TRACK
*
)
aItem
)
->
GetDrillValue
();
if
(
((
TRACK
*
)
aItem
)
->
IsDrillDefault
()
)
itmp
=
-
1
;
int
atmp
=
((
TRACK
*
)
aImage
)
->
GetDrillValue
();
if
(
((
TRACK
*
)
aImage
)
->
IsDrillDefault
()
)
atmp
=
-
1
;
(
(
TRACK
*
)
aItem
)
->
SetDrillValue
(
atmp
);
(
(
TRACK
*
)
aImage
)
->
SetDrillValue
(
itmp
);
}
break
;
case
TYPE_TEXTE
:
...
...
@@ -202,6 +211,7 @@ void SwapData( BOARD_ITEM* aItem, BOARD_ITEM* aImage )
}
break
;
case
TYPE_ZONE
:
default
:
wxMessageBox
(
wxT
(
"SwapData() error: unexpected type"
)
);
break
;
...
...
pcbnew/edit.cpp
View file @
514de91e
...
...
@@ -104,15 +104,6 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
case
ID_POPUP_PCB_SELECT_WIDTH6
:
case
ID_POPUP_PCB_SELECT_WIDTH7
:
case
ID_POPUP_PCB_SELECT_WIDTH8
:
case
ID_POPUP_PCB_SELECT_VIASIZE
:
case
ID_POPUP_PCB_SELECT_VIASIZE1
:
case
ID_POPUP_PCB_SELECT_VIASIZE2
:
case
ID_POPUP_PCB_SELECT_VIASIZE3
:
case
ID_POPUP_PCB_SELECT_VIASIZE4
:
case
ID_POPUP_PCB_SELECT_VIASIZE5
:
case
ID_POPUP_PCB_SELECT_VIASIZE6
:
case
ID_POPUP_PCB_SELECT_VIASIZE7
:
case
ID_POPUP_PCB_SELECT_VIASIZE8
:
case
ID_POPUP_PCB_MOVE_TRACK_NODE
:
case
ID_POPUP_PCB_DRAG_TRACK_SEGMENT_KEEP_SLOPE
:
case
ID_POPUP_PCB_DRAG_TRACK_SEGMENT
:
...
...
@@ -135,12 +126,6 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
case
ID_POPUP_ROTATE_BLOCK
:
case
ID_POPUP_COPY_BLOCK
:
case
ID_POPUP_PCB_VIA_EDITING
:
case
ID_POPUP_PCB_VIA_HOLE_TO_DEFAULT
:
case
ID_POPUP_PCB_VIA_HOLE_TO_VALUE
:
case
ID_POPUP_PCB_VIA_HOLE_ENTER_VALUE
:
case
ID_POPUP_PCB_VIA_HOLE_EXPORT
:
case
ID_POPUP_PCB_VIA_HOLE_RESET_TO_DEFAULT
:
case
ID_POPUP_PCB_VIA_HOLE_EXPORT_TO_OTHERS
:
case
ID_POPUP_PCB_EDIT_DRAWING
:
case
ID_POPUP_PCB_GETINFO_MARKER
:
break
;
...
...
@@ -1058,9 +1043,6 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
g_DesignSettings
.
m_UseConnectedTrackWidth
=
true
;
break
;
case
ID_POPUP_PCB_SELECT_VIASIZE
:
break
;
case
ID_AUX_TOOLBAR_PCB_VIA_SIZE
:
{
int
ii
=
m_SelViaSizeBox
->
GetChoice
();
...
...
@@ -1072,24 +1054,6 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
}
break
;
case
ID_POPUP_PCB_SELECT_VIASIZE1
:
case
ID_POPUP_PCB_SELECT_VIASIZE2
:
case
ID_POPUP_PCB_SELECT_VIASIZE3
:
case
ID_POPUP_PCB_SELECT_VIASIZE4
:
case
ID_POPUP_PCB_SELECT_VIASIZE5
:
case
ID_POPUP_PCB_SELECT_VIASIZE6
:
case
ID_POPUP_PCB_SELECT_VIASIZE7
:
case
ID_POPUP_PCB_SELECT_VIASIZE8
:
case
ID_POPUP_PCB_VIA_EDITING
:
case
ID_POPUP_PCB_VIA_HOLE_TO_DEFAULT
:
case
ID_POPUP_PCB_VIA_HOLE_TO_VALUE
:
case
ID_POPUP_PCB_VIA_HOLE_ENTER_VALUE
:
case
ID_POPUP_PCB_VIA_HOLE_EXPORT
:
case
ID_POPUP_PCB_VIA_HOLE_RESET_TO_DEFAULT
:
case
ID_POPUP_PCB_VIA_HOLE_EXPORT_TO_OTHERS
:
Via_Edit_Control
(
&
dc
,
id
,
(
SEGVIA
*
)
GetScreen
()
->
GetCurItem
()
);
break
;
case
ID_POPUP_PCB_MOVE_TRACK_SEGMENT
:
DrawPanel
->
MouseToCursorSchema
();
Start_MoveOneNodeOrSegment
(
(
TRACK
*
)
GetScreen
()
->
GetCurItem
(),
...
...
pcbnew/pcbframe.cpp
View file @
514de91e
...
...
@@ -194,10 +194,13 @@ BEGIN_EVENT_TABLE( WinEDA_PcbFrame, WinEDA_BasePcbFrame )
EVT_MENU_RANGE
(
ID_POPUP_PCB_START_RANGE
,
ID_POPUP_PCB_END_RANGE
,
WinEDA_PcbFrame
::
Process_Special_Functions
)
// Annulation de commande en cour
s
// popup menu
s
EVT_MENU_RANGE
(
ID_POPUP_GENERAL_START_RANGE
,
ID_POPUP_GENERAL_END_RANGE
,
WinEDA_PcbFrame
::
Process_Special_Functions
)
EVT_MENU_RANGE
(
ID_POPUP_VIA_EDIT_START_RANGE
,
ID_POPUP_VIA_EDIT_END_RANGE
,
WinEDA_PcbFrame
::
Via_Edit_Control
)
// PopUp Menus pour Zooms traites dans drawpanel.cpp
END_EVENT_TABLE
()
...
...
pcbnew/via_edit.cpp
View file @
514de91e
/**********************************************/
/* vi_edit.cpp: som editing function for vias */
/* vi_edit.cpp: som
e
editing function for vias */
/**********************************************/
#include "fctsys.h"
...
...
@@ -12,7 +12,7 @@
/**********************************************************************************/
void
WinEDA_PcbFrame
::
Via_Edit_Control
(
wx
DC
*
DC
,
int
command_type
,
SEGVIA
*
via
)
void
WinEDA_PcbFrame
::
Via_Edit_Control
(
wx
CommandEvent
&
event
)
/**********************************************************************************/
/*
...
...
@@ -21,8 +21,17 @@ void WinEDA_PcbFrame::Via_Edit_Control( wxDC* DC, int command_type, SEGVIA* via
{
int
ii
;
TRACK
*
via_struct
;
SEGVIA
*
via
=
(
SEGVIA
*
)
GetCurItem
();
wxClientDC
dc
(
DrawPanel
);
DrawPanel
->
CursorOff
(
&
dc
);
DrawPanel
->
PrepareGraphicContext
(
&
dc
);
switch
(
command_type
)
wxASSERT
(
via
->
Type
()
==
TYPE_VIA
);
PICKED_ITEMS_LIST
itemsListPicker
;
ITEM_PICKER
picker
(
NULL
,
UR_CHANGED
);
switch
(
event
.
GetId
()
)
{
case
ID_POPUP_PCB_SELECT_VIASIZE1
:
case
ID_POPUP_PCB_SELECT_VIASIZE2
:
...
...
@@ -33,21 +42,22 @@ void WinEDA_PcbFrame::Via_Edit_Control( wxDC* DC, int command_type, SEGVIA* via
case
ID_POPUP_PCB_SELECT_VIASIZE7
:
case
ID_POPUP_PCB_SELECT_VIASIZE8
:
// selec the new current value for via size (via diameter)
DrawPanel
->
MouseToCursorSchema
();
ii
=
command_type
-
ID_POPUP_PCB_SELECT_VIASIZE1
;
ii
=
event
.
GetId
()
-
ID_POPUP_PCB_SELECT_VIASIZE1
;
g_DesignSettings
.
m_CurrentViaSize
=
g_DesignSettings
.
m_ViaSizeHistory
[
ii
];
DisplayTrackSettings
();
break
;
case
ID_POPUP_PCB_VIA_HOLE_ENTER_VALUE
:
// Enter a new alternate value for drill via
InstallPcbOptionsFrame
(
wxDefaultPosition
,
DC
,
ID_PCB_TRACK_SIZE_SETUP
);
InstallPcbOptionsFrame
(
wxDefaultPosition
,
&
dc
,
ID_PCB_TRACK_SIZE_SETUP
);
DrawPanel
->
MouseToCursorSchema
();
case
ID_POPUP_PCB_VIA_HOLE_TO_VALUE
:
// Set the drill via to custom
if
(
(
g_DesignSettings
.
m_ViaDrillCustomValue
>
0
)
&&
(
g_DesignSettings
.
m_ViaDrillCustomValue
<
via
->
m_Width
)
)
{
via
->
Draw
(
DrawPanel
,
DC
,
GR_XOR
);
SaveCopyInUndoList
(
via
,
UR_CHANGED
);
via
->
Draw
(
DrawPanel
,
&
dc
,
GR_XOR
);
via
->
SetDrillValue
(
g_DesignSettings
.
m_ViaDrillCustomValue
);
via
->
Draw
(
DrawPanel
,
DC
,
GR_OR
);
via
->
Draw
(
DrawPanel
,
&
dc
,
GR_OR
);
GetScreen
()
->
SetModify
();
}
else
...
...
@@ -70,19 +80,24 @@ void WinEDA_PcbFrame::Via_Edit_Control( wxDC* DC, int command_type, SEGVIA* via
{
if
(
via_struct
->
m_Width
!=
via
->
m_Width
)
continue
;
via_struct
->
Draw
(
DrawPanel
,
DC
,
GR_XOR
);
picker
.
m_PickedItem
=
via_struct
;
picker
.
m_Link
=
via_struct
->
Copy
();
itemsListPicker
.
PushItem
(
picker
);
via_struct
->
Draw
(
DrawPanel
,
&
dc
,
GR_XOR
);
via_struct
->
SetDrillValue
(
via
->
GetDrillValue
()
);
via_struct
->
Draw
(
DrawPanel
,
DC
,
GR_OR
);
via_struct
->
Draw
(
DrawPanel
,
&
dc
,
GR_OR
);
}
}
SaveCopyInUndoList
(
itemsListPicker
,
UR_CHANGED
);
GetScreen
()
->
SetModify
();
break
;
case
ID_POPUP_PCB_VIA_HOLE_TO_DEFAULT
:
via
->
Draw
(
DrawPanel
,
DC
,
GR_XOR
);
SaveCopyInUndoList
(
via
,
UR_CHANGED
);
via
->
Draw
(
DrawPanel
,
&
dc
,
GR_XOR
);
via
->
SetDrillDefault
();
via
->
Draw
(
DrawPanel
,
DC
,
GR_OR
);
via
->
Draw
(
DrawPanel
,
&
dc
,
GR_OR
);
GetScreen
()
->
SetModify
();
break
;
...
...
@@ -94,12 +109,16 @@ void WinEDA_PcbFrame::Via_Edit_Control( wxDC* DC, int command_type, SEGVIA* via
{
if
(
!
via_struct
->
IsDrillDefault
()
)
{
via_struct
->
Draw
(
DrawPanel
,
DC
,
GR_XOR
);
picker
.
m_PickedItem
=
via_struct
;
picker
.
m_Link
=
via_struct
->
Copy
();
itemsListPicker
.
PushItem
(
picker
);
via_struct
->
Draw
(
DrawPanel
,
&
dc
,
GR_XOR
);
via_struct
->
SetDrillDefault
();
via_struct
->
Draw
(
DrawPanel
,
DC
,
GR_OR
);
via_struct
->
Draw
(
DrawPanel
,
&
dc
,
GR_OR
);
}
}
}
SaveCopyInUndoList
(
itemsListPicker
,
UR_CHANGED
);
GetScreen
()
->
SetModify
();
break
;
...
...
@@ -109,5 +128,6 @@ void WinEDA_PcbFrame::Via_Edit_Control( wxDC* DC, int command_type, SEGVIA* via
break
;
}
DrawPanel
->
CursorOn
(
&
dc
);
DrawPanel
->
MouseToCursorSchema
();
}
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