2019-06-17 00:34:21 +00:00
|
|
|
/*
|
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
|
|
*
|
|
|
|
* Copyright (C) 2017 Jon Evans <jon@craftyjon.com>
|
|
|
|
* Copyright (C) 2017-2019 KiCad Developers, see AUTHORS.txt for contributors.
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify it
|
|
|
|
* under the terms of the GNU General Public License as published by the
|
|
|
|
* Free Software Foundation, either version 3 of the License, or (at your
|
|
|
|
* option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful, but
|
|
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <bitmaps.h>
|
|
|
|
|
2019-08-08 21:10:37 +00:00
|
|
|
#include <cvpcb_mainframe.h>
|
2019-07-18 21:47:01 +00:00
|
|
|
#include <listboxes.h>
|
|
|
|
#include <tools/cvpcb_actions.h>
|
2019-06-17 00:34:21 +00:00
|
|
|
|
|
|
|
// Actions, being statically-defined, require specialized I18N handling. We continue to
|
|
|
|
// use the _() macro so that string harvesting by the I18N framework doesn't have to be
|
|
|
|
// specialized, but we don't translate on initialization and instead do it in the getters.
|
|
|
|
|
|
|
|
#undef _
|
|
|
|
#define _(s) s
|
|
|
|
|
|
|
|
|
2019-07-18 21:47:01 +00:00
|
|
|
// Selection tool action for the footprint viewer window
|
2020-03-29 11:54:18 +00:00
|
|
|
TOOL_ACTION CVPCB_ACTIONS::selectionActivate( "cvpcb.FootprintViewerInteractiveSelection",
|
|
|
|
AS_GLOBAL, 0, "",
|
2019-07-18 21:47:01 +00:00
|
|
|
"",
|
2021-03-08 02:59:07 +00:00
|
|
|
"", // No description, it is not supposed to be shown anywhere
|
|
|
|
BITMAPS::INVALID_BITMAP, AF_ACTIVATE );
|
2019-07-18 21:47:01 +00:00
|
|
|
|
2020-03-29 11:54:18 +00:00
|
|
|
TOOL_ACTION CVPCB_ACTIONS::controlActivate( "cvpcb.Control",
|
|
|
|
AS_GLOBAL, 0, "",
|
2019-08-08 22:11:59 +00:00
|
|
|
"",
|
2021-03-08 02:59:07 +00:00
|
|
|
"", // No description, it is not supposed to be shown anywhere
|
|
|
|
BITMAPS::INVALID_BITMAP, AF_ACTIVATE );
|
2019-08-08 22:11:59 +00:00
|
|
|
|
2019-07-18 21:47:01 +00:00
|
|
|
|
|
|
|
// Action to show the footprint viewer window
|
2020-03-29 11:54:18 +00:00
|
|
|
TOOL_ACTION CVPCB_ACTIONS::showFootprintViewer( "cvpcb.Control.ShowFootprintViewer",
|
|
|
|
AS_GLOBAL, 0, "",
|
2019-07-18 21:47:01 +00:00
|
|
|
_( "View selected footprint" ),
|
|
|
|
_( "View the selected footprint in the footprint viewer" ),
|
2021-03-08 02:59:07 +00:00
|
|
|
BITMAPS::show_footprint );
|
2019-07-18 21:47:01 +00:00
|
|
|
|
|
|
|
|
|
|
|
// Actions to handle management tasks
|
2020-03-29 11:54:18 +00:00
|
|
|
TOOL_ACTION CVPCB_ACTIONS::showEquFileTable( "cvpcb.Control.ShowEquFileTable",
|
|
|
|
AS_GLOBAL, 0, "",
|
2019-07-18 21:47:01 +00:00
|
|
|
_( "Manage Footprint Association Files" ),
|
|
|
|
_( "Configure footprint association file (.equ) list. These files are "
|
2021-02-06 20:42:27 +00:00
|
|
|
"used to automatically assign footprint names from symbol values." ) );
|
2019-07-18 21:47:01 +00:00
|
|
|
|
2022-04-30 07:43:28 +00:00
|
|
|
TOOL_ACTION CVPCB_ACTIONS::saveAssociationsToSchematic( "cvpcb.Control.SaveAssociationsToSchematic",
|
2020-03-29 11:54:18 +00:00
|
|
|
AS_GLOBAL,
|
2019-07-18 21:47:01 +00:00
|
|
|
MD_CTRL + 'S', LEGACY_HK_NAME( "Save" ),
|
|
|
|
_( "Save to Schematic" ),
|
|
|
|
_( "Save footprint associations in schematic symbol footprint fields" ),
|
2021-03-08 02:59:07 +00:00
|
|
|
BITMAPS::save );
|
2019-07-18 21:47:01 +00:00
|
|
|
|
2022-04-30 07:43:28 +00:00
|
|
|
TOOL_ACTION CVPCB_ACTIONS::saveAssociationsToFile( "cvpcb.Control.SaveAssociationsToFile",
|
|
|
|
AS_GLOBAL,
|
|
|
|
MD_CTRL + 'S', LEGACY_HK_NAME( "Save" ),
|
|
|
|
_( "Save to Schematic and File" ),
|
|
|
|
_( "Save footprint associations in schematic symbol footprint fields and schematic files" ),
|
|
|
|
BITMAPS::save );
|
|
|
|
|
2019-08-08 22:11:59 +00:00
|
|
|
// Actions to navigate the display
|
2020-03-29 11:54:18 +00:00
|
|
|
TOOL_ACTION CVPCB_ACTIONS::changeFocusRight( "cvpcb.Control.changeFocusRight",
|
|
|
|
AS_GLOBAL,
|
2019-08-08 22:11:59 +00:00
|
|
|
WXK_TAB, "",
|
|
|
|
"",
|
|
|
|
"",
|
2021-03-08 02:59:07 +00:00
|
|
|
BITMAPS::INVALID_BITMAP, AF_NONE,
|
2019-08-08 22:11:59 +00:00
|
|
|
(void*) CVPCB_MAINFRAME::CHANGE_FOCUS_RIGHT );
|
|
|
|
|
2020-03-29 11:54:18 +00:00
|
|
|
TOOL_ACTION CVPCB_ACTIONS::changeFocusLeft( "cvpcb.Control.changeFocusLeft",
|
|
|
|
AS_GLOBAL,
|
2019-08-08 22:11:59 +00:00
|
|
|
MD_SHIFT + WXK_TAB, "",
|
|
|
|
"",
|
|
|
|
"",
|
2021-03-08 02:59:07 +00:00
|
|
|
BITMAPS::INVALID_BITMAP, AF_NONE,
|
2019-08-08 22:11:59 +00:00
|
|
|
(void*) CVPCB_MAINFRAME::CHANGE_FOCUS_LEFT );
|
|
|
|
|
2019-07-18 21:47:01 +00:00
|
|
|
// Actions to navigate the component list
|
2020-03-29 11:54:18 +00:00
|
|
|
TOOL_ACTION CVPCB_ACTIONS::gotoNextNA( "cvpcb.Control.GotoNextNA",
|
|
|
|
AS_GLOBAL, 0, "",
|
2020-12-13 13:12:38 +00:00
|
|
|
_( "Select next unassigned symbol" ),
|
|
|
|
_( "Select next symbol with no footprint assignment" ),
|
2021-03-08 02:59:07 +00:00
|
|
|
BITMAPS::right, AF_NONE,
|
2019-08-08 21:10:37 +00:00
|
|
|
(void*) CVPCB_MAINFRAME::ITEM_NEXT );
|
2019-07-18 21:47:01 +00:00
|
|
|
|
2020-03-29 11:54:18 +00:00
|
|
|
TOOL_ACTION CVPCB_ACTIONS::gotoPreviousNA( "cvpcb.Control.GotoPreviousNA",
|
|
|
|
AS_GLOBAL, 0, "",
|
2020-12-13 13:12:38 +00:00
|
|
|
_( "Select previous unassigned symbol" ),
|
|
|
|
_( "Select previous symbol with no footprint assignment" ),
|
2021-03-08 02:59:07 +00:00
|
|
|
BITMAPS::left, AF_NONE,
|
2019-08-08 21:10:37 +00:00
|
|
|
(void*) CVPCB_MAINFRAME::ITEM_PREV );
|
2019-07-18 21:47:01 +00:00
|
|
|
|
|
|
|
|
|
|
|
// Actions to modify component associations
|
2020-03-29 11:54:18 +00:00
|
|
|
TOOL_ACTION CVPCB_ACTIONS::associate( "cvpcb.Association.Associate",
|
|
|
|
AS_GLOBAL,
|
2019-08-08 22:11:59 +00:00
|
|
|
WXK_RETURN, "",
|
2020-12-13 13:12:38 +00:00
|
|
|
_( "Assign footprint" ),
|
|
|
|
_( "Assign footprint to selected symbols" ),
|
2021-03-08 02:59:07 +00:00
|
|
|
BITMAPS::auto_associate );
|
2019-07-24 20:56:17 +00:00
|
|
|
|
2020-03-29 11:54:18 +00:00
|
|
|
TOOL_ACTION CVPCB_ACTIONS::autoAssociate( "cvpcb.Association.AutoAssociate",
|
|
|
|
AS_GLOBAL, 0, "",
|
2020-12-13 13:12:38 +00:00
|
|
|
_( "Automatically assign footprints" ),
|
|
|
|
_( "Perform automatic footprint assignment" ),
|
2021-03-08 02:59:07 +00:00
|
|
|
BITMAPS::auto_associate );
|
2019-07-18 21:47:01 +00:00
|
|
|
|
2020-03-29 11:54:18 +00:00
|
|
|
TOOL_ACTION CVPCB_ACTIONS::deleteAssoc( "cvpcb.Association.Delete",
|
|
|
|
AS_GLOBAL,
|
2019-08-08 23:22:57 +00:00
|
|
|
WXK_DELETE, "",
|
|
|
|
_( "Delete association" ),
|
|
|
|
_( "Delete selected footprint associations" ),
|
2021-03-08 02:59:07 +00:00
|
|
|
BITMAPS::delete_association );
|
2019-08-08 23:22:57 +00:00
|
|
|
|
2020-03-29 11:54:18 +00:00
|
|
|
TOOL_ACTION CVPCB_ACTIONS::deleteAll( "cvpcb.Association.DeleteAll",
|
|
|
|
AS_GLOBAL, 0, "",
|
2019-07-18 21:47:01 +00:00
|
|
|
_( "Delete all footprint associations" ),
|
|
|
|
_( "Delete all footprint associations" ),
|
2021-03-08 02:59:07 +00:00
|
|
|
BITMAPS::delete_association );
|
2019-07-18 21:47:01 +00:00
|
|
|
|
|
|
|
|
|
|
|
// Actions to filter the footprint list
|
2019-09-03 18:32:39 +00:00
|
|
|
TOOL_ACTION CVPCB_ACTIONS::FilterFPbyFPFilters( "cvpcb.Control.FilterFPbyFPFilters",
|
|
|
|
AS_GLOBAL, 0, "",
|
|
|
|
_( "Use symbol footprint filters" ),
|
|
|
|
_( "Filter footprint list by footprint filters defined in the symbol" ),
|
2021-03-08 02:59:07 +00:00
|
|
|
BITMAPS::module_filtered_list, AF_NONE,
|
2019-09-03 18:28:54 +00:00
|
|
|
(void*) FOOTPRINTS_LISTBOX::FILTERING_BY_COMPONENT_FP_FILTERS );
|
2019-07-18 21:47:01 +00:00
|
|
|
|
2019-09-03 18:32:39 +00:00
|
|
|
TOOL_ACTION CVPCB_ACTIONS::filterFPbyPin( "cvpcb.Control.FilterFPByPin",
|
|
|
|
AS_GLOBAL, 0, "",
|
2019-07-18 21:47:01 +00:00
|
|
|
_( "Filter by pin count" ),
|
|
|
|
_( "Filter footprint list by pin count" ),
|
2021-03-08 02:59:07 +00:00
|
|
|
BITMAPS::module_pin_filtered_list, AF_NONE,
|
2019-07-18 21:47:01 +00:00
|
|
|
(void*) FOOTPRINTS_LISTBOX::FILTERING_BY_PIN_COUNT );
|
2019-06-17 00:34:21 +00:00
|
|
|
|
2019-09-03 18:32:39 +00:00
|
|
|
TOOL_ACTION CVPCB_ACTIONS::FilterFPbyLibrary( "cvpcb.Control.FilterFPbyLibrary",
|
|
|
|
AS_GLOBAL, 0, "",
|
2019-07-18 21:47:01 +00:00
|
|
|
_( "Filter by library" ),
|
|
|
|
_( "Filter footprint list by library" ),
|
2021-03-08 02:59:07 +00:00
|
|
|
BITMAPS::module_library_list, AF_NONE,
|
2019-07-18 21:47:01 +00:00
|
|
|
(void*) FOOTPRINTS_LISTBOX::FILTERING_BY_LIBRARY );
|