48#define GRID_CELL_MARGIN 4
63 void showPopupMenu( wxMenu& menu, wxGridEvent& aEvent )
override;
70 const int clickedRow = aEvent.GetRow();
74 m_grid->SetGridCursor( clickedRow,
m_grid->GetGridCursorCol() );
76 m_grid->SelectRow( clickedRow );
80 wxString
id =
m_grid->GetCellValue( clickedRow,
83 if( std::optional<const PLUGIN_ACTION*> action = mgr.
GetAction(
id );
86 menu.Append(
MYID_RECREATE_ENV,
_(
"Recreate Plugin Environment" ),
_(
"Recreate Plugin Environment" ) );
87 menu.AppendSeparator();
102 wxString
id =
m_grid->GetCellValue(
m_grid->GetGridCursorRow(),
105 if( std::optional<const PLUGIN_ACTION*> action = mgr.
GetAction(
id );
124 m_grid->SetUseNativeColLabels();
127 m_grid->OverrideMinSize( 1.0, 1.0 );
148 m_grid->PopEventHandler(
true );
177 m_grid->SelectRow( aRow );
205 m_grid->SwapRows( aRowA, aRowB );
230 wxASSERT( settings );
239 for(
int ii = 0; ii <
m_grid->GetNumberRows(); ii++ )
243 if( mgr.
GetAction(
id ) != std::nullopt )
263 m_grid->AppendRows( orderedPlugins.size() );
266 wxSize iconSize( size, size );
268 for(
size_t row = 0; row < orderedPlugins.size(); row++ )
295 const int colMaxWidth = FromDIP( 400 );
297 for(
int col = 0; col <
m_grid->GetNumberCols(); col++ )
299 const wxString& heading =
m_grid->GetColLabelValue( col );
302 m_grid->SetColMinimalWidth( col, headingWidth );
303 int width = std::min(
m_grid->GetVisibleWidth( col ), colMaxWidth );
304 m_grid->SetColSize( col, std::max( headingWidth, width ) );
const KICOMMON_API wxEventTypeTag< wxCommandEvent > EDA_EVT_PLUGIN_AVAILABILITY_CHANGED
Notifies other parts of KiCad when plugin availability changes.
KIFACE_BASE & Kiface()
Global KIFACE_BASE "get" accessor.
wxBitmapBundle KiBitmapBundle(BITMAPS aBitmap, int aMinHeight)
Responsible for loading plugin definitions for API-based plugins (ones that do not run inside KiCad i...
void ReloadPlugins(std::optional< wxString > aDirectoryToScan=std::nullopt, std::shared_ptr< REPORTER > aReporter=nullptr)
Clears the loaded plugins and actions and re-scans the filesystem to register new ones.
void RecreatePluginEnvironment(const wxString &aIdentifier)
std::optional< const PLUGIN_ACTION * > GetAction(const wxString &aIdentifier)
const wxString & Name() const
Class DIALOG_HTML_REPORTER.
GRID_TRICKS(WX_GRID *aGrid)
virtual void doPopupSelection(wxCommandEvent &event)
virtual void showPopupMenu(wxMenu &menu, wxGridEvent &aEvent)
WX_GRID * m_grid
I don't own the grid, but he owns me.
APP_SETTINGS_BASE * KifaceSettings() const
STD_BITMAP_BUTTON * m_openDirectoryButton
STD_BITMAP_BUTTON * m_moveUpButton
PANEL_PCBNEW_ACTION_PLUGINS_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1,-1), long style=wxTAB_TRAVERSAL, const wxString &name=wxEmptyString)
STD_BITMAP_BUTTON * m_moveDownButton
STD_BITMAP_BUTTON * m_showErrorsButton
STD_BITMAP_BUTTON * m_reloadButton
DIALOG_HTML_REPORTER * m_errorDialog
void onPluginAvailabilityChanged(wxCommandEvent &aEvt)
bool TransferDataToWindow() override
void OnShowErrorsButtonClick(wxCommandEvent &event) override
Shows plugin import errors.
friend class PLUGINS_GRID_TRICKS
void OnMoveUpButtonClick(wxCommandEvent &event) override
Moves plugin up in the grid.
void OnGridCellClick(wxGridEvent &event) override
Selects a whole row.
wxBitmapBundle m_genericIcon
bool TransferDataFromWindow() override
void OnMoveDownButtonClick(wxCommandEvent &event) override
Moves plugin down in the grid.
PANEL_PCBNEW_ACTION_PLUGINS(wxWindow *aParent)
@ COLUMN_SETTINGS_IDENTIFIER
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.
static wxString GetUserPluginsPath()
Gets the user path for plugins.
static bool GetPluginActionButtonVisible(const wxString &aPluginPath, bool aPluginDefault)
Return true if button visibility action plugin setting was set to true or it is unset and plugin defa...
static std::vector< const PLUGIN_ACTION * > GetOrderedPluginActions()
Return ordered list of plugins in sequence in which they should appear on toolbar or in settings.
virtual COMMON_SETTINGS * GetCommonSettings() const
PLUGINS_GRID_TRICKS(WX_GRID *aGrid)
void showPopupMenu(wxMenu &menu, wxGridEvent &aEvent) override
void doPopupSelection(wxCommandEvent &event) override
@ GRIDTRICKS_FIRST_CLIENT_ID
bool LaunchExternal(const wxString &aPath)
Launches the given file or folder in the host OS.
PGM_BASE & Pgm()
The global program "get" accessor.
std::vector< std::pair< wxString, bool > > actions
Ordered list of plugin actions mapped to whether or not they are shown in the toolbar.
An action performed by a plugin via the IPC API.
wxBitmapBundle icon_light
const API_PLUGIN & plugin
IbisParser parser & reporter