diff --git a/pcbnew/basepcbframe.cpp b/pcbnew/basepcbframe.cpp index 8e539bfff8..2721c78285 100644 --- a/pcbnew/basepcbframe.cpp +++ b/pcbnew/basepcbframe.cpp @@ -699,17 +699,17 @@ void PCB_BASE_FRAME::UpdateStatusBar() { case INCHES: absformatter = wxT( "X %.6f Y %.6f" ); - locformatter = wxT( "dx %.6f dy %.6f dist %.4f" ); + locformatter = wxT( "dx %.6f dy %.6f dist %.4f" ); break; case MILLIMETRES: absformatter = wxT( "X %.6f Y %.6f" ); - locformatter = wxT( "dx %.6f dy %.6f dist %.3f" ); + locformatter = wxT( "dx %.6f dy %.6f dist %.3f" ); break; case UNSCALED_UNITS: absformatter = wxT( "X %f Y %f" ); - locformatter = wxT( "dx %f dy %f dist %f" ); + locformatter = wxT( "dx %f dy %f dist %f" ); break; case DEGREES: diff --git a/pcbnew/dialogs/dialog_footprint_wizard_list.cpp b/pcbnew/dialogs/dialog_footprint_wizard_list.cpp index a32323386f..858b372a07 100644 --- a/pcbnew/dialogs/dialog_footprint_wizard_list.cpp +++ b/pcbnew/dialogs/dialog_footprint_wizard_list.cpp @@ -34,12 +34,13 @@ #include #include +#define ROW_NAME 0 +#define ROW_DESCR 1 DIALOG_FOOTPRINT_WIZARD_LIST::DIALOG_FOOTPRINT_WIZARD_LIST( wxWindow* aParent ) : DIALOG_FOOTPRINT_WIZARD_LIST_BASE( aParent ) { - SetFocus(); int n_wizards = FOOTPRINT_WIZARDS::GetSize(); // Current wizard selection, empty or first @@ -50,8 +51,6 @@ DIALOG_FOOTPRINT_WIZARD_LIST::DIALOG_FOOTPRINT_WIZARD_LIST( wxWindow* aParent ) // Choose selection mode and insert the needed rows - m_footprintWizardsGrid->SetColSize( 0, 0 ); // hide the preview for now - m_footprintWizardsGrid->SetSelectionMode( wxGrid::wxGridSelectRows ); m_footprintWizardsGrid->InsertRows( 0, n_wizards, true ); @@ -63,8 +62,8 @@ DIALOG_FOOTPRINT_WIZARD_LIST::DIALOG_FOOTPRINT_WIZARD_LIST( wxWindow* aParent ) wxString description = wizard->GetDescription(); wxString image = wizard->GetImage(); - m_footprintWizardsGrid->SetCellValue( i, 1, name ); - m_footprintWizardsGrid->SetCellValue( i, 2, description ); + m_footprintWizardsGrid->SetCellValue( i, ROW_NAME, name ); + m_footprintWizardsGrid->SetCellValue( i, ROW_DESCR, description ); } @@ -72,6 +71,8 @@ DIALOG_FOOTPRINT_WIZARD_LIST::DIALOG_FOOTPRINT_WIZARD_LIST( wxWindow* aParent ) m_footprintWizardsGrid->ClearSelection(); m_footprintWizardsGrid->SelectRow( 0, false ); + GetSizer()->SetSizeHints( this ); + Center(); } @@ -87,15 +88,3 @@ FOOTPRINT_WIZARD* DIALOG_FOOTPRINT_WIZARD_LIST::GetWizard() { return m_FootprintWizard; } - - -void DIALOG_FOOTPRINT_WIZARD_LIST::OnOpenButtonClick( wxCommandEvent& event ) -{ - EndModal( wxID_OK ); -} - - -void DIALOG_FOOTPRINT_WIZARD_LIST::OnCancelClick( wxCommandEvent& event ) -{ - EndModal( wxID_CANCEL ); -} diff --git a/pcbnew/dialogs/dialog_footprint_wizard_list.fbp b/pcbnew/dialogs/dialog_footprint_wizard_list.fbp index 354cfde36f..4eff0f8327 100644 --- a/pcbnew/dialogs/dialog_footprint_wizard_list.fbp +++ b/pcbnew/dialogs/dialog_footprint_wizard_list.fbp @@ -44,7 +44,7 @@ 400,200 DIALOG_FOOTPRINT_WIZARD_LIST_BASE - 404,200 + 501,273 wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER DIALOG_SHIM; dialog_shim.h Footprint Wizards @@ -121,10 +121,10 @@ 1 wxALIGN_LEFT 20 - "Preview" "Name" "Description" + "Name" "Description" wxALIGN_CENTRE - 3 - 80,80,325 + 2 + 160,325 1 0 @@ -275,7 +275,7 @@ 0 1 - m_staticline1 + m_staticline 1 @@ -334,11 +334,11 @@ m_sdbSizer protected - OnCancelClick + - OnOpenButtonClick + diff --git a/pcbnew/dialogs/dialog_footprint_wizard_list.h b/pcbnew/dialogs/dialog_footprint_wizard_list.h index 0361e3634f..397d224556 100644 --- a/pcbnew/dialogs/dialog_footprint_wizard_list.h +++ b/pcbnew/dialogs/dialog_footprint_wizard_list.h @@ -40,8 +40,6 @@ public: private: void OnCellWizardClick( wxGridEvent& event ); - void OnOpenButtonClick( wxCommandEvent& event ); - void OnCancelClick( wxCommandEvent& event ); }; #endif // _DIALOG_FOOTPRINT_WIZARD_LIST_H_ diff --git a/pcbnew/dialogs/dialog_footprint_wizard_list_base.cpp b/pcbnew/dialogs/dialog_footprint_wizard_list_base.cpp index 2f350a936c..a63a2bbc8b 100644 --- a/pcbnew/dialogs/dialog_footprint_wizard_list_base.cpp +++ b/pcbnew/dialogs/dialog_footprint_wizard_list_base.cpp @@ -19,22 +19,20 @@ DIALOG_FOOTPRINT_WIZARD_LIST_BASE::DIALOG_FOOTPRINT_WIZARD_LIST_BASE( wxWindow* m_footprintWizardsGrid = new wxGrid( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); // Grid - m_footprintWizardsGrid->CreateGrid( 0, 3 ); + m_footprintWizardsGrid->CreateGrid( 0, 2 ); m_footprintWizardsGrid->EnableEditing( false ); m_footprintWizardsGrid->EnableGridLines( true ); m_footprintWizardsGrid->EnableDragGridSize( false ); m_footprintWizardsGrid->SetMargins( 0, 0 ); // Columns - m_footprintWizardsGrid->SetColSize( 0, 80 ); - m_footprintWizardsGrid->SetColSize( 1, 80 ); - m_footprintWizardsGrid->SetColSize( 2, 325 ); + m_footprintWizardsGrid->SetColSize( 0, 160 ); + m_footprintWizardsGrid->SetColSize( 1, 325 ); m_footprintWizardsGrid->EnableDragColMove( false ); m_footprintWizardsGrid->EnableDragColSize( true ); m_footprintWizardsGrid->SetColLabelSize( 20 ); - m_footprintWizardsGrid->SetColLabelValue( 0, _("Preview") ); - m_footprintWizardsGrid->SetColLabelValue( 1, _("Name") ); - m_footprintWizardsGrid->SetColLabelValue( 2, _("Description") ); + m_footprintWizardsGrid->SetColLabelValue( 0, _("Name") ); + m_footprintWizardsGrid->SetColLabelValue( 1, _("Description") ); m_footprintWizardsGrid->SetColLabelAlignment( wxALIGN_LEFT, wxALIGN_CENTRE ); // Rows @@ -51,8 +49,8 @@ DIALOG_FOOTPRINT_WIZARD_LIST_BASE::DIALOG_FOOTPRINT_WIZARD_LIST_BASE( wxWindow* bSizerMain->Add( m_footprintWizardsGrid, 1, wxALL|wxEXPAND, 5 ); - m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - bSizerMain->Add( m_staticline1, 0, wxEXPAND | wxALL, 5 ); + m_staticline = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); + bSizerMain->Add( m_staticline, 0, wxEXPAND | wxALL, 5 ); m_sdbSizer = new wxStdDialogButtonSizer(); m_sdbSizerOK = new wxButton( this, wxID_OK ); @@ -71,15 +69,11 @@ DIALOG_FOOTPRINT_WIZARD_LIST_BASE::DIALOG_FOOTPRINT_WIZARD_LIST_BASE( wxWindow* // Connect Events m_footprintWizardsGrid->Connect( wxEVT_GRID_CELL_LEFT_CLICK, wxGridEventHandler( DIALOG_FOOTPRINT_WIZARD_LIST_BASE::OnCellWizardClick ), NULL, this ); - m_sdbSizerCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_FOOTPRINT_WIZARD_LIST_BASE::OnCancelClick ), NULL, this ); - m_sdbSizerOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_FOOTPRINT_WIZARD_LIST_BASE::OnOpenButtonClick ), NULL, this ); } DIALOG_FOOTPRINT_WIZARD_LIST_BASE::~DIALOG_FOOTPRINT_WIZARD_LIST_BASE() { // Disconnect Events m_footprintWizardsGrid->Disconnect( wxEVT_GRID_CELL_LEFT_CLICK, wxGridEventHandler( DIALOG_FOOTPRINT_WIZARD_LIST_BASE::OnCellWizardClick ), NULL, this ); - m_sdbSizerCancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_FOOTPRINT_WIZARD_LIST_BASE::OnCancelClick ), NULL, this ); - m_sdbSizerOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_FOOTPRINT_WIZARD_LIST_BASE::OnOpenButtonClick ), NULL, this ); } diff --git a/pcbnew/dialogs/dialog_footprint_wizard_list_base.h b/pcbnew/dialogs/dialog_footprint_wizard_list_base.h index 6d0c1cba4c..c6143634f9 100644 --- a/pcbnew/dialogs/dialog_footprint_wizard_list_base.h +++ b/pcbnew/dialogs/dialog_footprint_wizard_list_base.h @@ -37,20 +37,18 @@ class DIALOG_FOOTPRINT_WIZARD_LIST_BASE : public DIALOG_SHIM protected: wxGrid* m_footprintWizardsGrid; - wxStaticLine* m_staticline1; + wxStaticLine* m_staticline; wxStdDialogButtonSizer* m_sdbSizer; wxButton* m_sdbSizerOK; wxButton* m_sdbSizerCancel; // Virtual event handlers, overide them in your derived class virtual void OnCellWizardClick( wxGridEvent& event ) { event.Skip(); } - virtual void OnCancelClick( wxCommandEvent& event ) { event.Skip(); } - virtual void OnOpenButtonClick( wxCommandEvent& event ) { event.Skip(); } public: - DIALOG_FOOTPRINT_WIZARD_LIST_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Footprint Wizards"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 404,200 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); + DIALOG_FOOTPRINT_WIZARD_LIST_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Footprint Wizards"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 501,273 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); ~DIALOG_FOOTPRINT_WIZARD_LIST_BASE(); }; diff --git a/pcbnew/footprint_wizard.cpp b/pcbnew/footprint_wizard.cpp index 7584e4a2c2..90159f28c1 100644 --- a/pcbnew/footprint_wizard.cpp +++ b/pcbnew/footprint_wizard.cpp @@ -19,10 +19,6 @@ #include #include -#define NEXT_PART 1 -#define NEW_PART 0 -#define PREVIOUS_PART -1 - void FOOTPRINT_WIZARD_FRAME::Process_Special_Functions( wxCommandEvent& event ) { @@ -154,13 +150,12 @@ MODULE* FOOTPRINT_WIZARD_FRAME::GetBuiltFootprint() void FOOTPRINT_WIZARD_FRAME::SelectFootprintWizard() { - DIALOG_FOOTPRINT_WIZARD_LIST* selectWizard = - new DIALOG_FOOTPRINT_WIZARD_LIST( this ); + DIALOG_FOOTPRINT_WIZARD_LIST wizardSelector( this ); - if( selectWizard->ShowModal() != wxID_OK ) + if( wizardSelector.ShowModal() != wxID_OK ) return; - FOOTPRINT_WIZARD* footprintWizard = selectWizard->GetWizard(); + FOOTPRINT_WIZARD* footprintWizard = wizardSelector.GetWizard(); if( footprintWizard ) { @@ -169,8 +164,8 @@ void FOOTPRINT_WIZARD_FRAME::SelectFootprintWizard() } else { - m_wizardName = wxT( "" ); - m_wizardDescription = wxT( "" ); + m_wizardName.Empty(); + m_wizardDescription.Empty(); } ReloadFootprint(); @@ -207,7 +202,7 @@ void FOOTPRINT_WIZARD_FRAME::ParametersUpdated( wxGridEvent& event ) wxArrayString arr; wxArrayString ptList = footprintWizard->GetParameterTypes( page ); - for( int i = 0; iGetCellValue( i, 1 ); diff --git a/pcbnew/footprint_wizard_frame.cpp b/pcbnew/footprint_wizard_frame.cpp index b57988b4bf..f76d29f772 100644 --- a/pcbnew/footprint_wizard_frame.cpp +++ b/pcbnew/footprint_wizard_frame.cpp @@ -25,7 +25,7 @@ */ /** - * @file modview_frame.cpp + * @file footprint_wizard_frame.cpp */ #include @@ -40,7 +40,6 @@ #include #include -#include #include #include "footprint_wizard_frame.h" #include @@ -93,26 +92,6 @@ BEGIN_EVENT_TABLE( FOOTPRINT_WIZARD_FRAME, EDA_DRAW_FRAME ) END_EVENT_TABLE() -/* - * This emulates the zoom menu entries found in the other KiCad applications. - * The library viewer does not have any menus so add an accelerator table to - * the main frame. - */ -static wxAcceleratorEntry accels[] = -{ - wxAcceleratorEntry( wxACCEL_NORMAL, WXK_F1, ID_ZOOM_IN ), - wxAcceleratorEntry( wxACCEL_NORMAL, WXK_F2, ID_ZOOM_OUT ), - wxAcceleratorEntry( wxACCEL_NORMAL, WXK_F3, ID_ZOOM_REDRAW ), - wxAcceleratorEntry( wxACCEL_NORMAL, WXK_F4, ID_POPUP_ZOOM_CENTER ), - wxAcceleratorEntry( wxACCEL_NORMAL, WXK_HOME, ID_ZOOM_PAGE ), - wxAcceleratorEntry( wxACCEL_NORMAL, WXK_SPACE, ID_SET_RELATIVE_OFFSET ) -}; - -#define ACCEL_TABLE_CNT ( sizeof( accels ) / sizeof( wxAcceleratorEntry ) ) - -#define EXTRA_BORDER_SIZE 2 - - #define FOOTPRINT_WIZARD_FRAME_NAME wxT( "FootprintWizard" ) FOOTPRINT_WIZARD_FRAME::FOOTPRINT_WIZARD_FRAME( KIWAY* aKiway, @@ -127,8 +106,6 @@ FOOTPRINT_WIZARD_FRAME::FOOTPRINT_WIZARD_FRAME( KIWAY* aKiway, if( aFrameType == FRAME_PCB_FOOTPRINT_WIZARD_MODAL ) SetModal( true ); - wxAcceleratorTable table( ACCEL_TABLE_CNT, accels ); - m_configPath = wxT( "FootprintWizard" ); m_showAxis = true; // true to draw axis. @@ -176,9 +153,6 @@ FOOTPRINT_WIZARD_FRAME::FOOTPRINT_WIZARD_FRAME( KIWAY* aKiway, DisplayWizardInfos(); - if( m_canvas ) - m_canvas->SetAcceleratorTable( table ); - m_auimgr.SetManagedWindow( this ); EDA_PANEINFO horiztb; @@ -230,7 +204,7 @@ FOOTPRINT_WIZARD_FRAME::FOOTPRINT_WIZARD_FRAME( KIWAY* aKiway, Show( true ); - this->SelectFootprintWizard(); + SelectFootprintWizard(); } diff --git a/pcbnew/pcbnew.cpp b/pcbnew/pcbnew.cpp index 6d45c3b056..100fbaafe3 100644 --- a/pcbnew/pcbnew.cpp +++ b/pcbnew/pcbnew.cpp @@ -247,6 +247,7 @@ static bool scriptingSetup() // [KICAD_PATH]/scripting/plugins // Add this default search path: path_frag = Pgm().GetExecutablePath() + wxT( "scripting/plugins" ); + #elif defined( __WXMAC__ ) // User plugin folder is ~/Library/Application Support/kicad/scripting/plugins path_frag = GetOSXKicadUserDataDir() + wxT( "/scripting/plugins" ); @@ -275,6 +276,7 @@ static bool scriptingSetup() // set $PYTHONPATH wxSetEnv( "PYTHONPATH", pypath ); + #else // Add this default search path: path_frag = wxT( "/usr/local/kicad/bin/scripting/plugins" ); @@ -317,16 +319,17 @@ bool IFACE::OnKifaceStart( PGM_BASE* aProgram, int aCtlBits ) if( !FP_LIB_TABLE::LoadGlobalTable( GFootprintTable ) ) { - DisplayInfoMessage( NULL, wxT( + DisplayInfoMessage( NULL, _( "You have run Pcbnew for the first time using the " - "new footprint library table method for finding " - "footprints. Pcbnew has either copied the default " + "new footprint library table method for finding footprints.\n" + "Pcbnew has either copied the default " "table or created an empty table in the kicad configuration " - "folder. You must first configure the library " + "folder.\n" + "You must first configure the library " "table to include all footprint libraries not " - "included with KiCad. See the \"Footprint Library " - "Table\" section of the CvPcb or Pcbnew documentation for " - "more information." ) ); + "included with KiCad.\n" + "See the \"Footprint Library Table\" section of" + "the CvPcb or Pcbnew documentation for more information." ) ); } } catch( const IO_ERROR& ioe )