diff --git a/pcbnew/dialogs/panel_pcbnew_action_plugins.cpp b/pcbnew/dialogs/panel_pcbnew_action_plugins.cpp index cc032b7f2c..7d9d4d882c 100644 --- a/pcbnew/dialogs/panel_pcbnew_action_plugins.cpp +++ b/pcbnew/dialogs/panel_pcbnew_action_plugins.cpp @@ -2,7 +2,7 @@ * This program source code file is part of KiCad, a free EDA CAD application. * * Copyright (C) 2018 Andrew Lutsenko, anlutsenko at gmail dot com - * Copyright (C) 1992-2018 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 1992-2019 KiCad Developers, see AUTHORS.txt for contributors. * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -192,7 +192,12 @@ bool PANEL_PCBNEW_ACTION_PLUGINS::TransferDataToWindow() } for( int col = 0; col < m_grid->GetNumberCols(); col++ ) + { + // Set the minimal width to the column label size. + m_grid->SetColMinimalWidth( col, m_grid->GetVisibleWidth( col, true, false, false ) ); + // Set the width to seen the full contents m_grid->SetColSize( col, m_grid->GetVisibleWidth( col, true, true, false ) ); + } m_grid->AutoSizeRows(); diff --git a/pcbnew/dialogs/panel_pcbnew_action_plugins_base.cpp b/pcbnew/dialogs/panel_pcbnew_action_plugins_base.cpp index 4892ae3dfa..f3513969c9 100644 --- a/pcbnew/dialogs/panel_pcbnew_action_plugins_base.cpp +++ b/pcbnew/dialogs/panel_pcbnew_action_plugins_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Aug 2 2018) +// C++ code generated with wxFormBuilder (version Dec 1 2018) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -15,74 +15,74 @@ PANEL_PCBNEW_ACTION_PLUGINS_BASE::PANEL_PCBNEW_ACTION_PLUGINS_BASE( wxWindow* pa { wxBoxSizer* bPanelSizer; bPanelSizer = new wxBoxSizer( wxVERTICAL ); - + wxBoxSizer* bGridSizer; bGridSizer = new wxBoxSizer( wxVERTICAL ); - + m_grid = new WX_GRID( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); - + // Grid m_grid->CreateGrid( 3, 6 ); m_grid->EnableEditing( false ); m_grid->EnableGridLines( true ); m_grid->EnableDragGridSize( false ); m_grid->SetMargins( 0, 0 ); - + // Columns m_grid->AutoSizeColumns(); m_grid->EnableDragColMove( false ); m_grid->EnableDragColSize( true ); m_grid->SetColLabelSize( 22 ); - m_grid->SetColLabelValue( 0, wxT("Icon") ); - m_grid->SetColLabelValue( 1, wxT("Show button") ); - m_grid->SetColLabelValue( 2, wxT("Name") ); - m_grid->SetColLabelValue( 3, wxT("Category") ); - m_grid->SetColLabelValue( 4, wxT("Description") ); - m_grid->SetColLabelValue( 5, wxT("Path") ); - m_grid->SetColLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE ); - + m_grid->SetColLabelValue( 0, _("Icon") ); + m_grid->SetColLabelValue( 1, _("Show button") ); + m_grid->SetColLabelValue( 2, _("Name") ); + m_grid->SetColLabelValue( 3, _("Category") ); + m_grid->SetColLabelValue( 4, _("Description") ); + m_grid->SetColLabelValue( 5, _("Path") ); + m_grid->SetColLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER ); + // Rows m_grid->EnableDragRowSize( true ); m_grid->SetRowLabelSize( 0 ); - m_grid->SetRowLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE ); - + m_grid->SetRowLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER ); + // Label Appearance - + // Cell Defaults - m_grid->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_CENTRE ); + m_grid->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_CENTER ); bGridSizer->Add( m_grid, 1, wxALL|wxEXPAND, 5 ); - - + + bPanelSizer->Add( bGridSizer, 1, wxALIGN_LEFT|wxEXPAND|wxLEFT, 0 ); - + wxBoxSizer* bButtonsSizer; bButtonsSizer = new wxBoxSizer( wxHORIZONTAL ); - + m_moveUpButton = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 ); m_moveUpButton->SetMinSize( wxSize( 30,30 ) ); - + bButtonsSizer->Add( m_moveUpButton, 0, wxLEFT|wxRIGHT, 5 ); - + m_moveDownButton = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 ); m_moveDownButton->SetMinSize( wxSize( 30,30 ) ); - + bButtonsSizer->Add( m_moveDownButton, 0, wxRIGHT, 5 ); - - + + bButtonsSizer->Add( 0, 0, 0, wxEXPAND|wxLEFT|wxRIGHT, 5 ); - + m_reloadButton = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 ); m_reloadButton->SetMinSize( wxSize( 30,30 ) ); - + bButtonsSizer->Add( m_reloadButton, 0, wxLEFT|wxRIGHT, 5 ); - - + + bPanelSizer->Add( bButtonsSizer, 0, wxEXPAND, 0 ); - - + + this->SetSizer( bPanelSizer ); this->Layout(); - + // Connect Events m_grid->Connect( wxEVT_GRID_CELL_LEFT_CLICK, wxGridEventHandler( PANEL_PCBNEW_ACTION_PLUGINS_BASE::OnGridCellClick ), NULL, this ); m_moveUpButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_PCBNEW_ACTION_PLUGINS_BASE::OnMoveUpButtonClick ), NULL, this ); @@ -97,5 +97,5 @@ PANEL_PCBNEW_ACTION_PLUGINS_BASE::~PANEL_PCBNEW_ACTION_PLUGINS_BASE() m_moveUpButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_PCBNEW_ACTION_PLUGINS_BASE::OnMoveUpButtonClick ), NULL, this ); m_moveDownButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_PCBNEW_ACTION_PLUGINS_BASE::OnMoveDownButtonClick ), NULL, this ); m_reloadButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_PCBNEW_ACTION_PLUGINS_BASE::OnReloadButtonClick ), NULL, this ); - + } diff --git a/pcbnew/dialogs/panel_pcbnew_action_plugins_base.fbp b/pcbnew/dialogs/panel_pcbnew_action_plugins_base.fbp index 25c5cee8c9..d7cb003dba 100644 --- a/pcbnew/dialogs/panel_pcbnew_action_plugins_base.fbp +++ b/pcbnew/dialogs/panel_pcbnew_action_plugins_base.fbp @@ -1,6 +1,6 @@ - + C++ @@ -15,7 +15,7 @@ 1000 none 0 - 0 + 1 PanelPcbnewActionPlugins . @@ -49,43 +49,6 @@ wxTAB_TRAVERSAL - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - bPanelSizer @@ -123,13 +86,13 @@ wxALIGN_LEFT - wxALIGN_CENTRE + wxALIGN_CENTER 0 1 - wxALIGN_CENTRE + wxALIGN_CENTER 22 "Icon" "Show button" "Name" "Category" "Description" "Path" - wxALIGN_CENTRE + wxALIGN_CENTER 6 @@ -172,10 +135,10 @@ 1 Resizable - wxALIGN_CENTRE + wxALIGN_CENTER 0 - wxALIGN_CENTRE + wxALIGN_CENTER 3 1 @@ -186,68 +149,7 @@ - - - - - - - - - - - OnGridCellClick - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -331,37 +233,7 @@ - - - - - - OnMoveUpButtonClick - - - - - - - - - - - - - - - - - - - - - - - - @@ -434,37 +306,7 @@ - - - - - - OnMoveDownButtonClick - - - - - - - - - - - - - - - - - - - - - - - - @@ -547,37 +389,7 @@ - - - - - - OnReloadButtonClick - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/pcbnew/dialogs/panel_pcbnew_action_plugins_base.h b/pcbnew/dialogs/panel_pcbnew_action_plugins_base.h index a7a3c856b7..4f15677f20 100644 --- a/pcbnew/dialogs/panel_pcbnew_action_plugins_base.h +++ b/pcbnew/dialogs/panel_pcbnew_action_plugins_base.h @@ -1,15 +1,15 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Aug 2 2018) +// C++ code generated with wxFormBuilder (version Dec 1 2018) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! /////////////////////////////////////////////////////////////////////////// -#ifndef __PANEL_PCBNEW_ACTION_PLUGINS_BASE_H__ -#define __PANEL_PCBNEW_ACTION_PLUGINS_BASE_H__ +#pragma once #include #include +#include class WX_GRID; #include @@ -31,28 +31,27 @@ class WX_GRID; /////////////////////////////////////////////////////////////////////////////// /// Class PANEL_PCBNEW_ACTION_PLUGINS_BASE /////////////////////////////////////////////////////////////////////////////// -class PANEL_PCBNEW_ACTION_PLUGINS_BASE : public wxPanel +class PANEL_PCBNEW_ACTION_PLUGINS_BASE : public wxPanel { private: - + protected: WX_GRID* m_grid; wxBitmapButton* m_moveUpButton; wxBitmapButton* m_moveDownButton; wxBitmapButton* m_reloadButton; - + // Virtual event handlers, overide them in your derived class virtual void OnGridCellClick( wxGridEvent& event ) { event.Skip(); } virtual void OnMoveUpButtonClick( wxCommandEvent& event ) { event.Skip(); } virtual void OnMoveDownButtonClick( wxCommandEvent& event ) { event.Skip(); } virtual void OnReloadButtonClick( wxCommandEvent& event ) { event.Skip(); } - - + + public: - - PANEL_PCBNEW_ACTION_PLUGINS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 485,200 ), long style = wxTAB_TRAVERSAL, const wxString& name = wxEmptyString ); + + PANEL_PCBNEW_ACTION_PLUGINS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 485,200 ), long style = wxTAB_TRAVERSAL, const wxString& name = wxEmptyString ); ~PANEL_PCBNEW_ACTION_PLUGINS_BASE(); - + }; -#endif //__PANEL_PCBNEW_ACTION_PLUGINS_BASE_H__