diff --git a/common/common.cpp b/common/common.cpp index 1e61aa1878..9604cc6411 100644 --- a/common/common.cpp +++ b/common/common.cpp @@ -31,10 +31,8 @@ Ki_PageDescr g_Sheet_B( wxSize( 17000, 11000 ), wxPoint( 0, 0 ), wxT( "B" ) ); Ki_PageDescr g_Sheet_C( wxSize( 22000, 17000 ), wxPoint( 0, 0 ), wxT( "C" ) ); Ki_PageDescr g_Sheet_D( wxSize( 34000, 22000 ), wxPoint( 0, 0 ), wxT( "D" ) ); Ki_PageDescr g_Sheet_E( wxSize( 44000, 34000 ), wxPoint( 0, 0 ), wxT( "E" ) ); -Ki_PageDescr g_Sheet_GERBER( wxSize( 32000, 32000 ), wxPoint( 0, 0 ), - wxT( "GERBER" ) ); -Ki_PageDescr g_Sheet_user( wxSize( 17000, 11000 ), wxPoint( 0, 0 ), - wxT( "User" ) ); +Ki_PageDescr g_Sheet_GERBER( wxSize( 32000, 32000 ), wxPoint( 0, 0 ), wxT( "GERBER" ) ); +Ki_PageDescr g_Sheet_user( wxSize( 17000, 11000 ), wxPoint( 0, 0 ), wxT( "User" ) ); Ki_PageDescr* g_SheetSizeList[NB_ITEMS + 1] = { diff --git a/gerbview/CMakeLists.txt b/gerbview/CMakeLists.txt index cb3438fd02..caf3cde0fe 100644 --- a/gerbview/CMakeLists.txt +++ b/gerbview/CMakeLists.txt @@ -18,6 +18,8 @@ set(GERBVIEW_SRCS files.cpp gerberframe.cpp gerbview_config.cpp + gerbview_dialog_display_options_frame_base.cpp + gerbview_dialog_display_options_frame.cpp gerbview.cpp hotkeys.cpp initpcb.cpp diff --git a/gerbview/edit.cpp b/gerbview/edit.cpp index a0a2cb4db5..a48c25b1e5 100644 --- a/gerbview/edit.cpp +++ b/gerbview/edit.cpp @@ -1,10 +1,11 @@ -/***********************************/ -/* edit.cpp: PCB editing functions */ -/***********************************/ +/***************************************/ +/* edit.cpp: Gerbview events functions */ +/***************************************/ #include "fctsys.h" #include "class_drawpanel.h" #include "confirm.h" +#include "common.h" #include "gestfich.h" #include "appl_wxstruct.h" diff --git a/gerbview/gerberframe.cpp b/gerbview/gerberframe.cpp index 851b7d630c..e30dac27c1 100644 --- a/gerbview/gerberframe.cpp +++ b/gerbview/gerberframe.cpp @@ -51,14 +51,14 @@ BEGIN_EVENT_TABLE( WinEDA_GerberFrame, WinEDA_BasePcbFrame ) EVT_MENU( ID_EXIT, WinEDA_GerberFrame::Process_Special_Functions ) -// menu Config +// menu Preferences EVT_MENU_RANGE( ID_CONFIG_AND_PREFERENCES_START, ID_CONFIG_AND_PREFERENCES_END, WinEDA_GerberFrame::Process_Config ) EVT_MENU( ID_COLORS_SETUP, WinEDA_GerberFrame::Process_Config ) - EVT_MENU( ID_OPTIONS_SETUP, WinEDA_GerberFrame::Process_Config ) - EVT_MENU( ID_PCB_DISPLAY_OPTIONS_SETUP, WinEDA_GerberFrame::Process_Config ) + EVT_MENU( ID_OPTIONS_SETUP, WinEDA_GerberFrame::InstallGerberGeneralOptionsFrame ) + EVT_MENU( ID_PCB_DISPLAY_OPTIONS_SETUP, WinEDA_GerberFrame::InstallGerberDisplayOptionsDialog ) EVT_MENU_RANGE( ID_LANGUAGE_CHOICE, ID_LANGUAGE_CHOICE_END, WinEDA_DrawFrame::SetLanguage ) @@ -331,3 +331,54 @@ int WinEDA_GerberFrame::BestZoom() return wxRound( MAX( x, y ) * (double) GetScreen()->m_ZoomScalar ); } + +/**************************************/ +void WinEDA_GerberFrame::LoadSettings() +/**************************************/ +{ + wxConfig* config = wxGetApp().m_EDA_Config; + + if( config == NULL ) + return; + + WinEDA_BasePcbFrame::LoadSettings(); + long pageSize_opt; + config->Read( GerbviewShowPageSizeOption, &pageSize_opt, 0l ); + int imax = 0; + for( ; g_GerberPageSizeList[imax] != NULL; imax++ ); + if( pageSize_opt < 0 || pageSize_opt >= imax ) + pageSize_opt = 0; + GetScreen()->m_CurrentSheetDesc = g_GerberPageSizeList[pageSize_opt]; + if ( pageSize_opt > 0 ) + { + m_Draw_Sheet_Ref = true; + } +} + +/**************************************/ +void WinEDA_GerberFrame::SaveSettings() +/**************************************/ +{ + wxConfig* config = wxGetApp().m_EDA_Config; + + if( config == NULL ) + return; + + WinEDA_BasePcbFrame::SaveSettings(); + + wxRealPoint GridSize = GetScreen()->GetGridSize(); + + long pageSize_opt = 0; + if( m_Draw_Sheet_Ref ) + { + for( int ii = 1; g_GerberPageSizeList[ii] != NULL; ii++ ) + { + if( GetScreen()->m_CurrentSheetDesc == g_GerberPageSizeList[ii] ) + { + pageSize_opt = ii; + break; + } + } + } + config->Write( GerbviewShowPageSizeOption, pageSize_opt ); +} diff --git a/gerbview/gerbview.cpp b/gerbview/gerbview.cpp index 6c94e7569a..59c32addca 100644 --- a/gerbview/gerbview.cpp +++ b/gerbview/gerbview.cpp @@ -30,8 +30,25 @@ int g_Default_GERBER_Format; int g_Plot_Spot_Mini; /* Diameter of the opening mini-track for GERBER. */ int g_DisplayPolygonsModeSketch; + +const wxString GerbviewProjectFileExt( wxT( "cnf" ) ); +const wxString GerbviewProjectFileWildcard( _( "GerbView project files (.cnf)|*.cnf" ) ); + +// Config keywords +const wxString GerbviewShowPageSizeOption( wxT( "ShowPageSizeOpt" ) ); + GERBER* g_GERBER_List[32]; +// List of page sizes +Ki_PageDescr* g_GerberPageSizeList[] = +{ + &g_Sheet_GERBER, // Full size page selection, and do not show page limits + &g_Sheet_GERBER, // Full size page selection, and show page limits + &g_Sheet_A4, &g_Sheet_A3, &g_Sheet_A2, + &g_Sheet_A, &g_Sheet_B, &g_Sheet_C, + NULL // End of list + }; + IMPLEMENT_APP( WinEDA_App ) diff --git a/gerbview/gerbview.h b/gerbview/gerbview.h index bb6d826407..a36e67d5d6 100644 --- a/gerbview/gerbview.h +++ b/gerbview/gerbview.h @@ -36,6 +36,13 @@ extern int g_Default_GERBER_Format; extern int g_Plot_Spot_Mini; /* Diameter of the opening mini-track for * GERBER */ +extern const wxString GerbviewProjectFileExt; +extern const wxString GerbviewProjectFileWildcard; + +extern Ki_PageDescr* g_GerberPageSizeList[]; + +// Config keywords +extern const wxString GerbviewShowPageSizeOption; /** * Enum APERTURE_T diff --git a/gerbview/gerbview_config.cpp b/gerbview/gerbview_config.cpp index 6e54532aa5..bb994337c1 100644 --- a/gerbview/gerbview_config.cpp +++ b/gerbview/gerbview_config.cpp @@ -21,10 +21,6 @@ #define HOTKEY_FILENAME wxT( "gerbview" ) -const wxString GerbviewProjectFileExt( wxT( "cnf" ) ); -const wxString GerbviewProjectFileWildcard( _( "GerbView project files (.cnf)|*.cnf" ) ); - - void WinEDA_GerberFrame::Process_Config( wxCommandEvent& event ) { int id = event.GetId(); @@ -47,11 +43,6 @@ void WinEDA_GerberFrame::Process_Config( wxCommandEvent& event ) break; } - case ID_PCB_DISPLAY_OPTIONS_SETUP: - case ID_OPTIONS_SETUP: - InstallGerberOptionsFrame( pos, id ); - break; - case ID_CONFIG_SAVE: Update_config(); break; diff --git a/gerbview/gerbview_dialog_display_options_frame.cpp b/gerbview/gerbview_dialog_display_options_frame.cpp new file mode 100644 index 0000000000..7cb7f6088e --- /dev/null +++ b/gerbview/gerbview_dialog_display_options_frame.cpp @@ -0,0 +1,132 @@ +/* + * file gerbview_dialog_display_options_frame.cpp + * Set the display options for Gerbview + */ + + +#include "fctsys.h" +#include "common.h" +#include "class_drawpanel.h" + +#include "pcbplot.h" +#include "gerbview.h" +#include "gerbview_dialog_display_options_frame_base.h" + + +/*******************************************/ +/* Dialog frame to select display options */ +/*******************************************/ +class DIALOG_DISPLAY_OPTIONS : public DIALOG_DISPLAY_OPTIONS_BASE +{ +private: + WinEDA_BasePcbFrame* m_Parent; + +public: + + DIALOG_DISPLAY_OPTIONS( WinEDA_BasePcbFrame* parent ); + ~DIALOG_DISPLAY_OPTIONS() {}; + +private: + void OnOKBUttonClick( wxCommandEvent& event ); + void OnCancelButtonClick( wxCommandEvent& event ); +}; + + +void WinEDA_GerberFrame::InstallGerberDisplayOptionsDialog( wxCommandEvent& event ) +{ + DIALOG_DISPLAY_OPTIONS dlg( this ); + int opt = dlg.ShowModal(); + if (opt > 0 ) + DrawPanel->Refresh(); +} + +DIALOG_DISPLAY_OPTIONS::DIALOG_DISPLAY_OPTIONS( WinEDA_BasePcbFrame *parent) : + DIALOG_DISPLAY_OPTIONS_BASE( parent, wxID_ANY ) +{ + m_Parent = parent; + SetFocus(); + + // Show Option Draw Lines + if( DisplayOpt.DisplayPcbTrackFill ) // We use DisplayPcbTrackFill as Lines draw option + m_OptDisplayLines->SetSelection( 1 ); + else + m_OptDisplayLines->SetSelection( 0 ); + + if( DisplayOpt.DisplayPadFill ) + m_OptDisplayFlashedItems->SetSelection( 1 ); + else + m_OptDisplayFlashedItems->SetSelection( 0 ); + + // Show Option Draw polygons + if( g_DisplayPolygonsModeSketch == 0 ) + m_OptDisplayPolygons->SetSelection( 1 ); + else + m_OptDisplayPolygons->SetSelection( 0 ); + + m_ShowPageLimits->SetSelection(0); + if( m_Parent->m_Draw_Sheet_Ref ) + { + for( int ii = 1; g_GerberPageSizeList[ii] != NULL; ii++ ) + { + if( m_Parent->GetScreen()->m_CurrentSheetDesc == g_GerberPageSizeList[ii] ) + { + m_ShowPageLimits->SetSelection(ii); + break; + } + } + } + + m_OptDisplayDCodes->SetValue( DisplayOpt.DisplayPadNum ); + + GetSizer()->Fit( this ); + GetSizer()->SetSizeHints( this ); +} + + +void DIALOG_DISPLAY_OPTIONS::OnCancelButtonClick( wxCommandEvent& WXUNUSED(event) ) +{ + EndModal( 0 ); +} + + +void DIALOG_DISPLAY_OPTIONS::OnOKBUttonClick( wxCommandEvent& event ) +{ + if( m_OptDisplayLines->GetSelection() == 1 ) + DisplayOpt.DisplayPcbTrackFill = TRUE; + else + DisplayOpt.DisplayPcbTrackFill = FALSE; + + if( m_OptDisplayFlashedItems->GetSelection() == 1 ) + { + DisplayOpt.DisplayPadFill = true; + DisplayOpt.DisplayViaFill = true; + } + else + { + DisplayOpt.DisplayViaFill = false; + DisplayOpt.DisplayPadFill = false; + } + + + if( m_OptDisplayPolygons->GetSelection() == 0 ) + g_DisplayPolygonsModeSketch = 1; + else + g_DisplayPolygonsModeSketch = 0; + + DisplayOpt.DisplayPadNum = m_OptDisplayDCodes->GetValue(); + + m_Parent->m_DisplayPadFill = m_Parent->m_DisplayViaFill = + DisplayOpt.DisplayViaFill; + m_Parent->m_DisplayPcbTrackFill = DisplayOpt.DisplayPcbTrackFill; + + int idx = m_ShowPageLimits->GetSelection(); + if( idx > 0 ) + m_Parent->m_Draw_Sheet_Ref = true; + else + m_Parent->m_Draw_Sheet_Ref = false; + + m_Parent->GetScreen()->m_CurrentSheetDesc = g_GerberPageSizeList[idx]; + + EndModal( 1 ); +} + diff --git a/gerbview/gerbview_dialog_display_options_frame_base.cpp b/gerbview/gerbview_dialog_display_options_frame_base.cpp new file mode 100644 index 0000000000..be42271b00 --- /dev/null +++ b/gerbview/gerbview_dialog_display_options_frame_base.cpp @@ -0,0 +1,93 @@ +/////////////////////////////////////////////////////////////////////////// +// C++ code generated with wxFormBuilder (version Apr 16 2008) +// http://www.wxformbuilder.org/ +// +// PLEASE DO "NOT" EDIT THIS FILE! +/////////////////////////////////////////////////////////////////////////// + +#include "gerbview_dialog_display_options_frame_base.h" + +/////////////////////////////////////////////////////////////////////////// + +DIALOG_DISPLAY_OPTIONS_BASE::DIALOG_DISPLAY_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* bDialogSizer; + bDialogSizer = new wxBoxSizer( wxVERTICAL ); + + wxBoxSizer* bUpperSizer; + bUpperSizer = new wxBoxSizer( wxHORIZONTAL ); + + wxBoxSizer* bLeftSizer; + bLeftSizer = new wxBoxSizer( wxVERTICAL ); + + wxString m_OptDisplayLinesChoices[] = { _("Sketch"), _("Filled") }; + int m_OptDisplayLinesNChoices = sizeof( m_OptDisplayLinesChoices ) / sizeof( wxString ); + m_OptDisplayLines = new wxRadioBox( this, wxID_ANY, _("Lines:"), wxDefaultPosition, wxDefaultSize, m_OptDisplayLinesNChoices, m_OptDisplayLinesChoices, 1, wxRA_SPECIFY_COLS ); + m_OptDisplayLines->SetSelection( 1 ); + bLeftSizer->Add( m_OptDisplayLines, 0, wxALL|wxEXPAND, 5 ); + + wxString m_OptDisplayFlashedItemsChoices[] = { _("Sketch"), _("Filled") }; + int m_OptDisplayFlashedItemsNChoices = sizeof( m_OptDisplayFlashedItemsChoices ) / sizeof( wxString ); + m_OptDisplayFlashedItems = new wxRadioBox( this, wxID_ANY, _("Spots:"), wxDefaultPosition, wxDefaultSize, m_OptDisplayFlashedItemsNChoices, m_OptDisplayFlashedItemsChoices, 1, wxRA_SPECIFY_COLS ); + m_OptDisplayFlashedItems->SetSelection( 1 ); + bLeftSizer->Add( m_OptDisplayFlashedItems, 0, wxALL|wxEXPAND, 5 ); + + wxString m_OptDisplayPolygonsChoices[] = { _("Sketch"), _("Filled") }; + int m_OptDisplayPolygonsNChoices = sizeof( m_OptDisplayPolygonsChoices ) / sizeof( wxString ); + m_OptDisplayPolygons = new wxRadioBox( this, wxID_ANY, _("Polygons:"), wxDefaultPosition, wxDefaultSize, m_OptDisplayPolygonsNChoices, m_OptDisplayPolygonsChoices, 1, wxRA_SPECIFY_COLS ); + m_OptDisplayPolygons->SetSelection( 1 ); + bLeftSizer->Add( m_OptDisplayPolygons, 0, wxALL|wxEXPAND, 5 ); + + bUpperSizer->Add( bLeftSizer, 1, wxEXPAND, 5 ); + + + bUpperSizer->Add( 20, 20, 0, 0, 5 ); + + wxBoxSizer* bRightSizer; + bRightSizer = new wxBoxSizer( wxVERTICAL ); + + wxString m_ShowPageLimitsChoices[] = { _("Full size. Do not show page limits"), _("Full size"), _("Size A4"), _("Size A3"), _("Size A2"), _("Size A"), _("Size B"), _("Size C") }; + int m_ShowPageLimitsNChoices = sizeof( m_ShowPageLimitsChoices ) / sizeof( wxString ); + m_ShowPageLimits = new wxRadioBox( this, wxID_ANY, _("Show Page Limits:"), wxDefaultPosition, wxDefaultSize, m_ShowPageLimitsNChoices, m_ShowPageLimitsChoices, 1, wxRA_SPECIFY_COLS ); + m_ShowPageLimits->SetSelection( 0 ); + bRightSizer->Add( m_ShowPageLimits, 0, wxALL|wxEXPAND, 5 ); + + + bRightSizer->Add( 20, 20, 0, 0, 5 ); + + m_OptDisplayDCodes = new wxCheckBox( this, wxID_ANY, _("Show D codes"), wxDefaultPosition, wxDefaultSize, 0 ); + m_OptDisplayDCodes->SetValue(true); + + bRightSizer->Add( m_OptDisplayDCodes, 0, wxALL, 5 ); + + bUpperSizer->Add( bRightSizer, 1, wxEXPAND, 5 ); + + bDialogSizer->Add( bUpperSizer, 1, wxEXPAND, 5 ); + + m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); + bDialogSizer->Add( m_staticline1, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 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(); + bDialogSizer->Add( m_sdbSizer1, 0, wxEXPAND|wxALL, 5 ); + + this->SetSizer( bDialogSizer ); + this->Layout(); + + // Connect Events + m_sdbSizer1Cancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DISPLAY_OPTIONS_BASE::OnCancelButtonClick ), NULL, this ); + m_sdbSizer1OK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DISPLAY_OPTIONS_BASE::OnOKBUttonClick ), NULL, this ); +} + +DIALOG_DISPLAY_OPTIONS_BASE::~DIALOG_DISPLAY_OPTIONS_BASE() +{ + // Disconnect Events + m_sdbSizer1Cancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DISPLAY_OPTIONS_BASE::OnCancelButtonClick ), NULL, this ); + m_sdbSizer1OK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DISPLAY_OPTIONS_BASE::OnOKBUttonClick ), NULL, this ); +} diff --git a/gerbview/gerbview_dialog_display_options_frame_base.fbp b/gerbview/gerbview_dialog_display_options_frame_base.fbp new file mode 100644 index 0000000000..63ca6fb7d2 --- /dev/null +++ b/gerbview/gerbview_dialog_display_options_frame_base.fbp @@ -0,0 +1,477 @@ + + + + + + C++ + 1 + UTF-8 + connect + gerbview_dialog_display_options_frame_base + 1000 + none + 1 + gerbview_dialog_display_options_frame_base + + . + + 1 + 0 + 0 + + + + + 1 + + + + 0 + wxID_ANY + + + DIALOG_DISPLAY_OPTIONS_BASE + + 413,299 + wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER + + Gerbview Draw Options + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + bDialogSizer + wxVERTICAL + none + + 5 + wxEXPAND + 1 + + + bUpperSizer + wxHORIZONTAL + none + + 5 + wxEXPAND + 1 + + + bLeftSizer + wxVERTICAL + none + + 5 + wxALL|wxEXPAND + 0 + + + "Sketch" "Filled" + + 1 + + + 0 + wxID_ANY + Lines: + 1 + + + m_OptDisplayLines + protected + + 1 + + wxRA_SPECIFY_COLS + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL|wxEXPAND + 0 + + + "Sketch" "Filled" + + 1 + + + 0 + wxID_ANY + Spots: + 1 + + + m_OptDisplayFlashedItems + protected + + 1 + + wxRA_SPECIFY_COLS + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL|wxEXPAND + 0 + + + "Sketch" "Filled" + + 1 + + + 0 + wxID_ANY + Polygons: + 1 + + + m_OptDisplayPolygons + protected + + 1 + + wxRA_SPECIFY_COLS + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + + 0 + + 20 + protected + 20 + + + + 5 + wxEXPAND + 1 + + + bRightSizer + wxVERTICAL + none + + 5 + wxALL|wxEXPAND + 0 + + + "Full size. Do not show page limits" "Full size" "Size A4" "Size A3" "Size A2" "Size A" "Size B" "Size C" + + 1 + + + 0 + wxID_ANY + Show Page Limits: + 1 + + + m_ShowPageLimits + protected + + 0 + + wxRA_SPECIFY_COLS + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + + 0 + + 20 + protected + 20 + + + + 5 + wxALL + 0 + + + 1 + + 1 + + + 0 + wxID_ANY + Show D codes + + + m_OptDisplayDCodes + protected + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND|wxTOP|wxRIGHT|wxLEFT + 0 + + + + 1 + + + 0 + wxID_ANY + + + m_staticline1 + protected + + + wxLI_HORIZONTAL + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND|wxALL + 0 + + 0 + 1 + 0 + 0 + 0 + 1 + 0 + 0 + + m_sdbSizer1 + protected + + OnCancelButtonClick + + + + OnOKBUttonClick + + + + + + + + diff --git a/gerbview/gerbview_dialog_display_options_frame_base.h b/gerbview/gerbview_dialog_display_options_frame_base.h new file mode 100644 index 0000000000..4dbb293bdf --- /dev/null +++ b/gerbview/gerbview_dialog_display_options_frame_base.h @@ -0,0 +1,59 @@ +/////////////////////////////////////////////////////////////////////////// +// C++ code generated with wxFormBuilder (version Apr 16 2008) +// http://www.wxformbuilder.org/ +// +// PLEASE DO "NOT" EDIT THIS FILE! +/////////////////////////////////////////////////////////////////////////// + +#ifndef __gerbview_dialog_display_options_frame_base__ +#define __gerbview_dialog_display_options_frame_base__ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/////////////////////////////////////////////////////////////////////////// + + +/////////////////////////////////////////////////////////////////////////////// +/// Class DIALOG_DISPLAY_OPTIONS_BASE +/////////////////////////////////////////////////////////////////////////////// +class DIALOG_DISPLAY_OPTIONS_BASE : public wxDialog +{ + private: + + protected: + wxRadioBox* m_OptDisplayLines; + wxRadioBox* m_OptDisplayFlashedItems; + wxRadioBox* m_OptDisplayPolygons; + + wxRadioBox* m_ShowPageLimits; + + wxCheckBox* m_OptDisplayDCodes; + wxStaticLine* m_staticline1; + wxStdDialogButtonSizer* m_sdbSizer1; + wxButton* m_sdbSizer1OK; + wxButton* m_sdbSizer1Cancel; + + // Virtual event handlers, overide them in your derived class + virtual void OnCancelButtonClick( wxCommandEvent& event ){ event.Skip(); } + virtual void OnOKBUttonClick( wxCommandEvent& event ){ event.Skip(); } + + + public: + DIALOG_DISPLAY_OPTIONS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Gerbview Draw Options"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 413,299 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); + ~DIALOG_DISPLAY_OPTIONS_BASE(); + +}; + +#endif //__gerbview_dialog_display_options_frame_base__ diff --git a/gerbview/options.cpp b/gerbview/options.cpp index 2dca515793..0db117d769 100644 --- a/gerbview/options.cpp +++ b/gerbview/options.cpp @@ -3,7 +3,7 @@ /************************/ /* - * Set the display options for Gerbview + * Set some general options of Gerbview */ @@ -126,8 +126,7 @@ private: wxRadioBox* m_GerberDefaultScale; public: - WinEDA_GerberGeneralOptionsFrame( WinEDA_BasePcbFrame* parent, - const wxPoint& pos ); + WinEDA_GerberGeneralOptionsFrame( WinEDA_BasePcbFrame* parent ); ~WinEDA_GerberGeneralOptionsFrame() {}; private: @@ -145,10 +144,9 @@ END_EVENT_TABLE() WinEDA_GerberGeneralOptionsFrame::WinEDA_GerberGeneralOptionsFrame( - WinEDA_BasePcbFrame* parent, - const wxPoint& framepos ) : + WinEDA_BasePcbFrame* parent ) : wxDialog( parent, -1, _( "Gerbview Options" ), - framepos, wxSize( 300, 240 ), + wxDefaultPosition, wxSize( 300, 240 ), wxDEFAULT_DIALOG_STYLE | wxFRAME_FLOAT_ON_PARENT ) { m_Parent = parent; @@ -234,175 +232,8 @@ void WinEDA_GerberGeneralOptionsFrame::OnOkClick( wxCommandEvent& event ) } -/*******************************************/ -/* Dialog frame to select display options */ -/*******************************************/ -class WinEDA_LookFrame : public wxDialog +void WinEDA_GerberFrame::InstallGerberGeneralOptionsFrame( wxCommandEvent& event ) { -private: - WinEDA_BasePcbFrame* m_Parent; - wxRadioBox* m_OptDisplayLines; - wxRadioBox* m_OptDisplayFlashes; - wxRadioBox* m_OptDisplayVias; //@@@@TODO: Does it belong here? - wxRadioBox* m_OptDisplayPolygons; - wxCheckBox* m_OptDisplayDCodes; - wxRadioBox* m_OptDisplayDrawings; - -public: - - WinEDA_LookFrame( WinEDA_BasePcbFrame* parent, const wxPoint& pos ); - ~WinEDA_LookFrame() {}; - -private: - void OnOkClick( wxCommandEvent& event ); - void OnCancelClick( wxCommandEvent& event ); - - DECLARE_EVENT_TABLE() -}; - -BEGIN_EVENT_TABLE( WinEDA_LookFrame, wxDialog ) - EVT_BUTTON( wxID_OK, WinEDA_LookFrame::OnOkClick ) - EVT_BUTTON( wxID_CANCEL, WinEDA_LookFrame::OnCancelClick ) -END_EVENT_TABLE() - - -WinEDA_LookFrame::WinEDA_LookFrame( WinEDA_BasePcbFrame* parent, - const wxPoint& framepos ) : - wxDialog( parent, -1, _( "Gerbview Draw Options" ), framepos, - wxSize( 350, 200 ), - wxDEFAULT_DIALOG_STYLE | wxFRAME_FLOAT_ON_PARENT ) -{ - m_Parent = parent; - - wxBoxSizer* MainBoxSizer = new wxBoxSizer( wxHORIZONTAL ); - SetSizer( MainBoxSizer ); - wxBoxSizer* RightBoxSizer = new wxBoxSizer( wxVERTICAL ); - wxBoxSizer* MiddleBoxSizer = new wxBoxSizer( wxVERTICAL ); - wxBoxSizer* LeftBoxSizer = new wxBoxSizer( wxVERTICAL ); - MainBoxSizer->Add( LeftBoxSizer, 0, wxGROW | wxALL, 5 ); - MainBoxSizer->Add( MiddleBoxSizer, 0, wxGROW | wxALL, 5 ); - MainBoxSizer->Add( RightBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5 ); - - wxButton* Button = new wxButton( this, wxID_OK, _( "OK" ) ); - RightBoxSizer->Add( Button, 0, wxGROW | wxALL, 5 ); - - Button = new wxButton( this, wxID_CANCEL, _( "Cancel" ) ); - RightBoxSizer->Add( Button, 0, wxGROW | wxALL, 5 ); - - // Show Option Draw Tracks - wxString list_opt2[2] = { _( "Sketch" ), _( "Filled" ) }; - m_OptDisplayLines = new wxRadioBox( this, -1, _( "Lines:" ), - wxDefaultPosition, wxDefaultSize, - 2, list_opt2, 1 ); - if( DisplayOpt.DisplayPcbTrackFill ) - m_OptDisplayLines->SetSelection( 1 ); - LeftBoxSizer->Add( m_OptDisplayLines, 0, wxGROW | wxALL, 5 ); - - m_OptDisplayFlashes = new wxRadioBox( this, -1, _( "Spots:" ), - wxDefaultPosition, wxDefaultSize, - 2, list_opt2, 1 ); - if( DisplayOpt.DisplayPadFill ) - m_OptDisplayFlashes->SetSelection( 1 ); - LeftBoxSizer->Add( m_OptDisplayFlashes, 0, wxGROW | wxALL, 5 ); - - - m_OptDisplayVias = new wxRadioBox( this, -1, _( "Spots:" ), - wxDefaultPosition, wxDefaultSize, - 2, list_opt2, 1 ); - if( DisplayOpt.DisplayViaFill ) - m_OptDisplayVias->SetSelection( 1 ); - LeftBoxSizer->Add( m_OptDisplayVias, 0, wxGROW | wxALL, 5 ); - - - - // Show Option Draw polygons - m_OptDisplayPolygons = new wxRadioBox( this, -1, _( "Polygons:" ), - wxDefaultPosition, wxDefaultSize, - 2, list_opt2, 1 ); - if( g_DisplayPolygonsModeSketch == 0 ) - m_OptDisplayPolygons->SetSelection( 1 ); - LeftBoxSizer->Add( m_OptDisplayPolygons, 0, wxGROW | wxALL, 5 ); - - wxString list_opt3[3] = { _( "Sketch" ), _( "Filled" ), _( "Line" ) }; - m_OptDisplayDrawings = new wxRadioBox( this, -1, _( "Display other items:" ), - wxDefaultPosition, wxDefaultSize, - 3, list_opt3, 1 ); - m_OptDisplayDrawings->SetSelection( DisplayOpt.DisplayDrawItems ); - MiddleBoxSizer->Add( m_OptDisplayDrawings, 0, wxGROW | wxALL, 5 ); - - m_OptDisplayDCodes = new wxCheckBox( this, -1, _( "Show D codes" ) ); - if( DisplayOpt.DisplayPadNum ) - m_OptDisplayDCodes->SetValue( TRUE ); - MiddleBoxSizer->Add( m_OptDisplayDCodes, 0, wxGROW | wxALL, 5 ); - - GetSizer()->Fit( this ); - GetSizer()->SetSizeHints( this ); -} - - -void WinEDA_LookFrame::OnCancelClick( wxCommandEvent& WXUNUSED(event) ) -{ - EndModal( -1 ); -} - - -void WinEDA_LookFrame::OnOkClick( wxCommandEvent& event ) -{ - if( m_OptDisplayLines->GetSelection() == 1 ) - DisplayOpt.DisplayPcbTrackFill = TRUE; - else - DisplayOpt.DisplayPcbTrackFill = FALSE; - - if( m_OptDisplayFlashes->GetSelection() == 1 ) - DisplayOpt.DisplayPadFill = true; - else - DisplayOpt.DisplayPadFill = false; - - if( m_OptDisplayVias->GetSelection() == 1 ) - DisplayOpt.DisplayViaFill = true; - else - DisplayOpt.DisplayViaFill = false; - - - if( m_OptDisplayPolygons->GetSelection() == 0 ) - g_DisplayPolygonsModeSketch = 1; - else - g_DisplayPolygonsModeSketch = 0; - - DisplayOpt.DisplayPadNum = m_OptDisplayDCodes->GetValue(); - - DisplayOpt.DisplayDrawItems = m_OptDisplayDrawings->GetSelection(); - - m_Parent->m_DisplayPadFill = DisplayOpt.DisplayPadFill; - m_Parent->m_DisplayViaFill = DisplayOpt.DisplayViaFill; - m_Parent->m_DisplayPcbTrackFill = DisplayOpt.DisplayPcbTrackFill; - - m_Parent->GetScreen()->SetRefreshReq(); - - EndModal( 1 ); -} - - -void WinEDA_GerberFrame::InstallGerberOptionsFrame( const wxPoint& pos, int id ) -{ - switch( id ) - { - case ID_PCB_DISPLAY_OPTIONS_SETUP: - { - WinEDA_LookFrame* OptionsFrame = - new WinEDA_LookFrame( this, pos ); - OptionsFrame->ShowModal(); - OptionsFrame->Destroy(); - } - break; - - case ID_OPTIONS_SETUP: - { - WinEDA_GerberGeneralOptionsFrame* OptionsFrame = - new WinEDA_GerberGeneralOptionsFrame( this, pos ); - OptionsFrame->ShowModal(); - OptionsFrame->Destroy(); - } - break; - } + WinEDA_GerberGeneralOptionsFrame dlg( this ); + dlg.ShowModal(); } diff --git a/gerbview/wxGerberFrame.h b/gerbview/wxGerberFrame.h index b2dedaa942..c4944a1199 100644 --- a/gerbview/wxGerberFrame.h +++ b/gerbview/wxGerberFrame.h @@ -49,6 +49,28 @@ public: void Update_config(); void OnCloseWindow( wxCloseEvent& Event ); + /** + * Load applications settings specific to the PCBNew. + * + * This overrides the base class WinEDA_BasePcbFrame::LoadSettings() to + * handle settings specific common to the PCB layout application. It + * calls down to the base class to load settings common to all PCB type + * drawing frames. Please put your application settings for PCBNew here + * to avoid having application settings loaded all over the place. + */ + virtual void LoadSettings(); + + /** + * Save applications settings common to PCB draw frame objects. + * + * This overrides the base class WinEDA_BasePcbFrame::SaveSettings() to + * save settings specific to the PCB layout application main window. It + * calls down to the base class to save settings common to all PCB type + * drawing frames. Please put your application settings for PCBNew here + * to avoid having application settings saved all over the place. + */ + virtual void SaveSettings(); + void Process_Special_Functions( wxCommandEvent& event ); void RedrawActiveWindow( wxDC* DC, bool EraseBg ); void ReCreateHToolbar(); @@ -70,7 +92,8 @@ public: void Process_Settings( wxCommandEvent& event ); void Process_Config( wxCommandEvent& event ); void InstallConfigFrame( const wxPoint& pos ); - void InstallGerberOptionsFrame( const wxPoint& pos, int id ); + void InstallGerberGeneralOptionsFrame( wxCommandEvent& event ); + void InstallGerberDisplayOptionsDialog( wxCommandEvent& event ); void InstallPcbGlobalDeleteFrame( const wxPoint& pos ); /* handlers for block commands */ diff --git a/internat/fr/kicad.mo b/internat/fr/kicad.mo index 0010fed880..3d6e1660c2 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 fec9ca3fc0..a82d91f16f 100644 --- a/internat/fr/kicad.po +++ b/internat/fr/kicad.po @@ -2,8 +2,8 @@ msgid "" msgstr "" "Project-Id-Version: kicad\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-11-21 20:29+0100\n" -"PO-Revision-Date: 2009-11-21 20:35+0100\n" +"POT-Creation-Date: 2009-11-22 20:55+0100\n" +"PO-Revision-Date: 2009-11-22 20:57+0100\n" "Last-Translator: \n" "Language-Team: kicad team \n" "MIME-Version: 1.0\n" @@ -10925,51 +10925,30 @@ msgstr "Changer Nom Fichier" msgid "noname" msgstr "noname" -#: gerbview/options.cpp:150 +#: gerbview/options.cpp:148 msgid "Gerbview Options" msgstr "Gerbview Options " -#: gerbview/options.cpp:187 +#: gerbview/options.cpp:185 msgid "millimeters" msgstr "millimètres" -#: gerbview/options.cpp:196 +#: gerbview/options.cpp:194 msgid "Small" msgstr "Petit" -#: gerbview/options.cpp:196 +#: gerbview/options.cpp:194 msgid "Big" msgstr "Grand" -#: gerbview/options.cpp:204 +#: gerbview/options.cpp:202 msgid "format: 2.3" msgstr "Format 2.3" -#: gerbview/options.cpp:204 +#: gerbview/options.cpp:202 msgid "format 3.4" msgstr "Format 3.4" -#: gerbview/options.cpp:271 -msgid "Gerbview Draw Options" -msgstr "Options d'Affichage" - -#: gerbview/options.cpp:294 -msgid "Lines:" -msgstr "Lignes:" - -#: gerbview/options.cpp:301 -#: gerbview/options.cpp:309 -msgid "Spots:" -msgstr "Spots:" - -#: gerbview/options.cpp:319 -msgid "Polygons:" -msgstr "Polygones:" - -#: gerbview/options.cpp:333 -msgid "Show D codes" -msgstr "Montrer DCodes" - #: gerbview/readgerb.cpp:137 msgid "File " msgstr "Fichier " @@ -10991,7 +10970,11 @@ msgstr "Fichiers Gerber DCODE (%s)|*.%s" msgid "Load GERBER DCODE File" msgstr "Charger Fichier de DCodes" -#: gerbview/gerbview.cpp:63 +#: gerbview/gerbview.cpp:35 +msgid "GerbView project files (.cnf)|*.cnf" +msgstr "Fichiers projet GerbView (.cnf)|*.cnf" + +#: gerbview/gerbview.cpp:80 msgid "GerbView is already running. Continue?" msgstr "Gerbview est en cours d'exécution. Continuer ?" @@ -11371,14 +11354,62 @@ msgstr "Afficher polygones en mode contour" msgid "Show dcode number" msgstr "Afficher le n° de DCode" -#: gerbview/gerbview_config.cpp:25 -msgid "GerbView project files (.cnf)|*.cnf" -msgstr "Fichiers projet GerbView (.cnf)|*.cnf" - -#: gerbview/gerbview_config.cpp:127 +#: gerbview/gerbview_config.cpp:118 msgid "Save GerbView Project File" msgstr "Sauver Fichier Projet Gerbview" +#: gerbview/gerbview_dialog_display_options_frame_base.cpp:27 +msgid "Lines:" +msgstr "Lignes:" + +#: gerbview/gerbview_dialog_display_options_frame_base.cpp:33 +msgid "Spots:" +msgstr "Spots:" + +#: gerbview/gerbview_dialog_display_options_frame_base.cpp:39 +msgid "Polygons:" +msgstr "Polygones:" + +#: gerbview/gerbview_dialog_display_options_frame_base.cpp:51 +msgid "Full size. Do not show page limits" +msgstr "Format maximum.Ne pas afficher les limites de page" + +#: gerbview/gerbview_dialog_display_options_frame_base.cpp:51 +msgid "Full size" +msgstr "Format maximum" + +#: gerbview/gerbview_dialog_display_options_frame_base.cpp:51 +msgid "Size A4" +msgstr "Format A4 " + +#: gerbview/gerbview_dialog_display_options_frame_base.cpp:51 +msgid "Size A3" +msgstr "Format A3" + +#: gerbview/gerbview_dialog_display_options_frame_base.cpp:51 +msgid "Size A2" +msgstr "Format A2" + +#: gerbview/gerbview_dialog_display_options_frame_base.cpp:51 +msgid "Size A" +msgstr "Format A" + +#: gerbview/gerbview_dialog_display_options_frame_base.cpp:51 +msgid "Size B" +msgstr "Format B" + +#: gerbview/gerbview_dialog_display_options_frame_base.cpp:51 +msgid "Size C" +msgstr "Format C" + +#: gerbview/gerbview_dialog_display_options_frame_base.cpp:53 +msgid "Show Page Limits:" +msgstr " Afficher Limites de Page" + +#: gerbview/gerbview_dialog_display_options_frame_base.cpp:60 +msgid "Show D codes" +msgstr "Montrer DCodes" + #: common/confirm.cpp:70 msgid "Warning" msgstr "Avertissement" @@ -11533,159 +11564,159 @@ msgstr "" msgid "Unable to find a PDF viewer for" msgstr "Impossible de trouver un visualisateur PDF pour" -#: common/common.cpp:59 +#: common/common.cpp:57 msgid "Kicad project files (*.pro)|*.pro" msgstr "Fichiers projet Kicad (*.pro)|*.pro" -#: common/common.cpp:60 +#: common/common.cpp:58 msgid "Kicad PCB files (*.brd)|*.brd" msgstr "Fichiers Kicad PCB (*.brd)|*.brd" -#: common/common.cpp:61 +#: common/common.cpp:59 msgid "Kicad schematic files (*.sch)|*.sch" msgstr "Fichiers schématiques Kicad (*.sch)|*.sch" -#: common/common.cpp:62 +#: common/common.cpp:60 msgid "Kicad netlist files (*.net)|*.net" msgstr "fichiers netlistes Kicad (*.net)|*.net" -#: common/common.cpp:63 +#: common/common.cpp:61 msgid "Gerber files (*.pho)|*.pho" msgstr "Fichiers Gerber (*.pho)|*.pho" -#: common/common.cpp:64 +#: common/common.cpp:62 msgid "Portable document format files (*.pdf)|*.pdf" msgstr "Fichiers \"Portable document format\" (*.pdf)|*.pdf" -#: common/common.cpp:65 +#: common/common.cpp:63 msgid "All files (*)|*" msgstr "Tous les fichiers (*)|*" -#: common/common.cpp:242 +#: common/common.cpp:240 msgid " (\"):" msgstr " (\"):" -#: common/common.cpp:272 +#: common/common.cpp:270 msgid "centimeters" msgstr "centimètres" -#: common/common.cpp:358 +#: common/common.cpp:356 msgid " \"" msgstr " \"" -#: common/common.cpp:586 +#: common/common.cpp:584 msgid "Copper " msgstr "Cuivre " -#: common/common.cpp:586 +#: common/common.cpp:584 msgid "Inner L1 " msgstr "Interne 1" -#: common/common.cpp:586 +#: common/common.cpp:584 msgid "Inner L2 " msgstr "Interne 2" -#: common/common.cpp:586 +#: common/common.cpp:584 msgid "Inner L3 " msgstr "Interne 3" -#: common/common.cpp:587 +#: common/common.cpp:585 msgid "Inner L4 " msgstr "Interne 4" -#: common/common.cpp:587 +#: common/common.cpp:585 msgid "Inner L5 " msgstr "Interne 5" -#: common/common.cpp:587 +#: common/common.cpp:585 msgid "Inner L6 " msgstr "Interne 6" -#: common/common.cpp:587 +#: common/common.cpp:585 msgid "Inner L7 " msgstr "Interne 7" -#: common/common.cpp:588 +#: common/common.cpp:586 msgid "Inner L8 " msgstr "Interne 8" -#: common/common.cpp:588 +#: common/common.cpp:586 msgid "Inner L9 " msgstr "Interne 9" -#: common/common.cpp:588 +#: common/common.cpp:586 msgid "Inner L10" msgstr "Interne 10" -#: common/common.cpp:588 +#: common/common.cpp:586 msgid "Inner L11" msgstr "Interne 11" -#: common/common.cpp:589 +#: common/common.cpp:587 msgid "Inner L12" msgstr "Interne 12" -#: common/common.cpp:589 +#: common/common.cpp:587 msgid "Inner L13" msgstr "Interne 13" -#: common/common.cpp:589 +#: common/common.cpp:587 msgid "Inner L14" msgstr "Interne 14" -#: common/common.cpp:590 +#: common/common.cpp:588 msgid "Adhes Cop" msgstr "Adhes Cu " -#: common/common.cpp:590 +#: common/common.cpp:588 msgid "Adhes Cmp" msgstr "Adhes Cmp" -#: common/common.cpp:590 +#: common/common.cpp:588 msgid "SoldP Cop" msgstr "SoldP Cu " -#: common/common.cpp:590 +#: common/common.cpp:588 msgid "SoldP Cmp" msgstr "SoldP Cmp" -#: common/common.cpp:591 +#: common/common.cpp:589 msgid "SilkS Cop" msgstr "Sérigr Cu " -#: common/common.cpp:591 +#: common/common.cpp:589 msgid "SilkS Cmp" msgstr "Sérigr Cmp" -#: common/common.cpp:591 +#: common/common.cpp:589 msgid "Mask Cop " msgstr "Masque Cu " -#: common/common.cpp:591 +#: common/common.cpp:589 msgid "Mask Cmp " msgstr "Masque Cmp" -#: common/common.cpp:592 +#: common/common.cpp:590 msgid "Drawings " msgstr "Drawings " -#: common/common.cpp:592 +#: common/common.cpp:590 msgid "Comments " msgstr "Commentaires " -#: common/common.cpp:592 +#: common/common.cpp:590 msgid "Eco1 " msgstr "Eco1 " -#: common/common.cpp:592 +#: common/common.cpp:590 msgid "Eco2 " msgstr "Eco2 " -#: common/common.cpp:593 +#: common/common.cpp:591 msgid "Edges Pcb" msgstr "Contour Pcb" -#: common/common.cpp:593 +#: common/common.cpp:591 msgid "BAD INDEX" msgstr "BAD INDEX" @@ -12006,18 +12037,6 @@ msgstr "Couche ECO1 On/Off" msgid "Eco2 Layer On/Off" msgstr "Couche ECO2 On/Off" -#: share/setpage.cpp:261 -msgid "Size A4" -msgstr "Format A4 " - -#: share/setpage.cpp:262 -msgid "Size A3" -msgstr "Format A3" - -#: share/setpage.cpp:263 -msgid "Size A2" -msgstr "Format A2" - #: share/setpage.cpp:264 msgid "Size A1" msgstr "Format A1" @@ -12026,18 +12045,6 @@ msgstr "Format A1" msgid "Size A0" msgstr "Format A0" -#: share/setpage.cpp:266 -msgid "Size A" -msgstr "Format A" - -#: share/setpage.cpp:267 -msgid "Size B" -msgstr "Format B" - -#: share/setpage.cpp:268 -msgid "Size C" -msgstr "Format C" - #: share/setpage.cpp:269 msgid "Size D" msgstr "Format D" @@ -12519,10 +12526,17 @@ msgstr "Couche 32" msgid "D codes id." msgstr "DCodes id." +#: gerbview/gerbview_dialog_display_options_frame_base.h:54 +msgid "Gerbview Draw Options" +msgstr "Options d'Affichage" + #: share/setpage.h:80 msgid "Page Settings" msgstr "Ajustage opt Page" +#, fuzzy +#~ msgid "Do Not Show" +#~ msgstr "Ne pas montrer" #~ msgid "Export a Specctra Design (*.dsn) File" #~ msgstr "Exporter un fichier de conception Specctra (*.dsn)" #~ msgid "Export a Specctra DSN file (to FreeRouter)"