Commit bc9d5217 authored by jean-pierre charras's avatar jean-pierre charras

Eeschema: fix bug in load_one_schematic_file.cpp: error about files version,...

Eeschema: fix bug in load_one_schematic_file.cpp: error about files version, that create errors for hierarchical labels.
Pcbnew: cleaning code in block.cpp, and modifye previous way to calculate block size in block command, because old way creates unexpected behavior in block rotate and block flip.
Pcbnew: Fix a bug in plot silkscreen layers.
Cvpcb: Fix compilation issue under MACOX
parent 25df2772
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
#include "protos.h" #include "protos.h"
#include "cvstruct.h" #include "cvstruct.h"
#include "colors_selection.h" #include "colors_selection.h"
#include "cvpcb_id.h"
#include "build_version.h" #include "build_version.h"
......
...@@ -71,10 +71,14 @@ bool WinEDA_SchematicFrame::LoadOneEEFile( SCH_SCREEN* screen, const wxString& F ...@@ -71,10 +71,14 @@ bool WinEDA_SchematicFrame::LoadOneEEFile( SCH_SCREEN* screen, const wxString& F
return FALSE; return FALSE;
} }
// get the file version here. TODO: Support version numbers > 9 // get the file version here.
char version = line[9 + sizeof(SCHEMATIC_HEAD_STRING)]; char *strversion = line + 9 + sizeof(SCHEMATIC_HEAD_STRING);
int ver = version - '0'; // Skip blanks
if( ver > EESCHEMA_VERSION ) while( *strversion && *strversion < '0' )
strversion++;
int version = atoi(strversion);
if( version > EESCHEMA_VERSION )
{ {
MsgDiag = FullFileName + _( " was created by a more recent \ MsgDiag = FullFileName + _( " was created by a more recent \
version of EESchema and may not load correctly. Please consider updating!" ); version of EESchema and may not load correctly. Please consider updating!" );
...@@ -83,7 +87,7 @@ version of EESchema and may not load correctly. Please consider updating!" ); ...@@ -83,7 +87,7 @@ version of EESchema and may not load correctly. Please consider updating!" );
#if 0 #if 0
// Compile it if the new version is unreadable by previous eeschema versions // Compile it if the new version is unreadable by previous eeschema versions
else if( ver < EESCHEMA_VERSION ) else if( version < EESCHEMA_VERSION )
{ {
MsgDiag = FullFileName + _( " was created by an older version of \ MsgDiag = FullFileName + _( " was created by an older version of \
EESchema. It will be stored in the new file format when you save this file \ EESchema. It will be stored in the new file format when you save this file \
...@@ -159,9 +163,9 @@ again." ); ...@@ -159,9 +163,9 @@ again." );
} }
else if( Name1[0] == 'L' ) else if( Name1[0] == 'L' )
item = new SCH_LABEL(); item = new SCH_LABEL();
else if( Name1[0] == 'G' && ver > '1' ) else if( Name1[0] == 'G' && version > 1 )
item = new SCH_GLOBALLABEL(); item = new SCH_GLOBALLABEL();
else if( (Name1[0] == 'H') || (Name1[0] == 'G' && ver == '1') ) else if( (Name1[0] == 'H') || (Name1[0] == 'G' && version == 1) )
item = new SCH_HIERLABEL(); item = new SCH_HIERLABEL();
else else
item = new SCH_TEXT(); item = new SCH_TEXT();
......
...@@ -4,6 +4,7 @@ add_definitions(-DPCBNEW) ...@@ -4,6 +4,7 @@ add_definitions(-DPCBNEW)
# Includes # Includes
### ###
include_directories(${CMAKE_CURRENT_SOURCE_DIR} include_directories(${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/dialogs
${Boost_INCLUDE_DIR} ${Boost_INCLUDE_DIR}
../3d-viewer ../3d-viewer
../common ../common
...@@ -41,6 +42,7 @@ set(PCBNEW_SRCS ...@@ -41,6 +42,7 @@ set(PCBNEW_SRCS
cross-probing.cpp cross-probing.cpp
debug_kbool_key_file_fct.cpp debug_kbool_key_file_fct.cpp
deltrack.cpp deltrack.cpp
dialogs/dialog_block_options_base.cpp
dialog_copper_zones.cpp dialog_copper_zones.cpp
dialog_copper_zones_base.cpp dialog_copper_zones_base.cpp
dialog_design_rules.cpp dialog_design_rules.cpp
......
...@@ -16,6 +16,8 @@ ...@@ -16,6 +16,8 @@
#include "pcbplot.h" #include "pcbplot.h"
#include "trigo.h" #include "trigo.h"
#include "dialog_block_options_base.h"
#include "protos.h" #include "protos.h"
#define BLOCK_OUTLINE_COLOR YELLOW #define BLOCK_OUTLINE_COLOR YELLOW
...@@ -29,6 +31,7 @@ ...@@ -29,6 +31,7 @@
**/ **/
static void drawPickedItems( WinEDA_DrawPanel* aPanel, wxDC* aDC, static void drawPickedItems( WinEDA_DrawPanel* aPanel, wxDC* aDC,
wxPoint aOffset ); wxPoint aOffset );
/** /**
* Function drawMovingBlock * Function drawMovingBlock
* handles drawing of a moving block * handles drawing of a moving block
...@@ -40,184 +43,89 @@ static void drawMovingBlock( WinEDA_DrawPanel* aPanel, wxDC* aDC, ...@@ -40,184 +43,89 @@ static void drawMovingBlock( WinEDA_DrawPanel* aPanel, wxDC* aDC,
bool aErase ); bool aErase );
static bool Block_Include_Modules = TRUE; static bool Block_Include_Modules = true;
static bool BlockIncludeLockedModules = TRUE; static bool BlockIncludeLockedModules = true;
static bool Block_Include_Tracks = TRUE; static bool Block_Include_Tracks = true;
static bool Block_Include_Zones = TRUE; static bool Block_Include_Zones = true;
static bool Block_Include_Draw_Items = TRUE; static bool Block_Include_Draw_Items = true;
static bool Block_Include_Edges_Items = TRUE; static bool Block_Include_Edges_Items = true;
static bool Block_Include_PcbTextes = TRUE; static bool Block_Include_PcbTextes = true;
static bool BlockDrawItems = TRUE; static bool BlockDrawItems = true;
/************************************/ /************************************/
/* class WinEDA_ExecBlockCmdFrame */ /* class DIALOG_BLOCK_OPTIONS */
/************************************/ /************************************/
class WinEDA_ExecBlockCmdFrame : public wxDialog class DIALOG_BLOCK_OPTIONS : public DIALOG_BLOCK_OPTIONS_BASE
{ {
private: private:
WinEDA_BasePcbFrame* m_Parent; WinEDA_BasePcbFrame* m_Parent;
wxCheckBox* m_Include_Modules;
wxCheckBox* m_IncludeLockedModules;
wxCheckBox* m_Include_Tracks;
wxCheckBox* m_Include_Zones;
wxCheckBox* m_Include_Draw_Items;
wxCheckBox* m_Include_Edges_Items;
wxCheckBox* m_Include_PcbTextes;
wxCheckBox* m_DrawBlockItems;
public: public:
WinEDA_ExecBlockCmdFrame( WinEDA_BasePcbFrame* parent, DIALOG_BLOCK_OPTIONS( WinEDA_BasePcbFrame* parent,
const wxString& title ); const wxString& title );
~WinEDA_ExecBlockCmdFrame() ~DIALOG_BLOCK_OPTIONS()
{ {
} }
private: private:
void ExecuteCommand( wxCommandEvent& event ); void ExecuteCommand( wxCommandEvent& event );
void Cancel( wxCommandEvent& event ); void OnCancel( wxCommandEvent& event );
void checkBoxClicked( wxCommandEvent& aEvent ); void checkBoxClicked( wxCommandEvent& aEvent );
DECLARE_EVENT_TABLE()
}; };
BEGIN_EVENT_TABLE( WinEDA_ExecBlockCmdFrame, wxDialog ) static bool InstallBlockCmdFrame( WinEDA_BasePcbFrame* parent, const wxString& title )
EVT_BUTTON( wxID_OK, WinEDA_ExecBlockCmdFrame::ExecuteCommand )
EVT_BUTTON( wxID_CANCEL, WinEDA_ExecBlockCmdFrame::Cancel )
EVT_CHECKBOX( wxID_ANY, WinEDA_ExecBlockCmdFrame::checkBoxClicked )
END_EVENT_TABLE()
static bool InstallBlockCmdFrame( WinEDA_BasePcbFrame* parent,
const wxString& title )
{ {
int nocmd; int nocmd;
wxPoint oldpos = parent->GetScreen()->m_Curseur; wxPoint oldpos = parent->GetScreen()->m_Curseur;
parent->DrawPanel->m_IgnoreMouseEvents = TRUE; parent->DrawPanel->m_IgnoreMouseEvents = true;
WinEDA_ExecBlockCmdFrame* frame = DIALOG_BLOCK_OPTIONS dlg( parent, title );
new WinEDA_ExecBlockCmdFrame( parent, title );
nocmd = frame->ShowModal(); nocmd = dlg.ShowModal();
frame->Destroy();
parent->GetScreen()->m_Curseur = oldpos; parent->GetScreen()->m_Curseur = oldpos;
parent->DrawPanel->MouseToCursorSchema(); parent->DrawPanel->MouseToCursorSchema();
parent->DrawPanel->m_IgnoreMouseEvents = FALSE; parent->DrawPanel->m_IgnoreMouseEvents = false;
parent->DrawPanel->SetCursor( parent->DrawPanel->m_PanelCursor = parent->DrawPanel->SetCursor( parent->DrawPanel->m_PanelCursor =
parent->DrawPanel->m_PanelDefaultCursor ); parent->DrawPanel->m_PanelDefaultCursor );
return nocmd ? FALSE : TRUE; return nocmd ? false : true;
} }
WinEDA_ExecBlockCmdFrame::WinEDA_ExecBlockCmdFrame( WinEDA_BasePcbFrame* parent, DIALOG_BLOCK_OPTIONS::DIALOG_BLOCK_OPTIONS( WinEDA_BasePcbFrame* parent,
const wxString& title ) : const wxString& title ) :
wxDialog( parent, -1, title, wxPoint( -1, -1 ), wxDefaultSize, DIALOG_BLOCK_OPTIONS_BASE( parent, -1, title )
DIALOG_STYLE )
{ {
wxPoint pos;
wxButton* m_button1;
wxButton* m_button2;
m_Parent = parent; m_Parent = parent;
Centre();
this->SetSizeHints( wxDefaultSize, wxDefaultSize );
this->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 90,
false, wxEmptyString ) );
/* Sizer 1 creation */
wxFlexGridSizer* fgSizer1;
fgSizer1 = new wxFlexGridSizer( 7, 1, 0, 0 );
fgSizer1->SetFlexibleDirection( wxBOTH );
fgSizer1->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
m_Include_Modules = new wxCheckBox( this, -1, _( "Include Modules" ),
wxDefaultPosition, wxDefaultSize,
0 );
m_Include_Modules->SetValue( Block_Include_Modules );
fgSizer1->Add( m_Include_Modules, 0, wxALL, 5 );
m_IncludeLockedModules = new wxCheckBox( this, -1, _( "Include Locked Modules" ), m_Include_Modules->SetValue( Block_Include_Modules );
wxDefaultPosition, wxDefaultSize,
0 );
m_IncludeLockedModules->SetValue( BlockIncludeLockedModules ); m_IncludeLockedModules->SetValue( BlockIncludeLockedModules );
if( m_Include_Modules->GetValue() )
m_IncludeLockedModules->Enable();
else
m_IncludeLockedModules->Disable();
fgSizer1->Add( m_IncludeLockedModules, 0, wxALL, 5 );
m_Include_Tracks = new wxCheckBox( this, -1, _( "Include Tracks" ),
wxDefaultPosition, wxDefaultSize, 0 );
m_Include_Tracks->SetValue( Block_Include_Tracks ); m_Include_Tracks->SetValue( Block_Include_Tracks );
fgSizer1->Add( m_Include_Tracks, 0, wxALL, 5 );
m_Include_Zones = new wxCheckBox( this, -1, _( "Include Zones" ),
wxDefaultPosition, wxDefaultSize, 0 );
m_Include_Zones->SetValue( Block_Include_Zones ); m_Include_Zones->SetValue( Block_Include_Zones );
fgSizer1->Add( m_Include_Zones, 0, wxALL, 5 );
m_Include_PcbTextes = new wxCheckBox( this, -1,
_( "Include Text Items" ),
wxDefaultPosition,
wxDefaultSize, 0 );
m_Include_PcbTextes->SetValue( Block_Include_PcbTextes );
fgSizer1->Add( m_Include_PcbTextes, 0, wxALL, 5 );
m_Include_Draw_Items = new wxCheckBox( this, -1, _( "Include Drawings" ),
wxDefaultPosition,
wxDefaultSize, 0 );
m_Include_Draw_Items->SetValue( Block_Include_Draw_Items ); m_Include_Draw_Items->SetValue( Block_Include_Draw_Items );
fgSizer1->Add( m_Include_Draw_Items, 0, wxALL, 5 );
m_Include_Edges_Items = new wxCheckBox( this, -1,
_( "Include Board Outline Layer" ),
wxDefaultPosition,
wxDefaultSize, 0 );
m_Include_Edges_Items->SetValue( Block_Include_Edges_Items ); m_Include_Edges_Items->SetValue( Block_Include_Edges_Items );
fgSizer1->Add( m_Include_Edges_Items, 0, wxALL, 5 ); m_Include_PcbTextes->SetValue( Block_Include_PcbTextes );
m_DrawBlockItems = new wxCheckBox( this, -1,
_( "Draw Block Items" ),
wxDefaultPosition,
wxDefaultSize, 0 );
m_DrawBlockItems->SetValue( BlockDrawItems ); m_DrawBlockItems->SetValue( BlockDrawItems );
fgSizer1->Add( m_DrawBlockItems, 0, wxALL, 5 ); SetFocus();
GetSizer()->SetSizeHints( this );
/* Sizer 2 creation */ Centre();
wxFlexGridSizer* fgSizer2;
fgSizer2 = new wxFlexGridSizer( 1, 2, 0, 0 );
fgSizer2->SetFlexibleDirection( wxBOTH );
fgSizer2->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
m_button2 = new wxButton( this, wxID_CANCEL, _( "Cancel" ),
wxDefaultPosition, wxDefaultSize, 0 );
fgSizer2->Add( m_button2, 0, wxALL, 5 );
m_button1 = new wxButton( this, wxID_OK, _( "OK" ), wxDefaultPosition,
wxDefaultSize, 0 );
m_button1->SetDefault();
fgSizer2->Add( m_button1, 0, wxALL, 5 );
fgSizer1->Add( fgSizer2, 1, wxALIGN_RIGHT, 5 );
this->SetSizer( fgSizer1 );
this->Layout();
fgSizer1->Fit( this );
} }
void WinEDA_ExecBlockCmdFrame::Cancel( wxCommandEvent& WXUNUSED (event) ) void DIALOG_BLOCK_OPTIONS::OnCancel( wxCommandEvent& WXUNUSED (event) )
{ {
EndModal( -1 ); EndModal( -1 );
} }
void WinEDA_ExecBlockCmdFrame::checkBoxClicked( wxCommandEvent& WXUNUSED (aEvent) )
void DIALOG_BLOCK_OPTIONS::checkBoxClicked( wxCommandEvent& WXUNUSED (aEvent) )
{ {
if( m_Include_Modules->GetValue() ) if( m_Include_Modules->GetValue() )
m_IncludeLockedModules->Enable(); m_IncludeLockedModules->Enable();
...@@ -225,7 +133,8 @@ void WinEDA_ExecBlockCmdFrame::checkBoxClicked( wxCommandEvent& WXUNUSED (aEvent ...@@ -225,7 +133,8 @@ void WinEDA_ExecBlockCmdFrame::checkBoxClicked( wxCommandEvent& WXUNUSED (aEvent
m_IncludeLockedModules->Disable(); m_IncludeLockedModules->Disable();
} }
void WinEDA_ExecBlockCmdFrame::ExecuteCommand( wxCommandEvent& event )
void DIALOG_BLOCK_OPTIONS::ExecuteCommand( wxCommandEvent& event )
{ {
Block_Include_Modules = m_Include_Modules->GetValue(); Block_Include_Modules = m_Include_Modules->GetValue();
BlockIncludeLockedModules = m_IncludeLockedModules->GetValue(); BlockIncludeLockedModules = m_IncludeLockedModules->GetValue();
...@@ -234,7 +143,7 @@ void WinEDA_ExecBlockCmdFrame::ExecuteCommand( wxCommandEvent& event ) ...@@ -234,7 +143,7 @@ void WinEDA_ExecBlockCmdFrame::ExecuteCommand( wxCommandEvent& event )
Block_Include_Draw_Items = m_Include_Draw_Items->GetValue(); Block_Include_Draw_Items = m_Include_Draw_Items->GetValue();
Block_Include_Edges_Items = m_Include_Edges_Items->GetValue(); Block_Include_Edges_Items = m_Include_Edges_Items->GetValue();
Block_Include_PcbTextes = m_Include_PcbTextes->GetValue(); Block_Include_PcbTextes = m_Include_PcbTextes->GetValue();
BlockDrawItems = m_DrawBlockItems->GetValue(); BlockDrawItems = m_DrawBlockItems->GetValue();
EndModal( 0 ); EndModal( 0 );
} }
...@@ -285,11 +194,11 @@ int WinEDA_PcbFrame::ReturnBlockCommand( int key ) ...@@ -285,11 +194,11 @@ int WinEDA_PcbFrame::ReturnBlockCommand( int key )
/* Routine to handle the BLOCK PLACE command */ /* Routine to handle the BLOCK PLACE command */
void WinEDA_PcbFrame::HandleBlockPlace( wxDC* DC ) void WinEDA_PcbFrame::HandleBlockPlace( wxDC* DC )
{ {
bool err = FALSE; bool err = false;
if( DrawPanel->ManageCurseur == NULL ) if( DrawPanel->ManageCurseur == NULL )
{ {
err = TRUE; err = true;
DisplayError( this, wxT( "Error in HandleBlockPLace : ManageCurseur = NULL" ) ); DisplayError( this, wxT( "Error in HandleBlockPLace : ManageCurseur = NULL" ) );
} }
GetScreen()->m_BlockLocate.m_State = STATE_BLOCK_STOP; GetScreen()->m_BlockLocate.m_State = STATE_BLOCK_STOP;
...@@ -297,21 +206,21 @@ void WinEDA_PcbFrame::HandleBlockPlace( wxDC* DC ) ...@@ -297,21 +206,21 @@ void WinEDA_PcbFrame::HandleBlockPlace( wxDC* DC )
switch( GetScreen()->m_BlockLocate.m_Command ) switch( GetScreen()->m_BlockLocate.m_Command )
{ {
case BLOCK_IDLE: case BLOCK_IDLE:
err = TRUE; err = true;
break; break;
case BLOCK_DRAG: /* Drag */ case BLOCK_DRAG: /* Drag */
case BLOCK_MOVE: /* Move */ case BLOCK_MOVE: /* Move */
case BLOCK_PRESELECT_MOVE: /* Move with preselection list*/ case BLOCK_PRESELECT_MOVE: /* Move with preselection list*/
if( DrawPanel->ManageCurseur ) if( DrawPanel->ManageCurseur )
DrawPanel->ManageCurseur( DrawPanel, DC, FALSE ); DrawPanel->ManageCurseur( DrawPanel, DC, false );
Block_Move(); Block_Move();
GetScreen()->m_BlockLocate.ClearItemsList(); GetScreen()->m_BlockLocate.ClearItemsList();
break; break;
case BLOCK_COPY: /* Copy */ case BLOCK_COPY: /* Copy */
if( DrawPanel->ManageCurseur ) if( DrawPanel->ManageCurseur )
DrawPanel->ManageCurseur( DrawPanel, DC, FALSE ); DrawPanel->ManageCurseur( DrawPanel, DC, false );
Block_Duplicate(); Block_Duplicate();
GetScreen()->m_BlockLocate.ClearItemsList(); GetScreen()->m_BlockLocate.ClearItemsList();
break; break;
...@@ -349,13 +258,13 @@ void WinEDA_PcbFrame::HandleBlockPlace( wxDC* DC ) ...@@ -349,13 +258,13 @@ void WinEDA_PcbFrame::HandleBlockPlace( wxDC* DC )
*/ */
int WinEDA_PcbFrame::HandleBlockEnd( wxDC* DC ) int WinEDA_PcbFrame::HandleBlockEnd( wxDC* DC )
{ {
int endcommande = TRUE; int endcommande = true;
// If coming here after cancel block, clean up and exit // If coming here after cancel block, clean up and exit
if( GetScreen()->m_BlockLocate.m_State == STATE_NO_BLOCK ) if( GetScreen()->m_BlockLocate.m_State == STATE_NO_BLOCK )
{ {
DrawPanel->ManageCurseur = NULL; DrawPanel->ManageCurseur = NULL;
DrawPanel->ForceCloseManageCurseur = NULL; DrawPanel->ForceCloseManageCurseur = NULL;
GetScreen()->m_BlockLocate.m_Flags = 0; GetScreen()->m_BlockLocate.m_Flags = 0;
GetScreen()->m_BlockLocate.m_Command = BLOCK_IDLE; GetScreen()->m_BlockLocate.m_Command = BLOCK_IDLE;
GetScreen()->m_BlockLocate.ClearItemsList(); GetScreen()->m_BlockLocate.ClearItemsList();
...@@ -365,29 +274,29 @@ int WinEDA_PcbFrame::HandleBlockEnd( wxDC* DC ) ...@@ -365,29 +274,29 @@ int WinEDA_PcbFrame::HandleBlockEnd( wxDC* DC )
// Show dialog if there are no selected items and // Show dialog if there are no selected items and
// we're not zooming // we're not zooming
if ( !GetScreen()->m_BlockLocate.GetCount() && if( !GetScreen()->m_BlockLocate.GetCount()
GetScreen()->m_BlockLocate.m_Command != BLOCK_ZOOM ) && GetScreen()->m_BlockLocate.m_Command != BLOCK_ZOOM )
{ {
if( !InstallBlockCmdFrame( this, _( "Block Operation" ) ) ) if( !InstallBlockCmdFrame( this, _( "Block Operation" ) ) )
{ {
DrawPanel->ManageCurseur = NULL; DrawPanel->ManageCurseur = NULL;
DrawPanel->ForceCloseManageCurseur = NULL; DrawPanel->ForceCloseManageCurseur = NULL;
GetScreen()->m_BlockLocate.m_Flags = 0; GetScreen()->m_BlockLocate.m_Flags = 0;
GetScreen()->m_BlockLocate.m_State = STATE_NO_BLOCK; GetScreen()->m_BlockLocate.m_State = STATE_NO_BLOCK;
GetScreen()->m_BlockLocate.m_Command = BLOCK_IDLE; GetScreen()->m_BlockLocate.m_Command = BLOCK_IDLE;
GetScreen()->m_BlockLocate.ClearItemsList(); GetScreen()->m_BlockLocate.ClearItemsList();
DisplayToolMsg( wxEmptyString ); DisplayToolMsg( wxEmptyString );
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;
DrawPanel->ForceCloseManageCurseur = NULL; DrawPanel->ForceCloseManageCurseur = NULL;
GetScreen()->m_BlockLocate.m_Flags = 0; GetScreen()->m_BlockLocate.m_Flags = 0;
GetScreen()->m_BlockLocate.m_State = STATE_NO_BLOCK; GetScreen()->m_BlockLocate.m_State = STATE_NO_BLOCK;
GetScreen()->m_BlockLocate.m_Command = BLOCK_IDLE; GetScreen()->m_BlockLocate.m_Command = BLOCK_IDLE;
...@@ -396,22 +305,26 @@ int WinEDA_PcbFrame::HandleBlockEnd( wxDC* DC ) ...@@ -396,22 +305,26 @@ int WinEDA_PcbFrame::HandleBlockEnd( wxDC* DC )
return 0; return 0;
} }
// Move cursor to the center of the smallest rectangle wxPoint blockCenter;
// Move cursor to the best position in selected rect:
// can be the block locate rect or the the smallest rectangle
// containing the centers of all selected items. // containing the centers of all selected items.
// Unfortunately, this option gives unpredicatble results when flipping or mirroring blocks
#if 0 // set to 1 to use smallest rectangle center
// Move cursor to the center of
// Also set m_BlockLocate to the size of the rectangle. // Also set m_BlockLocate to the size of the rectangle.
PICKED_ITEMS_LIST* itemsList = &DrawPanel->GetScreen()->m_BlockLocate.m_ItemsSelection; PICKED_ITEMS_LIST* itemsList = &DrawPanel->GetScreen()->m_BlockLocate.m_ItemsSelection;
wxPoint blockCenter;
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;
maxY = minY; maxY = minY;
for( unsigned ii = 1; ii < itemsList->GetCount(); ii++ ) for( unsigned ii = 1; ii < itemsList->GetCount(); ii++ )
{ {
item = (BOARD_ITEM*) itemsList->GetPickedItem( ii ); item = (BOARD_ITEM*) itemsList->GetPickedItem( ii );
tempX = item->GetPosition().x; tempX = item->GetPosition().x;
tempY = item->GetPosition().y; tempY = item->GetPosition().y;
if( tempX > maxX ) if( tempX > maxX )
...@@ -426,17 +339,19 @@ int WinEDA_PcbFrame::HandleBlockEnd( wxDC* DC ) ...@@ -426,17 +339,19 @@ int WinEDA_PcbFrame::HandleBlockEnd( wxDC* DC )
blockCenter.x = ( minX + maxX ) / 2; blockCenter.x = ( minX + maxX ) / 2;
blockCenter.y = ( minY + maxY ) / 2; blockCenter.y = ( minY + maxY ) / 2;
GetScreen()->m_BlockLocate.SetOrigin( minX, minY );
GetScreen()->m_BlockLocate.SetEnd( maxX, maxY );
#else
blockCenter = GetScreen()->m_BlockLocate.Centre();
#endif
DrawPanel->CursorOff( DC ); DrawPanel->CursorOff( DC );
GetScreen()->m_Curseur = blockCenter; GetScreen()->m_Curseur = blockCenter;
GetScreen()->m_BlockLocate.SetLastCursorPosition( blockCenter ); GetScreen()->m_BlockLocate.SetLastCursorPosition( blockCenter );
GetScreen()->m_BlockLocate.SetOrigin( minX, minY );
GetScreen()->m_BlockLocate.SetEnd( maxX, maxY );
DrawPanel->MouseToCursorSchema(); DrawPanel->MouseToCursorSchema();
DrawPanel->CursorOn( DC ); DrawPanel->CursorOn( 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:
...@@ -448,9 +363,9 @@ int WinEDA_PcbFrame::HandleBlockEnd( wxDC* DC ) ...@@ -448,9 +363,9 @@ int WinEDA_PcbFrame::HandleBlockEnd( wxDC* DC )
case BLOCK_COPY: /* Copy */ case BLOCK_COPY: /* Copy */
case BLOCK_PRESELECT_MOVE: /* Move with preselection list*/ case BLOCK_PRESELECT_MOVE: /* Move with preselection list*/
GetScreen()->m_BlockLocate.m_State = STATE_BLOCK_MOVE; GetScreen()->m_BlockLocate.m_State = STATE_BLOCK_MOVE;
endcommande = FALSE; endcommande = false;
DrawPanel->ManageCurseur = drawMovingBlock; DrawPanel->ManageCurseur = drawMovingBlock;
DrawPanel->ManageCurseur( DrawPanel, DC, FALSE ); DrawPanel->ManageCurseur( DrawPanel, DC, false );
break; break;
case BLOCK_DELETE: /* Delete */ case BLOCK_DELETE: /* Delete */
...@@ -493,9 +408,8 @@ int WinEDA_PcbFrame::HandleBlockEnd( wxDC* DC ) ...@@ -493,9 +408,8 @@ int WinEDA_PcbFrame::HandleBlockEnd( wxDC* DC )
default: default:
break; break;
} }
}
if( endcommande == TRUE ) if( endcommande == true )
{ {
GetScreen()->m_BlockLocate.m_Flags = 0; GetScreen()->m_BlockLocate.m_Flags = 0;
GetScreen()->m_BlockLocate.m_State = STATE_NO_BLOCK; GetScreen()->m_BlockLocate.m_State = STATE_NO_BLOCK;
...@@ -521,7 +435,7 @@ int WinEDA_PcbFrame::HandleBlockEnd( wxDC* DC ) ...@@ -521,7 +435,7 @@ int WinEDA_PcbFrame::HandleBlockEnd( wxDC* DC )
*/ */
void WinEDA_PcbFrame::Block_SelectItems() void WinEDA_PcbFrame::Block_SelectItems()
{ {
int masque_layer; int masque_layer;
GetScreen()->m_BlockLocate.Normalize(); GetScreen()->m_BlockLocate.Normalize();
...@@ -531,10 +445,10 @@ void WinEDA_PcbFrame::Block_SelectItems() ...@@ -531,10 +445,10 @@ void WinEDA_PcbFrame::Block_SelectItems()
if( Block_Include_Modules ) if( Block_Include_Modules )
{ {
for( MODULE* module = m_Pcb->m_Modules; module != NULL; for( MODULE* module = m_Pcb->m_Modules; module != NULL;
module = module->Next() ) module = module->Next() )
{ {
if( module->HitTest( GetScreen()->m_BlockLocate ) && if( module->HitTest( GetScreen()->m_BlockLocate )
( !module->IsLocked() || BlockIncludeLockedModules ) ) && ( !module->IsLocked() || BlockIncludeLockedModules ) )
{ {
picker.m_PickedItem = module; picker.m_PickedItem = module;
picker.m_PickedItemType = module->Type(); picker.m_PickedItemType = module->Type();
...@@ -547,7 +461,7 @@ void WinEDA_PcbFrame::Block_SelectItems() ...@@ -547,7 +461,7 @@ void WinEDA_PcbFrame::Block_SelectItems()
if( Block_Include_Tracks ) if( Block_Include_Tracks )
{ {
for( TRACK* pt_segm = m_Pcb->m_Track; pt_segm != NULL; for( TRACK* pt_segm = m_Pcb->m_Track; pt_segm != NULL;
pt_segm = pt_segm->Next() ) pt_segm = pt_segm->Next() )
{ {
if( pt_segm->HitTest( GetScreen()->m_BlockLocate ) ) if( pt_segm->HitTest( GetScreen()->m_BlockLocate ) )
{ {
...@@ -568,7 +482,7 @@ void WinEDA_PcbFrame::Block_SelectItems() ...@@ -568,7 +482,7 @@ void WinEDA_PcbFrame::Block_SelectItems()
masque_layer &= ~EDGE_LAYER; masque_layer &= ~EDGE_LAYER;
for( BOARD_ITEM* PtStruct = m_Pcb->m_Drawings; PtStruct != NULL; for( BOARD_ITEM* PtStruct = m_Pcb->m_Drawings; PtStruct != NULL;
PtStruct = PtStruct->Next() ) PtStruct = PtStruct->Next() )
{ {
bool select_me = false; bool select_me = false;
switch( PtStruct->Type() ) switch( PtStruct->Type() )
...@@ -621,13 +535,15 @@ void WinEDA_PcbFrame::Block_SelectItems() ...@@ -621,13 +535,15 @@ void WinEDA_PcbFrame::Block_SelectItems()
if( Block_Include_Zones ) if( Block_Include_Zones )
{ {
#if 0 #if 0
/* This section can creates problems if selected: /* This section can creates problems if selected:
* m_Pcb->m_Zone can have a *lot* of items (100 000 is easily possible) * m_Pcb->m_Zone can have a *lot* of items (100 000 is easily possible)
* so it is not selected (and TODO: will be removed, one day) * so it is not selected (and TODO: will be removed, one day)
*/ */
for( SEGZONE* pt_segm = m_Pcb->m_Zone; pt_segm != NULL; for( SEGZONE* pt_segm = m_Pcb->m_Zone; pt_segm != NULL;
pt_segm = pt_segm->Next() ) pt_segm = pt_segm->Next() )
{ /* Segments used in Zone filling selection */ {
/* Segments used in Zone filling selection */
if( pt_segm->HitTest( GetScreen()->m_BlockLocate ) ) if( pt_segm->HitTest( GetScreen()->m_BlockLocate ) )
{ {
...@@ -636,6 +552,7 @@ void WinEDA_PcbFrame::Block_SelectItems() ...@@ -636,6 +552,7 @@ void WinEDA_PcbFrame::Block_SelectItems()
itemsList->PushItem( picker ); itemsList->PushItem( picker );
} }
} }
#endif #endif
for( int ii = 0; ii < m_Pcb->GetAreaCount(); ii++ ) for( int ii = 0; ii < m_Pcb->GetAreaCount(); ii++ )
{ {
...@@ -650,13 +567,14 @@ void WinEDA_PcbFrame::Block_SelectItems() ...@@ -650,13 +567,14 @@ 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 )
{ {
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 );
...@@ -664,23 +582,26 @@ static void drawPickedItems( WinEDA_DrawPanel* aPanel, wxDC* aDC, ...@@ -664,23 +582,26 @@ static void drawPickedItems( WinEDA_DrawPanel* aPanel, wxDC* aDC,
{ {
case TYPE_MODULE: case TYPE_MODULE:
{ {
MODULE* module = (MODULE*) item; MODULE* module = (MODULE*) item;
frame->GetBoard()->m_Status_Pcb &= ~RATSNEST_ITEM_LOCAL_OK; frame->GetBoard()->m_Status_Pcb &= ~RATSNEST_ITEM_LOCAL_OK;
DrawModuleOutlines( aPanel, aDC, module ); DrawModuleOutlines( aPanel, aDC, module );
break; break;
} }
case TYPE_DRAWSEGMENT: case TYPE_DRAWSEGMENT:
{ {
DRAWSEGMENT* segment = (DRAWSEGMENT*) item; DRAWSEGMENT* segment = (DRAWSEGMENT*) item;
segment->Draw( aPanel, aDC, GR_XOR, aOffset ); segment->Draw( aPanel, aDC, GR_XOR, aOffset );
break; break;
} }
case TYPE_TEXTE: case TYPE_TEXTE:
{ {
TEXTE_PCB* text = (TEXTE_PCB*) item; TEXTE_PCB* text = (TEXTE_PCB*) item;
text->Draw( aPanel, aDC, GR_XOR, aOffset ); text->Draw( aPanel, aDC, GR_XOR, aOffset );
break; break;
} }
case TYPE_TRACK: case TYPE_TRACK:
case TYPE_VIA: case TYPE_VIA:
{ {
...@@ -688,18 +609,21 @@ static void drawPickedItems( WinEDA_DrawPanel* aPanel, wxDC* aDC, ...@@ -688,18 +609,21 @@ static void drawPickedItems( WinEDA_DrawPanel* aPanel, wxDC* aDC,
track->Draw( aPanel, aDC, GR_XOR, aOffset ); track->Draw( aPanel, aDC, GR_XOR, aOffset );
break; break;
} }
case TYPE_MIRE: case TYPE_MIRE:
{ {
MIREPCB* mire = (MIREPCB*) item; MIREPCB* mire = (MIREPCB*) item;
mire->Draw( aPanel, aDC, GR_XOR, aOffset ); mire->Draw( aPanel, aDC, GR_XOR, aOffset );
break; break;
} }
case TYPE_DIMENSION: case TYPE_DIMENSION:
{ {
DIMENSION* dimension = (DIMENSION*) item; DIMENSION* dimension = (DIMENSION*) item;
dimension->Draw( aPanel, aDC, GR_XOR, aOffset ); dimension->Draw( aPanel, aDC, GR_XOR, aOffset );
break; break;
} }
case TYPE_ZONE_CONTAINER: case TYPE_ZONE_CONTAINER:
{ {
ZONE_CONTAINER* zoneContainer = (ZONE_CONTAINER*) item; ZONE_CONTAINER* zoneContainer = (ZONE_CONTAINER*) item;
...@@ -707,6 +631,7 @@ static void drawPickedItems( WinEDA_DrawPanel* aPanel, wxDC* aDC, ...@@ -707,6 +631,7 @@ static void drawPickedItems( WinEDA_DrawPanel* aPanel, wxDC* aDC,
zoneContainer->DrawFilledArea( aPanel, aDC, GR_XOR, aOffset ); zoneContainer->DrawFilledArea( aPanel, aDC, GR_XOR, aOffset );
break; break;
} }
// Currently markers are not affected by block commands // Currently markers are not affected by block commands
case TYPE_MARKER_PCB: case TYPE_MARKER_PCB:
{ {
...@@ -719,9 +644,11 @@ static void drawPickedItems( WinEDA_DrawPanel* aPanel, wxDC* aDC, ...@@ -719,9 +644,11 @@ static void drawPickedItems( WinEDA_DrawPanel* aPanel, wxDC* aDC,
break; break;
} }
} }
g_Offset_Module = wxPoint( 0, 0 ); g_Offset_Module = wxPoint( 0, 0 );
} }
static void drawMovingBlock( WinEDA_DrawPanel* aPanel, wxDC* aDC, static void drawMovingBlock( WinEDA_DrawPanel* aPanel, wxDC* aDC,
bool aErase ) bool aErase )
{ {
...@@ -732,30 +659,26 @@ static void drawMovingBlock( WinEDA_DrawPanel* aPanel, wxDC* aDC, ...@@ -732,30 +659,26 @@ static void drawMovingBlock( WinEDA_DrawPanel* aPanel, wxDC* aDC,
if( screen->m_BlockLocate.m_MoveVector.x if( screen->m_BlockLocate.m_MoveVector.x
|| screen->m_BlockLocate.m_MoveVector.y ) || screen->m_BlockLocate.m_MoveVector.y )
{ {
if( !BlockDrawItems ) screen->m_BlockLocate.Draw( aPanel, aDC, screen->m_BlockLocate.m_MoveVector,
screen->m_BlockLocate.Draw( aPanel, aDC, screen->m_BlockLocate.m_MoveVector, GR_XOR, BLOCK_OUTLINE_COLOR );
GR_XOR, BLOCK_OUTLINE_COLOR ); if( BlockDrawItems )
else
drawPickedItems( aPanel, aDC, screen->m_BlockLocate.m_MoveVector ); drawPickedItems( aPanel, aDC, screen->m_BlockLocate.m_MoveVector );
} }
} }
if( screen->m_BlockLocate.m_State != STATE_BLOCK_STOP ) if( screen->m_BlockLocate.m_State != STATE_BLOCK_STOP )
{ {
screen->m_BlockLocate.m_MoveVector.x = screen->m_Curseur.x - screen->m_BlockLocate.m_MoveVector = screen->m_Curseur -
screen->m_BlockLocate.m_BlockLastCursorPosition.x; screen->m_BlockLocate.m_BlockLastCursorPosition;
screen->m_BlockLocate.m_MoveVector.y = screen->m_Curseur.y -
screen->m_BlockLocate.m_BlockLastCursorPosition.y;
} }
if( screen->m_BlockLocate.m_MoveVector.x if( screen->m_BlockLocate.m_MoveVector.x
|| screen->m_BlockLocate.m_MoveVector.y ) || screen->m_BlockLocate.m_MoveVector.y )
{ {
if( !BlockDrawItems ) screen->m_BlockLocate.Draw( aPanel, aDC, screen->m_BlockLocate.m_MoveVector,
screen->m_BlockLocate.Draw( aPanel, aDC, screen->m_BlockLocate.m_MoveVector, GR_XOR, BLOCK_OUTLINE_COLOR );
GR_XOR, BLOCK_OUTLINE_COLOR ); if( BlockDrawItems )
else drawPickedItems( aPanel, aDC, screen->m_BlockLocate.m_MoveVector );
drawPickedItems( aPanel, aDC, screen->m_BlockLocate.m_MoveVector );
} }
} }
...@@ -791,18 +714,18 @@ void WinEDA_PcbFrame::Block_Delete() ...@@ -791,18 +714,18 @@ void WinEDA_PcbFrame::Block_Delete()
m_Pcb->Remove( item ); m_Pcb->Remove( item );
break; break;
case TYPE_DRAWSEGMENT: // a segment not on copper layers case TYPE_DRAWSEGMENT: // a segment not on copper layers
case TYPE_TEXTE: // a text on a layer case TYPE_TEXTE: // a text on a layer
case TYPE_TRACK: // a track segment (segment on a copper layer) case TYPE_TRACK: // a track segment (segment on a copper layer)
case TYPE_VIA: // a via (like atrack segment on a copper layer) case TYPE_VIA: // a via (like atrack segment on a copper layer)
case TYPE_DIMENSION: // a dimension (graphic item) case TYPE_DIMENSION: // a dimension (graphic item)
case TYPE_MIRE: // a target (graphic item) case TYPE_MIRE: // a target (graphic item)
item->UnLink(); item->UnLink();
break; break;
// These items are deleted, but not put in undo list // These items are deleted, but not put in undo list
case TYPE_MARKER_PCB: // a marker used to show something case TYPE_MARKER_PCB: // a marker used to show something
case TYPE_ZONE: // SEG_ZONE items are now deprecated case TYPE_ZONE: // SEG_ZONE items are now deprecated
item->UnLink(); item->UnLink();
itemsList->RemovePicker( ii ); itemsList->RemovePicker( ii );
ii--; ii--;
...@@ -817,8 +740,8 @@ void WinEDA_PcbFrame::Block_Delete() ...@@ -817,8 +740,8 @@ void WinEDA_PcbFrame::Block_Delete()
SaveCopyInUndoList( *itemsList, UR_DELETED ); SaveCopyInUndoList( *itemsList, UR_DELETED );
Compile_Ratsnest( NULL, TRUE ); Compile_Ratsnest( NULL, true );
DrawPanel->Refresh( TRUE ); DrawPanel->Refresh( true );
} }
...@@ -832,7 +755,7 @@ void WinEDA_PcbFrame::Block_Rotate() ...@@ -832,7 +755,7 @@ void WinEDA_PcbFrame::Block_Rotate()
{ {
wxPoint oldpos; wxPoint oldpos;
wxPoint centre; // rotation cent-re for the rotation transform wxPoint centre; // rotation cent-re for the rotation transform
int rotAngle = 900; // rotation angle in 0.1 deg. int rotAngle = 900; // rotation angle in 0.1 deg.
oldpos = GetScreen()->m_Curseur; oldpos = GetScreen()->m_Curseur;
centre = GetScreen()->m_BlockLocate.Centre(); centre = GetScreen()->m_BlockLocate.Centre();
...@@ -845,22 +768,21 @@ void WinEDA_PcbFrame::Block_Rotate() ...@@ -845,22 +768,21 @@ void WinEDA_PcbFrame::Block_Rotate()
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 );
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:
((MODULE*) item)->m_Flags = 0; ( (MODULE*) item )->m_Flags = 0;
m_Pcb->m_Status_Pcb = 0; m_Pcb->m_Status_Pcb = 0;
break; break;
/* Move and rotate the track segments */ /* Move and rotate the track segments */
case TYPE_TRACK: // a track segment (segment on a copper layer) case TYPE_TRACK: // a track segment (segment on a copper layer)
case TYPE_VIA: // a via (like atrack segment on a copper layer) case TYPE_VIA: // a via (like atrack segment on a copper layer)
m_Pcb->m_Status_Pcb = 0; m_Pcb->m_Status_Pcb = 0;
break; break;
case TYPE_ZONE_CONTAINER: case TYPE_ZONE_CONTAINER:
case TYPE_DRAWSEGMENT: case TYPE_DRAWSEGMENT:
...@@ -883,14 +805,14 @@ void WinEDA_PcbFrame::Block_Rotate() ...@@ -883,14 +805,14 @@ void WinEDA_PcbFrame::Block_Rotate()
SaveCopyInUndoList( *itemsList, UR_ROTATED, centre ); SaveCopyInUndoList( *itemsList, UR_ROTATED, centre );
Compile_Ratsnest( NULL, TRUE ); Compile_Ratsnest( NULL, true );
DrawPanel->Refresh( TRUE ); DrawPanel->Refresh( true );
} }
/** /**
* Function Block_Flip * Function Block_Flip
* flips items within the selected block. * Flip 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
*/ */
...@@ -912,16 +834,15 @@ void WinEDA_PcbFrame::Block_Flip() ...@@ -912,16 +834,15 @@ void WinEDA_PcbFrame::Block_Flip()
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 );
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:
((MODULE*) item)->m_Flags = 0; ( (MODULE*) item )->m_Flags = 0;
m_Pcb->m_Status_Pcb = 0; m_Pcb->m_Status_Pcb = 0;
break; break;
/* Move and rotate the track segments */ /* Move and rotate the track segments */
case TYPE_TRACK: // a track segment (segment on a copper layer) case TYPE_TRACK: // a track segment (segment on a copper layer)
...@@ -950,8 +871,8 @@ void WinEDA_PcbFrame::Block_Flip() ...@@ -950,8 +871,8 @@ void WinEDA_PcbFrame::Block_Flip()
} }
SaveCopyInUndoList( *itemsList, UR_FLIPPED, center ); SaveCopyInUndoList( *itemsList, UR_FLIPPED, center );
Compile_Ratsnest( NULL, TRUE ); Compile_Ratsnest( NULL, true );
DrawPanel->Refresh( TRUE ); DrawPanel->Refresh( true );
} }
...@@ -966,7 +887,7 @@ void WinEDA_PcbFrame::Block_Move() ...@@ -966,7 +887,7 @@ void WinEDA_PcbFrame::Block_Move()
{ {
OnModify(); OnModify();
wxPoint MoveVector = GetScreen()->m_BlockLocate.m_MoveVector; wxPoint MoveVector = GetScreen()->m_BlockLocate.m_MoveVector;
PICKED_ITEMS_LIST* itemsList = &GetScreen()->m_BlockLocate.m_ItemsSelection; PICKED_ITEMS_LIST* itemsList = &GetScreen()->m_BlockLocate.m_ItemsSelection;
itemsList->m_Status = UR_MOVED; itemsList->m_Status = UR_MOVED;
...@@ -980,15 +901,15 @@ void WinEDA_PcbFrame::Block_Move() ...@@ -980,15 +901,15 @@ void WinEDA_PcbFrame::Block_Move()
switch( item->Type() ) switch( item->Type() )
{ {
case TYPE_MODULE: case TYPE_MODULE:
m_Pcb->m_Status_Pcb = 0; m_Pcb->m_Status_Pcb = 0;
((MODULE*) item)->m_Flags = 0; ( (MODULE*) item )->m_Flags = 0;
break; break;
/* Move track segments */ /* Move track segments */
case TYPE_TRACK: // a track segment (segment on a copper layer) case TYPE_TRACK: // a track segment (segment on a copper layer)
case TYPE_VIA: // a via (like a track segment on a copper layer) case TYPE_VIA: // a via (like a track segment on a copper layer)
m_Pcb->m_Status_Pcb = 0; m_Pcb->m_Status_Pcb = 0;
break; break;
case TYPE_ZONE_CONTAINER: case TYPE_ZONE_CONTAINER:
case TYPE_DRAWSEGMENT: case TYPE_DRAWSEGMENT:
...@@ -1011,14 +932,14 @@ void WinEDA_PcbFrame::Block_Move() ...@@ -1011,14 +932,14 @@ void WinEDA_PcbFrame::Block_Move()
SaveCopyInUndoList( *itemsList, UR_MOVED, MoveVector ); SaveCopyInUndoList( *itemsList, UR_MOVED, MoveVector );
Compile_Ratsnest( NULL, TRUE ); Compile_Ratsnest( NULL, true );
DrawPanel->Refresh( TRUE ); DrawPanel->Refresh( true );
} }
/** /**
* Function Block_Duplicate * Function Block_Duplicate
* duplicates all items within the selected block. * Duplicate 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
...@@ -1031,11 +952,11 @@ void WinEDA_PcbFrame::Block_Duplicate() ...@@ -1031,11 +952,11 @@ void WinEDA_PcbFrame::Block_Duplicate()
PICKED_ITEMS_LIST* itemsList = &GetScreen()->m_BlockLocate.m_ItemsSelection; PICKED_ITEMS_LIST* itemsList = &GetScreen()->m_BlockLocate.m_ItemsSelection;
PICKED_ITEMS_LIST newList; PICKED_ITEMS_LIST newList;
newList.m_Status = UR_NEW; newList.m_Status = UR_NEW;
ITEM_PICKER picker(NULL, UR_NEW); ITEM_PICKER picker( NULL, UR_NEW );
BOARD_ITEM * newitem; BOARD_ITEM* newitem;
for( unsigned ii = 0; ii < itemsList->GetCount(); ii++ ) for( unsigned ii = 0; ii < itemsList->GetCount(); ii++ )
{ {
...@@ -1044,78 +965,78 @@ void WinEDA_PcbFrame::Block_Duplicate() ...@@ -1044,78 +965,78 @@ void WinEDA_PcbFrame::Block_Duplicate()
switch( item->Type() ) switch( item->Type() )
{ {
case TYPE_MODULE: case TYPE_MODULE:
{ {
MODULE* module = (MODULE*) item; MODULE* module = (MODULE*) item;
MODULE* new_module; MODULE* new_module;
m_Pcb->m_Status_Pcb = 0; m_Pcb->m_Status_Pcb = 0;
module->m_Flags = 0; module->m_Flags = 0;
newitem = new_module = new MODULE( m_Pcb ); newitem = new_module = new MODULE( m_Pcb );
new_module->Copy( module ); new_module->Copy( module );
new_module->m_TimeStamp = GetTimeStamp(); new_module->m_TimeStamp = GetTimeStamp();
m_Pcb->m_Modules.PushFront( new_module ); m_Pcb->m_Modules.PushFront( new_module );
} }
break; break;
case TYPE_TRACK: case TYPE_TRACK:
case TYPE_VIA: case TYPE_VIA:
{ {
TRACK* track = (TRACK*) item; TRACK* track = (TRACK*) item;
m_Pcb->m_Status_Pcb = 0; m_Pcb->m_Status_Pcb = 0;
TRACK* new_track = track->Copy(); TRACK* new_track = track->Copy();
newitem = new_track; newitem = new_track;
m_Pcb->m_Track.PushFront( new_track ); m_Pcb->m_Track.PushFront( new_track );
} }
break; break;
case TYPE_ZONE: // SEG_ZONE items are now deprecated case TYPE_ZONE: // SEG_ZONE items are now deprecated
break; break;
case TYPE_ZONE_CONTAINER: case TYPE_ZONE_CONTAINER:
{ {
ZONE_CONTAINER* new_zone = ZONE_CONTAINER* new_zone =
new ZONE_CONTAINER( (BOARD*) item->GetParent() ); new ZONE_CONTAINER( (BOARD*) item->GetParent() );
new_zone->Copy( (ZONE_CONTAINER*) item ); new_zone->Copy( (ZONE_CONTAINER*) item );
new_zone->m_TimeStamp = GetTimeStamp(); new_zone->m_TimeStamp = GetTimeStamp();
newitem = new_zone; newitem = new_zone;
m_Pcb->Add( new_zone ); m_Pcb->Add( new_zone );
} }
break; break;
case TYPE_DRAWSEGMENT: case TYPE_DRAWSEGMENT:
{ {
DRAWSEGMENT* new_drawsegment = new DRAWSEGMENT( m_Pcb ); DRAWSEGMENT* new_drawsegment = new DRAWSEGMENT( m_Pcb );
new_drawsegment->Copy( (DRAWSEGMENT*) item ); new_drawsegment->Copy( (DRAWSEGMENT*) item );
m_Pcb->Add( new_drawsegment ); m_Pcb->Add( new_drawsegment );
newitem = new_drawsegment; newitem = new_drawsegment;
} }
break; break;
case TYPE_TEXTE: case TYPE_TEXTE:
{ {
TEXTE_PCB* new_pcbtext = new TEXTE_PCB( m_Pcb ); TEXTE_PCB* new_pcbtext = new TEXTE_PCB( m_Pcb );
new_pcbtext->Copy( (TEXTE_PCB*) item ); new_pcbtext->Copy( (TEXTE_PCB*) item );
m_Pcb->Add( new_pcbtext ); m_Pcb->Add( new_pcbtext );
newitem = new_pcbtext; newitem = new_pcbtext;
} }
break; break;
case TYPE_MIRE: case TYPE_MIRE:
{ {
MIREPCB* new_mire = new MIREPCB( m_Pcb ); MIREPCB* new_mire = new MIREPCB( m_Pcb );
new_mire->Copy( (MIREPCB*) item ); new_mire->Copy( (MIREPCB*) item );
m_Pcb->Add( new_mire ); m_Pcb->Add( new_mire );
newitem = new_mire; newitem = new_mire;
} }
break; break;
case TYPE_DIMENSION: case TYPE_DIMENSION:
{ {
DIMENSION* new_cotation = new DIMENSION( m_Pcb ); DIMENSION* new_cotation = new DIMENSION( m_Pcb );
new_cotation->Copy( (DIMENSION*) item ); new_cotation->Copy( (DIMENSION*) item );
m_Pcb->Add( new_cotation ); m_Pcb->Add( new_cotation );
newitem = new_cotation; newitem = new_cotation;
} }
break; break;
default: default:
wxMessageBox( wxT( "WinEDA_PcbFrame::Block_Duplicate( ) error: unexpected type" ) ); wxMessageBox( wxT( "WinEDA_PcbFrame::Block_Duplicate( ) error: unexpected type" ) );
...@@ -1125,15 +1046,15 @@ void WinEDA_PcbFrame::Block_Duplicate() ...@@ -1125,15 +1046,15 @@ void WinEDA_PcbFrame::Block_Duplicate()
if( newitem ) if( newitem )
{ {
newitem->Move( MoveVector ); newitem->Move( MoveVector );
picker.m_PickedItem = newitem; picker.m_PickedItem = newitem;
picker.m_PickedItemType = newitem->Type(); picker.m_PickedItemType = newitem->Type();
newList.PushItem(picker); newList.PushItem( picker );
} }
} }
if( newList.GetCount() ) if( newList.GetCount() )
SaveCopyInUndoList( newList, UR_NEW ); SaveCopyInUndoList( newList, UR_NEW );
Compile_Ratsnest( NULL, TRUE ); Compile_Ratsnest( NULL, true );
DrawPanel->Refresh( TRUE ); DrawPanel->Refresh( true );
} }
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Sep 8 2010)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#include "dialog_block_options_base.h"
///////////////////////////////////////////////////////////////////////////
DIALOG_BLOCK_OPTIONS_BASE::DIALOG_BLOCK_OPTIONS_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style )
{
this->SetSizeHints( wxDefaultSize, wxDefaultSize );
wxBoxSizer* bSizerMain;
bSizerMain = new wxBoxSizer( wxVERTICAL );
wxGridSizer* gSizer1;
gSizer1 = new wxGridSizer( 4, 2, 0, 0 );
m_Include_Modules = new wxCheckBox( this, wxID_ANY, _("Include Modules"), wxDefaultPosition, wxDefaultSize, 0 );
gSizer1->Add( m_Include_Modules, 0, wxALL, 5 );
m_Include_PcbTextes = new wxCheckBox( this, wxID_ANY, _("Include Texts on Copper Layers"), wxDefaultPosition, wxDefaultSize, 0 );
gSizer1->Add( m_Include_PcbTextes, 0, wxALL, 5 );
m_IncludeLockedModules = new wxCheckBox( this, wxID_ANY, _("Include Locked Modules"), wxDefaultPosition, wxDefaultSize, 0 );
gSizer1->Add( m_IncludeLockedModules, 0, wxALL, 5 );
m_Include_Draw_Items = new wxCheckBox( this, wxID_ANY, _("Include Drawings"), wxDefaultPosition, wxDefaultSize, 0 );
gSizer1->Add( m_Include_Draw_Items, 0, wxALL, 5 );
m_Include_Tracks = new wxCheckBox( this, wxID_ANY, _("Include Tracks"), wxDefaultPosition, wxDefaultSize, 0 );
gSizer1->Add( m_Include_Tracks, 0, wxALL, 5 );
m_Include_Edges_Items = new wxCheckBox( this, wxID_ANY, _("Include Board Outline Layer"), wxDefaultPosition, wxDefaultSize, 0 );
gSizer1->Add( m_Include_Edges_Items, 0, wxALL, 5 );
m_Include_Zones = new wxCheckBox( this, wxID_ANY, _("Include Zones"), wxDefaultPosition, wxDefaultSize, 0 );
gSizer1->Add( m_Include_Zones, 0, wxALL, 5 );
m_DrawBlockItems = new wxCheckBox( this, wxID_ANY, _("Draw Block Items while Moving"), wxDefaultPosition, wxDefaultSize, 0 );
gSizer1->Add( m_DrawBlockItems, 0, wxALL, 5 );
bSizerMain->Add( gSizer1, 0, wxEXPAND, 5 );
m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
bSizerMain->Add( m_staticline1, 0, wxEXPAND | wxALL, 5 );
m_sdbSizer1 = new wxStdDialogButtonSizer();
m_sdbSizer1OK = new wxButton( this, wxID_OK );
m_sdbSizer1->AddButton( m_sdbSizer1OK );
m_sdbSizer1Cancel = new wxButton( this, wxID_CANCEL );
m_sdbSizer1->AddButton( m_sdbSizer1Cancel );
m_sdbSizer1->Realize();
bSizerMain->Add( m_sdbSizer1, 0, wxALIGN_RIGHT|wxALL, 5 );
this->SetSizer( bSizerMain );
this->Layout();
this->Centre( wxBOTH );
// Connect Events
m_Include_Modules->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_BLOCK_OPTIONS_BASE::checkBoxClicked ), NULL, this );
m_Include_PcbTextes->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_BLOCK_OPTIONS_BASE::checkBoxClicked ), NULL, this );
m_IncludeLockedModules->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_BLOCK_OPTIONS_BASE::checkBoxClicked ), NULL, this );
m_Include_Draw_Items->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_BLOCK_OPTIONS_BASE::checkBoxClicked ), NULL, this );
m_Include_Tracks->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_BLOCK_OPTIONS_BASE::checkBoxClicked ), NULL, this );
m_Include_Edges_Items->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_BLOCK_OPTIONS_BASE::checkBoxClicked ), NULL, this );
m_Include_Zones->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_BLOCK_OPTIONS_BASE::checkBoxClicked ), NULL, this );
m_DrawBlockItems->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_BLOCK_OPTIONS_BASE::checkBoxClicked ), NULL, this );
m_sdbSizer1Cancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_BLOCK_OPTIONS_BASE::OnCancel ), NULL, this );
m_sdbSizer1OK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_BLOCK_OPTIONS_BASE::ExecuteCommand ), NULL, this );
}
DIALOG_BLOCK_OPTIONS_BASE::~DIALOG_BLOCK_OPTIONS_BASE()
{
// Disconnect Events
m_Include_Modules->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_BLOCK_OPTIONS_BASE::checkBoxClicked ), NULL, this );
m_Include_PcbTextes->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_BLOCK_OPTIONS_BASE::checkBoxClicked ), NULL, this );
m_IncludeLockedModules->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_BLOCK_OPTIONS_BASE::checkBoxClicked ), NULL, this );
m_Include_Draw_Items->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_BLOCK_OPTIONS_BASE::checkBoxClicked ), NULL, this );
m_Include_Tracks->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_BLOCK_OPTIONS_BASE::checkBoxClicked ), NULL, this );
m_Include_Edges_Items->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_BLOCK_OPTIONS_BASE::checkBoxClicked ), NULL, this );
m_Include_Zones->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_BLOCK_OPTIONS_BASE::checkBoxClicked ), NULL, this );
m_DrawBlockItems->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_BLOCK_OPTIONS_BASE::checkBoxClicked ), NULL, this );
m_sdbSizer1Cancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_BLOCK_OPTIONS_BASE::OnCancel ), NULL, this );
m_sdbSizer1OK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_BLOCK_OPTIONS_BASE::ExecuteCommand ), NULL, this );
}
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<wxFormBuilder_Project>
<FileVersion major="1" minor="10" />
<object class="Project" expanded="1">
<property name="class_decoration"></property>
<property name="code_generation">C++</property>
<property name="disconnect_events">1</property>
<property name="disconnect_mode">source_name</property>
<property name="disconnect_python_events">0</property>
<property name="encoding">UTF-8</property>
<property name="event_generation">connect</property>
<property name="file">dialog_block_options_base</property>
<property name="first_id">1000</property>
<property name="help_provider">none</property>
<property name="internationalize">1</property>
<property name="name">dialog_block_options_base</property>
<property name="namespace"></property>
<property name="path">.</property>
<property name="precompiled_header"></property>
<property name="relative_path">1</property>
<property name="skip_python_events">1</property>
<property name="use_enum">0</property>
<property name="use_microsoft_bom">0</property>
<object class="Dialog" expanded="1">
<property name="bg"></property>
<property name="center">wxBOTH</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="enabled">1</property>
<property name="event_handler">impl_virtual</property>
<property name="extra_style"></property>
<property name="fg"></property>
<property name="font"></property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="name">DIALOG_BLOCK_OPTIONS_BASE</property>
<property name="pos"></property>
<property name="size">397,171</property>
<property name="style">wxDEFAULT_DIALOG_STYLE</property>
<property name="subclass"></property>
<property name="title"></property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnActivate"></event>
<event name="OnActivateApp"></event>
<event name="OnChar"></event>
<event name="OnClose"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnHibernate"></event>
<event name="OnIconize"></event>
<event name="OnIdle"></event>
<event name="OnInitDialog"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">bSizerMain</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxGridSizer" expanded="1">
<property name="cols">2</property>
<property name="hgap">0</property>
<property name="minimum_size"></property>
<property name="name">gSizer1</property>
<property name="permission">none</property>
<property name="rows">4</property>
<property name="vgap">0</property>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="1">
<property name="bg"></property>
<property name="checked">0</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="font"></property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Include Modules</property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="name">m_Include_Modules</property>
<property name="permission">protected</property>
<property name="pos"></property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnChar"></event>
<event name="OnCheckBox">checkBoxClicked</event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="1">
<property name="bg"></property>
<property name="checked">0</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="font"></property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Include Texts on Copper Layers</property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="name">m_Include_PcbTextes</property>
<property name="permission">protected</property>
<property name="pos"></property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnChar"></event>
<event name="OnCheckBox">checkBoxClicked</event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="1">
<property name="bg"></property>
<property name="checked">0</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="font"></property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Include Locked Modules</property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="name">m_IncludeLockedModules</property>
<property name="permission">protected</property>
<property name="pos"></property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnChar"></event>
<event name="OnCheckBox">checkBoxClicked</event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="1">
<property name="bg"></property>
<property name="checked">0</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="font"></property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Include Drawings</property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="name">m_Include_Draw_Items</property>
<property name="permission">protected</property>
<property name="pos"></property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnChar"></event>
<event name="OnCheckBox">checkBoxClicked</event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="1">
<property name="bg"></property>
<property name="checked">0</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="font"></property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Include Tracks</property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="name">m_Include_Tracks</property>
<property name="permission">protected</property>
<property name="pos"></property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnChar"></event>
<event name="OnCheckBox">checkBoxClicked</event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="1">
<property name="bg"></property>
<property name="checked">0</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="font"></property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Include Board Outline Layer</property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="name">m_Include_Edges_Items</property>
<property name="permission">protected</property>
<property name="pos"></property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnChar"></event>
<event name="OnCheckBox">checkBoxClicked</event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="1">
<property name="bg"></property>
<property name="checked">0</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="font"></property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Include Zones</property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="name">m_Include_Zones</property>
<property name="permission">protected</property>
<property name="pos"></property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnChar"></event>
<event name="OnCheckBox">checkBoxClicked</event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="1">
<property name="bg"></property>
<property name="checked">0</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="font"></property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Draw Block Items while Moving</property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="name">m_DrawBlockItems</property>
<property name="permission">protected</property>
<property name="pos"></property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnChar"></event>
<event name="OnCheckBox">checkBoxClicked</event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND | wxALL</property>
<property name="proportion">0</property>
<object class="wxStaticLine" expanded="1">
<property name="bg"></property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="font"></property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="name">m_staticline1</property>
<property name="permission">protected</property>
<property name="pos"></property>
<property name="size"></property>
<property name="style">wxLI_HORIZONTAL</property>
<property name="subclass"></property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALIGN_RIGHT|wxALL</property>
<property name="proportion">0</property>
<object class="wxStdDialogButtonSizer" expanded="1">
<property name="Apply">0</property>
<property name="Cancel">1</property>
<property name="ContextHelp">0</property>
<property name="Help">0</property>
<property name="No">0</property>
<property name="OK">1</property>
<property name="Save">0</property>
<property name="Yes">0</property>
<property name="minimum_size"></property>
<property name="name">m_sdbSizer1</property>
<property name="permission">protected</property>
<event name="OnApplyButtonClick"></event>
<event name="OnCancelButtonClick">OnCancel</event>
<event name="OnContextHelpButtonClick"></event>
<event name="OnHelpButtonClick"></event>
<event name="OnNoButtonClick"></event>
<event name="OnOKButtonClick">ExecuteCommand</event>
<event name="OnSaveButtonClick"></event>
<event name="OnYesButtonClick"></event>
</object>
</object>
</object>
</object>
</object>
</wxFormBuilder_Project>
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Sep 8 2010)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#ifndef __dialog_block_options_base__
#define __dialog_block_options_base__
#include <wx/intl.h>
#include <wx/string.h>
#include <wx/checkbox.h>
#include <wx/gdicmn.h>
#include <wx/font.h>
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/sizer.h>
#include <wx/statline.h>
#include <wx/button.h>
#include <wx/dialog.h>
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
/// Class DIALOG_BLOCK_OPTIONS_BASE
///////////////////////////////////////////////////////////////////////////////
class DIALOG_BLOCK_OPTIONS_BASE : public wxDialog
{
private:
protected:
wxCheckBox* m_Include_Modules;
wxCheckBox* m_Include_PcbTextes;
wxCheckBox* m_IncludeLockedModules;
wxCheckBox* m_Include_Draw_Items;
wxCheckBox* m_Include_Tracks;
wxCheckBox* m_Include_Edges_Items;
wxCheckBox* m_Include_Zones;
wxCheckBox* m_DrawBlockItems;
wxStaticLine* m_staticline1;
wxStdDialogButtonSizer* m_sdbSizer1;
wxButton* m_sdbSizer1OK;
wxButton* m_sdbSizer1Cancel;
// Virtual event handlers, overide them in your derived class
virtual void checkBoxClicked( wxCommandEvent& event ) { event.Skip(); }
virtual void OnCancel( wxCommandEvent& event ) { event.Skip(); }
virtual void ExecuteCommand( wxCommandEvent& event ) { event.Skip(); }
public:
DIALOG_BLOCK_OPTIONS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 397,171 ), long style = wxDEFAULT_DIALOG_STYLE );
~DIALOG_BLOCK_OPTIONS_BASE();
};
#endif //__dialog_block_options_base__
...@@ -67,8 +67,8 @@ void WinEDA_BasePcbFrame::Plot_Serigraphie( PLOTTER* plotter, ...@@ -67,8 +67,8 @@ void WinEDA_BasePcbFrame::Plot_Serigraphie( PLOTTER* plotter,
/* Plot pads (creates pads outlines, for pads on silkscreen layers) */ /* Plot pads (creates pads outlines, for pads on silkscreen layers) */
int layersmask_plotpads = masque_layer; int layersmask_plotpads = masque_layer;
// Calculate the mask layers of allowed layers for pads // Calculate the mask layers of allowed layers for pads
if( !g_pcb_plot_options.PlotPadsOnSilkLayer ) if( !g_pcb_plot_options.PlotPadsOnSilkLayer ) // Do not plot pads on silk screen layers
layersmask_plotpads &= ~(SILKSCREEN_LAYER_BACK || SILKSCREEN_LAYER_FRONT); layersmask_plotpads &= ~(SILKSCREEN_LAYER_BACK | SILKSCREEN_LAYER_FRONT );
if( layersmask_plotpads ) if( layersmask_plotpads )
{ {
for( MODULE* Module = m_Pcb->m_Modules; Module; Module = Module->Next() ) for( MODULE* Module = m_Pcb->m_Modules; Module; Module = Module->Next() )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment