KiCad PCB EDA Suite
Loading...
Searching...
No Matches
pcbnew_action_plugins.cpp
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright (C) 2017-2023 KiCad Developers, see AUTHORS.txt for contributors.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, you may find one here:
18 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
19 * or you may search the http://www.gnu.org website for the version 2 license,
20 * or you may write to the Free Software Foundation, Inc.,
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
22 */
23
25#include <pgm_base.h>
27#include <pcbnew_settings.h>
28#include <bitmaps.h>
29#include <board.h>
30#include <board_commit.h>
32#include <footprint.h>
34#include <pcb_track.h>
35#include <zone.h>
36#include <pcbnew_settings.h>
37#include <tool/action_menu.h>
38#include <tool/action_toolbar.h>
39#include <tool/tool_manager.h>
40#include <tools/pcb_actions.h>
42#include <pcb_painter.h>
43#include <wx/msgdlg.h>
44#include <wx/app.h>
45#include <kiplatform/app.h>
46#include "../../scripting/python_scripting.h"
47
49{
50 PyLOCK lock;
51
52 m_PyAction = aAction;
53 Py_XINCREF( aAction );
54}
55
56
58{
59 PyLOCK lock;
60
61 Py_XDECREF( m_PyAction );
62}
63
64
65PyObject* PYTHON_ACTION_PLUGIN::CallMethod( const char* aMethod, PyObject* aArglist )
66{
67 PyLOCK lock;
68
69 PyErr_Clear();
70
71 // pFunc is a new reference to the desired method
72 PyObject* pFunc = PyObject_GetAttrString( m_PyAction, aMethod );
73
74 if( pFunc && PyCallable_Check( pFunc ) )
75 {
76 PyObject* result = PyObject_CallObject( pFunc, aArglist );
77
78 if( !wxTheApp )
80
81 if( PyErr_Occurred() )
82 {
83 wxString message = _HKI( "Exception on python action plugin code" );
84 wxString traceback = PyErrStringWithTraceback();
85
86 std::cerr << message << std::endl << std::endl;
87 std::cerr << traceback << std::endl;
88
89 if( wxTheApp )
90 wxSafeShowMessage( wxGetTranslation( message ), traceback );
91 }
92
93 if( !wxTheApp )
94 {
95 wxArrayString messages;
96 messages.Add( "Fatal error");
97 messages.Add( wxString::Format(
98 "The application handle was destroyed after running Python plugin '%s'.",
99 m_cachedName ) );
100
101 // Poor man's ASCII message box
102 {
103 int maxLen = 0;
104
105 for( const wxString& msg : messages )
106 if( (int)msg.length() > maxLen )
107 maxLen = msg.length();
108
109 wxChar ch = '*';
110 wxString border( ch, 3 );
111
112 std::cerr << wxString( ch, maxLen + 2 + border.length() * 2 ) << std::endl;
113 std::cerr << border << ' ' << wxString( ' ', maxLen ) << ' ' << border << std::endl;
114
115 for( wxString msg : messages )
116 std::cerr << border << ' ' << msg.Pad( maxLen - msg.length() ) << ' ' << border
117 << std::endl;
118
119 std::cerr << border << ' ' << wxString( ' ', maxLen ) << ' ' << border << std::endl;
120 std::cerr << wxString( ch, maxLen + 2 + border.length() * 2 ) << std::endl;
121 }
122
123#ifdef _WIN32
124 std::cerr << std::endl << "Press any key to abort..." << std::endl;
125 (void) std::getchar();
126#endif
127
128 abort();
129 }
130
131 if( result )
132 {
133 Py_XDECREF( pFunc );
134 return result;
135 }
136 }
137 else
138 {
139 wxString msg = wxString::Format( _( "Method '%s' not found, or not callable" ), aMethod );
140 wxMessageBox( msg, _( "Unknown Method" ), wxICON_ERROR | wxOK );
141 }
142
143 if( pFunc )
144 {
145 Py_XDECREF( pFunc );
146 }
147
148 return nullptr;
149}
150
151
152wxString PYTHON_ACTION_PLUGIN::CallRetStrMethod( const char* aMethod, PyObject* aArglist )
153{
154 wxString ret;
155 PyLOCK lock;
156
157 PyObject* result = CallMethod( aMethod, aArglist );
158
159 ret = PyStringToWx( result );
160 Py_XDECREF( result );
161
162 return ret;
163}
164
165
167{
168 PyLOCK lock;
169
170 return CallRetStrMethod( "GetCategoryName" );
171}
172
173
175{
176 PyLOCK lock;
177
178 wxString name = CallRetStrMethod( "GetName" );
180
181 return name;
182}
183
184
186{
187 PyLOCK lock;
188
189 return CallRetStrMethod( "GetDescription" );
190}
191
192
194{
195 PyLOCK lock;
196
197 PyObject* result = CallMethod( "GetShowToolbarButton");
198
199 return PyObject_IsTrue(result);
200}
201
202
204{
205 PyLOCK lock;
206
207 PyObject* arglist = Py_BuildValue( "(i)", static_cast<int>( aDark ) );
208
209 wxString result = CallRetStrMethod( "GetIconFileName", arglist );
210
211 Py_DECREF( arglist );
212
213 return result;
214}
215
216
218{
219 PyLOCK lock;
220
221 return CallRetStrMethod( "GetPluginPath" );
222}
223
224
226{
227 PyLOCK lock;
228
229 CallMethod( "Run" );
230}
231
232
234{
235 return (void*) m_PyAction;
236}
237
238
239void PYTHON_ACTION_PLUGINS::register_action( PyObject* aPyAction )
240{
241 PYTHON_ACTION_PLUGIN* fw = new PYTHON_ACTION_PLUGIN( aPyAction );
242
243 fw->register_action();
244}
245
246
248{
249 // deregister also destroys the previously created "PYTHON_ACTION_PLUGIN object"
250 ACTION_PLUGINS::deregister_object( (void*) aPyAction );
251}
252
253
254void PCB_EDIT_FRAME::OnActionPluginMenu( wxCommandEvent& aEvent )
255{
256 ACTION_PLUGIN* actionPlugin = ACTION_PLUGINS::GetActionByMenu( aEvent.GetId() );
257
258 if( actionPlugin )
259 RunActionPlugin( actionPlugin );
260}
261
262
263void PCB_EDIT_FRAME::OnActionPluginButton( wxCommandEvent& aEvent )
264{
265 ACTION_PLUGIN* actionPlugin = ACTION_PLUGINS::GetActionByButton( aEvent.GetId() );
266
267 if( actionPlugin )
268 RunActionPlugin( actionPlugin );
269}
270
272{
273
274 PICKED_ITEMS_LIST itemsList;
275 BOARD* currentPcb = GetBoard();
276 bool fromEmpty = false;
277
278 // Append tracks:
279 for( PCB_TRACK* item : currentPcb->Tracks() )
280 {
281 ITEM_PICKER picker( nullptr, item, UNDO_REDO::CHANGED );
282 itemsList.PushItem( picker );
283 }
284
285 // Append footprints:
286 for( FOOTPRINT* item : currentPcb->Footprints() )
287 {
288 ITEM_PICKER picker( nullptr, item, UNDO_REDO::CHANGED );
289 itemsList.PushItem( picker );
290 }
291
292 // Append drawings
293 for( BOARD_ITEM* item : currentPcb->Drawings() )
294 {
295 ITEM_PICKER picker( nullptr, item, UNDO_REDO::CHANGED );
296 itemsList.PushItem( picker );
297 }
298
299 // Append zones outlines
300 for( ZONE* zone : currentPcb->Zones() )
301 {
302 ITEM_PICKER picker( nullptr, zone, UNDO_REDO::CHANGED );
303 itemsList.PushItem( picker );
304 }
305
306 if( itemsList.GetCount() > 0 )
307 SaveCopyInUndoList( itemsList, UNDO_REDO::CHANGED );
308 else
309 fromEmpty = true;
310
311 itemsList.ClearItemsList();
312
313 BOARD_COMMIT commit( this );
314
315 // Execute plugin itself...
317 aActionPlugin->Run();
319
320 // Get back the undo buffer to fix some modifications
321 PICKED_ITEMS_LIST* oldBuffer = nullptr;
322
323 if( fromEmpty )
324 {
325 oldBuffer = new PICKED_ITEMS_LIST();
326 }
327 else
328 {
329 oldBuffer = PopCommandFromUndoList();
330 wxASSERT( oldBuffer );
331 }
332
333 // Try do discover what was modified
334 PICKED_ITEMS_LIST deletedItemsList;
335
336 // The list of existing items after running the action script
337 const auto currItemList = currentPcb->GetItemSet();
338
339 // Found deleted items
340 for( unsigned int i = 0; i < oldBuffer->GetCount(); i++ )
341 {
342 BOARD_ITEM* item = (BOARD_ITEM*) oldBuffer->GetPickedItem( i );
343 ITEM_PICKER picker( nullptr, item, UNDO_REDO::DELETED );
344
345 wxASSERT( item );
346
347 if( currItemList.find( item ) == currItemList.end() )
348 {
349 deletedItemsList.PushItem( picker );
350 commit.Removed( item );
351 }
352 }
353
354 // Mark deleted elements in undolist
355
356 for( unsigned int i = 0; i < deletedItemsList.GetCount(); i++ )
357 {
358 oldBuffer->PushItem( deletedItemsList.GetItemWrapper( i ) );
359 }
360
361 // Find new footprints
362 for( FOOTPRINT* item : currentPcb->Footprints() )
363 {
364 if( !oldBuffer->ContainsItem( item ) )
365 {
366 ITEM_PICKER picker( nullptr, item, UNDO_REDO::NEWITEM );
367 oldBuffer->PushItem( picker );
368 commit.Added( item );
369 }
370 }
371
372 for( PCB_TRACK* item : currentPcb->Tracks() )
373 {
374 if( !oldBuffer->ContainsItem( item ) )
375 {
376 ITEM_PICKER picker( nullptr, item, UNDO_REDO::NEWITEM );
377 oldBuffer->PushItem( picker );
378 commit.Added( item );
379 }
380 }
381
382 for( BOARD_ITEM* item : currentPcb->Drawings() )
383 {
384 if( !oldBuffer->ContainsItem( item ) )
385 {
386 ITEM_PICKER picker( nullptr, item, UNDO_REDO::NEWITEM );
387 oldBuffer->PushItem( picker );
388 commit.Added( item );
389 }
390 }
391
392 for( ZONE* zone : currentPcb->Zones() )
393 {
394 if( !oldBuffer->ContainsItem( zone ) )
395 {
396 ITEM_PICKER picker( nullptr, zone, UNDO_REDO::NEWITEM );
397 oldBuffer->PushItem( picker );
398 commit.Added( zone );
399 }
400 }
401
402 if( oldBuffer->GetCount() )
403 {
404 OnModify();
405 PushCommandToUndoList( oldBuffer );
406 }
407 else
408 {
409 delete oldBuffer;
410 }
411
412 // Apply changes, UndoList already handled
413 commit.Push( _( "Apply Action Script" ), SKIP_UNDO | SKIP_SET_DIRTY );
414
416}
417
418
420{
421 // The list of existing items after running the action script
422 const BOARD_ITEM_SET items = GetBoard()->GetItemSet();
423
424 // Sync selection with items selection state
425 SELECTION& selection = GetCurrentSelection();
427 EDA_ITEMS to_add;
428 EDA_ITEMS to_remove;
429
430 for( BOARD_ITEM* item : items )
431 {
432 if( item->IsSelected() && !selection.Contains( item ) )
433 {
434 item->ClearSelected(); // temporarily
435 to_add.push_back( item );
436 }
437 }
438
439 for( EDA_ITEM* item : selection.GetItems() )
440 {
441 if( !item->IsSelected() )
442 to_remove.push_back( static_cast<BOARD_ITEM*>( item ) );
443 }
444
445 if( !to_add.empty() )
446 selTool->AddItemsToSel( &to_add );
447
448 if( !to_remove.empty() )
449 selTool->RemoveItemsFromSel( &to_remove );
450
452
453 PCB_DRAW_PANEL_GAL* canvas = GetCanvas();
454
455 canvas->GetView()->Clear();
456 canvas->GetView()->InitPreview();
458 canvas->DisplayBoard( m_pcb );
459
460 // allow tools to re-add their view items (selection previews, grids, etc.)
461 if( m_toolManager )
463
464 // reload the drawing-sheet
466
467 canvas->SyncLayersVisibility( m_pcb );
468
469 canvas->Refresh();
470}
471
472
474{
475 if( !actionMenu ) // Should not occur.
476 return;
477
478 for( int ii = 0; ii < ACTION_PLUGINS::GetActionsCount(); ii++ )
479 {
480 wxMenuItem* item;
482 const wxBitmap& bitmap = ap->iconBitmap.IsOk() ? ap->iconBitmap :
483 KiBitmap( BITMAPS::puzzle_piece );
484
485 item = KIUI::AddMenuItem( actionMenu, wxID_ANY, ap->GetName(), ap->GetDescription(),
486 bitmap );
487
488 Connect( item->GetId(), wxEVT_COMMAND_MENU_SELECTED,
489 wxCommandEventHandler( PCB_EDIT_FRAME::OnActionPluginMenu ) );
490
491 ACTION_PLUGINS::SetActionMenu( ii, item->GetId() );
492 }
493}
494
495
497{
498 bool need_separator = true;
499 const std::vector<ACTION_PLUGIN*>& orderedPlugins = GetOrderedActionPlugins();
500
501 for( ACTION_PLUGIN* ap : orderedPlugins )
502 {
503 if( GetActionPluginButtonVisible( ap->GetPluginPath(), ap->GetShowToolbarButton() ) )
504 {
505 if( need_separator )
506 {
508 need_separator = false;
509 }
510
511 // Add button
512 wxBitmap bitmap;
513
514 if ( ap->iconBitmap.IsOk() )
515 bitmap = KiScaledBitmap( ap->iconBitmap, this );
516 else
517 bitmap = KiScaledBitmap( BITMAPS::puzzle_piece, this );
518
519 wxAuiToolBarItem* button = m_mainToolBar->AddTool( wxID_ANY, wxEmptyString,
520 bitmap, ap->GetName() );
521
522 Connect( button->GetId(), wxEVT_COMMAND_MENU_SELECTED,
523 wxCommandEventHandler( PCB_EDIT_FRAME::OnActionPluginButton ) );
524
525 // Link action plugin to button
526 ACTION_PLUGINS::SetActionButton( ap, button->GetId() );
527 }
528 }
529}
530
531
532std::vector<ACTION_PLUGIN*> PCB_EDIT_FRAME::GetOrderedActionPlugins()
533{
535
536 std::vector<ACTION_PLUGIN*> plugins;
537 std::vector<ACTION_PLUGIN*> orderedPlugins;
538
539 for( int i = 0; i < ACTION_PLUGINS::GetActionsCount(); i++ )
540 plugins.push_back( ACTION_PLUGINS::GetAction( i ) );
541
542 // First add plugins that have entries in settings
543 for( const auto& pair : cfg->m_VisibleActionPlugins )
544 {
545 auto loc = std::find_if( plugins.begin(), plugins.end(),
546 [pair] ( ACTION_PLUGIN* plugin )
547 {
548 return plugin->GetPluginPath() == pair.first;
549 } );
550
551 if( loc != plugins.end() )
552 {
553 orderedPlugins.push_back( *loc );
554 plugins.erase( loc );
555 }
556 }
557
558 // Now append new plugins that have not been configured yet
559 for( auto remaining_plugin : plugins )
560 orderedPlugins.push_back( remaining_plugin );
561
562 return orderedPlugins;
563}
564
565
566bool PCB_EDIT_FRAME::GetActionPluginButtonVisible( const wxString& aPluginPath,
567 bool aPluginDefault )
568{
570
571 for( const auto& entry : cfg->m_VisibleActionPlugins )
572 {
573 if( entry.first == aPluginPath )
574 return entry.second;
575 }
576
577 // Plugin is not in settings, return default.
578 return aPluginDefault;
579}
const char * name
Definition: DXF_plotter.cpp:57
wxBitmap KiBitmap(BITMAPS aBitmap, int aHeightTag)
Construct a wxBitmap from an image identifier Returns the image from the active theme if the image ha...
Definition: bitmap.cpp:104
wxBitmap KiScaledBitmap(BITMAPS aBitmap, wxWindow *aWindow, int aHeight, bool aQuantized)
Construct a wxBitmap from a memory record, scaling it if device DPI demands it.
Definition: bitmap.cpp:147
std::set< BOARD_ITEM *, CompareByUuid > BOARD_ITEM_SET
Set of BOARD_ITEMs ordered by UUID.
Definition: board.h:274
Defines the structure of a menu based on ACTIONs.
Definition: action_menu.h:49
static bool deregister_object(void *aObject)
Deregister an object which builds a action.
static ACTION_PLUGIN * GetActionByMenu(int aMenu)
Find action plugin associated to a menu ID.
static int GetActionsCount()
static ACTION_PLUGIN * GetAction(const wxString &aName)
static void SetActionButton(ACTION_PLUGIN *aAction, int idButton)
Associate a button id to an action plugin.
static void SetActionMenu(int aIndex, int idMenu)
Associate a menu id to an action plugin.
static void SetActionRunning(bool aRunning)
static ACTION_PLUGIN * GetActionByButton(int aButton)
Find action plugin associated to a button ID.
This is the parent class from where any action plugin class must derive.
Definition: action_plugin.h:39
wxBitmap iconBitmap
void register_action()
It's the standard method of a "ACTION_PLUGIN" to register itself into the ACTION_PLUGINS singleton ma...
virtual wxString GetDescription()=0
virtual wxString GetName()=0
virtual void Run()=0
This method the the action.
void AddScaledSeparator(wxWindow *aWindow)
Add a separator that introduces space on either side to not squash the tools when scaled.
virtual void Push(const wxString &aMessage=wxEmptyString, int aCommitFlags=0) override
Revert the commit by restoring the modified items state.
const VECTOR2I & GetGridOrigin()
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition: board_item.h:79
Information pertinent to a Pcbnew printed circuit board.
Definition: board.h:290
const PAGE_INFO & GetPageSettings() const
Definition: board.h:689
const ZONES & Zones() const
Definition: board.h:335
bool BuildConnectivity(PROGRESS_REPORTER *aReporter=nullptr)
Build or rebuild the board connectivity database for the board, especially the list of connected item...
Definition: board.cpp:187
const FOOTPRINTS & Footprints() const
Definition: board.h:331
const BOARD_ITEM_SET GetItemSet()
Definition: board.cpp:3022
const TRACKS & Tracks() const
Definition: board.h:329
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Definition: board.cpp:892
const DRAWINGS & Drawings() const
Definition: board.h:333
COMMIT & Added(EDA_ITEM *aItem, BASE_SCREEN *aScreen=nullptr)
Remove a new item from the model.
Definition: commit.h:86
COMMIT & Removed(EDA_ITEM *aItem, BASE_SCREEN *aScreen=nullptr)
Modify a given item in the model.
Definition: commit.h:98
virtual void PushCommandToUndoList(PICKED_ITEMS_LIST *aItem)
Add a command to undo in the undo list.
virtual PICKED_ITEMS_LIST * PopCommandFromUndoList()
Return the last command to undo and remove it from list, nothing is deleted.
ACTION_TOOLBAR * m_mainToolBar
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=nullptr) override
KIGFX::GAL * GetGAL() const
Return a pointer to the GAL instance used in the panel.
A base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:89
void SetGridOrigin(const VECTOR2D &aGridOrigin)
Set the origin point for the grid.
void Clear()
Remove all items from the view.
Definition: view.cpp:1168
void InitPreview()
Definition: view.cpp:1724
ACTION_PLUGIN_SETTINGS_LIST m_VisibleActionPlugins
void SaveCopyInUndoList(EDA_ITEM *aItemToCopy, UNDO_REDO aTypeCommand) override
Create a new entry in undo list of commands.
Definition: undo_redo.cpp:163
PCB_DRAW_PANEL_GAL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
BOARD * GetBoard() const
virtual KIGFX::PCB_VIEW * GetView() const override
Return a pointer to the #VIEW instance used in the panel.
void DisplayBoard(BOARD *aBoard, PROGRESS_REPORTER *aReporter=nullptr)
Add all items from the current board to the VIEW, so they can be displayed by GAL.
void SyncLayersVisibility(const BOARD *aBoard)
Update "visibility" property of each layer of a given BOARD.
void OnModify() override
Must be called after a board change to set the modified flag.
static std::vector< ACTION_PLUGIN * > GetOrderedActionPlugins()
Return ordered list of plugins in sequence in which they should appear on toolbar or in settings.
void SetPageSettings(const PAGE_INFO &aPageSettings) override
void OnActionPluginButton(wxCommandEvent &aEvent)
Launched by the button when an action is called.
void RunActionPlugin(ACTION_PLUGIN *aActionPlugin)
Execute action plugin's Run() method and updates undo buffer.
void buildActionPluginMenus(ACTION_MENU *aActionMenu)
Fill action menu with all registered action plugins.
void RebuildAndRefresh()
Rebuilds board connectivity, refreshes canvas.
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...
SELECTION & GetCurrentSelection() override
Get the current selection from the canvas area.
void OnActionPluginMenu(wxCommandEvent &aEvent)
Launched by the menu when an action is called.
void AddActionPluginTools()
Append action plugin buttons to main toolbar.
The selection tool: currently supports:
virtual SETTINGS_MANAGER & GetSettingsManager() const
Definition: pgm_base.h:142
A holder to handle information on schematic or board items.
void PushItem(const ITEM_PICKER &aItem)
Push aItem to the top of the list.
ITEM_PICKER GetItemWrapper(unsigned int aIdx) const
bool ContainsItem(const EDA_ITEM *aItem) const
unsigned GetCount() const
void ClearItemsList()
Delete only the list of pickers NOT the picked data itself.
EDA_ITEM * GetPickedItem(unsigned int aIdx) const
static void deregister_action(PyObject *aPyAction)
static void register_action(PyObject *aPyAction)
bool GetShowToolbarButton() override
wxString CallRetStrMethod(const char *aMethod, PyObject *aArglist=nullptr)
PyObject * CallMethod(const char *aMethod, PyObject *aArglist=nullptr)
wxString GetCategoryName() override
wxString GetName() override
wxString GetDescription() override
wxString GetPluginPath() override
PYTHON_ACTION_PLUGIN(PyObject *action)
void Run() override
This method the the action.
wxString GetIconFileName(bool aDark) override
void * GetObject() override
This method gets the pointer to the object from where this action constructs.
int AddItemsToSel(const TOOL_EVENT &aEvent)
int RemoveItemsFromSel(const TOOL_EVENT &aEvent)
const std::deque< EDA_ITEM * > GetItems() const
Definition: selection.h:121
bool Contains(EDA_ITEM *aItem) const
Definition: selection.cpp:84
T * GetAppSettings()
Returns a handle to the a given settings by type If the settings have already been loaded,...
TOOL_MANAGER * m_toolManager
Definition: tools_holder.h:167
@ REDRAW
Full drawing refresh.
Definition: tool_base.h:83
void ResetTools(TOOL_BASE::RESET_REASON aReason)
Reset all tools (i.e.
Handle a list of polygons defining a copper zone.
Definition: zone.h:73
#define _HKI(x)
#define _(s)
std::vector< EDA_ITEM * > EDA_ITEMS
Define list of drawing items for screens.
Definition: eda_item.h:536
bool AttachConsole(bool aTryAlloc)
Tries to attach a console window with stdout, stderr and stdin.
Definition: unix/app.cpp:51
KICOMMON_API wxMenuItem * AddMenuItem(wxMenu *aMenu, int aId, const wxString &aText, const wxBitmapBundle &aImage, wxItemKind aType=wxITEM_NORMAL)
Create and insert a menu item with an icon into aMenu.
Definition: ui_common.cpp:372
Class PCBNEW_ACTION_PLUGINS.
PGM_BASE & Pgm()
The global Program "get" accessor.
Definition: pgm_base.cpp:1060
see class PGM_BASE
#define SKIP_SET_DIRTY
Definition: sch_commit.h:43
#define SKIP_UNDO
Definition: sch_commit.h:41
VECTOR2< double > VECTOR2D
Definition: vector2d.h:690