37#define GRID_CELL_MARGIN 4
55 m_grid->PopEventHandler(
true );
74 auto selectedRows =
m_grid->GetSelectedRows();
77 if( selectedRows.size() != 1 )
return;
79 int selectedRow = selectedRows[0];
82 if( selectedRow == 0 )
88 SwapRows( selectedRow, selectedRow - 1 );
96 auto selectedRows =
m_grid->GetSelectedRows();
99 if( selectedRows.size() != 1 )
return;
101 int selectedRow = selectedRows[0];
104 if( selectedRow + 1 ==
m_grid->GetNumberRows() )
110 SwapRows( selectedRow, selectedRow + 1 );
123 for(
int column = 1; column <
m_grid->GetNumberCols(); column++ )
125 tempStr =
m_grid->GetCellValue( aRowA, column );
126 m_grid->SetCellValue( aRowA, column,
m_grid->GetCellValue( aRowB, column ) );
127 m_grid->SetCellValue( aRowB, column, tempStr );
149 wxASSERT( settings );
155 for(
int ii = 0; ii <
m_grid->GetNumberRows(); ii++ )
174 m_grid->AppendRows( orderedPlugins.size() );
176 for(
size_t row = 0; row < orderedPlugins.size(); row++ )
199 for(
int col = 0; col <
m_grid->GetNumberCols(); col++ )
201 const wxString& heading =
m_grid->GetColLabelValue( col );
205 m_grid->SetColMinimalWidth( col, headingWidth );
250 logWindow.ShowModal();
Class PCBNEW_ACTION_PLUGINS.
KIFACE_BASE & Kiface()
Global KIFACE_BASE "get" accessor.
wxBitmap KiBitmap(BITMAPS aBitmap, int aHeightTag)
Construct a wxBitmap from an image identifier Returns the image from the active theme if the image ha...
static int GetActionsCount()
This is the parent class from where any action plugin class must derive.
virtual wxString GetDescription()=0
virtual wxString GetPluginPath()=0
virtual wxString GetCategoryName()=0
virtual wxString GetName()=0
virtual bool GetShowToolbarButton()=0
Add mouse and command handling (such as cut, copy, and paste) to a WX_GRID instance.
APP_SETTINGS_BASE * KifaceSettings() const
Class PANEL_PCBNEW_ACTION_PLUGINS_BASE.
STD_BITMAP_BUTTON * m_openDirectoryButton
STD_BITMAP_BUTTON * m_moveUpButton
STD_BITMAP_BUTTON * m_moveDownButton
STD_BITMAP_BUTTON * m_showErrorsButton
STD_BITMAP_BUTTON * m_reloadButton
bool TransferDataToWindow() override
void OnShowErrorsButtonClick(wxCommandEvent &event) override
Shows plugin import errors.
void OnMoveUpButtonClick(wxCommandEvent &event) override
Moves plugin up in the grid.
void OnGridCellClick(wxGridEvent &event) override
Selects a whole row.
bool TransferDataFromWindow() override
void OnMoveDownButtonClick(wxCommandEvent &event) override
Moves plugin down in the grid.
PANEL_PCBNEW_ACTION_PLUGINS(wxWindow *aParent)
void OnOpenDirectoryButtonClick(wxCommandEvent &event) override
Opens user's action plugin directory.
void SwapRows(int aRowA, int aRowB)
~PANEL_PCBNEW_ACTION_PLUGINS() override
void OnReloadButtonClick(wxCommandEvent &event) override
Reloads plugins and updates grid.
ACTION_PLUGIN_SETTINGS_LIST m_VisibleActionPlugins
static std::vector< ACTION_PLUGIN * > GetOrderedActionPlugins()
Return ordered list of plugins in sequence in which they should appear on toolbar or in settings.
static bool GetActionPluginButtonVisible(const wxString &aPluginPath, bool aPluginDefault)
Return true if button visibility action plugin setting was set to true or it is unset and plugin defa...
int GetVisibleWidth(int aCol, bool aHeader=true, bool aContents=true, bool aKeep=false)
Calculates the specified column based on the actual size of the text on screen.
void ClearRows()
wxWidgets recently added an ASSERT which fires if the position is greater than or equal to the number...
void pcbnewGetWizardsBackTrace(wxString &aTrace)
Return the backtrace of errors (if any) when wizard python scripts are loaded.