36 #include <wx/treebook.h> 39 #define GRID_CELL_MARGIN 4 59 m_grid->PopEventHandler(
true );
78 auto selectedRows =
m_grid->GetSelectedRows();
81 if( selectedRows.size() != 1 )
return;
83 int selectedRow = selectedRows[0];
86 if( selectedRow == 0 )
92 SwapRows( selectedRow, selectedRow - 1 );
100 auto selectedRows =
m_grid->GetSelectedRows();
103 if( selectedRows.size() != 1 )
return;
105 int selectedRow = selectedRows[0];
108 if( selectedRow + 1 ==
m_grid->GetNumberRows() )
114 SwapRows( selectedRow, selectedRow + 1 );
127 for(
int column = 1; column <
m_grid->GetNumberCols(); column++ )
129 tempStr =
m_grid->GetCellValue( aRowA, column );
130 m_grid->SetCellValue( aRowA, column,
m_grid->GetCellValue( aRowB, column ) );
131 m_grid->SetCellValue( aRowB, column, tempStr );
153 wxASSERT( settings );
159 for(
int ii = 0; ii <
m_grid->GetNumberRows(); ii++ )
178 m_grid->AppendRows( orderedPlugins.size() );
180 for(
size_t row = 0; row < orderedPlugins.size(); row++ )
203 for(
int col = 0; col <
m_grid->GetNumberCols(); col++ )
205 const wxString& heading =
m_grid->GetColLabelValue( col );
209 m_grid->SetColMinimalWidth( col, headingWidth );
249 logWindow.ShowModal();
virtual wxString GetName()=0
This is the parent class from where any action plugin class must derive.
void OnShowErrorsButtonClick(wxCommandEvent &event) override
Shows plugin import errors.
virtual bool GetShowToolbarButton()=0
KIFACE_BASE & Kiface()
Global KIFACE_BASE "get" accessor.
static TOOL_ACTION pluginsReload
Scripting Actions.
virtual wxString GetDescription()=0
Add mouse and command handling (such as cut, copy, and paste) to a WX_GRID instance.
void SwapRows(int aRowA, int aRowB)
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=false, bool aKeep=true)
Calculates the specified column based on the actual size of the text on screen.
bool TransferDataFromWindow() override
virtual wxString GetPluginPath()=0
void pcbnewGetWizardsBackTrace(wxString &aTrace)
Return the backtrace of errors (if any) when wizard python scripts are loaded.
void OnReloadButtonClick(wxCommandEvent &event) override
Reloads plugins and updates grid.
void OnOpenDirectoryButtonClick(wxCommandEvent &event) override
Opens user's action plugin directory.
void OnMoveUpButtonClick(wxCommandEvent &event) override
Moves plugin up in the grid.
std::vector< ACTION_PLUGIN * > GetOrderedActionPlugins()
Return ordered list of plugins in sequence in which they should appear on toolbar or in settings.
PANEL_PCBNEW_ACTION_PLUGINS(PCB_EDIT_FRAME *aFrame, PAGED_DIALOG *aWindow)
void OnMoveDownButtonClick(wxCommandEvent &event) override
Moves plugin down in the grid.
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 TOOL_ACTION pluginsShowFolder
virtual wxString GetCategoryName()=0
bool TransferDataToWindow() override
wxBitmapButton * m_showErrorsButton
Class PCBNEW_ACTION_PLUGINS.
ACTION_PLUGIN_SETTINGS_LIST m_VisibleActionPlugins
wxBitmapButton * m_moveUpButton
~PANEL_PCBNEW_ACTION_PLUGINS() override
The main frame for Pcbnew.
void ClearRows()
wxWidgets recently added an ASSERT which fires if the position is greater than or equal to the number...
Class PANEL_PCBNEW_ACTION_PLUGINS_BASE.
wxBitmapButton * m_reloadButton
wxBitmapButton * m_openDirectoryButton
wxBitmapButton * m_moveDownButton
void OnGridCellClick(wxGridEvent &event) override
Selects a whole row.