diff --git a/common/base_screen.cpp b/common/base_screen.cpp index c3839804d5..97c67a881a 100644 --- a/common/base_screen.cpp +++ b/common/base_screen.cpp @@ -65,7 +65,7 @@ void BASE_SCREEN::InitDatas() m_Curseur.y = ReturnPageSize().y / 2; } - m_O_Curseur = m_Curseur; + m_O_Curseur.x = m_O_Curseur.y = 0; SetCurItem( NULL ); @@ -451,13 +451,13 @@ void BASE_SCREEN::AddGrid( const wxRealPoint& size, int units, int id ) if( units == MILLIMETRE ) { - x = size.x / 25.4000508001016; - y = size.y / 25.4000508001016; + x = size.x / 25.4; + y = size.y / 25.4; } else if( units == CENTIMETRE ) { - x = size.x / 2.54000508001016; - y = size.y / 2.54000508001016; + x = size.x / 2.54; + y = size.y / 2.54; } else { diff --git a/common/basicframe.cpp b/common/basicframe.cpp index 9a90eb41fe..461971bcc1 100644 --- a/common/basicframe.cpp +++ b/common/basicframe.cpp @@ -88,7 +88,6 @@ void WinEDA_BasicFrame::SetLanguage( wxCommandEvent& event ) wxGetApp().SetLanguageIdentifier( id ); if ( wxGetApp().SetLanguage() ) { - wxLogDebug( wxT( "Recreating menu bar due to language change." ) ); ReCreateMenuBar(); Refresh(); } diff --git a/common/zoom.cpp b/common/zoom.cpp index a2738c0164..707efd86b6 100644 --- a/common/zoom.cpp +++ b/common/zoom.cpp @@ -247,10 +247,10 @@ void WinEDA_DrawFrame::AddMenuZoomAndGrid( wxMenu* MasterMenu ) else { if( g_UnitMetric == 0 ) // inches - msg.Printf( wxT( "%.1f mils, (%.3f mm)" ), + msg.Printf( wxT( "%.1f mils\t(%.3f mm)" ), gridValueInch * 1000, gridValue_mm ); else - msg.Printf( wxT( "%.3f mm, (%.1f mils)" ), + msg.Printf( wxT( "%.3f mm\t(%.1f mils)" ), gridValue_mm, gridValueInch * 1000 ); } gridMenu->Append( tmp.m_Id, msg, wxEmptyString, true ); diff --git a/eeschema/CMakeLists.txt b/eeschema/CMakeLists.txt index 0058101081..65323c3634 100644 --- a/eeschema/CMakeLists.txt +++ b/eeschema/CMakeLists.txt @@ -56,6 +56,8 @@ set(EESCHEMA_SRCS dialog_eeschema_options.cpp dialog_erc.cpp dialog_erc_base.cpp + dialog_libedit_dimensions.cpp + dialog_libedit_dimensions_base.cpp dialog_lib_edit_draw_item.cpp dialog_lib_edit_draw_item_base.cpp dialog_lib_edit_pin.cpp diff --git a/eeschema/dialog_eeschema_config.cpp b/eeschema/dialog_eeschema_config.cpp index a07352e651..8cfa3ee131 100644 --- a/eeschema/dialog_eeschema_config.cpp +++ b/eeschema/dialog_eeschema_config.cpp @@ -46,24 +46,34 @@ private: public: - DIALOG_EESCHEMA_CONFIG( WinEDA_SchematicFrame * parent ); + DIALOG_EESCHEMA_CONFIG( WinEDA_SchematicFrame * parent, WinEDA_DrawFrame * activeWindow ); ~DIALOG_EESCHEMA_CONFIG() {}; }; /******************************************************************/ -void WinEDA_SchematicFrame::InstallConfigFrame( const wxPoint& pos ) +void WinEDA_SchematicFrame::InstallConfigFrame( wxCommandEvent& event ) /******************************************************************/ { - DIALOG_EESCHEMA_CONFIG CfgFrame( this ); + DIALOG_EESCHEMA_CONFIG CfgFrame( this, this ); CfgFrame.ShowModal(); } +/******************************************************************/ +void WinEDA_LibeditFrame::InstallConfigFrame( wxCommandEvent& event ) +/******************************************************************/ +{ + DIALOG_EESCHEMA_CONFIG CfgFrame( (WinEDA_SchematicFrame *)GetParent(), this ); + + CfgFrame.ShowModal(); +} + /*******************************************************************************/ -DIALOG_EESCHEMA_CONFIG::DIALOG_EESCHEMA_CONFIG( WinEDA_SchematicFrame* parent ) - : DIALOG_EESCHEMA_CONFIG_FBP( parent ) +DIALOG_EESCHEMA_CONFIG::DIALOG_EESCHEMA_CONFIG( WinEDA_SchematicFrame* parent, + WinEDA_DrawFrame * activeWindow ) + : DIALOG_EESCHEMA_CONFIG_FBP( activeWindow ) /*******************************************************************************/ { wxString msg; diff --git a/eeschema/dialog_libedit_dimensions.cpp b/eeschema/dialog_libedit_dimensions.cpp new file mode 100644 index 0000000000..b8a3be8e04 --- /dev/null +++ b/eeschema/dialog_libedit_dimensions.cpp @@ -0,0 +1,42 @@ +/* + * dialog_libedit_dimensions.cpp + * Handles the dialog so set current texts and pins sizes in LibEdit + */ +#include "fctsys.h" +//#include "appl_wxstruct.h" +#include "common.h" +//#include "class_drawpanel.h" + +#include "program.h" +#include "general.h" +#include "libeditframe.h" + + +#include "dialog_libedit_dimensions_base.h" + + +class DIALOG_LIBEDIT_DIMENSIONS : public DIALOG_LIBEDIT_DIMENSIONS_BASE +{ + private: + public: + DIALOG_LIBEDIT_DIMENSIONS( WinEDA_LibeditFrame* parent); + ~DIALOG_LIBEDIT_DIMENSIONS(); + +}; + +void WinEDA_LibeditFrame::InstallDimensionsDialog( wxCommandEvent& event ) +{ + DIALOG_LIBEDIT_DIMENSIONS dlg(this); + dlg.ShowModal( ); +} + +DIALOG_LIBEDIT_DIMENSIONS::DIALOG_LIBEDIT_DIMENSIONS( WinEDA_LibeditFrame* parent ) + : DIALOG_LIBEDIT_DIMENSIONS_BASE( parent ) +{ + this->Centre( wxBOTH ); +} + +DIALOG_LIBEDIT_DIMENSIONS::~DIALOG_LIBEDIT_DIMENSIONS() +{ +} + diff --git a/eeschema/dialog_libedit_dimensions_base.cpp b/eeschema/dialog_libedit_dimensions_base.cpp new file mode 100644 index 0000000000..6bd0a19701 --- /dev/null +++ b/eeschema/dialog_libedit_dimensions_base.cpp @@ -0,0 +1,160 @@ +/////////////////////////////////////////////////////////////////////////// +// C++ code generated with wxFormBuilder (version Apr 16 2008) +// http://www.wxformbuilder.org/ +// +// PLEASE DO "NOT" EDIT THIS FILE! +/////////////////////////////////////////////////////////////////////////// + +#include "dialog_libedit_dimensions_base.h" + +/////////////////////////////////////////////////////////////////////////// + +DIALOG_LIBEDIT_DIMENSIONS_BASE::DIALOG_LIBEDIT_DIMENSIONS_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* mainSizer; + mainSizer = new wxBoxSizer( wxHORIZONTAL ); + + wxBoxSizer* bSizerMain; + bSizerMain = new wxBoxSizer( wxVERTICAL ); + + wxFlexGridSizer* fgSizer1; + fgSizer1 = new wxFlexGridSizer( 7, 3, 0, 0 ); + fgSizer1->AddGrowableCol( 0 ); + fgSizer1->AddGrowableCol( 1 ); + fgSizer1->AddGrowableCol( 2 ); + fgSizer1->SetFlexibleDirection( wxHORIZONTAL ); + fgSizer1->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); + + m_staticText3 = new wxStaticText( this, wxID_ANY, _("&Grid size:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText3->Wrap( -1 ); + fgSizer1->Add( m_staticText3, 1, wxALIGN_CENTER_VERTICAL|wxALL, 3 ); + + wxString m_choiceGridSizeChoices[] = { _("100"), _("50"), _("25"), _("10"), _("5"), _("2"), _("1") }; + int m_choiceGridSizeNChoices = sizeof( m_choiceGridSizeChoices ) / sizeof( wxString ); + m_choiceGridSize = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceGridSizeNChoices, m_choiceGridSizeChoices, 0 ); + m_choiceGridSize->SetSelection( 0 ); + fgSizer1->Add( m_choiceGridSize, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 3 ); + + m_staticGridUnits = new wxStaticText( this, wxID_ANY, _("mils"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticGridUnits->Wrap( -1 ); + fgSizer1->Add( m_staticGridUnits, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 ); + + m_staticText5 = new wxStaticText( this, wxID_ANY, _("Current graphic &line width:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText5->Wrap( -1 ); + fgSizer1->Add( m_staticText5, 1, wxALIGN_CENTER_VERTICAL|wxALL, 3 ); + + m_CurrentGraphicLineThicknessCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + fgSizer1->Add( m_CurrentGraphicLineThicknessCtrl, 0, wxALL|wxEXPAND, 5 ); + + m_staticLineWidthUnits = new wxStaticText( this, wxID_ANY, _("mils"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticLineWidthUnits->Wrap( -1 ); + fgSizer1->Add( m_staticLineWidthUnits, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 ); + + m_staticText7 = new wxStaticText( this, wxID_ANY, _("Current graphic text &size:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText7->Wrap( -1 ); + fgSizer1->Add( m_staticText7, 1, wxALIGN_CENTER_VERTICAL|wxALL, 3 ); + + m_CurrentGraphicTextSizeCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + fgSizer1->Add( m_CurrentGraphicTextSizeCtrl, 0, wxALL|wxEXPAND, 5 ); + + m_staticTextSizeUnits = new wxStaticText( this, wxID_ANY, _("mils"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextSizeUnits->Wrap( -1 ); + fgSizer1->Add( m_staticTextSizeUnits, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 ); + + m_staticText9 = new wxStaticText( this, wxID_ANY, _("Repeat draw item &horizontal displacement:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText9->Wrap( -1 ); + fgSizer1->Add( m_staticText9, 1, wxALIGN_CENTER_VERTICAL|wxALL, 3 ); + + wxString m_choiceRepeatHorizontalChoices[] = { _("100"), _("50") }; + int m_choiceRepeatHorizontalNChoices = sizeof( m_choiceRepeatHorizontalChoices ) / sizeof( wxString ); + m_choiceRepeatHorizontal = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceRepeatHorizontalNChoices, m_choiceRepeatHorizontalChoices, 0 ); + m_choiceRepeatHorizontal->SetSelection( 0 ); + fgSizer1->Add( m_choiceRepeatHorizontal, 0, wxALL|wxEXPAND, 5 ); + + m_staticRepeatXUnits = new wxStaticText( this, wxID_ANY, _("mils"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticRepeatXUnits->Wrap( -1 ); + fgSizer1->Add( m_staticRepeatXUnits, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 ); + + m_staticText12 = new wxStaticText( this, wxID_ANY, _("Repeat draw item &vertical displacement:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText12->Wrap( -1 ); + fgSizer1->Add( m_staticText12, 1, wxALIGN_CENTER_VERTICAL|wxALL, 3 ); + + wxString m_choiceRepeatVerticalChoices[] = { _("100"), _("50") }; + int m_choiceRepeatVerticalNChoices = sizeof( m_choiceRepeatVerticalChoices ) / sizeof( wxString ); + m_choiceRepeatVertical = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceRepeatVerticalNChoices, m_choiceRepeatVerticalChoices, 0 ); + m_choiceRepeatVertical->SetSelection( 0 ); + fgSizer1->Add( m_choiceRepeatVertical, 0, wxALL|wxEXPAND, 5 ); + + m_staticRepeatYUnits = new wxStaticText( this, wxID_ANY, _("mils"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticRepeatYUnits->Wrap( -1 ); + fgSizer1->Add( m_staticRepeatYUnits, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 ); + + m_staticText15 = new wxStaticText( this, wxID_ANY, _("Current &pin lenght"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText15->Wrap( -1 ); + fgSizer1->Add( m_staticText15, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + + m_CurrentPinLenghtCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + fgSizer1->Add( m_CurrentPinLenghtCtrl, 0, wxEXPAND|wxALL, 5 ); + + m_staticText161 = new wxStaticText( this, wxID_ANY, _("mils"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText161->Wrap( -1 ); + fgSizer1->Add( m_staticText161, 0, wxALL, 5 ); + + m_CurrentPinNameSizeText = new wxStaticText( this, wxID_ANY, _("Current pin name size"), wxDefaultPosition, wxDefaultSize, 0 ); + m_CurrentPinNameSizeText->Wrap( -1 ); + fgSizer1->Add( m_CurrentPinNameSizeText, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + + m_CurrentPinNameSizeCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + fgSizer1->Add( m_CurrentPinNameSizeCtrl, 0, wxALL|wxEXPAND, 5 ); + + m_staticText18 = new wxStaticText( this, wxID_ANY, _("mils"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText18->Wrap( -1 ); + fgSizer1->Add( m_staticText18, 0, wxALL, 5 ); + + m_CurrentPinNumberSizeText = new wxStaticText( this, wxID_ANY, _("Current pin number size"), wxDefaultPosition, wxDefaultSize, 0 ); + m_CurrentPinNumberSizeText->Wrap( -1 ); + fgSizer1->Add( m_CurrentPinNumberSizeText, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + + m_CurrentPinNumberSizeCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + fgSizer1->Add( m_CurrentPinNumberSizeCtrl, 0, wxALL|wxEXPAND, 5 ); + + m_staticText20 = new wxStaticText( this, wxID_ANY, _("mils"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText20->Wrap( -1 ); + fgSizer1->Add( m_staticText20, 0, wxALL, 5 ); + + m_staticText16 = new wxStaticText( this, wxID_ANY, _("&Repeat pin number increment:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText16->Wrap( -1 ); + fgSizer1->Add( m_staticText16, 0, wxALL|wxALIGN_CENTER_VERTICAL, 3 ); + + m_spinRepeatLabel = new wxSpinCtrl( this, wxID_ANY, wxT("1"), wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS|wxSP_WRAP, 0, 10, 1 ); + fgSizer1->Add( m_spinRepeatLabel, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 3 ); + + + fgSizer1->Add( 0, 0, 1, wxALIGN_CENTER_VERTICAL|wxEXPAND, 3 ); + + bSizerMain->Add( fgSizer1, 0, wxALIGN_CENTER|wxEXPAND, 0 ); + + m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); + bSizerMain->Add( m_staticline1, 0, wxEXPAND | wxALL, 5 ); + + m_sdbSizer1 = new wxStdDialogButtonSizer(); + m_sdbSizer1OK = new wxButton( this, wxID_OK ); + m_sdbSizer1->AddButton( m_sdbSizer1OK ); + m_sdbSizer1Cancel = new wxButton( this, wxID_CANCEL ); + m_sdbSizer1->AddButton( m_sdbSizer1Cancel ); + m_sdbSizer1->Realize(); + bSizerMain->Add( m_sdbSizer1, 0, wxALL|wxEXPAND, 0 ); + + mainSizer->Add( bSizerMain, 1, wxALL|wxEXPAND, 12 ); + + this->SetSizer( mainSizer ); + this->Layout(); + + this->Centre( wxBOTH ); +} + +DIALOG_LIBEDIT_DIMENSIONS_BASE::~DIALOG_LIBEDIT_DIMENSIONS_BASE() +{ +} diff --git a/eeschema/dialog_libedit_dimensions_base.fbp b/eeschema/dialog_libedit_dimensions_base.fbp new file mode 100644 index 0000000000..1807e42f46 --- /dev/null +++ b/eeschema/dialog_libedit_dimensions_base.fbp @@ -0,0 +1,1545 @@ + + + + + + C++ + 1 + UTF-8 + table + dialog_libedit_dimensions_base + 1000 + none + 1 + dialog_libedit_dimensions_base + + . + + 1 + 1 + 0 + + + wxBOTH + + 1 + + + + 0 + wxID_ANY + + + DIALOG_LIBEDIT_DIMENSIONS_BASE + + 412,358 + wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER + + Library Editor Options + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + mainSizer + wxHORIZONTAL + none + + 12 + wxALL|wxEXPAND + 1 + + + bSizerMain + wxVERTICAL + none + + 0 + wxALIGN_CENTER|wxEXPAND + 0 + + 3 + wxHORIZONTAL + 0,1,2 + + 0 + + fgSizer1 + wxFLEX_GROWMODE_SPECIFIED + none + 7 + 0 + + 3 + wxALIGN_CENTER_VERTICAL|wxALL + 1 + + + + 1 + + + 0 + wxID_ANY + &Grid size: + + + m_staticText3 + protected + + + + + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 3 + wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND + 0 + + + "100" "50" "25" "10" "5" "2" "1" + + 1 + + + 0 + wxID_ANY + + + m_choiceGridSize + protected + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 3 + wxALIGN_CENTER_VERTICAL|wxALL + 0 + + + + 1 + + + 0 + wxID_ANY + mils + + + m_staticGridUnits + protected + + + + + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 3 + wxALIGN_CENTER_VERTICAL|wxALL + 1 + + + + 1 + + + 0 + wxID_ANY + Current graphic &line width: + + + m_staticText5 + protected + + + + + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL|wxEXPAND + 0 + + + + 1 + + + 0 + wxID_ANY + + 0 + + m_CurrentGraphicLineThicknessCtrl + protected + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 3 + wxALIGN_CENTER_VERTICAL|wxALL + 0 + + + + 1 + + + 0 + wxID_ANY + mils + + + m_staticLineWidthUnits + protected + + + + + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 3 + wxALIGN_CENTER_VERTICAL|wxALL + 1 + + + + 1 + + + 0 + wxID_ANY + Current graphic text &size: + + + m_staticText7 + protected + + + + + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL|wxEXPAND + 0 + + + + 1 + + + 0 + wxID_ANY + + 0 + + m_CurrentGraphicTextSizeCtrl + protected + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 3 + wxALIGN_CENTER_VERTICAL|wxALL + 0 + + + + 1 + + + 0 + wxID_ANY + mils + + + m_staticTextSizeUnits + protected + + + + + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 3 + wxALIGN_CENTER_VERTICAL|wxALL + 1 + + + + 1 + + + 0 + wxID_ANY + Repeat draw item &horizontal displacement: + + + m_staticText9 + protected + + + + + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL|wxEXPAND + 0 + + + "100" "50" + + 1 + + + 0 + wxID_ANY + + + m_choiceRepeatHorizontal + protected + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 3 + wxALIGN_CENTER_VERTICAL|wxALL + 0 + + + + 1 + + + 0 + wxID_ANY + mils + + + m_staticRepeatXUnits + protected + + + + + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 3 + wxALIGN_CENTER_VERTICAL|wxALL + 1 + + + + 1 + + + 0 + wxID_ANY + Repeat draw item &vertical displacement: + + + m_staticText12 + protected + + + + + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL|wxEXPAND + 0 + + + "100" "50" + + 1 + + + 0 + wxID_ANY + + + m_choiceRepeatVertical + protected + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 3 + wxALIGN_CENTER_VERTICAL|wxALL + 0 + + + + 1 + + + 0 + wxID_ANY + mils + + + m_staticRepeatYUnits + protected + + + + + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL|wxALIGN_CENTER_VERTICAL + 0 + + + + 1 + + + 0 + wxID_ANY + Current &pin lenght + + + m_staticText15 + protected + + + + + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND|wxALL + 0 + + + + 1 + + + 0 + wxID_ANY + + 0 + + m_CurrentPinLenghtCtrl + protected + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL + 0 + + + + 1 + + + 0 + wxID_ANY + mils + + + m_staticText161 + protected + + + + + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL|wxALIGN_CENTER_VERTICAL + 0 + + + + 1 + + + 0 + wxID_ANY + Current pin name size + + + m_CurrentPinNameSizeText + protected + + + + + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL|wxEXPAND + 0 + + + + 1 + + + 0 + wxID_ANY + + 0 + + m_CurrentPinNameSizeCtrl + protected + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL + 0 + + + + 1 + + + 0 + wxID_ANY + mils + + + m_staticText18 + protected + + + + + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL|wxALIGN_CENTER_VERTICAL + 0 + + + + 1 + + + 0 + wxID_ANY + Current pin number size + + + m_CurrentPinNumberSizeText + protected + + + + + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL|wxEXPAND + 0 + + + + 1 + + + 0 + wxID_ANY + + 0 + + m_CurrentPinNumberSizeCtrl + protected + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL + 0 + + + + 1 + + + 0 + wxID_ANY + mils + + + m_staticText20 + protected + + + + + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 3 + wxALL|wxALIGN_CENTER_VERTICAL + 0 + + + + 1 + + + 0 + wxID_ANY + &Repeat pin number increment: + + + m_staticText16 + protected + + + + + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 3 + wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND + 0 + + + + 1 + + + 0 + wxID_ANY + 1 + 10 + + 0 + + m_spinRepeatLabel + protected + + + wxSP_ARROW_KEYS|wxSP_WRAP + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 3 + wxALIGN_CENTER_VERTICAL|wxEXPAND + 1 + + 0 + protected + 0 + + + + + + 5 + wxEXPAND | wxALL + 0 + + + + 1 + + + 0 + wxID_ANY + + + m_staticline1 + protected + + + wxLI_HORIZONTAL + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + wxALL|wxEXPAND + 0 + + 0 + 1 + 0 + 0 + 0 + 1 + 0 + 0 + + m_sdbSizer1 + protected + + + + + + + + + + + + + + + + diff --git a/eeschema/dialog_libedit_dimensions_base.h b/eeschema/dialog_libedit_dimensions_base.h new file mode 100644 index 0000000000..d8acc598a2 --- /dev/null +++ b/eeschema/dialog_libedit_dimensions_base.h @@ -0,0 +1,75 @@ +/////////////////////////////////////////////////////////////////////////// +// C++ code generated with wxFormBuilder (version Apr 16 2008) +// http://www.wxformbuilder.org/ +// +// PLEASE DO "NOT" EDIT THIS FILE! +/////////////////////////////////////////////////////////////////////////// + +#ifndef __dialog_libedit_dimensions_base__ +#define __dialog_libedit_dimensions_base__ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/////////////////////////////////////////////////////////////////////////// + +/////////////////////////////////////////////////////////////////////////////// +/// Class DIALOG_LIBEDIT_DIMENSIONS_BASE +/////////////////////////////////////////////////////////////////////////////// +class DIALOG_LIBEDIT_DIMENSIONS_BASE : public wxDialog +{ + private: + + protected: + wxStaticText* m_staticText3; + wxChoice* m_choiceGridSize; + wxStaticText* m_staticGridUnits; + wxStaticText* m_staticText5; + wxTextCtrl* m_CurrentGraphicLineThicknessCtrl; + wxStaticText* m_staticLineWidthUnits; + wxStaticText* m_staticText7; + wxTextCtrl* m_CurrentGraphicTextSizeCtrl; + wxStaticText* m_staticTextSizeUnits; + wxStaticText* m_staticText9; + wxChoice* m_choiceRepeatHorizontal; + wxStaticText* m_staticRepeatXUnits; + wxStaticText* m_staticText12; + wxChoice* m_choiceRepeatVertical; + wxStaticText* m_staticRepeatYUnits; + wxStaticText* m_staticText15; + wxTextCtrl* m_CurrentPinLenghtCtrl; + wxStaticText* m_staticText161; + wxStaticText* m_CurrentPinNameSizeText; + wxTextCtrl* m_CurrentPinNameSizeCtrl; + wxStaticText* m_staticText18; + wxStaticText* m_CurrentPinNumberSizeText; + wxTextCtrl* m_CurrentPinNumberSizeCtrl; + wxStaticText* m_staticText20; + wxStaticText* m_staticText16; + wxSpinCtrl* m_spinRepeatLabel; + + wxStaticLine* m_staticline1; + wxStdDialogButtonSizer* m_sdbSizer1; + wxButton* m_sdbSizer1OK; + wxButton* m_sdbSizer1Cancel; + + public: + DIALOG_LIBEDIT_DIMENSIONS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Library Editor Options"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 412,358 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); + ~DIALOG_LIBEDIT_DIMENSIONS_BASE(); + +}; + +#endif //__dialog_libedit_dimensions_base__ diff --git a/eeschema/eelayer.cpp b/eeschema/eelayer.cpp index 9d164312be..ac125e0ec0 100644 --- a/eeschema/eelayer.cpp +++ b/eeschema/eelayer.cpp @@ -34,7 +34,7 @@ END_EVENT_TABLE() /**************************************************************/ -void DisplayColorSetupFrame( WinEDA_SchematicFrame* parent, +void DisplayColorSetupFrame( WinEDA_DrawFrame* parent, const wxPoint& framepos ) { /**************************************************************/ @@ -55,7 +55,7 @@ WinEDA_SetColorsFrame::WinEDA_SetColorsFrame() // Standard Constructor -WinEDA_SetColorsFrame::WinEDA_SetColorsFrame( WinEDA_SchematicFrame* parent, +WinEDA_SetColorsFrame::WinEDA_SetColorsFrame( WinEDA_DrawFrame* parent, const wxPoint& framepos ) { m_Parent = parent; diff --git a/eeschema/eelayer.h b/eeschema/eelayer.h index 6423eae8b8..2f26d2efcd 100644 --- a/eeschema/eelayer.h +++ b/eeschema/eelayer.h @@ -285,7 +285,7 @@ private: DECLARE_DYNAMIC_CLASS( WinEDA_SetColorsFrame ) DECLARE_EVENT_TABLE() - WinEDA_SchematicFrame* m_Parent; + WinEDA_DrawFrame* m_Parent; wxBoxSizer* OuterBoxSizer; wxBoxSizer* MainBoxSizer; wxBoxSizer* ColumnBoxSizer; @@ -325,7 +325,7 @@ private: public: // Constructors and destructor WinEDA_SetColorsFrame(); - WinEDA_SetColorsFrame( WinEDA_SchematicFrame* parent, const wxPoint& framepos ); + WinEDA_SetColorsFrame( WinEDA_DrawFrame* parent, const wxPoint& framepos ); ~WinEDA_SetColorsFrame(); }; diff --git a/eeschema/eeschema_config.cpp b/eeschema/eeschema_config.cpp index 573e1904a1..97204f35e4 100644 --- a/eeschema/eeschema_config.cpp +++ b/eeschema/eeschema_config.cpp @@ -13,6 +13,7 @@ #include "program.h" #include "general.h" #include "protos.h" +#include "libeditframe.h" #include "eeschema_config.h" #include "worksheet.h" #include "hotkeys.h" @@ -25,6 +26,82 @@ #define FR_HISTORY_LIST_CNT 10 ///< Maximum number of find and replace strings. +void WinEDA_LibeditFrame::Process_Config( wxCommandEvent& event ) +{ + int id = event.GetId(); + wxPoint pos; + wxFileName fn; + WinEDA_SchematicFrame * schFrame = (WinEDA_SchematicFrame *) GetParent(); + + wxGetMousePosition( &pos.x, &pos.y ); + + pos.y += 5; + + switch( id ) + { + case ID_COLORS_SETUP: + DisplayColorSetupFrame( this, pos ); + break; + + case ID_CONFIG_SAVE: + schFrame->SaveProjectFile( this, false ); + break; + + case ID_CONFIG_READ: + { + fn = g_RootSheet->m_AssociatedScreen->m_FileName; + fn.SetExt( ProjectFileExtension ); + + wxFileDialog dlg( this, _( "Read Project File" ), fn.GetPath(), + fn.GetFullName(), ProjectFileWildcard, + wxFD_OPEN | wxFD_FILE_MUST_EXIST ); + + if( dlg.ShowModal() == wxID_CANCEL ) + break; + + schFrame->LoadProjectFile( dlg.GetPath(), TRUE ); + } + break; + + + /* Hotkey IDs */ + case ID_PREFERENCES_HOTKEY_CREATE_CONFIG: + fn = wxFileName( ReturnHotkeyConfigFilePath( g_ConfigFileLocationChoice ), + HOTKEY_FILENAME, + DEFAULT_HOTKEY_FILENAME_EXT ); + WriteHotkeyConfigFile( fn.GetFullPath(), s_Eeschema_Hokeys_Descr, true ); + break; + + case ID_PREFERENCES_HOTKEY_READ_CONFIG: + Read_Hotkey_Config( this, true ); + break; + + case ID_PREFERENCES_HOTKEY_EDIT_CONFIG: + { + fn = wxFileName( ReturnHotkeyConfigFilePath( g_ConfigFileLocationChoice ), + HOTKEY_FILENAME, DEFAULT_HOTKEY_FILENAME_EXT ); + wxString editorname = wxGetApp().GetEditorName(); + if( !editorname.IsEmpty() ) + ExecuteFile( this, editorname, QuoteFullPath( fn ) ); + } + break; + + case ID_PREFERENCES_HOTKEY_PATH_IS_HOME: + case ID_PREFERENCES_HOTKEY_PATH_IS_KICAD: + HandleHotkeyConfigMenuSelection( this, id ); + break; + + case ID_PREFERENCES_HOTKEY_SHOW_CURRENT_LIST: + // Display current hotkey list for LibEdit. + DisplayHotkeyList( this, s_Libedit_Hokeys_Descr ); + break; + + default: + DisplayError( this, wxT( "WinEDA_LibeditFrame::Process_Config error" ) ); + } +} + + void WinEDA_SchematicFrame::Process_Config( wxCommandEvent& event ) { @@ -42,10 +119,6 @@ void WinEDA_SchematicFrame::Process_Config( wxCommandEvent& event ) DisplayColorSetupFrame( this, pos ); break; - case ID_CONFIG_REQ: // Display the configuration window. - InstallConfigFrame( pos ); - break; - case ID_CONFIG_SAVE: SaveProjectFile( this, false ); break; @@ -100,7 +173,7 @@ void WinEDA_SchematicFrame::Process_Config( wxCommandEvent& event ) break; default: - DisplayError( this, wxT( "WinEDA_SchematicFrame::Process_Config internal error" ) ); + DisplayError( this, wxT( "WinEDA_SchematicFrame::Process_Config error" ) ); } } @@ -334,7 +407,7 @@ void WinEDA_SchematicFrame::SaveProjectFile( wxWindow* displayframe, bool askove int options = wxFD_SAVE; if( askoverwrite ) options |= wxFD_OVERWRITE_PROMPT; - wxFileDialog dlg( this, _( "Save Project Settings" ), wxGetCwd(), + wxFileDialog dlg( displayframe, _( "Save Project Settings" ), wxGetCwd(), fn.GetFullName(), ProjectFileWildcard, options ); if( dlg.ShowModal() == wxID_CANCEL ) diff --git a/eeschema/eeschema_id.h b/eeschema/eeschema_id.h index 572f23b8ce..37b36e1e23 100644 --- a/eeschema/eeschema_id.h +++ b/eeschema/eeschema_id.h @@ -127,6 +127,9 @@ enum id_eeschema_frm ID_POPUP_SCH_GETINFO_MARKER, ID_POPUP_END_RANGE, + /* Library editor main menubar IDs. */ + ID_LIBEDIT_DIMENSIONS, + /* Library editor horizontal toolbar IDs. */ ID_LIBEDIT_SELECT_PART, ID_LIBEDIT_SELECT_CURRENT_LIB, @@ -174,7 +177,7 @@ enum id_eeschema_frm ID_POPUP_LIBEDIT_FIELD_ROTATE_ITEM, ID_POPUP_LIBEDIT_DELETE_CURRENT_POLY_SEGMENT, ID_POPUP_LIBEDIT_ROTATE_GRAPHIC_TEXT, - + /* Library editor menubar IDs */ ID_LIBEDIT_SAVE_CURRENT_LIB_AS, ID_LIBEDIT_GEN_PNG_FILE, diff --git a/eeschema/libeditframe.cpp b/eeschema/libeditframe.cpp index 6673c9cf20..cdea97bfea 100644 --- a/eeschema/libeditframe.cpp +++ b/eeschema/libeditframe.cpp @@ -125,6 +125,25 @@ EVT_MENU( ID_LIBEDIT_GEN_SVG_FILE, EVT_MENU( ID_GENERAL_HELP, WinEDA_DrawFrame::GetKicadHelp ) +EVT_MENU( ID_CONFIG_REQ, + WinEDA_LibeditFrame::InstallConfigFrame ) +EVT_MENU( ID_CONFIG_SAVE, + WinEDA_LibeditFrame::Process_Config ) +EVT_MENU( ID_CONFIG_READ, + WinEDA_LibeditFrame::Process_Config ) +EVT_MENU( ID_COLORS_SETUP, + WinEDA_LibeditFrame::Process_Config ) +EVT_MENU( ID_LIBEDIT_DIMENSIONS, + WinEDA_LibeditFrame::InstallDimensionsDialog ) + +EVT_MENU_RANGE( ID_PREFERENCES_HOTKEY_START, + ID_PREFERENCES_HOTKEY_END, + WinEDA_LibeditFrame::Process_Config ) + +EVT_MENU_RANGE( ID_LANGUAGE_CHOICE, ID_LANGUAGE_CHOICE_END, + WinEDA_LibeditFrame::SetLanguage ) + + /* Context menu events and commands. */ EVT_MENU( ID_LIBEDIT_EDIT_PIN, WinEDA_LibeditFrame::OnEditPin ) @@ -169,13 +188,15 @@ EVT_UPDATE_UI_RANGE( ID_LIBEDIT_PIN_BUTT, ID_LIBEDIT_EXPORT_BODY_BUTT, END_EVENT_TABLE() -WinEDA_LibeditFrame::WinEDA_LibeditFrame( wxWindow* father, +WinEDA_LibeditFrame::WinEDA_LibeditFrame( WinEDA_SchematicFrame* aParent, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : - WinEDA_DrawFrame( father, LIBEDITOR_FRAME, title, pos, size, style ) + WinEDA_DrawFrame( aParent, LIBEDITOR_FRAME, title, pos, size, style ) { + wxASSERT( aParent ); + m_FrameName = wxT( "LibeditFrame" ); m_Draw_Axis = true; // true to draw axis m_ConfigPath = wxT( "LibraryEditor" ); @@ -970,3 +991,13 @@ void WinEDA_LibeditFrame::EnsureActiveLibExists() else m_library = NULL; } + +/** function SetLanguage + * called on a language menu selection + */ +void WinEDA_LibeditFrame::SetLanguage( wxCommandEvent& event ) +{ + WinEDA_BasicFrame::SetLanguage( event ); + WinEDA_SchematicFrame *parent = (WinEDA_SchematicFrame *)GetParent(); + parent->WinEDA_BasicFrame::SetLanguage( event ); +} diff --git a/eeschema/libeditframe.h b/eeschema/libeditframe.h index 78d5ef6d53..bc0c114011 100644 --- a/eeschema/libeditframe.h +++ b/eeschema/libeditframe.h @@ -27,7 +27,7 @@ public: WinEDAChoiceBox* m_SelAliasBox; // a box to select the alias to edit (if any) public: - WinEDA_LibeditFrame( wxWindow* father, + WinEDA_LibeditFrame( WinEDA_SchematicFrame* aParent, const wxString& title, const wxPoint& pos, const wxSize& size, long style = KICAD_DEFAULT_DRAWFRAME_STYLE ); @@ -42,6 +42,14 @@ public: */ static void EnsureActiveLibExists(); + /** function SetLanguage + * called on a language menu selection + */ + void SetLanguage( wxCommandEvent& event ); + + void InstallConfigFrame( wxCommandEvent& event ); + void InstallDimensionsDialog( wxCommandEvent& event ); + void Process_Config( wxCommandEvent& event ); void OnPlotCurrentComponent( wxCommandEvent& event ); void Process_Special_Functions( wxCommandEvent& event ); void OnImportPart( wxCommandEvent& event ); diff --git a/eeschema/menubar_libedit.cpp b/eeschema/menubar_libedit.cpp index da79780c00..ee33c7890b 100644 --- a/eeschema/menubar_libedit.cpp +++ b/eeschema/menubar_libedit.cpp @@ -200,6 +200,50 @@ void WinEDA_LibeditFrame::ReCreateMenuBar() item->SetBitmap( add_polygon_xpm ); placeMenu->Append( item ); + /** + * Preferences Menu + */ + wxMenu* configmenu = new wxMenu; + + /* Library */ + item = new wxMenuItem( configmenu, ID_CONFIG_REQ, _( "&Library" ), + _( "Library preferences" ) ); + item->SetBitmap( library_xpm ); + configmenu->Append( item ); + + /* Colors */ + item = new wxMenuItem( configmenu, ID_COLORS_SETUP, _( "&Colors" ), + _( "Color preferences" ) ); + item->SetBitmap( palette_xpm ); + configmenu->Append( item ); + +#if 0 // work in progress. activated when finished +/* Dimension */ + item = new wxMenuItem( configmenu, ID_LIBEDIT_DIMENSIONS, _( "&Dimensions" ), + _( "Tickness of graphic lines, texts sizes and others" ) ); + item->SetBitmap( add_dimension_xpm ); + configmenu->Append( item ); +#endif + /* Language submenu */ + wxGetApp().AddMenuLanguageList( configmenu ); + + /* Hotkey submenu */ + AddHotkeyConfigMenu( configmenu ); + + /* Separator */ + configmenu->AppendSeparator(); + + /* Save preferences */ + item = new wxMenuItem( configmenu, ID_CONFIG_SAVE, _( "&Save preferences" ), + _( "Save application preferences" ) ); + item->SetBitmap( save_setup_xpm ); + configmenu->Append( item ); + + /* Read preferences */ + item = new wxMenuItem( configmenu, ID_CONFIG_READ, _( "&Read preferences" ), + _( "Read application preferences" ) ); + item->SetBitmap( read_setup_xpm ); + configmenu->Append( item ); /** * Help Menu @@ -217,6 +261,7 @@ void WinEDA_LibeditFrame::ReCreateMenuBar() menuBar->Append( editMenu, _( "&Edit" ) ); menuBar->Append( viewMenu, _( "&View" ) ); menuBar->Append( placeMenu, _( "&Place" ) ); + menuBar->Append( configmenu, _( "&Preferences" ) ); menuBar->Append( helpMenu, _( "&Help" ) ); /* Associate the menu bar with the frame */ diff --git a/eeschema/protos.h b/eeschema/protos.h index 429c4a1f6e..f6fd8d2244 100644 --- a/eeschema/protos.h +++ b/eeschema/protos.h @@ -158,7 +158,7 @@ void RedrawOneStruct( WinEDA_DrawPanel* panel, /**************/ void SeedLayers(); EDA_Colors ReturnLayerColor( int Layer ); -void DisplayColorSetupFrame( WinEDA_SchematicFrame* parent, +void DisplayColorSetupFrame( WinEDA_DrawFrame* parent, const wxPoint& pos ); /*************/ diff --git a/eeschema/schframe.cpp b/eeschema/schframe.cpp index 68b4eef589..50a5487232 100644 --- a/eeschema/schframe.cpp +++ b/eeschema/schframe.cpp @@ -63,14 +63,21 @@ BEGIN_EVENT_TABLE( WinEDA_SchematicFrame, WinEDA_DrawFrame ) EVT_MENU( ID_POPUP_SCH_COPY_ITEM, WinEDA_SchematicFrame::OnCopySchematicItemRequest ) - EVT_MENU_RANGE( ID_CONFIG_AND_PREFERENCES_START, - ID_CONFIG_AND_PREFERENCES_END, + EVT_MENU( ID_CONFIG_REQ, + WinEDA_SchematicFrame::InstallConfigFrame ) + EVT_MENU( ID_CONFIG_SAVE, + WinEDA_SchematicFrame::Process_Config ) + EVT_MENU( ID_CONFIG_READ, + WinEDA_SchematicFrame::Process_Config ) + EVT_MENU_RANGE( ID_PREFERENCES_HOTKEY_START, + ID_PREFERENCES_HOTKEY_END, WinEDA_SchematicFrame::Process_Config ) + EVT_TOOL( ID_COLORS_SETUP, WinEDA_SchematicFrame::Process_Config ) EVT_TOOL( ID_OPTIONS_SETUP, WinEDA_SchematicFrame::OnSetOptions ) EVT_MENU_RANGE( ID_LANGUAGE_CHOICE, ID_LANGUAGE_CHOICE_END, - WinEDA_DrawFrame::SetLanguage ) + WinEDA_SchematicFrame::SetLanguage ) EVT_TOOL_RANGE( ID_ZOOM_IN, ID_ZOOM_PAGE, WinEDA_SchematicFrame::OnZoom ) @@ -747,3 +754,14 @@ void WinEDA_SchematicFrame::OnExit( wxCommandEvent& event ) { Close( true ); } + +/** function SetLanguage + * called on a language menu selection + */ +void WinEDA_SchematicFrame::SetLanguage( wxCommandEvent& event ) +{ + WinEDA_BasicFrame::SetLanguage( event ); + if( m_LibeditFrame ) + m_LibeditFrame->WinEDA_BasicFrame::SetLanguage( event ); +} + diff --git a/gerbview/gerberframe.cpp b/gerbview/gerberframe.cpp index d1db484d18..ee73b74c34 100644 --- a/gerbview/gerberframe.cpp +++ b/gerbview/gerberframe.cpp @@ -54,8 +54,12 @@ BEGIN_EVENT_TABLE( WinEDA_GerberFrame, WinEDA_BasePcbFrame ) EVT_MENU( ID_EXIT, WinEDA_GerberFrame::Process_Special_Functions ) // menu Preferences - EVT_MENU_RANGE( ID_CONFIG_AND_PREFERENCES_START, - ID_CONFIG_AND_PREFERENCES_END, + EVT_MENU( ID_CONFIG_REQ, + WinEDA_GerberFrame::Process_Config ) + EVT_MENU( ID_CONFIG_SAVE, + WinEDA_GerberFrame::Process_Config ) + EVT_MENU_RANGE( ID_PREFERENCES_HOTKEY_START, + ID_PREFERENCES_HOTKEY_END, WinEDA_GerberFrame::Process_Config ) EVT_MENU( ID_MENU_GERBVIEW_SHOW_HIDE_LAYERS_MANAGER_DIALOG, WinEDA_GerberFrame::OnSelectOptionToolbar ) diff --git a/include/id.h b/include/id.h index c1f592eceb..8d1fbf5645 100644 --- a/include/id.h +++ b/include/id.h @@ -29,11 +29,11 @@ enum main_id ID_SAVE_BOARD, ID_SAVE_BOARD_AS, - ID_CONFIG_AND_PREFERENCES_START, ID_CONFIG_REQ, ID_CONFIG_SAVE, ID_CONFIG_READ, + ID_PREFERENCES_HOTKEY_START, ID_PREFERENCES_HOTKEY_SUBMENU, ID_PREFERENCES_HOTKEY_CREATE_CONFIG, ID_PREFERENCES_HOTKEY_READ_CONFIG, @@ -41,10 +41,7 @@ enum main_id ID_PREFERENCES_HOTKEY_PATH_IS_HOME, ID_PREFERENCES_HOTKEY_PATH_IS_KICAD, ID_PREFERENCES_HOTKEY_SHOW_CURRENT_LIST, - - ID_PREFERENCES_UNUSED2, - ID_PREFERENCES_UNUSED3, - ID_CONFIG_AND_PREFERENCES_END, + ID_PREFERENCES_HOTKEY_END, ID_GEN_PRINT, ID_GEN_PLOT, diff --git a/include/wxEeschemaStruct.h b/include/wxEeschemaStruct.h index 65da77523d..5fffef0882 100644 --- a/include/wxEeschemaStruct.h +++ b/include/wxEeschemaStruct.h @@ -145,7 +145,7 @@ public: virtual wxString GetScreenDesc(); - void InstallConfigFrame( const wxPoint& pos ); + void InstallConfigFrame( wxCommandEvent& event ); void OnLeftClick( wxDC* DC, const wxPoint& MousePos ); void OnLeftDClick( wxDC* DC, const wxPoint& MousePos ); @@ -326,6 +326,11 @@ private: void OnUpdateHiddenPins( wxUpdateUIEvent& event ); void OnUpdateBusOrientation( wxUpdateUIEvent& event ); + /** function SetLanguage + * called on a language menu selection + */ + void SetLanguage( wxCommandEvent& event ); + // Bus Entry SCH_BUS_ENTRY* CreateBusEntry( wxDC* DC, int entry_type ); void SetBusEntryShape( wxDC* DC, diff --git a/pcbnew/classpcb.cpp b/pcbnew/classpcb.cpp index 4da39831d0..038af398dc 100644 --- a/pcbnew/classpcb.cpp +++ b/pcbnew/classpcb.cpp @@ -29,7 +29,7 @@ static const int PcbZoomList[] = }; #define PCB_ZOOM_LIST_CNT ( sizeof( PcbZoomList ) / sizeof( int ) ) -#define MM_TO_PCB_UNITS 10000.0 / 25.4000508001016 +#define MM_TO_PCB_UNITS 10000.0 / 25.4 /* Default grid sizes for PCB editor screens. */ diff --git a/pcbnew/pcbframe.cpp b/pcbnew/pcbframe.cpp index 369162209f..496c731c7b 100644 --- a/pcbnew/pcbframe.cpp +++ b/pcbnew/pcbframe.cpp @@ -108,8 +108,14 @@ BEGIN_EVENT_TABLE( WinEDA_PcbFrame, WinEDA_BasePcbFrame ) EVT_MENU( wxID_EXIT, WinEDA_PcbFrame::OnQuit ) // menu Config - EVT_MENU_RANGE( ID_CONFIG_AND_PREFERENCES_START, - ID_CONFIG_AND_PREFERENCES_END, + EVT_MENU( ID_CONFIG_REQ, + WinEDA_PcbFrame::Process_Config ) + EVT_MENU( ID_CONFIG_SAVE, + WinEDA_PcbFrame::Process_Config ) + EVT_MENU( ID_CONFIG_READ, + WinEDA_PcbFrame::Process_Config ) + EVT_MENU_RANGE( ID_PREFERENCES_HOTKEY_START, + ID_PREFERENCES_HOTKEY_END, WinEDA_PcbFrame::Process_Config ) EVT_MENU( ID_MENU_PCB_SHOW_HIDE_LAYERS_MANAGER_DIALOG, @@ -625,7 +631,10 @@ void WinEDA_PcbFrame::SetLanguage( wxCommandEvent& event ) WinEDA_DrawFrame::SetLanguage( event ); m_Layers->SetLayersManagerTabsText( ); wxAuiPaneInfo& pane_info = m_auimgr.GetPane(m_Layers); - pane_info.Caption( _( "Visibles" ) ); + pane_info.Caption( _( "Visibles" ) ); m_auimgr.Update(); ReFillLayerWidget(); + + if( m_ModuleEditFrame ) + m_ModuleEditFrame->WinEDA_DrawFrame::SetLanguage( event ); }