dialog work

This commit is contained in:
dickelbeck 2008-03-21 19:27:11 +00:00
parent 8f2e706853
commit 11d8f51b5c
4 changed files with 185 additions and 118 deletions

View File

@ -5,10 +5,20 @@ Started 2007-June-11
Please add newer entries at the top, list the date and your name with Please add newer entries at the top, list the date and your name with
email address. email address.
2008-Mar-21 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================
+pcbnew
pcbplot.cpp now saves the selected layers as wxConfig options,
i.e. retentitively. The ESC key now works in that dialog.
Make upper/lower case conformat to UIpolicies.txt
Put buttons at bottom, "Close" as bottom button.
2008-Mar-21 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr> 2008-Mar-21 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
================================================================================ ================================================================================
+eeschema +eeschema
Removed an very old bug in onrightclick.cpp which crashes eeschema when right clicking in a field inside a component. Removed an very old bug in onrightclick.cpp which crashes eeschema when
right clicking in a field inside a component.
Old code should never works, but ... Old code should never works, but ...
@ -19,6 +29,7 @@ email address.
If possible (i.e. if freeroute.jnlp is found in kicad binary directory) javaws is called insteed of the default browser) If possible (i.e. if freeroute.jnlp is found in kicad binary directory) javaws is called insteed of the default browser)
So @todo removed So @todo removed
>>>>>>> .r920
2008-Mar-19 UPDATE Dick Hollenbeck <dick@softplc.com> 2008-Mar-19 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================ ================================================================================
+eeschema +eeschema

View File

@ -296,16 +296,32 @@ public:
EDA_BaseStruct* GetCurItem() const { return m_CurrentItem; } EDA_BaseStruct* GetCurItem() const { return m_CurrentItem; }
/* fonctions relatives au zoom */ //----<zoom stuff>----------------------------------------------------------
int GetZoom(); /* retourne le coeff de zoom */ /**
void SetZoom( int coeff ); /* ajuste le coeff de zoom a coeff */ * Function GetZoom
void SetZoomList( int* zoomlist ); /* init liste des zoom (NULL terminated) */ * returns the current zoom factor
*/
int GetZoom() const;
/**
* Function SetZoom
* adjusts the current zoom factor
*/
void SetZoom( int coeff );
/**
* Function SetZoomList
* sets the list of zoom factors.
* @param aZoomList An array of zoom factors in ascending order, zero terminated
*/
void SetZoomList( const int* zoomlist );
void SetNextZoom(); /* ajuste le prochain coeff de zoom */ void SetNextZoom(); /* ajuste le prochain coeff de zoom */
void SetPreviousZoom(); /* ajuste le precedent coeff de zoom */ void SetPreviousZoom(); /* ajuste le precedent coeff de zoom */
void SetFirstZoom(); /* ajuste le coeff de zoom a 1*/ void SetFirstZoom(); /* ajuste le coeff de zoom a 1*/
void SetLastZoom(); /* ajuste le coeff de zoom au max */ void SetLastZoom(); /* ajuste le coeff de zoom au max */
/* fonctions relatives a la grille */ //----<grid stuff>----------------------------------------------------------
wxSize GetGrid(); /* retourne la grille */ wxSize GetGrid(); /* retourne la grille */
void SetGrid( const wxSize& size ); void SetGrid( const wxSize& size );
void SetGridList( wxSize* sizelist ); /* init liste des grilles (NULL terminated) */ void SetGridList( wxSize* sizelist ); /* init liste des grilles (NULL terminated) */

View File

@ -36,7 +36,8 @@ void EDA_BaseStruct::Place( WinEDA_DrawFrame* frame, wxDC* DC )
/* Constructeur de SCREEN */ /* Constructeur de SCREEN */
PCB_SCREEN::PCB_SCREEN( int idscreen ) : BASE_SCREEN( TYPESCREEN ) PCB_SCREEN::PCB_SCREEN( int idscreen ) : BASE_SCREEN( TYPESCREEN )
{ {
int zoom_list[] = { 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 0 }; // a zero terminated list
static const int zoom_list[] = { 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 0 };
m_Type = idscreen; m_Type = idscreen;
SetGridList( g_GridList ); SetGridList( g_GridList );

View File

@ -17,20 +17,23 @@
#define PLOT_DEFAULT_MARGE 300 // mils #define PLOT_DEFAULT_MARGE 300 // mils
/* Keywords to r/w options in config */ /* Keywords to r/w options in config */
#define EDGELAYER_GERBER_OPT_KEY wxT( "EdgeLayerGerberOpt" ) #define OPTKEY_EDGELAYER_GERBER wxT( "EdgeLayerGerberOpt" )
#define PLOT_XFINESCALE_ADJ_KEY wxT( "PlotXFineScaleAdj" ) #define OPTKEY_XFINESCALE_ADJ wxT( "PlotXFineScaleAdj" )
#define PLOT_YFINESCALE_ADJ_KEY wxT( "PlotYFineScaleAdj" ) #define OPTKEY_YFINESCALE_ADJ wxT( "PlotYFineScaleAdj" )
#define OPTKEY_LAYERBASE wxT( "PlotLayer_%d" )
#define OPTKEY_PADS_ON_SILKSCREEN wxT( "PlotPadsOnSilkscreen" )
#define OPTKEY_ALWAYS_PRINT_PADS wxT( "PlotAlwaysPads" )
#define OPTKEY_OUTPUT_FORMAT wxT( "PlotOutputFormat" )
// variables locale :
static long s_SelectedLayers = CUIVRE_LAYER | CMP_LAYER | static long s_SelectedLayers = CUIVRE_LAYER | CMP_LAYER |
SILKSCREEN_LAYER_CMP | SILKSCREEN_LAYER_CU; SILKSCREEN_LAYER_CMP | SILKSCREEN_LAYER_CU;
static bool s_PlotOriginIsAuxAxis = FALSE; static bool s_PlotOriginIsAuxAxis = FALSE;
// Routines Locales
enum id_plotps { enum id_plotps {
ID_CLOSE_PLOT = 8020, ID_DRILL_SHAPE_OPT = 8020,
ID_DRILL_SHAPE_OPT,
ID_SCALE_OPT, ID_SCALE_OPT,
ID_ROTATE_OPT, ID_ROTATE_OPT,
ID_MIROR_OPT, ID_MIROR_OPT,
@ -61,8 +64,8 @@ class WinEDA_PlotFrame : public wxDialog
{ {
public: public:
WinEDA_BasePcbFrame* m_Parent; WinEDA_BasePcbFrame* m_Parent;
wxButton* m_MergePlotButton; wxButton* m_PlotButton; // button with initial focus
wxCheckBox* m_BoxSelecLayer[32]; wxCheckBox* m_BoxSelectLayer[32];
wxRadioBox* m_PlotFormatOpt; wxRadioBox* m_PlotFormatOpt;
wxRadioBox* m_Choice_Plot_Offset; wxRadioBox* m_Choice_Plot_Offset;
wxRadioBox* m_Drill_Shape_Opt; wxRadioBox* m_Drill_Shape_Opt;
@ -104,7 +107,7 @@ private:
BEGIN_EVENT_TABLE( WinEDA_PlotFrame, wxDialog ) BEGIN_EVENT_TABLE( WinEDA_PlotFrame, wxDialog )
EVT_CLOSE( WinEDA_PlotFrame::OnClose ) EVT_CLOSE( WinEDA_PlotFrame::OnClose )
EVT_BUTTON( ID_CLOSE_PLOT, WinEDA_PlotFrame::OnQuit ) EVT_BUTTON( wxID_CANCEL, WinEDA_PlotFrame::OnQuit )
EVT_BUTTON( ID_EXEC_PLOT, WinEDA_PlotFrame::Plot ) EVT_BUTTON( ID_EXEC_PLOT, WinEDA_PlotFrame::Plot )
EVT_BUTTON( ID_SAVE_OPT_PLOT, WinEDA_PlotFrame::SaveOptPlot ) EVT_BUTTON( ID_SAVE_OPT_PLOT, WinEDA_PlotFrame::SaveOptPlot )
EVT_BUTTON( ID_CREATE_DRILL_FILE, WinEDA_PlotFrame::CreateDrillFile ) EVT_BUTTON( ID_CREATE_DRILL_FILE, WinEDA_PlotFrame::CreateDrillFile )
@ -122,13 +125,15 @@ WinEDA_PlotFrame::WinEDA_PlotFrame( WinEDA_BasePcbFrame* parent ) :
wxDEFAULT_DIALOG_STYLE ) wxDEFAULT_DIALOG_STYLE )
/********************************************************************/ /********************************************************************/
{ {
wxButton* Button; wxButton* button;
int ii;
m_Parent = parent; m_Parent = parent;
BOARD* board = parent->m_Pcb; BOARD* board = parent->m_Pcb;
wxConfig* config = m_Parent->m_Parent->m_EDA_Config; // Current config used by application
SetFont( *g_DialogFont ); SetFont( *g_DialogFont );
Centre(); Centre();
@ -162,9 +167,12 @@ WinEDA_PlotFrame::WinEDA_PlotFrame( WinEDA_BasePcbFrame* parent ) :
m_PlotFormatOpt = new wxRadioBox( this, ID_SEL_PLOT_FORMAT, m_PlotFormatOpt = new wxRadioBox( this, ID_SEL_PLOT_FORMAT,
_( "Plot Format" ), wxDefaultPosition, wxSize( -1, -1 ), _( "Plot Format" ), wxDefaultPosition, wxSize( -1, -1 ),
4, fmtmsg, 1, wxRA_SPECIFY_COLS ); 4, fmtmsg, 1, wxRA_SPECIFY_COLS );
MidRightBoxSizer->Add( m_PlotFormatOpt, 0, wxGROW | wxALL, 5 ); MidRightBoxSizer->Add( m_PlotFormatOpt, 0, wxGROW | wxALL, 5 );
if( config && config->Read( OPTKEY_OUTPUT_FORMAT, &m_PlotFormat ) )
m_PlotFormatOpt->SetSelection( m_PlotFormat );
else
{
switch( m_PlotFormat ) switch( m_PlotFormat )
{ {
case PLOT_FORMAT_HPGL: case PLOT_FORMAT_HPGL:
@ -186,6 +194,7 @@ WinEDA_PlotFrame::WinEDA_PlotFrame( WinEDA_BasePcbFrame* parent ) :
m_PlotFormatOpt->SetSelection( 2 ); m_PlotFormatOpt->SetSelection( 2 );
break; break;
} }
}
// Creation des menus d'option du format GERBER // Creation des menus d'option du format GERBER
m_GerbSpotSizeMinOpt = new WinEDA_ValueCtrl( this, _( "Spot min" ), m_GerbSpotSizeMinOpt = new WinEDA_ValueCtrl( this, _( "Spot min" ),
@ -193,35 +202,35 @@ WinEDA_PlotFrame::WinEDA_PlotFrame( WinEDA_BasePcbFrame* parent ) :
UNITS_MILS ); UNITS_MILS );
// Creation des menus d'option du format HPGL // Creation des menus d'option du format HPGL
m_HPGLPenSizeOpt = new WinEDA_ValueCtrl( this, _( "Pen Size" ), m_HPGLPenSizeOpt = new WinEDA_ValueCtrl( this, _( "Pen size" ),
g_HPGL_Pen_Diam, g_UnitMetric, MidRightBoxSizer, g_HPGL_Pen_Diam, g_UnitMetric, MidRightBoxSizer,
UNITS_MILS ); UNITS_MILS );
// unites standards = cm pour vitesse plume en HPGL // unites standards = cm pour vitesse plume en HPGL
m_HPGLPenSpeedOpt = new WinEDA_ValueCtrl( this, _( "Pen Speed (cm/s)" ), m_HPGLPenSpeedOpt = new WinEDA_ValueCtrl( this, _( "Pen speed (cm/s)" ),
g_HPGL_Pen_Speed, CENTIMETRE, MidRightBoxSizer, g_HPGL_Pen_Speed, CENTIMETRE, MidRightBoxSizer,
1 ); 1 );
m_HPGLPenSpeedOpt->SetToolTip( _( "Set pen speed in cm/s" ) ); m_HPGLPenSpeedOpt->SetToolTip( _( "Set pen speed in cm/s" ) );
m_HPGLPenOverlayOpt = new WinEDA_ValueCtrl( this, _( "Pen Ovr" ), m_HPGLPenOverlayOpt = new WinEDA_ValueCtrl( this, _( "Pen ovr" ),
g_HPGL_Pen_Recouvrement, g_UnitMetric, g_HPGL_Pen_Recouvrement, g_UnitMetric,
MidRightBoxSizer, UNITS_MILS ); MidRightBoxSizer, UNITS_MILS );
m_HPGLPenOverlayOpt->SetToolTip( _( "Set plot overlay for filling" ) ); m_HPGLPenOverlayOpt->SetToolTip( _( "Set plot overlay for filling" ) );
m_LinesWidth = new WinEDA_ValueCtrl( this, _( "Lines Width" ), m_LinesWidth = new WinEDA_ValueCtrl( this, _( "Lines width" ),
g_PlotLine_Width, g_UnitMetric, MidRightBoxSizer, g_PlotLine_Width, g_UnitMetric, MidRightBoxSizer,
PCB_INTERNAL_UNIT ); PCB_INTERNAL_UNIT );
m_LinesWidth->SetToolTip( _( "Set width for lines in Line plot mode" ) ); m_LinesWidth->SetToolTip( _( "Set width for lines in line plot mode" ) );
// Create the right column commands // Create the right column commands
static const wxString choice_plot_offset_msg[] = static const wxString choice_plot_offset_msg[] =
{ _( "Absolute" ), _( "Auxiliary axis" ) }; { _( "Absolute" ), _( "Auxiliary axis" ) };
m_Choice_Plot_Offset = new wxRadioBox( this, ID_SEL_PLOT_OFFSET_OPTION, m_Choice_Plot_Offset = new wxRadioBox( this, ID_SEL_PLOT_OFFSET_OPTION,
_( "Plot Origin" ), _( "Plot origin" ),
wxDefaultPosition, wxSize( -1, -1 ), wxDefaultPosition, wxSize( -1, -1 ),
2, choice_plot_offset_msg, 1, wxRA_SPECIFY_COLS ); 2, choice_plot_offset_msg, 1, wxRA_SPECIFY_COLS );
@ -231,87 +240,98 @@ WinEDA_PlotFrame::WinEDA_PlotFrame( WinEDA_BasePcbFrame* parent ) :
/* Add a spacer for a better look */ /* Add a spacer for a better look */
RightBoxSizer->Add( 5, 5, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 20 ); RightBoxSizer->Add( 5, 5, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 20 );
/* Create the command buttons */
Button = new wxButton( this, ID_EXEC_PLOT, _( "Plot" ) );
Button->SetForegroundColour( *wxRED );
RightBoxSizer->Add( Button, 0, wxGROW | wxALL, 5 );
Button = new wxButton( this, ID_CLOSE_PLOT, _( "Close" ) );
Button->SetForegroundColour( *wxBLUE );
RightBoxSizer->Add( Button, 0, wxGROW | wxALL, 5 );
Button = new wxButton( this, ID_SAVE_OPT_PLOT, _( "Save options" ) );
Button->SetForegroundColour( wxColour( 0, 80, 0 ) );
RightBoxSizer->Add( Button, 0, wxGROW | wxALL, 5 );
Button = new wxButton( this, ID_CREATE_DRILL_FILE, _( "Create Drill File" ) );
Button->SetForegroundColour( wxColour( 0, 80, 80 ) );
RightBoxSizer->Add( Button, 0, wxGROW | wxALL, 5 );
// Create scale adjust option // Create scale adjust option
m_XScaleAdjust = m_YScaleAdjust = 1.0; m_XScaleAdjust = m_YScaleAdjust = 1.0;
if( m_Parent->m_Parent->m_EDA_Config ) if( config )
{ {
m_Parent->m_Parent->m_EDA_Config->Read( EDGELAYER_GERBER_OPT_KEY, &g_Exclude_Edges_Pcb ); config->Read( OPTKEY_EDGELAYER_GERBER, &g_Exclude_Edges_Pcb );
m_Parent->m_Parent->m_EDA_Config->Read( PLOT_XFINESCALE_ADJ_KEY, &m_XScaleAdjust ); config->Read( OPTKEY_XFINESCALE_ADJ, &m_XScaleAdjust );
m_Parent->m_Parent->m_EDA_Config->Read( PLOT_XFINESCALE_ADJ_KEY, &m_YScaleAdjust ); config->Read( OPTKEY_XFINESCALE_ADJ, &m_YScaleAdjust );
} }
m_FineAdjustXscaleOpt = new WinEDA_DFloatValueCtrl( this, _(
"X Scale Adjust" ), m_XScaleAdjust,
RightBoxSizer );
m_FineAdjustXscaleOpt = new WinEDA_DFloatValueCtrl( this,
_( "X scale adjust" ), m_XScaleAdjust,
RightBoxSizer );
m_FineAdjustXscaleOpt->SetToolTip( _( "Set X scale adjust for exact scale plotting" ) ); m_FineAdjustXscaleOpt->SetToolTip( _( "Set X scale adjust for exact scale plotting" ) );
m_FineAdjustYscaleOpt = new WinEDA_DFloatValueCtrl( this, _(
"Y Scale Adjust" ), m_YScaleAdjust,
RightBoxSizer );
m_FineAdjustYscaleOpt = new WinEDA_DFloatValueCtrl( this,
_("Y scale adjust" ), m_YScaleAdjust,
RightBoxSizer );
m_FineAdjustYscaleOpt->SetToolTip( _( "Set Y scale adjust for exact scale plotting" ) ); m_FineAdjustYscaleOpt->SetToolTip( _( "Set Y scale adjust for exact scale plotting" ) );
m_Plot_PS_Negative = new wxCheckBox( this, -1, _( "Plot Negative" ) ); m_Plot_PS_Negative = new wxCheckBox( this, -1, _( "Plot negative" ) );
m_Plot_PS_Negative->SetValue( g_Plot_PS_Negative ); m_Plot_PS_Negative->SetValue( g_Plot_PS_Negative );
RightBoxSizer->Add( m_Plot_PS_Negative, 0, wxGROW | wxALL, 5 ); RightBoxSizer->Add( m_Plot_PS_Negative, 0, wxGROW | wxALL, 5 );
/* Create the command buttons */
m_PlotButton = new wxButton( this, ID_EXEC_PLOT, _( "Plot" ) );
m_PlotButton->SetForegroundColour( *wxRED );
RightBoxSizer->Add( m_PlotButton, 0, wxGROW | wxALL, 5 );
button = new wxButton( this, ID_SAVE_OPT_PLOT, _( "Save Options" ) );
button->SetForegroundColour( wxColour( 0, 80, 0 ) );
RightBoxSizer->Add( button, 0, wxGROW | wxALL, 5 );
button = new wxButton( this, ID_CREATE_DRILL_FILE, _( "Create Drill File" ) );
button->SetForegroundColour( wxColour( 0, 80, 80 ) );
RightBoxSizer->Add( button, 0, wxGROW | wxALL, 5 );
button = new wxButton( this, wxID_CANCEL, _( "Close" ) );
button->SetForegroundColour( *wxBLUE );
RightBoxSizer->Add( button, 0, wxGROW | wxALL, 5 );
// Creation de la liste des layers // Creation de la liste des layers
wxBoxSizer* OneColumnLayerBoxSizer = new wxBoxSizer( wxVERTICAL );
LayersBoxSizer->Add( OneColumnLayerBoxSizer, 0, wxGROW | wxALL, 5 );
int mask = 1; int mask = 1;
wxBoxSizer* OneColonLayerBoxSizer = new wxBoxSizer( wxVERTICAL ); for( int layer=0; layer<NB_LAYERS; layer++, mask <<= 1 )
LayersBoxSizer->Add( OneColonLayerBoxSizer, 0, wxGROW | wxALL, 5 );
for( ii = 0; ii < NB_LAYERS; ii++, mask <<= 1 )
{ {
if( ii == 16 ) if( layer == 16 )
{ {
OneColonLayerBoxSizer = new wxBoxSizer( wxVERTICAL ); OneColumnLayerBoxSizer = new wxBoxSizer( wxVERTICAL );
LayersBoxSizer->Add( OneColumnLayerBoxSizer, 0, wxGROW | wxALL, 5 );
LayersBoxSizer->Add( OneColonLayerBoxSizer, 0, wxGROW | wxALL, 5 );
} }
m_BoxSelecLayer[ii] = new wxCheckBox( this, -1, board->GetLayerName (ii) ); m_BoxSelectLayer[layer] = new wxCheckBox( this, -1, board->GetLayerName(layer) );
if( mask & s_SelectedLayers ) if( mask & s_SelectedLayers )
m_BoxSelecLayer[ii]->SetValue( true ); m_BoxSelectLayer[layer]->SetValue( true );
OneColonLayerBoxSizer->Add( m_BoxSelecLayer[ii], 0, wxGROW | wxALL, 1 );
OneColumnLayerBoxSizer->Add( m_BoxSelectLayer[layer], 0, wxGROW | wxALL, 1 );
}
if( config )
{
wxString layerKey;
for( int layer=0; layer<NB_LAYERS; ++layer )
{
bool option;
layerKey.Printf( OPTKEY_LAYERBASE, layer );
if( config->Read( layerKey, &option ) )
m_BoxSelectLayer[layer]->SetValue( option );
}
} }
// Option for excluding contents of "Edges Pcb" layer // Option for excluding contents of "Edges Pcb" layer
m_Exclude_Edges_Pcb = new wxCheckBox( this, m_Exclude_Edges_Pcb = new wxCheckBox( this,
ID_EXCLUDE_EDGES_PCB, _( "Exclude Edges Pcb Layer" ) ); ID_EXCLUDE_EDGES_PCB, _( "Exclude Edges_Pcb layer" ) );
m_Exclude_Edges_Pcb->SetValue( g_Exclude_Edges_Pcb ); m_Exclude_Edges_Pcb->SetValue( g_Exclude_Edges_Pcb );
m_Exclude_Edges_Pcb->SetToolTip( m_Exclude_Edges_Pcb->SetToolTip(
_( "Exclude contents of Edges Pcb layer from all other layers" ) ); _( "Exclude contents of Edges_Pcb layer from all other layers" ) );
LeftBoxSizer->Add( m_Exclude_Edges_Pcb, 0, wxGROW | wxALL, 1 ); LeftBoxSizer->Add( m_Exclude_Edges_Pcb, 0, wxGROW | wxALL, 1 );
// Option d'impression du cartouche: // Option d'impression du cartouche:
if( m_Parent->m_Print_Sheet_Ref ) if( m_Parent->m_Print_Sheet_Ref )
{ {
m_Plot_Sheet_Ref = new wxCheckBox( this, ID_PRINT_REF, _( "Print Sheet Ref" ) ); m_Plot_Sheet_Ref = new wxCheckBox( this, ID_PRINT_REF, _( "Print sheet ref" ) );
m_Plot_Sheet_Ref->SetValue( Plot_Sheet_Ref ); m_Plot_Sheet_Ref->SetValue( Plot_Sheet_Ref );
LeftBoxSizer->Add( m_Plot_Sheet_Ref, 0, wxGROW | wxALL, 1 ); LeftBoxSizer->Add( m_Plot_Sheet_Ref, 0, wxGROW | wxALL, 1 );
@ -320,56 +340,57 @@ WinEDA_PlotFrame::WinEDA_PlotFrame( WinEDA_BasePcbFrame* parent ) :
Plot_Sheet_Ref = false; Plot_Sheet_Ref = false;
// Option d'impression des pads sur toutes les couches // Option d'impression des pads sur toutes les couches
m_Plot_Pads_on_Silkscreen = new wxCheckBox( this, m_Plot_Pads_on_Silkscreen = new wxCheckBox( this, ID_PRINT_PAD_ON_SILKSCREEN,
ID_PRINT_PAD_ON_SILKSCREEN, _( _( "Print pads on silkscreen" ) );
"Print Pads on Silkscreen" ) ); if( config )
config->Read( OPTKEY_PADS_ON_SILKSCREEN, &PlotPadsOnSilkLayer );
m_Plot_Pads_on_Silkscreen->SetValue( PlotPadsOnSilkLayer ); m_Plot_Pads_on_Silkscreen->SetValue( PlotPadsOnSilkLayer );
m_Plot_Pads_on_Silkscreen->SetToolTip( m_Plot_Pads_on_Silkscreen->SetToolTip(
_( "Enable/disable print/plot pads on Silkscreen layers" ) ); _( "Enable/disable print/plot pads on silkscreen layers" ) );
LeftBoxSizer->Add( m_Plot_Pads_on_Silkscreen, 0, wxGROW | wxALL, 1 ); LeftBoxSizer->Add( m_Plot_Pads_on_Silkscreen, 0, wxGROW | wxALL, 1 );
m_Force_Plot_Pads = new wxCheckBox( this, ID_FORCE_PRINT_PAD, m_Force_Plot_Pads = new wxCheckBox( this, ID_FORCE_PRINT_PAD,
_( "Always Print Pads" ) ); _( "Always print pads" ) );
if( config )
config->Read( OPTKEY_ALWAYS_PRINT_PADS, &Plot_Pads_All_Layers );
m_Force_Plot_Pads->SetValue( Plot_Pads_All_Layers ); m_Force_Plot_Pads->SetValue( Plot_Pads_All_Layers );
m_Force_Plot_Pads->SetToolTip( _( "Force print/plot pads on ALL layers" ) ); m_Force_Plot_Pads->SetToolTip( _( "Force print/plot pads on ALL layers" ) );
LeftBoxSizer->Add( m_Force_Plot_Pads, 0, wxGROW | wxALL, 1 ); LeftBoxSizer->Add( m_Force_Plot_Pads, 0, wxGROW | wxALL, 1 );
// Options d'impression des textes modules // Options d'impression des textes modules
m_Plot_Text_Value = new wxCheckBox( this, ID_PRINT_VALUE, _( "Print Module Value" ) ); m_Plot_Text_Value = new wxCheckBox( this, ID_PRINT_VALUE, _( "Print module value" ) );
m_Plot_Text_Value->SetValue( Sel_Texte_Valeur ); m_Plot_Text_Value->SetValue( Sel_Texte_Valeur );
m_Plot_Text_Value->SetToolTip( m_Plot_Text_Value->SetToolTip(
_( "Enable/disable print/plot module value on Silkscreen layers" ) ); _( "Enable/disable print/plot module value on silkscreen layers" ) );
LeftBoxSizer->Add( m_Plot_Text_Value, 0, wxGROW | wxALL, 1 ); LeftBoxSizer->Add( m_Plot_Text_Value, 0, wxGROW | wxALL, 1 );
m_Plot_Text_Ref = new wxCheckBox( this, ID_PRINT_REF, _( "Print Module Reference" ) ); m_Plot_Text_Ref = new wxCheckBox( this, ID_PRINT_REF, _( "Print module reference" ) );
m_Plot_Text_Ref->SetValue( Sel_Texte_Reference ); m_Plot_Text_Ref->SetValue( Sel_Texte_Reference );
m_Plot_Text_Ref->SetToolTip( m_Plot_Text_Ref->SetToolTip(
_( "Enable/disable print/plot module reference on Silkscreen layers" ) ); _( "Enable/disable print/plot module reference on silkscreen layers" ) );
LeftBoxSizer->Add( m_Plot_Text_Ref, 0, wxGROW | wxALL, 1 ); LeftBoxSizer->Add( m_Plot_Text_Ref, 0, wxGROW | wxALL, 1 );
m_Plot_Text_Div = new wxCheckBox( this, ID_PRINT_MODULE_TEXTS, m_Plot_Text_Div = new wxCheckBox( this, ID_PRINT_MODULE_TEXTS,
_( "Print other Module texts" ) ); _( "Print other module texts" ) );
m_Plot_Text_Div->SetValue( Sel_Texte_Divers ); m_Plot_Text_Div->SetValue( Sel_Texte_Divers );
m_Plot_Text_Div->SetToolTip( m_Plot_Text_Div->SetToolTip(
_( "Enable/disable print/plot module field texts on Silkscreen layers" ) ); _( "Enable/disable print/plot module field texts on silkscreen layers" ) );
LeftBoxSizer->Add( m_Plot_Text_Div, 0, wxGROW | wxALL, 1 ); LeftBoxSizer->Add( m_Plot_Text_Div, 0, wxGROW | wxALL, 1 );
m_Plot_Invisible_Text = new wxCheckBox( this, m_Plot_Invisible_Text = new wxCheckBox( this,
ID_FORCE_PRINT_INVISIBLE_TEXT, _( ID_FORCE_PRINT_INVISIBLE_TEXT, _(
"Force Print Invisible Texts" ) ); "Force print invisible texts" ) );
m_Plot_Invisible_Text->SetValue( Sel_Texte_Invisible ); m_Plot_Invisible_Text->SetValue( Sel_Texte_Invisible );
m_Plot_Invisible_Text->SetToolTip( m_Plot_Invisible_Text->SetToolTip(
_( "Force print/plot module invisible texts on Silkscreen layers" ) ); _( "Force print/plot module invisible texts on silkscreen layers" ) );
LeftBoxSizer->Add( m_Plot_Invisible_Text, 0, wxGROW | wxALL, 1 ); LeftBoxSizer->Add( m_Plot_Invisible_Text, 0, wxGROW | wxALL, 1 );
static const wxString drillmsg[3] = { _( "No Drill mark" ), _( "Small mark" ), _( "Real Drill" ) }; static const wxString drillmsg[3] = { _( "No drill mark" ), _( "Small mark" ), _( "Real drill" ) };
m_Drill_Shape_Opt = new wxRadioBox( this, ID_DRILL_SHAPE_OPT, m_Drill_Shape_Opt = new wxRadioBox( this, ID_DRILL_SHAPE_OPT,
_( "Pads Drill Opt" ), wxDefaultPosition, wxSize( -1, -1 ), _( "Pads Drill Opt" ), wxDefaultPosition, wxSize( -1, -1 ),
3, drillmsg, 1, wxRA_SPECIFY_COLS ); 3, drillmsg, 1, wxRA_SPECIFY_COLS );
@ -388,6 +409,7 @@ WinEDA_PlotFrame::WinEDA_PlotFrame( WinEDA_BasePcbFrame* parent ) :
MidLeftBoxSizer->Add( m_Scale_Opt, 0, wxGROW | wxALL, 5 ); MidLeftBoxSizer->Add( m_Scale_Opt, 0, wxGROW | wxALL, 5 );
static const wxString list_opt3[3] = { _( "Line" ), _( "Filled" ), _( "Sketch" ) }; static const wxString list_opt3[3] = { _( "Line" ), _( "Filled" ), _( "Sketch" ) };
m_PlotModeOpt = new wxRadioBox( this, ID_PLOT_MODE_OPT, _( "Plot Mode" ), m_PlotModeOpt = new wxRadioBox( this, ID_PLOT_MODE_OPT, _( "Plot Mode" ),
wxDefaultPosition, wxDefaultSize, wxDefaultPosition, wxDefaultSize,
3, list_opt3, 1 ); 3, list_opt3, 1 );
@ -396,13 +418,13 @@ WinEDA_PlotFrame::WinEDA_PlotFrame( WinEDA_BasePcbFrame* parent ) :
MidLeftBoxSizer->Add( m_PlotModeOpt, 0, wxGROW | wxALL, 5 ); MidLeftBoxSizer->Add( m_PlotModeOpt, 0, wxGROW | wxALL, 5 );
m_PlotMirorOpt = new wxCheckBox( this, ID_MIROR_OPT, m_PlotMirorOpt = new wxCheckBox( this, ID_MIROR_OPT,
_( "Plot Mirror" ) ); _( "Plot mirror" ) );
m_PlotMirorOpt->SetValue( Plot_Set_MIROIR ); m_PlotMirorOpt->SetValue( Plot_Set_MIROIR );
MidLeftBoxSizer->Add( m_PlotMirorOpt, 0, wxGROW | wxALL, 5 ); MidLeftBoxSizer->Add( m_PlotMirorOpt, 0, wxGROW | wxALL, 5 );
m_PlotNoViaOnMaskOpt = new wxCheckBox( this, ID_MASKVIA_OPT, m_PlotNoViaOnMaskOpt = new wxCheckBox( this, ID_MASKVIA_OPT,
_( "Vias on Mask" ) ); _( "Vias on mask" ) );
m_PlotNoViaOnMaskOpt->SetValue( g_DrawViaOnMaskLayer ); m_PlotNoViaOnMaskOpt->SetValue( g_DrawViaOnMaskLayer );
m_PlotNoViaOnMaskOpt->SetToolTip( m_PlotNoViaOnMaskOpt->SetToolTip(
@ -422,6 +444,9 @@ WinEDA_PlotFrame::WinEDA_PlotFrame( WinEDA_BasePcbFrame* parent ) :
GetSizer()->Fit( this ); GetSizer()->Fit( this );
GetSizer()->SetSizeHints( this ); GetSizer()->SetSizeHints( this );
// without this line, the ESC key does not work
m_PlotButton->SetFocus();
} }
@ -582,11 +607,24 @@ void WinEDA_PlotFrame::SaveOptPlot( wxCommandEvent& event )
m_XScaleAdjust = m_FineAdjustXscaleOpt->GetValue(); m_XScaleAdjust = m_FineAdjustXscaleOpt->GetValue();
m_YScaleAdjust = m_FineAdjustYscaleOpt->GetValue(); m_YScaleAdjust = m_FineAdjustYscaleOpt->GetValue();
if( m_Parent->m_Parent->m_EDA_Config ) wxConfig* config = m_Parent->m_Parent->m_EDA_Config;
if( config)
{ {
m_Parent->m_Parent->m_EDA_Config->Write( EDGELAYER_GERBER_OPT_KEY, g_Exclude_Edges_Pcb ); config->Write( OPTKEY_EDGELAYER_GERBER, g_Exclude_Edges_Pcb );
m_Parent->m_Parent->m_EDA_Config->Write( PLOT_XFINESCALE_ADJ_KEY, m_XScaleAdjust ); config->Write( OPTKEY_XFINESCALE_ADJ, m_XScaleAdjust );
m_Parent->m_Parent->m_EDA_Config->Write( PLOT_YFINESCALE_ADJ_KEY, m_YScaleAdjust ); config->Write( OPTKEY_YFINESCALE_ADJ, m_YScaleAdjust );
config->Write( OPTKEY_PADS_ON_SILKSCREEN, PlotPadsOnSilkLayer );
config->Write( OPTKEY_ALWAYS_PRINT_PADS, Plot_Pads_All_Layers );
m_PlotFormat = m_PlotFormatOpt->GetSelection();
config->Write( OPTKEY_OUTPUT_FORMAT, m_PlotFormat );
wxString layerKey;
for( int layer=0; layer<NB_LAYERS; ++layer )
{
layerKey.Printf( OPTKEY_LAYERBASE, layer );
config->Write( layerKey, m_BoxSelectLayer[layer]->IsChecked() );
}
} }
g_Plot_PS_Negative = m_Plot_PS_Negative->GetValue(); g_Plot_PS_Negative = m_Plot_PS_Negative->GetValue();
@ -650,7 +688,7 @@ void WinEDA_PlotFrame::Plot( wxCommandEvent& event )
for( layer_to_plot = 0; layer_to_plot < NB_LAYERS; layer_to_plot++, mask <<= 1 ) for( layer_to_plot = 0; layer_to_plot < NB_LAYERS; layer_to_plot++, mask <<= 1 )
{ {
if( m_BoxSelecLayer[layer_to_plot]->GetValue() ) if( m_BoxSelectLayer[layer_to_plot]->GetValue() )
{ {
s_SelectedLayers |= mask; s_SelectedLayers |= mask;
@ -684,5 +722,6 @@ void WinEDA_BasePcbFrame::ToPlotter( wxCommandEvent& event )
{ {
WinEDA_PlotFrame* frame = new WinEDA_PlotFrame( this ); WinEDA_PlotFrame* frame = new WinEDA_PlotFrame( this );
frame->ShowModal(); frame->Destroy(); frame->ShowModal();
frame->Destroy();
} }