diff --git a/change_log.txt b/change_log.txt index af65f93a61..efe41a9665 100644 --- a/change_log.txt +++ b/change_log.txt @@ -11,8 +11,6 @@ email address. bug solved: netlist calculations could crash eeschema under very rare circumstances. recent bug solved: background filled shapes (filled but not solid: texts are readables inside shapes) were drawn (and plotted) as filled (solid) shapes - enhancements needed for plotting background filled shapes, in color mode - (cannot be filled in black and white mode) 2008-Aug-18 UPDATE Jean-Pierre Charras ================================================================================ diff --git a/eeschema/eelibs_draw_components.cpp b/eeschema/eelibs_draw_components.cpp index f0b1e4f9ab..e51dc2fe9e 100644 --- a/eeschema/eelibs_draw_components.cpp +++ b/eeschema/eelibs_draw_components.cpp @@ -471,10 +471,12 @@ void DrawLibPartAux( WinEDA_DrawPanel* panel, wxDC* DC, { EXCHG( x1, x2 ); EXCHG( y1, y2 ) } - fill_option = Arc->m_Fill & (~g_PrintFillMask); + fill_option = Arc->m_Fill; + if ( g_IsPrinting && fill_option == FILLED_WITH_BG_BODYCOLOR && GetGRForceBlackPenState( ) ) + fill_option = NO_FILL; if( Color < 0 ) // Normal Color Layer { - if( (fill_option == FILLED_WITH_BG_BODYCOLOR) && !g_IsPrinting ) + if( fill_option == FILLED_WITH_BG_BODYCOLOR ) GRFilledArc( &panel->m_ClipBox, DC, xc, yc, t1, t2, Arc->m_Rayon, Arc->m_Width, CharColor, ReturnLayerColor( LAYER_DEVICE_BACKGROUND ) ); @@ -513,10 +515,12 @@ void DrawLibPartAux( WinEDA_DrawPanel* panel, wxDC* DC, y1 = Pos.y + TransMat[1][0] * Circle->m_Pos.x + TransMat[1][1] * Circle->m_Pos.y; - fill_option = Circle->m_Fill & (~g_PrintFillMask); + fill_option = Circle->m_Fill; + if ( g_IsPrinting && fill_option == FILLED_WITH_BG_BODYCOLOR && GetGRForceBlackPenState( ) ) + fill_option = NO_FILL; if( Color < 0 ) { - if( (fill_option == FILLED_WITH_BG_BODYCOLOR) && !g_IsPrinting ) + if( fill_option == FILLED_WITH_BG_BODYCOLOR ) GRFilledCircle( &panel->m_ClipBox, DC, x1, y1, Circle->m_Rayon, LineWidth, CharColor, ReturnLayerColor( LAYER_DEVICE_BACKGROUND ) ); @@ -567,10 +571,12 @@ void DrawLibPartAux( WinEDA_DrawPanel* panel, wxDC* DC, + TransMat[0][1] * Square->m_End.y; y2 = Pos.y + TransMat[1][0] * Square->m_End.x + TransMat[1][1] * Square->m_End.y; - fill_option = Square->m_Fill & (~g_PrintFillMask); + fill_option = Square->m_Fill; + if ( g_IsPrinting && fill_option == FILLED_WITH_BG_BODYCOLOR && GetGRForceBlackPenState( ) ) + fill_option = NO_FILL; if( Color < 0 ) { - if( (fill_option == FILLED_WITH_BG_BODYCOLOR) && !g_IsPrinting ) + if( fill_option == FILLED_WITH_BG_BODYCOLOR ) GRFilledRect( &panel->m_ClipBox, DC, x1, y1, x2, y2, CharColor, LineWidth, ReturnLayerColor( LAYER_DEVICE_BACKGROUND ) ); @@ -648,10 +654,12 @@ void DrawLibPartAux( WinEDA_DrawPanel* panel, wxDC* DC, TransMat[1][1] * polyline->PolyList[i * 2 + 1]; } - fill_option = polyline->m_Fill & (~g_PrintFillMask); + fill_option = polyline->m_Fill; + if ( g_IsPrinting && fill_option == FILLED_WITH_BG_BODYCOLOR && GetGRForceBlackPenState( ) ) + fill_option = NO_FILL; if( Color < 0 ) { - if( (fill_option == FILLED_WITH_BG_BODYCOLOR) && !g_IsPrinting ) + if( fill_option == FILLED_WITH_BG_BODYCOLOR ) GRPoly( &panel->m_ClipBox, DC, polyline->n, Buf_Poly_Drawings, 1, LineWidth, CharColor, ReturnLayerColor( LAYER_DEVICE_BACKGROUND ) ); @@ -962,12 +970,14 @@ void DrawLibraryDrawStruct( WinEDA_DrawPanel* panel, wxDC* DC, { EXCHG( x1, x2 ); EXCHG( y1, y2 ) } - fill_option = Arc->m_Fill & (~g_PrintFillMask); - if( (Arc->m_Fill == FILLED_WITH_BG_BODYCOLOR) && !g_IsPrinting ) + fill_option = Arc->m_Fill; + if ( g_IsPrinting && fill_option == FILLED_WITH_BG_BODYCOLOR && GetGRForceBlackPenState( ) ) + fill_option = NO_FILL; + if( fill_option == FILLED_WITH_BG_BODYCOLOR ) GRFilledArc( &panel->m_ClipBox, DC, xc, yc, t1, t2, Arc->m_Rayon, CharColor, ReturnLayerColor( LAYER_DEVICE_BACKGROUND ) ); - else if( Arc->m_Fill == FILLED_SHAPE ) + else if( fill_option == FILLED_SHAPE ) GRFilledArc( &panel->m_ClipBox, DC, xc, yc, t1, t2, Arc->m_Rayon, LineWidth, CharColor, CharColor ); #ifdef DRAW_ARC_WITH_ANGLE @@ -987,8 +997,10 @@ void DrawLibraryDrawStruct( WinEDA_DrawPanel* panel, wxDC* DC, LibDrawCircle* Circle = (LibDrawCircle*) DrawItem; x1 = PartX + Circle->m_Pos.x; y1 = PartY - Circle->m_Pos.y; - fill_option = Circle->m_Fill & (~g_PrintFillMask); - if( (fill_option == FILLED_WITH_BG_BODYCOLOR) && !g_IsPrinting ) + fill_option = Circle->m_Fill; + if ( g_IsPrinting && fill_option == FILLED_WITH_BG_BODYCOLOR && GetGRForceBlackPenState( ) ) + fill_option = NO_FILL; + if( fill_option == FILLED_WITH_BG_BODYCOLOR ) GRFilledCircle( &panel->m_ClipBox, DC, x1, y1, Circle->m_Rayon, LineWidth, CharColor, ReturnLayerColor( LAYER_DEVICE_BACKGROUND ) ); @@ -1020,8 +1032,10 @@ void DrawLibraryDrawStruct( WinEDA_DrawPanel* panel, wxDC* DC, y1 = PartY - Square->m_Pos.y; x2 = PartX + Square->m_End.x; y2 = PartY - Square->m_End.y; - fill_option = Square->m_Fill & (~g_PrintFillMask); - if( (fill_option == FILLED_WITH_BG_BODYCOLOR) && !g_IsPrinting ) + fill_option = Square->m_Fill; + if ( g_IsPrinting && fill_option == FILLED_WITH_BG_BODYCOLOR && GetGRForceBlackPenState( ) ) + fill_option = NO_FILL; + if( fill_option == FILLED_WITH_BG_BODYCOLOR ) GRFilledRect( &panel->m_ClipBox, DC, x1, y1, x2, y2, CharColor, LineWidth, ReturnLayerColor( LAYER_DEVICE_BACKGROUND ) ); @@ -1078,8 +1092,10 @@ void DrawLibraryDrawStruct( WinEDA_DrawPanel* panel, wxDC* DC, Buf_Poly_Drawings[i * 2 + 1] = PartY - polyline->PolyList[i * 2 + 1]; } - fill_option = polyline->m_Fill & (~g_PrintFillMask); - if( (fill_option == FILLED_WITH_BG_BODYCOLOR) && !g_IsPrinting ) + fill_option = polyline->m_Fill; + if ( g_IsPrinting && fill_option == FILLED_WITH_BG_BODYCOLOR && GetGRForceBlackPenState( ) ) + fill_option = NO_FILL; + if( fill_option == FILLED_WITH_BG_BODYCOLOR ) GRPoly( &panel->m_ClipBox, DC, polyline->n, Buf_Poly_Drawings, 1, LineWidth, CharColor, ReturnLayerColor( LAYER_DEVICE_BACKGROUND ) ); diff --git a/eeschema/general.h b/eeschema/general.h index cc30458f81..b88952a584 100644 --- a/eeschema/general.h +++ b/eeschema/general.h @@ -161,9 +161,6 @@ struct EESchemaVariables }; eda_global struct EESchemaVariables g_EESchemaVar; -/* Variable fonction print */ -eda_global int g_PrintFillMask; /* pour les options "FILL", - l'option reelle est m_Fill & ~PrintFillMask */ /* Variables globales pour Libview */ eda_global wxString g_CurrentViewLibraryName; /* nom de la librairie en cours d'examen */ diff --git a/eeschema/libcmp.h b/eeschema/libcmp.h index 5562be376b..7a9606db2c 100644 --- a/eeschema/libcmp.h +++ b/eeschema/libcmp.h @@ -30,9 +30,10 @@ #define IEEE_SYMBOL_PIN_DIM 40 /* Dim of special pin symbol. */ #define NO_FILL 0 // Poly, Squar, Circle, Arc = option No Fill -#define FILLED_SHAPE 1 // Poly, Squar, Circle, Arc = option Fill with current color -#define FILLED_WITH_BG_BODYCOLOR 2 // Poly, Squar, Circle, Arc = option Fill -// with background body color +#define FILLED_SHAPE 1 // Poly, Squar, Circle, Arc = option Fill with current color ("Solid shape") +#define FILLED_WITH_BG_BODYCOLOR 2 /* Poly, Squar, Circle, Arc = option Fill + * with background body color, translucent (texts on this shape can be see) + * not fille in B&W plot mode */ //Offsets used in editing library component, for handle aliad dats #define ALIAS_NAME 0 diff --git a/eeschema/plot.cpp b/eeschema/plot.cpp index 4b70418632..78adf13138 100644 --- a/eeschema/plot.cpp +++ b/eeschema/plot.cpp @@ -187,6 +187,7 @@ void PlotLibPart( SCH_COMPONENT* DrawLibItem ) int TransMat[2][2], PartX, PartY, Multi, convert; int CharColor = -1; wxPoint pos; + bool draw_bgfill = false; Entry = FindLibPart( DrawLibItem->m_ChipName.GetData(), wxEmptyString, FIND_ROOT ); if( Entry == NULL ) @@ -206,7 +207,10 @@ void PlotLibPart( SCH_COMPONENT* DrawLibItem ) Plume( 'U' ); if( (g_PlotFormat == PLOT_FORMAT_POST) && g_PlotPSColorOpt ) + { SetColorMapPS( ReturnLayerColor( LAYER_DEVICE ) ); + draw_bgfill = true; + } switch( DEntry->Type() ) { @@ -219,6 +223,13 @@ void PlotLibPart( SCH_COMPONENT* DrawLibItem ) pos.y = PartY + TransMat[1][0] * Arc->m_Pos.x + TransMat[1][1] * Arc->m_Pos.y; MapAngles( &t1, &t2, TransMat ); + if ( draw_bgfill && Arc->m_Fill == FILLED_WITH_BG_BODYCOLOR ) + { + SetColorMapPS( ReturnLayerColor( LAYER_DEVICE_BACKGROUND ) ); + PlotArc( pos, t1, t2, Arc->m_Rayon, true, 0 ); + } + if( (g_PlotFormat == PLOT_FORMAT_POST) && g_PlotPSColorOpt ) + SetColorMapPS( ReturnLayerColor( LAYER_DEVICE ) ); PlotArc( pos, t1, t2, Arc->m_Rayon, Arc->m_Fill == FILLED_SHAPE ? true : false, Arc->m_Width ); } break; @@ -230,6 +241,13 @@ void PlotLibPart( SCH_COMPONENT* DrawLibItem ) TransMat[0][1] * Circle->m_Pos.y; pos.y = PartY + TransMat[1][0] * Circle->m_Pos.x + TransMat[1][1] * Circle->m_Pos.y; + if ( draw_bgfill && Circle->m_Fill == FILLED_WITH_BG_BODYCOLOR ) + { + SetColorMapPS( ReturnLayerColor( LAYER_DEVICE_BACKGROUND ) ); + PlotCercle( pos, Circle->m_Rayon * 2, true, 0 ); + } + if( (g_PlotFormat == PLOT_FORMAT_POST) && g_PlotPSColorOpt ) + SetColorMapPS( ReturnLayerColor( LAYER_DEVICE ) ); PlotCercle( pos, Circle->m_Rayon * 2, Circle->m_Fill == FILLED_SHAPE ? true : false, Circle->m_Width ); } break; @@ -266,6 +284,13 @@ void PlotLibPart( SCH_COMPONENT* DrawLibItem ) y2 = PartY + TransMat[1][0] * Square->m_End.x + TransMat[1][1] * Square->m_End.y; + if ( draw_bgfill && Square->m_Fill == FILLED_WITH_BG_BODYCOLOR ) + { + SetColorMapPS( ReturnLayerColor( LAYER_DEVICE_BACKGROUND ) ); + PlotRect( wxPoint(x1, y1), wxPoint(x2, y2), true, 0 ); + } + if( (g_PlotFormat == PLOT_FORMAT_POST) && g_PlotPSColorOpt ) + SetColorMapPS( ReturnLayerColor( LAYER_DEVICE ) ); PlotRect( wxPoint(x1, y1), wxPoint(x2, y2), Square->m_Fill == FILLED_SHAPE ? true : false, Square->m_Width ); } break; @@ -311,6 +336,13 @@ void PlotLibPart( SCH_COMPONENT* DrawLibItem ) TransMat[1][1] * polyline->PolyList[ii * 2 + 1]; } + if ( draw_bgfill && polyline->m_Fill == FILLED_WITH_BG_BODYCOLOR ) + { + SetColorMapPS( ReturnLayerColor( LAYER_DEVICE_BACKGROUND ) ); + PlotPoly( ii, Poly, true, 0 ); + } + if( (g_PlotFormat == PLOT_FORMAT_POST) && g_PlotPSColorOpt ) + SetColorMapPS( ReturnLayerColor( LAYER_DEVICE ) ); PlotPoly( ii, Poly, polyline->m_Fill == FILLED_SHAPE ? true : false, polyline->m_Width ); MyFree( Poly ); } diff --git a/eeschema/plothpgl.cpp b/eeschema/plothpgl.cpp index 1d7ec9172f..6e0bb60f8a 100644 --- a/eeschema/plothpgl.cpp +++ b/eeschema/plothpgl.cpp @@ -205,7 +205,7 @@ void WinEDA_PlotHPGLFrame::CreateControls() SetFont( *g_DialogFont ); ////@begin WinEDA_PlotHPGLFrame content construction - // Generated by DialogBlocks, 29/04/2008 21:13:14 (unregistered) + // Generated by DialogBlocks, 23/08/2008 08:33:29 (unregistered) WinEDA_PlotHPGLFrame* itemDialog1 = this; @@ -245,19 +245,19 @@ void WinEDA_PlotHPGLFrame::CreateControls() itemStaticBoxSizer7->Add(itemStaticText8, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5); m_ButtPenWidth = new wxSpinCtrl( itemDialog1, ID_PEN_WIDTH_UPDATED, _T("1"), wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS|wxSP_WRAP, 1, 100, 1 ); - itemStaticBoxSizer7->Add(m_ButtPenWidth, 0, wxALIGN_LEFT|wxALL, 5); + itemStaticBoxSizer7->Add(m_ButtPenWidth, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxBOTTOM, 5); wxStaticText* itemStaticText10 = new wxStaticText( itemDialog1, wxID_STATIC, _("Pen Speed ( cm/s )"), wxDefaultPosition, wxDefaultSize, 0 ); itemStaticBoxSizer7->Add(itemStaticText10, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5); m_ButtPenSpeed = new wxSpinCtrl( itemDialog1, ID_PEN_SPEED_UPDATED, _T("1"), wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 1, 100, 1 ); - itemStaticBoxSizer7->Add(m_ButtPenSpeed, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5); + itemStaticBoxSizer7->Add(m_ButtPenSpeed, 0, wxALIGN_CENTER_HORIZONTAL|wxLEFT|wxRIGHT|wxBOTTOM, 5); wxStaticText* itemStaticText12 = new wxStaticText( itemDialog1, wxID_STATIC, _("Pen Number"), wxDefaultPosition, wxDefaultSize, 0 ); itemStaticBoxSizer7->Add(itemStaticText12, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5); m_ButtPenNum = new wxSpinCtrl( itemDialog1, ID_PEN_NUMBER_UPDATED, _T("1"), wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 1, 8, 1 ); - itemStaticBoxSizer7->Add(m_ButtPenNum, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5); + itemStaticBoxSizer7->Add(m_ButtPenNum, 0, wxALIGN_CENTER_HORIZONTAL|wxLEFT|wxRIGHT|wxBOTTOM, 5); wxStaticBox* itemStaticBoxSizer14Static = new wxStaticBox(itemDialog1, wxID_ANY, _("Page offset:")); wxStaticBoxSizer* itemStaticBoxSizer14 = new wxStaticBoxSizer(itemStaticBoxSizer14Static, wxVERTICAL); @@ -267,20 +267,21 @@ void WinEDA_PlotHPGLFrame::CreateControls() itemStaticBoxSizer14->Add(itemStaticText15, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5); m_PlotOrgPosition_X = new wxTextCtrl( itemDialog1, ID_TEXTCTRL1, _T(""), wxDefaultPosition, wxDefaultSize, 0 ); - itemStaticBoxSizer14->Add(m_PlotOrgPosition_X, 0, wxALIGN_LEFT|wxALL, 5); + itemStaticBoxSizer14->Add(m_PlotOrgPosition_X, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxBOTTOM, 5); wxStaticText* itemStaticText17 = new wxStaticText( itemDialog1, wxID_STATIC, _("Plot Offset Y"), wxDefaultPosition, wxDefaultSize, 0 ); itemStaticBoxSizer14->Add(itemStaticText17, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5); m_PlotOrgPosition_Y = new wxTextCtrl( itemDialog1, ID_TEXTCTRL2, _T(""), wxDefaultPosition, wxDefaultSize, 0 ); - itemStaticBoxSizer14->Add(m_PlotOrgPosition_Y, 0, wxALIGN_LEFT|wxALL, 5); + itemStaticBoxSizer14->Add(m_PlotOrgPosition_Y, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxBOTTOM, 5); itemBoxSizer3->Add(5, 5, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); wxBoxSizer* itemBoxSizer20 = new wxBoxSizer(wxVERTICAL); itemBoxSizer3->Add(itemBoxSizer20, 0, wxALIGN_TOP|wxLEFT|wxTOP|wxBOTTOM, 5); - wxButton* itemButton21 = new wxButton( itemDialog1, ID_PLOT_HPGL_CURRENT_EXECUTE, _("&Plot CURRENT"), wxDefaultPosition, wxDefaultSize, 0 ); + wxButton* itemButton21 = new wxButton( itemDialog1, ID_PLOT_HPGL_CURRENT_EXECUTE, _("&Plot Page"), wxDefaultPosition, wxDefaultSize, 0 ); + itemButton21->SetDefault(); itemButton21->SetForegroundColour(wxColour(0, 128, 0)); itemBoxSizer20->Add(itemButton21, 0, wxGROW|wxALL, 5); @@ -289,7 +290,6 @@ void WinEDA_PlotHPGLFrame::CreateControls() itemBoxSizer20->Add(itemButton22, 0, wxGROW|wxALL, 5); m_btClose = new wxButton( itemDialog1, wxID_CANCEL, _("&Close"), wxDefaultPosition, wxDefaultSize, 0 ); - m_btClose->SetDefault(); m_btClose->SetForegroundColour(wxColour(128, 0, 0)); itemBoxSizer20->Add(m_btClose, 0, wxGROW|wxALL, 5); @@ -308,7 +308,7 @@ void WinEDA_PlotHPGLFrame::CreateControls() m_ButtPenSpeed->SetValidator( wxGenericValidator(& g_HPGL_Pen_Descr.m_Pen_Speed) ); m_ButtPenNum->SetValidator( wxGenericValidator(& g_HPGL_Pen_Descr.m_Pen_Num) ); ////@end WinEDA_PlotHPGLFrame content construction - m_btClose->SetFocus(); + SetFocus(); // Make ESC key working } diff --git a/eeschema/plothpgl.pjd b/eeschema/plothpgl.pjd index 7619e6d95e..4d01b77922 100644 --- a/eeschema/plothpgl.pjd +++ b/eeschema/plothpgl.pjd @@ -136,7 +136,7 @@ 0 "" 1 - 0 + -8519680 "" "Debug" "ANSI" @@ -605,7 +605,7 @@ 5 1 1 - 1 + 0 1 0 0 @@ -745,7 +745,7 @@ 5 1 1 - 1 + 0 1 0 0 @@ -885,7 +885,7 @@ 5 1 1 - 1 + 0 1 0 0 @@ -1072,14 +1072,13 @@ 5 1 1 - 1 + 0 1 0 0 0 "" "" - 0 "wxStaticText: wxID_STATIC" @@ -1225,14 +1224,13 @@ 5 1 1 - 1 + 0 1 0 0 0 "" "" - 0 @@ -1309,8 +1307,8 @@ "" "" "" - "&Plot CURRENT" - 0 + "&Plot Page" + 1 "" "" "" @@ -1444,7 +1442,7 @@ "" "m_btClose" "&Close" - 1 + 0 "" "" "" diff --git a/eeschema/plotps.cpp b/eeschema/plotps.cpp index 7f0b0242c6..7e5bfad692 100644 --- a/eeschema/plotps.cpp +++ b/eeschema/plotps.cpp @@ -101,13 +101,11 @@ IMPLEMENT_DYNAMIC_CLASS( WinEDA_PlotPSFrame, wxDialog ) BEGIN_EVENT_TABLE( WinEDA_PlotPSFrame, wxDialog ) ////@begin WinEDA_PlotPSFrame event table entries -EVT_INIT_DIALOG( WinEDA_PlotPSFrame::OnInitDialog ) + EVT_BUTTON( ID_PLOT_PS_CURRENT_EXECUTE, WinEDA_PlotPSFrame::OnPlotPsCurrentExecuteClick ) -EVT_BUTTON( ID_PLOT_PS_CURRENT_EXECUTE, WinEDA_PlotPSFrame::OnPlotPsCurrentExecuteClick ) + EVT_BUTTON( ID_PLOT_PS_ALL_EXECUTE, WinEDA_PlotPSFrame::OnPlotPsAllExecuteClick ) -EVT_BUTTON( ID_PLOT_PS_ALL_EXECUTE, WinEDA_PlotPSFrame::OnPlotPsAllExecuteClick ) - -EVT_BUTTON( wxID_CANCEL, WinEDA_PlotPSFrame::OnCancelClick ) + EVT_BUTTON( wxID_CANCEL, WinEDA_PlotPSFrame::OnCancelClick ) ////@end WinEDA_PlotPSFrame event table entries @@ -147,24 +145,22 @@ bool WinEDA_PlotPSFrame::Create( wxWindow* parent, ////@begin WinEDA_PlotPSFrame member initialisation m_SizeOption = NULL; m_PlotPSColorOption = NULL; - m_Plot_Sheet_Ref = NULL; + m_Plot_Sheet_Ref = NULL; m_btClose = NULL; m_DefaultLineSizeCtrlSizer = NULL; m_MsgBox = NULL; - ////@end WinEDA_PlotPSFrame member initialisation ////@begin WinEDA_PlotPSFrame creation - SetExtraStyle( wxWS_EX_BLOCK_EVENTS ); + SetExtraStyle(wxWS_EX_BLOCK_EVENTS); wxDialog::Create( parent, id, caption, pos, size, style ); CreateControls(); - if( GetSizer() ) + if (GetSizer()) { - GetSizer()->SetSizeHints( this ); + GetSizer()->SetSizeHints(this); } Centre(); - ////@end WinEDA_PlotPSFrame creation return true; } @@ -179,114 +175,75 @@ void WinEDA_PlotPSFrame::CreateControls() SetFont( *g_DialogFont ); ////@begin WinEDA_PlotPSFrame content construction - // Generated by DialogBlocks, 29/04/2008 21:12:22 (unregistered) + // Generated by DialogBlocks, 23/08/2008 08:35:17 (unregistered) WinEDA_PlotPSFrame* itemDialog1 = this; - wxBoxSizer* itemBoxSizer2 = new wxBoxSizer( wxVERTICAL ); + wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL); + itemDialog1->SetSizer(itemBoxSizer2); - itemDialog1->SetSizer( itemBoxSizer2 ); - - wxBoxSizer* itemBoxSizer3 = new wxBoxSizer( wxHORIZONTAL ); - - itemBoxSizer2->Add( itemBoxSizer3, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5 ); + wxBoxSizer* itemBoxSizer3 = new wxBoxSizer(wxHORIZONTAL); + itemBoxSizer2->Add(itemBoxSizer3, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5); wxArrayString m_SizeOptionStrings; - m_SizeOptionStrings.Add( _( "Auto" ) ); - m_SizeOptionStrings.Add( _( "Page Size A4" ) ); - m_SizeOptionStrings.Add( _( "Page Size A" ) ); - m_SizeOption = new wxRadioBox( itemDialog1, ID_RADIOBOX1, _( - "Plot page size:" ), wxDefaultPosition, wxDefaultSize, - m_SizeOptionStrings, 1, - wxRA_SPECIFY_COLS ); + m_SizeOptionStrings.Add(_("Auto")); + m_SizeOptionStrings.Add(_("Page Size A4")); + m_SizeOptionStrings.Add(_("Page Size A")); + m_SizeOption = new wxRadioBox( itemDialog1, ID_RADIOBOX1, _("Plot page size:"), wxDefaultPosition, wxDefaultSize, m_SizeOptionStrings, 1, wxRA_SPECIFY_COLS ); + m_SizeOption->SetSelection(0); + itemBoxSizer3->Add(m_SizeOption, 0, wxGROW|wxALL, 5); - m_SizeOption->SetSelection( 0 ); - itemBoxSizer3->Add( m_SizeOption, 0, wxGROW | wxALL, 5 ); + itemBoxSizer3->Add(5, 5, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); - itemBoxSizer3->Add( 5, 5, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5 ); - - wxStaticBox* itemStaticBoxSizer6Static = new wxStaticBox( itemDialog1, wxID_ANY, _( - "Plot Options:" ) ); - - wxStaticBoxSizer* itemStaticBoxSizer6 = new wxStaticBoxSizer( - itemStaticBoxSizer6Static, - wxVERTICAL ); - - itemBoxSizer3->Add( itemStaticBoxSizer6, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5 ); + wxStaticBox* itemStaticBoxSizer6Static = new wxStaticBox(itemDialog1, wxID_ANY, _("Plot Options:")); + wxStaticBoxSizer* itemStaticBoxSizer6 = new wxStaticBoxSizer(itemStaticBoxSizer6Static, wxVERTICAL); + itemBoxSizer3->Add(itemStaticBoxSizer6, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); wxArrayString m_PlotPSColorOptionStrings; - m_PlotPSColorOptionStrings.Add( _( "B/W" ) ); - m_PlotPSColorOptionStrings.Add( _( "Color" ) ); - m_PlotPSColorOption = new wxRadioBox( itemDialog1, ID_RADIOBOX, _( - "Plot Color:" ), wxDefaultPosition, wxDefaultSize, - m_PlotPSColorOptionStrings, 1, - wxRA_SPECIFY_COLS ); + m_PlotPSColorOptionStrings.Add(_("B/W")); + m_PlotPSColorOptionStrings.Add(_("Color")); + m_PlotPSColorOption = new wxRadioBox( itemDialog1, ID_RADIOBOX, _("Plot Color:"), wxDefaultPosition, wxDefaultSize, m_PlotPSColorOptionStrings, 1, wxRA_SPECIFY_COLS ); + m_PlotPSColorOption->SetSelection(0); + itemStaticBoxSizer6->Add(m_PlotPSColorOption, 0, wxGROW|wxALL, 5); - m_PlotPSColorOption->SetSelection( 0 ); - itemStaticBoxSizer6->Add( m_PlotPSColorOption, 0, wxGROW | wxALL, 5 ); + m_Plot_Sheet_Ref = new wxCheckBox( itemDialog1, ID_CHECKBOX, _("Print Sheet Ref"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE ); + m_Plot_Sheet_Ref->SetValue(false); + itemStaticBoxSizer6->Add(m_Plot_Sheet_Ref, 0, wxGROW|wxALL, 5); - m_Plot_Sheet_Ref = new wxCheckBox( itemDialog1, ID_CHECKBOX, _( - "Print Sheet Ref" ), wxDefaultPosition, - wxDefaultSize, wxCHK_2STATE ); + itemBoxSizer3->Add(5, 5, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); - m_Plot_Sheet_Ref->SetValue( false ); - itemStaticBoxSizer6->Add( m_Plot_Sheet_Ref, 0, wxGROW | wxALL, 5 ); + wxBoxSizer* itemBoxSizer10 = new wxBoxSizer(wxVERTICAL); + itemBoxSizer3->Add(itemBoxSizer10, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); - itemBoxSizer3->Add( 5, 5, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5 ); + wxButton* itemButton11 = new wxButton( itemDialog1, ID_PLOT_PS_CURRENT_EXECUTE, _("&Plot Page"), wxDefaultPosition, wxDefaultSize, 0 ); + itemButton11->SetDefault(); + itemButton11->SetForegroundColour(wxColour(0, 128, 0)); + itemBoxSizer10->Add(itemButton11, 0, wxGROW|wxALL, 5); - wxBoxSizer* itemBoxSizer10 = new wxBoxSizer( wxVERTICAL ); + wxButton* itemButton12 = new wxButton( itemDialog1, ID_PLOT_PS_ALL_EXECUTE, _("Plot A&LL"), wxDefaultPosition, wxDefaultSize, 0 ); + itemButton12->SetForegroundColour(wxColour(179, 0, 0)); + itemBoxSizer10->Add(itemButton12, 0, wxGROW|wxALL, 5); - itemBoxSizer3->Add( itemBoxSizer10, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5 ); + m_btClose = new wxButton( itemDialog1, wxID_CANCEL, _("Close"), wxDefaultPosition, wxDefaultSize, 0 ); + m_btClose->SetForegroundColour(wxColour(0, 0, 255)); + itemBoxSizer10->Add(m_btClose, 0, wxGROW|wxALL, 5); - wxButton* itemButton11 = new wxButton( itemDialog1, ID_PLOT_PS_CURRENT_EXECUTE, _( - "&Plot CURRENT" ), wxDefaultPosition, - wxDefaultSize, 0 ); + m_DefaultLineSizeCtrlSizer = new wxBoxSizer(wxVERTICAL); + itemBoxSizer2->Add(m_DefaultLineSizeCtrlSizer, 0, wxGROW|wxALL, 5); - itemButton11->SetForegroundColour( wxColour( 0, 128, 0 ) ); - itemBoxSizer10->Add( itemButton11, 0, wxGROW | wxALL, 5 ); + wxStaticText* itemStaticText15 = new wxStaticText( itemDialog1, wxID_STATIC, _("Messages :"), wxDefaultPosition, wxDefaultSize, 0 ); + itemBoxSizer2->Add(itemStaticText15, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5); - wxButton* itemButton12 = new wxButton( itemDialog1, ID_PLOT_PS_ALL_EXECUTE, _( - "Plot A&LL" ), wxDefaultPosition, - wxDefaultSize, 0 ); - - itemButton12->SetForegroundColour( wxColour( 179, 0, 0 ) ); - itemBoxSizer10->Add( itemButton12, 0, wxGROW | wxALL, 5 ); - - m_btClose = new wxButton( itemDialog1, wxID_CANCEL, _( - "Close" ), wxDefaultPosition, wxDefaultSize, - 0 ); - - m_btClose->SetDefault(); - m_btClose->SetForegroundColour( wxColour( 0, 0, 255 ) ); - itemBoxSizer10->Add( m_btClose, 0, wxGROW | wxALL, 5 ); - - m_DefaultLineSizeCtrlSizer = new wxBoxSizer( wxVERTICAL ); - - itemBoxSizer2->Add( m_DefaultLineSizeCtrlSizer, 0, wxGROW | wxALL, 5 ); - - wxStaticText* itemStaticText15 = new wxStaticText( itemDialog1, wxID_STATIC, _( - "Messages :" ), wxDefaultPosition, - wxDefaultSize, 0 ); - - itemBoxSizer2->Add( itemStaticText15, - 0, - wxALIGN_LEFT | wxLEFT | wxRIGHT | wxTOP | wxADJUST_MINSIZE, - 5 ); - - m_MsgBox = new wxTextCtrl( itemDialog1, ID_TEXTCTRL, _T( - "" ), wxDefaultPosition, wxSize( -1, - 200 ), wxTE_MULTILINE ); - - itemBoxSizer2->Add( m_MsgBox, 0, wxGROW | wxALL | wxFIXED_MINSIZE, 5 ); + m_MsgBox = new wxTextCtrl( itemDialog1, ID_TEXTCTRL, _T(""), wxDefaultPosition, wxSize(-1, 200), wxTE_MULTILINE ); + itemBoxSizer2->Add(m_MsgBox, 0, wxGROW|wxALL|wxFIXED_MINSIZE, 5); // Set validators - m_SizeOption->SetValidator( wxGenericValidator( &PS_SizeSelect ) ); - m_PlotPSColorOption->SetValidator( wxGenericValidator( &g_PlotPSColorOpt ) ); - m_Plot_Sheet_Ref->SetValidator( wxGenericValidator( &Plot_Sheet_Ref ) ); - + m_SizeOption->SetValidator( wxGenericValidator(& PS_SizeSelect) ); + m_PlotPSColorOption->SetValidator( wxGenericValidator(& g_PlotPSColorOpt) ); + m_Plot_Sheet_Ref->SetValidator( wxGenericValidator(& Plot_Sheet_Ref) ); ////@end WinEDA_PlotPSFrame content construction - m_btClose->SetFocus(); + SetFocus(); // make the ESC work m_DefaultLineSizeCtrl = new WinEDA_ValueCtrl( this, _( "Default Line Width" ), g_PlotPSMinimunLineWidth, @@ -313,9 +270,8 @@ wxBitmap WinEDA_PlotPSFrame::GetBitmapResource( const wxString& name ) { // Bitmap retrieval ////@begin WinEDA_PlotPSFrame bitmap retrieval - wxUnusedVar( name ); + wxUnusedVar(name); return wxNullBitmap; - ////@end WinEDA_PlotPSFrame bitmap retrieval } @@ -328,9 +284,8 @@ wxIcon WinEDA_PlotPSFrame::GetIconResource( const wxString& name ) { // Icon retrieval ////@begin WinEDA_PlotPSFrame icon retrieval - wxUnusedVar( name ); + wxUnusedVar(name); return wxNullIcon; - ////@end WinEDA_PlotPSFrame icon retrieval } @@ -616,18 +571,3 @@ void WinEDA_PlotPSFrame::PlotOneSheetPS( const wxString& FileName, } -/*! - * wxEVT_INIT_DIALOG event handler for ID_DIALOG - */ - -void WinEDA_PlotPSFrame::OnInitDialog( wxInitDialogEvent& event ) -{ - // make the ESC work - m_SizeOption->SetFocus(); - -////@begin wxEVT_INIT_DIALOG event handler for ID_DIALOG in WinEDA_PlotPSFrame. - // Before editing this code, remove the block markers. - event.Skip(); - -////@end wxEVT_INIT_DIALOG event handler for ID_DIALOG in WinEDA_PlotPSFrame. -} diff --git a/eeschema/plotps.h b/eeschema/plotps.h index cad3ed5797..89bb992b24 100644 --- a/eeschema/plotps.h +++ b/eeschema/plotps.h @@ -83,9 +83,6 @@ public: ////@begin WinEDA_PlotPSFrame event handler declarations - /// wxEVT_INIT_DIALOG event handler for ID_DIALOG - void OnInitDialog( wxInitDialogEvent& event ); - /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_PLOT_PS_CURRENT_EXECUTE void OnPlotPsCurrentExecuteClick( wxCommandEvent& event ); diff --git a/eeschema/plotps.pjd b/eeschema/plotps.pjd index 698061494d..a8e432766d 100644 --- a/eeschema/plotps.pjd +++ b/eeschema/plotps.pjd @@ -221,7 +221,6 @@ "" 0 0 - "wxEVT_INIT_DIALOG|OnInitDialog|NONE||WinEDA_PlotPSFrame" "ID_DIALOG" 10000 "WinEDA_PlotPSFrame" @@ -649,8 +648,8 @@ "" "" "" - "&Plot CURRENT" - 0 + "&Plot Page" + 1 "" "" "" @@ -784,7 +783,7 @@ "" "m_btClose" "Close" - 1 + 0 "" "" "" @@ -1007,7 +1006,6 @@ 1 "" "" - 0 diff --git a/internat/fr/kicad.mo b/internat/fr/kicad.mo index 993a4478c7..1c8f8234df 100644 Binary files a/internat/fr/kicad.mo and b/internat/fr/kicad.mo differ diff --git a/internat/fr/kicad.po b/internat/fr/kicad.po index c9ad74232f..e9d0017857 100644 --- a/internat/fr/kicad.po +++ b/internat/fr/kicad.po @@ -3,7 +3,7 @@ msgstr "" "Project-Id-Version: kicad\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2008-08-17 18:59+0100\n" -"PO-Revision-Date: 2008-08-22 14:10+0100\n" +"PO-Revision-Date: 2008-08-22 19:31+0100\n" "Last-Translator: \n" "Language-Team: kicad team \n" "MIME-Version: 1.0\n" @@ -8080,7 +8080,7 @@ msgstr "Imprimer cartouche" #: eeschema/plotps.cpp:242 #: eeschema/plothpgl.cpp:283 msgid "&Plot CURRENT" -msgstr "&Imprimer courant" +msgstr "&Tracer courant" #: eeschema/plotps.cpp:249 #: eeschema/plothpgl.cpp:287 @@ -9432,7 +9432,6 @@ msgid "PCBnew (PCB editor)" msgstr "PCBnew (Editeur de circuits imprimés)" #: kicad/commandframe.cpp:70 -#, fuzzy msgid "GerbView (Gerber viewer)" msgstr "GerbView (Visualisateur Gerber)" diff --git a/share/svg_print.cpp b/share/svg_print.cpp index 109c703e5c..3910832cb9 100644 --- a/share/svg_print.cpp +++ b/share/svg_print.cpp @@ -49,6 +49,11 @@ ////@begin XPM images ////@end XPM images + +// Keys for configuration +#define PLOTSVGPENWIDTH_KEY wxT( "PlotSVGPenWidth") +#define PLOTSVGMODECOLOR_KEY wxT( "PlotSVGModeColor" ) + extern BASE_SCREEN* ActiveScreen; #ifdef EESCHEMA #define WIDTH_MAX_VALUE 100 @@ -102,13 +107,13 @@ IMPLEMENT_DYNAMIC_CLASS( WinEDA_PrintSVGFrame, wxDialog ) BEGIN_EVENT_TABLE( WinEDA_PrintSVGFrame, wxDialog ) ////@begin WinEDA_PrintSVGFrame event table entries -EVT_CLOSE( WinEDA_PrintSVGFrame::OnCloseWindow ) + EVT_CLOSE( WinEDA_PrintSVGFrame::OnCloseWindow ) -EVT_RADIOBOX( ID_RADIOBOX_SETPRINTMODE, WinEDA_PrintSVGFrame::OnRadioboxSetprintmodeSelected ) + EVT_RADIOBOX( ID_RADIOBOX_SETPRINTMODE, WinEDA_PrintSVGFrame::OnRadioboxSetprintmodeSelected ) -EVT_BUTTON( ID_PRINT_EXECUTE, WinEDA_PrintSVGFrame::OnPrintExecuteClick ) + EVT_BUTTON( ID_PRINT_EXECUTE, WinEDA_PrintSVGFrame::OnPrintExecuteClick ) -EVT_BUTTON( wxID_CLOSE, WinEDA_PrintSVGFrame::OnCloseClick ) + EVT_BUTTON( wxID_CANCEL, WinEDA_PrintSVGFrame::OnCancelClick ) ////@end WinEDA_PrintSVGFrame event table entries @@ -135,8 +140,8 @@ WinEDA_PrintSVGFrame::WinEDA_PrintSVGFrame( WinEDA_DrawFrame* parent, wxConfig* Config = m_Parent->m_Parent->m_EDA_Config; if( Config ) { - Config->Read( wxT( "PlotSVGPenWidth" ), &s_SVGPenMinWidth ); - Config->Read( wxT( "PlotSVGModeColor" ), &s_PlotBlackAndWhite ); + Config->Read( PLOTSVGPENWIDTH_KEY, &s_SVGPenMinWidth ); + Config->Read( PLOTSVGMODECOLOR_KEY, &s_PlotBlackAndWhite ); } Create( parent, id, caption, pos, size, style ); @@ -158,23 +163,21 @@ bool WinEDA_PrintSVGFrame::Create( wxWindow* parent, m_DialogPenWidthSizer = NULL; m_ModeColorOption = NULL; m_Print_Sheet_Ref = NULL; - m_PagesOption = NULL; + m_PagesOption = NULL; m_FileNameCtrl = NULL; - m_MessagesBox = NULL; - + m_MessagesBox = NULL; ////@end WinEDA_PrintSVGFrame member initialisation ////@begin WinEDA_PrintSVGFrame creation - SetExtraStyle( GetExtraStyle() | wxWS_EX_BLOCK_EVENTS ); + SetExtraStyle(wxWS_EX_BLOCK_EVENTS); wxDialog::Create( parent, id, caption, pos, size, style ); CreateControls(); - if( GetSizer() ) + if (GetSizer()) { - GetSizer()->SetSizeHints( this ); + GetSizer()->SetSizeHints(this); } Centre(); - ////@end WinEDA_PrintSVGFrame creation return true; } @@ -189,114 +192,72 @@ void WinEDA_PrintSVGFrame::CreateControls() SetFont( *g_DialogFont ); ////@begin WinEDA_PrintSVGFrame content construction - // Generated by DialogBlocks, 24/01/2007 19:00:23 (unregistered) + // Generated by DialogBlocks, 23/08/2008 08:56:55 (unregistered) WinEDA_PrintSVGFrame* itemDialog1 = this; - wxBoxSizer* itemBoxSizer2 = new wxBoxSizer( wxVERTICAL ); + wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL); + itemDialog1->SetSizer(itemBoxSizer2); - itemDialog1->SetSizer( itemBoxSizer2 ); + wxBoxSizer* itemBoxSizer3 = new wxBoxSizer(wxHORIZONTAL); + itemBoxSizer2->Add(itemBoxSizer3, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5); - wxBoxSizer* itemBoxSizer3 = new wxBoxSizer( wxHORIZONTAL ); + wxBoxSizer* itemBoxSizer4 = new wxBoxSizer(wxVERTICAL); + itemBoxSizer3->Add(itemBoxSizer4, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); - itemBoxSizer2->Add( itemBoxSizer3, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5 ); + m_DialogPenWidthSizer = new wxBoxSizer(wxVERTICAL); + itemBoxSizer4->Add(m_DialogPenWidthSizer, 0, wxGROW|wxALL, 5); - wxBoxSizer* itemBoxSizer4 = new wxBoxSizer( wxVERTICAL ); + wxArrayString m_ModeColorOptionStrings; + m_ModeColorOptionStrings.Add(_("Color")); + m_ModeColorOptionStrings.Add(_("Black and White")); + m_ModeColorOption = new wxRadioBox( itemDialog1, ID_RADIOBOX_SETPRINTMODE, _("Print mode"), wxDefaultPosition, wxDefaultSize, m_ModeColorOptionStrings, 1, wxRA_SPECIFY_COLS ); + m_ModeColorOption->SetSelection(0); + itemBoxSizer4->Add(m_ModeColorOption, 0, wxGROW|wxALL, 5); - itemBoxSizer3->Add( itemBoxSizer4, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5 ); + m_Print_Sheet_Ref = new wxCheckBox( itemDialog1, ID_CHECKBOX, _("Print Sheet Ref"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE ); + m_Print_Sheet_Ref->SetValue(false); + itemBoxSizer4->Add(m_Print_Sheet_Ref, 0, wxALIGN_LEFT|wxALL, 5); - m_DialogPenWidthSizer = new wxBoxSizer( wxVERTICAL ); + itemBoxSizer3->Add(5, 5, 0, wxALIGN_CENTER_VERTICAL|wxALL, 15); - itemBoxSizer4->Add( m_DialogPenWidthSizer, 0, wxGROW | wxALL, 5 ); + wxBoxSizer* itemBoxSizer9 = new wxBoxSizer(wxVERTICAL); + itemBoxSizer3->Add(itemBoxSizer9, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); - wxString m_ModeColorOptionStrings[] = { - _( "Color" ), - _( "Black and White" ) - }; - m_ModeColorOption = new wxRadioBox( itemDialog1, ID_RADIOBOX_SETPRINTMODE, _( - "Print mode" ), wxDefaultPosition, wxDefaultSize, 2, - m_ModeColorOptionStrings, 1, - wxRA_SPECIFY_COLS ); - - m_ModeColorOption->SetSelection( 0 ); - itemBoxSizer4->Add( m_ModeColorOption, 0, wxALIGN_LEFT | wxALL, 5 ); - - m_Print_Sheet_Ref = new wxCheckBox( itemDialog1, ID_CHECKBOX, _( - "Print Sheet Ref" ), wxDefaultPosition, wxDefaultSize, - wxCHK_2STATE ); - - m_Print_Sheet_Ref->SetValue( false ); - itemBoxSizer4->Add( m_Print_Sheet_Ref, 0, wxALIGN_LEFT | wxALL, 5 ); - - itemBoxSizer3->Add( 5, 5, 0, wxALIGN_CENTER_VERTICAL | wxALL, 15 ); - - wxBoxSizer* itemBoxSizer9 = new wxBoxSizer( wxVERTICAL ); - - itemBoxSizer3->Add( itemBoxSizer9, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5 ); - - wxString m_PagesOptionStrings[] = { - _( "Current" ), - _( "All" ) - }; - m_PagesOption = new wxRadioBox( itemDialog1, ID_RADIOBOX1, _( - "Page Print:" ), wxDefaultPosition, - wxDefaultSize, 2, m_PagesOptionStrings, 1, - wxRA_SPECIFY_COLS ); - - m_PagesOption->SetSelection( 0 ); - itemBoxSizer9->Add( m_PagesOption, 0, wxALIGN_LEFT | wxALL, 5 ); - - wxButton* itemButton11 = new wxButton( itemDialog1, ID_PRINT_EXECUTE, _( - "Create &File" ), wxDefaultPosition, - wxDefaultSize, 0 ); + wxArrayString m_PagesOptionStrings; + m_PagesOptionStrings.Add(_("Current")); + m_PagesOptionStrings.Add(_("All")); + m_PagesOption = new wxRadioBox( itemDialog1, ID_RADIOBOX1, _("Page Print:"), wxDefaultPosition, wxDefaultSize, m_PagesOptionStrings, 1, wxRA_SPECIFY_COLS ); + m_PagesOption->SetSelection(0); + itemBoxSizer9->Add(m_PagesOption, 0, wxALIGN_LEFT|wxALL, 5); + wxButton* itemButton11 = new wxButton( itemDialog1, ID_PRINT_EXECUTE, _("Create &File"), wxDefaultPosition, wxDefaultSize, 0 ); itemButton11->SetDefault(); - itemButton11->SetForegroundColour( wxColour( 0, 128, 0 ) ); - itemBoxSizer9->Add( itemButton11, 0, wxGROW | wxALL, 5 ); + itemButton11->SetForegroundColour(wxColour(0, 128, 0)); + itemBoxSizer9->Add(itemButton11, 0, wxGROW|wxALL, 5); - wxButton* itemButton12 = new wxButton( itemDialog1, wxID_CLOSE, _( - "&Close" ), wxDefaultPosition, - wxDefaultSize, 0 ); + wxButton* itemButton12 = new wxButton( itemDialog1, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0 ); + itemButton12->SetForegroundColour(wxColour(0, 0, 198)); + itemBoxSizer9->Add(itemButton12, 0, wxGROW|wxALL, 5); - itemButton12->SetForegroundColour( wxColour( 0, 0, 198 ) ); - itemBoxSizer9->Add( itemButton12, 0, wxGROW | wxALL, 5 ); + wxStaticText* itemStaticText13 = new wxStaticText( itemDialog1, wxID_STATIC, _("Filename:"), wxDefaultPosition, wxDefaultSize, 0 ); + itemBoxSizer2->Add(itemStaticText13, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5); - wxStaticText* itemStaticText13 = new wxStaticText( itemDialog1, wxID_STATIC, _( - "Filename:" ), wxDefaultPosition, - wxDefaultSize, 0 ); + m_FileNameCtrl = new wxTextCtrl( itemDialog1, ID_TEXTCTRL, _T(""), wxDefaultPosition, wxDefaultSize, 0 ); + itemBoxSizer2->Add(m_FileNameCtrl, 0, wxGROW|wxLEFT|wxRIGHT|wxBOTTOM, 5); - itemBoxSizer2->Add( itemStaticText13, - 0, - wxALIGN_LEFT | wxLEFT | wxRIGHT | wxTOP | wxADJUST_MINSIZE, - 5 ); + wxStaticText* itemStaticText15 = new wxStaticText( itemDialog1, wxID_STATIC, _("Messages:"), wxDefaultPosition, wxDefaultSize, 0 ); + itemBoxSizer2->Add(itemStaticText15, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5); - m_FileNameCtrl = new wxTextCtrl( itemDialog1, ID_TEXTCTRL, _T( - "" ), wxDefaultPosition, wxDefaultSize, - 0 ); - - itemBoxSizer2->Add( m_FileNameCtrl, 0, wxGROW | wxALL, 5 ); - - wxStaticText* itemStaticText15 = new wxStaticText( itemDialog1, wxID_STATIC, _( - "Messages:" ), wxDefaultPosition, - wxDefaultSize, 0 ); - - itemBoxSizer2->Add( itemStaticText15, - 0, - wxALIGN_LEFT | wxLEFT | wxRIGHT | wxTOP | wxADJUST_MINSIZE, - 5 ); - - m_MessagesBox = new wxTextCtrl( itemDialog1, ID_TEXTCTRL1, _T( - "" ), wxDefaultPosition, wxSize( -1, - 100 ), wxTE_MULTILINE | wxTE_READONLY ); - - itemBoxSizer2->Add( m_MessagesBox, 0, wxGROW | wxALL, 5 ); + m_MessagesBox = new wxTextCtrl( itemDialog1, ID_TEXTCTRL1, _T(""), wxDefaultPosition, wxSize(-1, 100), wxTE_MULTILINE|wxTE_READONLY ); + itemBoxSizer2->Add(m_MessagesBox, 0, wxGROW|wxLEFT|wxRIGHT|wxBOTTOM, 5); // Set validators - m_ModeColorOption->SetValidator( wxGenericValidator( &s_PlotBlackAndWhite ) ); - m_Print_Sheet_Ref->SetValidator( wxGenericValidator( &Print_Sheet_Ref ) ); - + m_ModeColorOption->SetValidator( wxGenericValidator(& s_PlotBlackAndWhite) ); + m_Print_Sheet_Ref->SetValidator( wxGenericValidator(& Print_Sheet_Ref) ); ////@end WinEDA_PrintSVGFrame content construction + SetFocus(); // Make ESC key working m_DialogPenWidth = new WinEDA_ValueCtrl( this, _( "Pen width mini" ), s_SVGPenMinWidth, g_UnitMetric, m_DialogPenWidthSizer, @@ -322,9 +283,8 @@ wxBitmap WinEDA_PrintSVGFrame::GetBitmapResource( const wxString& name ) { // Bitmap retrieval ////@begin WinEDA_PrintSVGFrame bitmap retrieval - wxUnusedVar( name ); + wxUnusedVar(name); return wxNullBitmap; - ////@end WinEDA_PrintSVGFrame bitmap retrieval } @@ -337,9 +297,8 @@ wxIcon WinEDA_PrintSVGFrame::GetIconResource( const wxString& name ) { // Icon retrieval ////@begin WinEDA_PrintSVGFrame icon retrieval - wxUnusedVar( name ); + wxUnusedVar(name); return wxNullIcon; - ////@end WinEDA_PrintSVGFrame icon retrieval } @@ -540,9 +499,9 @@ void WinEDA_PrintSVGFrame::OnPrintExecuteClick( wxCommandEvent& event ) * wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CLOSE */ -void WinEDA_PrintSVGFrame::OnCloseClick( wxCommandEvent& event ) +void WinEDA_PrintSVGFrame::OnCancelClick( wxCommandEvent& event ) { - Close( TRUE ); + Close( ); } @@ -557,10 +516,10 @@ void WinEDA_PrintSVGFrame::OnCloseWindow( wxCloseEvent& event ) if( Config ) { s_PlotBlackAndWhite = m_ModeColorOption->GetSelection(); - Config->Write( wxT( "PlotSVGPenWidth" ), s_SVGPenMinWidth ); - Config->Write( wxT( "PlotSVGModeColor" ), s_PlotBlackAndWhite ); + Config->Write( PLOTSVGPENWIDTH_KEY, s_SVGPenMinWidth ); + Config->Write( PLOTSVGMODECOLOR_KEY, s_PlotBlackAndWhite ); } - event.Skip(); + EndModal( 0 ); } diff --git a/share/svg_print.h b/share/svg_print.h index 35b404a6e9..14c67b9d9d 100644 --- a/share/svg_print.h +++ b/share/svg_print.h @@ -97,8 +97,8 @@ public: /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_PRINT_EXECUTE void OnPrintExecuteClick( wxCommandEvent& event ); - /// wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CLOSE - void OnCloseClick( wxCommandEvent& event ); + /// wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL + void OnCancelClick( wxCommandEvent& event ); ////@end WinEDA_PrintSVGFrame event handler declarations diff --git a/share/svg_print.pjd b/share/svg_print.pjd index c589943aba..d71121f18e 100644 --- a/share/svg_print.pjd +++ b/share/svg_print.pjd @@ -1,4 +1,4 @@ - +
0 @@ -6,13 +6,14 @@ "" "" "" - 23 "" 0 0 0 + 1 1 1 + 1 0 "jean-pierre Charras" "License GNU" @@ -44,12 +45,6 @@ // Licence: ///////////////////////////////////////////////////////////////////////////// -" - " -/*! - * %BODY% - */ - " "///////////////////////////////////////////////////////////////////////////// // Name: %SYMBOLS-FILENAME% @@ -83,6 +78,14 @@ #include "wx/wx.h" #endif +" + " /// %BODY% +" + " +/*! + * %BODY% + */ + " "app_resources.h" "app_resources.cpp" @@ -94,6 +97,7 @@ "" "<None>" "<System>" + "utf-8" "<System>" "" 0 @@ -104,9 +108,12 @@ 0 0 1 + 0 1 1 + 0 1 + 0
@@ -129,6 +136,7 @@ 0 "" 1 + -8519680 "" "Debug" "ANSI" @@ -170,6 +178,8 @@ "%AUTO%" "%AUTO%" "%AUTO%" + 0 + 1 @@ -183,7 +193,7 @@ 1 1 0 - 0 + 1 "Windows" "html-document" @@ -207,8 +217,11 @@ 10000 0 "" + 0 + "" 0 - "wxEVT_CLOSE_WINDOW|OnCloseWindow" + 0 + "wxEVT_CLOSE_WINDOW|OnCloseWindow|||" "ID_DIALOG" 10000 "WinEDA_PrintSVGFrame" @@ -229,10 +242,16 @@ 0 1 "<Any platform>" + "" + "" + "" + "" + "" + "" + "Tiled" 0 1 0 - 0 1 0 0 @@ -261,6 +280,7 @@ -1 400 300 + 0 "" "wxBoxSizer V" @@ -337,7 +357,7 @@ 1 0 0 - "24/1/2007" + "23/8/2008" "wbBoxSizerProxy" "Vertical" "m_DialogPenWidthSizer" @@ -368,7 +388,13 @@ "wxEVT_COMMAND_RADIOBOX_SELECTED|OnRadioboxSetprintmodeSelected" "ID_RADIOBOX_SETPRINTMODE" 10007 + "" "wxRadioBox" + "wxRadioBox" + 1 + 0 + "" + "" "m_ModeColorOption" "Print mode" 1 @@ -384,6 +410,11 @@ "<Any platform>" "s_PlotBlackAndWhite" "wxGenericValidator(& %VARIABLE%)" + "" + "" + "" + "" + "" 0 1 0 @@ -394,7 +425,7 @@ -1 -1 -1 - "Left" + "Expand" "Centre" 0 5 @@ -421,7 +452,13 @@ "wbCheckBoxProxy" "ID_CHECKBOX" 10004 + "" "wxCheckBox" + "wxCheckBox" + 1 + 0 + "" + "" "m_Print_Sheet_Ref" "Print Sheet Ref" 0 @@ -429,6 +466,11 @@ "" "Print_Sheet_Ref" "wxGenericValidator(& %VARIABLE%)" + "" + "" + "" + "" + "" "" "" "" @@ -526,7 +568,13 @@ "wbRadioBoxProxy" "ID_RADIOBOX1" 10008 + "" "wxRadioBox" + "wxRadioBox" + 1 + 0 + "" + "" "m_PagesOption" "Page Print:" 1 @@ -542,6 +590,11 @@ "<Any platform>" "" "" + "" + "" + "" + "" + "" 0 1 0 @@ -580,12 +633,25 @@ "wxEVT_COMMAND_BUTTON_CLICKED|OnPrintExecuteClick" "ID_PRINT_EXECUTE" 10002 + "" "wxButton" + "wxButton" + 1 + 0 + "" + "" "" "Create &File" 1 "" "" + "" + "" + "" + "" + "" + "" + "" "" "008000" "" @@ -621,7 +687,7 @@ "" - "wxButton: wxID_CLOSE" + "wxButton: wxID_CANCEL" "dialog-control-document" "" "dialogcontrol" @@ -631,15 +697,28 @@ 0 "5/7/2006" "wbButtonProxy" - "wxEVT_COMMAND_BUTTON_CLICKED|OnCloseClick" - "wxID_CLOSE" - 5001 + "wxEVT_COMMAND_BUTTON_CLICKED|OnCancelClick|||WinEDA_PrintSVGFrame" + "wxID_CANCEL" + 5101 + "" "wxButton" + "wxButton" + 1 + 0 + "" + "" "" - "&Close" + "Cancel" 0 "" "" + "" + "" + "" + "" + "" + "" + "" "" "0000C6" "" @@ -689,7 +768,13 @@ "wbStaticTextProxy" "wxID_STATIC" 5105 + "" "wxStaticText" + "wxStaticText" + 1 + 0 + "" + "" "" "Filename:" -1 @@ -703,6 +788,11 @@ "<Any platform>" "" "" + "" + "" + "" + "" + "" 0 0 0 @@ -748,7 +838,13 @@ "wbTextCtrlProxy" "ID_TEXTCTRL" 10001 + "" "wxTextCtrl" + "wxTextCtrl" + 1 + 0 + "" + "" "m_FileNameCtrl" "" 0 @@ -762,6 +858,11 @@ "<Any platform>" "" "" + "" + "" + "" + "" + "" 0 0 0 @@ -775,8 +876,9 @@ 0 0 0 - 0 + 0 0 + 0 0 0 0 @@ -797,7 +899,7 @@ 5 1 1 - 1 + 0 1 0 0 @@ -818,7 +920,13 @@ "wbStaticTextProxy" "wxID_STATIC" 5105 + "" "wxStaticText" + "wxStaticText" + 1 + 0 + "" + "" "" "Messages:" -1 @@ -832,6 +940,11 @@ "<Any platform>" "" "" + "" + "" + "" + "" + "" 0 0 0 @@ -877,7 +990,13 @@ "wbTextCtrlProxy" "ID_TEXTCTRL1" 10006 + "" "wxTextCtrl" + "wxTextCtrl" + 1 + 0 + "" + "" "m_MessagesBox" "" 0 @@ -891,6 +1010,11 @@ "<Any platform>" "" "" + "" + "" + "" + "" + "" 1 0 0 @@ -904,8 +1028,9 @@ 0 0 0 - 0 + 0 0 + 0 0 0 0 @@ -926,7 +1051,7 @@ 5 1 1 - 1 + 0 1 0 0 diff --git a/share/wxprint.cpp b/share/wxprint.cpp index ad8e2f7b5c..0c6e40db25 100644 --- a/share/wxprint.cpp +++ b/share/wxprint.cpp @@ -172,9 +172,6 @@ void WinEDA_DrawFrame::ToPrinter( wxCommandEvent& event ) WinEDA_PrintFrame* frame = new WinEDA_PrintFrame( this ); frame->ShowModal(); frame->Destroy(); -#ifdef EESCHEMA - g_PrintFillMask = 0; -#endif } @@ -783,10 +780,7 @@ void EDA_Printout::DrawPage() panel->m_ClipBox.SetSize( wxSize( 0x7FFFFF0, 0x7FFFFF0 ) ); g_IsPrinting = TRUE; -#ifdef EESCHEMA - if( s_Print_Black_and_White ) - g_PrintFillMask = FILLED_WITH_BG_BODYCOLOR; -#endif + #ifdef PCBNEW if( m_Print_Sheet_Ref ) m_Parent->TraceWorkSheet( dc, ActiveScreen, 0 ); @@ -832,10 +826,6 @@ void EDA_Printout::DrawPage() panel->PrintPage( dc, m_Print_Sheet_Ref, s_PrintMaskLayer ); #endif -#ifdef EESCHEMA - g_PrintFillMask = 0; -#endif - g_IsPrinting = FALSE; panel->m_ClipBox = tmp;