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
25df2772
Commit
25df2772
authored
Nov 12, 2010
by
Dick Hollenbeck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
formatting
parent
6c9244e8
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
75 additions
and
65 deletions
+75
-65
block_commande.h
include/block_commande.h
+4
-4
block.cpp
pcbnew/block.cpp
+71
-61
No files found.
include/block_commande.h
View file @
25df2772
...
@@ -78,8 +78,8 @@ public:
...
@@ -78,8 +78,8 @@ public:
/**
/**
* Function InitData
* Function InitData
*
Init
the initial values of a BLOCK_SELECTOR, before starting a block
*
sets
the initial values of a BLOCK_SELECTOR, before starting a block
*command
*
command
*/
*/
void
InitData
(
WinEDA_DrawPanel
*
Panel
,
const
wxPoint
&
startpos
);
void
InitData
(
WinEDA_DrawPanel
*
Panel
,
const
wxPoint
&
startpos
);
...
@@ -96,14 +96,14 @@ public:
...
@@ -96,14 +96,14 @@ public:
/**
/**
* Function PushItem
* Function PushItem
*
Add
aItem to the list of items
*
adds
aItem to the list of items
* @param aItem = an ITEM_PICKER to add to the list
* @param aItem = an ITEM_PICKER to add to the list
*/
*/
void
PushItem
(
ITEM_PICKER
&
aItem
);
void
PushItem
(
ITEM_PICKER
&
aItem
);
/**
/**
* Function ClearListAndDeleteItems
* Function ClearListAndDeleteItems
* delete only the list of EDA_BaseStruct * pointers, AND the data printed
* delete
s
only the list of EDA_BaseStruct * pointers, AND the data printed
* by m_Item
* by m_Item
*/
*/
void
ClearListAndDeleteItems
();
void
ClearListAndDeleteItems
();
...
...
pcbnew/block.cpp
View file @
25df2772
...
@@ -380,8 +380,10 @@ int WinEDA_PcbFrame::HandleBlockEnd( wxDC* DC )
...
@@ -380,8 +380,10 @@ int WinEDA_PcbFrame::HandleBlockEnd( wxDC* DC )
DrawAndSizingBlockOutlines
(
DrawPanel
,
DC
,
FALSE
);
DrawAndSizingBlockOutlines
(
DrawPanel
,
DC
,
FALSE
);
return
0
;
return
0
;
}
}
DrawAndSizingBlockOutlines
(
DrawPanel
,
DC
,
FALSE
);
DrawAndSizingBlockOutlines
(
DrawPanel
,
DC
,
FALSE
);
Block_SelectItems
();
Block_SelectItems
();
// Exit if no items found
// Exit if no items found
if
(
!
GetScreen
()
->
m_BlockLocate
.
GetCount
()
)
{
if
(
!
GetScreen
()
->
m_BlockLocate
.
GetCount
()
)
{
DrawPanel
->
ManageCurseur
=
NULL
;
DrawPanel
->
ManageCurseur
=
NULL
;
...
@@ -393,6 +395,7 @@ int WinEDA_PcbFrame::HandleBlockEnd( wxDC* DC )
...
@@ -393,6 +395,7 @@ int WinEDA_PcbFrame::HandleBlockEnd( wxDC* DC )
DisplayToolMsg
(
wxEmptyString
);
DisplayToolMsg
(
wxEmptyString
);
return
0
;
return
0
;
}
}
// Move cursor to the center of the smallest rectangle
// Move cursor to the center of the smallest rectangle
// containing the centers of all selected items.
// containing the centers of all selected items.
// Also set m_BlockLocate to the size of the rectangle.
// Also set m_BlockLocate to the size of the rectangle.
...
@@ -401,6 +404,7 @@ int WinEDA_PcbFrame::HandleBlockEnd( wxDC* DC )
...
@@ -401,6 +404,7 @@ int WinEDA_PcbFrame::HandleBlockEnd( wxDC* DC )
int
minX
,
minY
,
maxX
,
maxY
;
int
minX
,
minY
,
maxX
,
maxY
;
int
tempX
,
tempY
;
int
tempX
,
tempY
;
BOARD_ITEM
*
item
=
(
BOARD_ITEM
*
)
itemsList
->
GetPickedItem
(
0
);
BOARD_ITEM
*
item
=
(
BOARD_ITEM
*
)
itemsList
->
GetPickedItem
(
0
);
minX
=
item
->
GetPosition
().
x
;
minX
=
item
->
GetPosition
().
x
;
minY
=
item
->
GetPosition
().
y
;
minY
=
item
->
GetPosition
().
y
;
maxX
=
minX
;
maxX
=
minX
;
...
@@ -419,6 +423,7 @@ int WinEDA_PcbFrame::HandleBlockEnd( wxDC* DC )
...
@@ -419,6 +423,7 @@ int WinEDA_PcbFrame::HandleBlockEnd( wxDC* DC )
if
(
tempY
<
minY
)
if
(
tempY
<
minY
)
minY
=
tempY
;
minY
=
tempY
;
}
}
blockCenter
.
x
=
(
minX
+
maxX
)
/
2
;
blockCenter
.
x
=
(
minX
+
maxX
)
/
2
;
blockCenter
.
y
=
(
minY
+
maxY
)
/
2
;
blockCenter
.
y
=
(
minY
+
maxY
)
/
2
;
DrawPanel
->
CursorOff
(
DC
);
DrawPanel
->
CursorOff
(
DC
);
...
@@ -431,6 +436,7 @@ int WinEDA_PcbFrame::HandleBlockEnd( wxDC* DC )
...
@@ -431,6 +436,7 @@ int WinEDA_PcbFrame::HandleBlockEnd( wxDC* DC )
}
}
if
(
DrawPanel
->
ManageCurseur
)
if
(
DrawPanel
->
ManageCurseur
)
{
switch
(
GetScreen
()
->
m_BlockLocate
.
m_Command
)
switch
(
GetScreen
()
->
m_BlockLocate
.
m_Command
)
{
{
case
BLOCK_IDLE
:
case
BLOCK_IDLE
:
...
@@ -469,7 +475,7 @@ int WinEDA_PcbFrame::HandleBlockEnd( wxDC* DC )
...
@@ -469,7 +475,7 @@ int WinEDA_PcbFrame::HandleBlockEnd( wxDC* DC )
GetScreen
()
->
m_BlockLocate
.
m_State
=
STATE_BLOCK_STOP
;
GetScreen
()
->
m_BlockLocate
.
m_State
=
STATE_BLOCK_STOP
;
if
(
GetScreen
()
->
m_BlockLocate
.
GetCount
()
)
if
(
GetScreen
()
->
m_BlockLocate
.
GetCount
()
)
{
{
// TODO
(if useful) Save_Block( );
// @todo
(if useful) Save_Block( );
}
}
break
;
break
;
...
@@ -487,6 +493,7 @@ int WinEDA_PcbFrame::HandleBlockEnd( wxDC* DC )
...
@@ -487,6 +493,7 @@ int WinEDA_PcbFrame::HandleBlockEnd( wxDC* DC )
default
:
default
:
break
;
break
;
}
}
}
if
(
endcommande
==
TRUE
)
if
(
endcommande
==
TRUE
)
{
{
...
@@ -641,7 +648,7 @@ void WinEDA_PcbFrame::Block_SelectItems()
...
@@ -641,7 +648,7 @@ void WinEDA_PcbFrame::Block_SelectItems()
}
}
}
}
}
}
}
}
static
void
drawPickedItems
(
WinEDA_DrawPanel
*
aPanel
,
wxDC
*
aDC
,
static
void
drawPickedItems
(
WinEDA_DrawPanel
*
aPanel
,
wxDC
*
aDC
,
wxPoint
aOffset
)
wxPoint
aOffset
)
...
@@ -649,6 +656,7 @@ static void drawPickedItems( WinEDA_DrawPanel* aPanel, wxDC* aDC,
...
@@ -649,6 +656,7 @@ static void drawPickedItems( WinEDA_DrawPanel* aPanel, wxDC* aDC,
PICKED_ITEMS_LIST
*
itemsList
=
&
aPanel
->
GetScreen
()
->
m_BlockLocate
.
m_ItemsSelection
;
PICKED_ITEMS_LIST
*
itemsList
=
&
aPanel
->
GetScreen
()
->
m_BlockLocate
.
m_ItemsSelection
;
WinEDA_BasePcbFrame
*
frame
=
(
WinEDA_BasePcbFrame
*
)
aPanel
->
GetParent
();
WinEDA_BasePcbFrame
*
frame
=
(
WinEDA_BasePcbFrame
*
)
aPanel
->
GetParent
();
g_Offset_Module
=
-
aOffset
;
g_Offset_Module
=
-
aOffset
;
for
(
unsigned
ii
=
0
;
ii
<
itemsList
->
GetCount
();
ii
++
)
for
(
unsigned
ii
=
0
;
ii
<
itemsList
->
GetCount
();
ii
++
)
{
{
BOARD_ITEM
*
item
=
(
BOARD_ITEM
*
)
itemsList
->
GetPickedItem
(
ii
);
BOARD_ITEM
*
item
=
(
BOARD_ITEM
*
)
itemsList
->
GetPickedItem
(
ii
);
...
@@ -840,6 +848,7 @@ void WinEDA_PcbFrame::Block_Rotate()
...
@@ -840,6 +848,7 @@ void WinEDA_PcbFrame::Block_Rotate()
wxASSERT
(
item
);
wxASSERT
(
item
);
itemsList
->
SetPickedItemStatus
(
UR_ROTATED
,
ii
);
itemsList
->
SetPickedItemStatus
(
UR_ROTATED
,
ii
);
item
->
Rotate
(
centre
,
rotAngle
);
item
->
Rotate
(
centre
,
rotAngle
);
switch
(
item
->
Type
()
)
switch
(
item
->
Type
()
)
{
{
case
TYPE_MODULE
:
case
TYPE_MODULE
:
...
@@ -881,7 +890,7 @@ void WinEDA_PcbFrame::Block_Rotate()
...
@@ -881,7 +890,7 @@ void WinEDA_PcbFrame::Block_Rotate()
/**
/**
* Function Block_Flip
* Function Block_Flip
*
Flip
items within the selected block.
*
flips
items within the selected block.
* The flip center is the center of the block
* The flip center is the center of the block
* @param none
* @param none
*/
*/
...
@@ -906,6 +915,7 @@ void WinEDA_PcbFrame::Block_Flip()
...
@@ -906,6 +915,7 @@ void WinEDA_PcbFrame::Block_Flip()
wxASSERT
(
item
);
wxASSERT
(
item
);
itemsList
->
SetPickedItemStatus
(
UR_FLIPPED
,
ii
);
itemsList
->
SetPickedItemStatus
(
UR_FLIPPED
,
ii
);
item
->
Flip
(
center
);
item
->
Flip
(
center
);
switch
(
item
->
Type
()
)
switch
(
item
->
Type
()
)
{
{
case
TYPE_MODULE
:
case
TYPE_MODULE
:
...
@@ -1008,7 +1018,7 @@ void WinEDA_PcbFrame::Block_Move()
...
@@ -1008,7 +1018,7 @@ void WinEDA_PcbFrame::Block_Move()
/**
/**
* Function Block_Duplicate
* Function Block_Duplicate
*
Duplicate
all items within the selected block.
*
duplicates
all items within the selected block.
* New location is determined by the current offset from the selected block's
* New location is determined by the current offset from the selected block's
* original location.
* original location.
* @param none
* @param none
...
@@ -1112,7 +1122,7 @@ void WinEDA_PcbFrame::Block_Duplicate()
...
@@ -1112,7 +1122,7 @@ void WinEDA_PcbFrame::Block_Duplicate()
break
;
break
;
}
}
if
(
newitem
)
if
(
newitem
)
{
{
newitem
->
Move
(
MoveVector
);
newitem
->
Move
(
MoveVector
);
picker
.
m_PickedItem
=
newitem
;
picker
.
m_PickedItem
=
newitem
;
...
...
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