37#define GRID_CELL_MARGIN 4
44 m_grid->SetUseNativeColLabels();
56 m_grid->PopEventHandler(
true );
75 auto selectedRows =
m_grid->GetSelectedRows();
78 if( selectedRows.size() != 1 )
return;
80 int selectedRow = selectedRows[0];
83 if( selectedRow == 0 )
89 SwapRows( selectedRow, selectedRow - 1 );
97 auto selectedRows =
m_grid->GetSelectedRows();
100 if( selectedRows.size() != 1 )
return;
102 int selectedRow = selectedRows[0];
105 if( selectedRow + 1 ==
m_grid->GetNumberRows() )
111 SwapRows( selectedRow, selectedRow + 1 );
124 for(
int column = 1; column <
m_grid->GetNumberCols(); column++ )
126 tempStr =
m_grid->GetCellValue( aRowA, column );
127 m_grid->SetCellValue( aRowA, column,
m_grid->GetCellValue( aRowB, column ) );
128 m_grid->SetCellValue( aRowB, column, tempStr );
150 wxASSERT( settings );
156 for(
int ii = 0; ii <
m_grid->GetNumberRows(); ii++ )
175 m_grid->AppendRows( orderedPlugins.size() );
177 for(
size_t row = 0; row < orderedPlugins.size(); row++ )
200 for(
int col = 0; col <
m_grid->GetNumberCols(); col++ )
202 const wxString& heading =
m_grid->GetColLabelValue( col );
206 m_grid->SetColMinimalWidth( col, headingWidth );
251 logWindow.ShowModal();
Class PCBNEW_ACTION_PLUGINS.
KIFACE_BASE & Kiface()
Global KIFACE_BASE "get" accessor.
wxBitmapBundle KiBitmapBundle(BITMAPS aBitmap)
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.