ADDED: Manager dialog for generative objects.

This commit is contained in:
Alex Shvartzkop 2023-10-07 08:30:29 +03:00 committed by dsa-t
parent a4832dd3c8
commit 08e0d8d98a
8 changed files with 1234 additions and 0 deletions

View File

@ -82,6 +82,8 @@ set( PCBNEW_DIALOGS
dialogs/dialog_gencad_export_options.cpp
dialogs/dialog_gendrill.cpp
dialogs/dialog_gendrill_base.cpp
dialogs/dialog_generators.cpp
dialogs/dialog_generators_base.cpp
dialogs/dialog_get_footprint_by_name_base.cpp
dialogs/dialog_global_deletion.cpp
dialogs/dialog_global_deletion_base.cpp

View File

@ -0,0 +1,467 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2023 Alex Shvartzkop <dudesuchamazing@gmail.com>
* Copyright (C) 2023 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 2
* 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, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "dialog_generators.h"
#include <pcb_edit_frame.h>
#include <board.h>
#include <pcb_generator.h>
#include <tool/tool_manager.h>
#include <tools/pcb_actions.h>
#include <tools/generator_tool.h>
void DIALOG_GENERATORS::clearModels()
{
for( auto& [name, ptr] : m_dataModels )
{
if( ptr )
ptr->DecRef();
}
m_dataModels.clear();
m_columnNameTypes.clear();
m_dataViews.clear();
}
void DIALOG_GENERATORS::clearModel( const wxString& aName )
{
if( m_dataModels[aName] )
{
m_dataModels[aName]->DeleteAllItems();
m_dataModels[aName]->ClearColumns();
}
m_columnNameTypes[aName].clear();
}
void DIALOG_GENERATORS::deleteModel( const wxString& aName )
{
if( m_dataModels[aName] )
m_dataModels[aName]->DecRef();
for( size_t i = 0; i < m_Notebook->GetPageCount(); i++ )
{
wxWindow* page = m_Notebook->GetPage( i );
if( page->GetName() == aName )
{
m_Notebook->DeletePage( i );
break;
}
}
m_dataViews.erase( aName );
m_dataModels.erase( aName );
m_columnNameTypes.erase( aName );
}
void DIALOG_GENERATORS::RebuildModels()
{
wxString lastPageName;
std::set<wxString> lastUUIDs;
if( auto page = m_Notebook->GetCurrentPage() )
{
lastPageName = page->GetName();
wxDataViewCtrl* dataView = m_dataViews[lastPageName];
int uuidCol = dataView->GetColumnCount() - 1;
wxDataViewItemArray selections;
dataView->GetSelections( selections );
for( wxDataViewItem& item : selections )
{
wxVariant var;
dataView->GetModel()->GetValue( var, item, uuidCol );
lastUUIDs.emplace( var.GetString() );
}
}
int newPageId = -1;
std::map<wxString, std::map<KIID, std::vector<std::pair<wxString, wxVariant>>>> dataMap;
for( PCB_GENERATOR* gen : m_currentBoard->Generators() )
{
std::vector<std::pair<wxString, wxVariant>> rowData = gen->GetRowData();
const KIID uuid = gen->m_Uuid;
rowData.emplace_back( wxS( "UUID" ), uuid.AsString() );
dataMap[gen->GetName()][uuid] = rowData;
}
std::vector<wxString> toDelete;
for( size_t i = 0; i < m_Notebook->GetPageCount(); i++ )
{
wxWindow* page = m_Notebook->GetPage( i );
if( dataMap.find(page->GetName()) == dataMap.end() )
{
toDelete.emplace_back( page->GetName() );
}
}
for( const wxString& name : toDelete )
deleteModel( name );
for( auto& [typeName, uuidToRowMap] : dataMap )
{
bool exists = false;
for( size_t i = 0; i < m_Notebook->GetPageCount(); i++ )
{
if( m_Notebook->GetPage( i )->GetName() == typeName )
{
exists = true;
break;
}
}
if( exists )
{
clearModel( typeName );
}
else
{
wxString title = typeName + wxString::Format( " (%d)", int( uuidToRowMap.size() ) );
addPage( typeName, title );
}
}
for( auto& [typeName, uuidToRowMap] : dataMap )
{
std::vector<std::pair<wxString, wxString>>& thisColNameTypes = m_columnNameTypes[typeName];
std::map<wxString, int> nameToColIdMap;
std::set<wxString> columnsSet;
for( auto& [uuid, rowMap] : uuidToRowMap )
{
for( auto& [colName, value] : rowMap )
{
if( columnsSet.find( colName ) == columnsSet.end() )
{
int colId = columnsSet.size();
columnsSet.emplace( colName );
nameToColIdMap[colName] = colId;
thisColNameTypes.emplace_back( colName, "string" );
}
}
}
wxDataViewListStore* store = new wxDataViewListStore();
for( auto& [name, type] : thisColNameTypes )
store->AppendColumn( type );
int colCount = thisColNameTypes.size();
for( auto& [uuid, rowMap] : uuidToRowMap )
{
wxVector<wxVariant> values( colCount );
for( auto& [dataName, value] : rowMap )
{
values[nameToColIdMap[dataName]] = value;
}
store->AppendItem( values );
}
m_dataModels[typeName] = store;
}
m_Notebook->DeleteAllPages();
int pageId = 0;
for( auto& [typeName, model] : m_dataModels )
{
wxString title = typeName + wxString::Format( " (%d)", model->GetItemCount() );
wxDataViewCtrl* dataView = addPage( typeName, title );
if( typeName == lastPageName )
newPageId = pageId;
dataView->AssociateModel( model );
int colId = 0;
for( auto& [name, type] : m_columnNameTypes[typeName] )
{
int flags = wxDATAVIEW_COL_RESIZABLE | wxDATAVIEW_COL_SORTABLE;
if( name == wxS( "UUID" ) )
flags |= wxDATAVIEW_COL_HIDDEN;
dataView->AppendTextColumn( name, colId, wxDATAVIEW_CELL_INERT, wxCOL_WIDTH_AUTOSIZE,
wxALIGN_LEFT, flags );
colId++;
}
m_dataViews[typeName] = dataView;
pageId++;
}
if( newPageId != -1 )
{
m_Notebook->SetSelection( newPageId );
wxDataViewCtrl* dataView = m_dataViews[lastPageName];
int uuidCol = dataView->GetColumnCount() - 1;
wxDataViewListStore* model = m_dataModels[lastPageName];
size_t itemCount = model->GetItemCount();
wxDataViewItemArray newSelections;
for( size_t itemId = 0; itemId < itemCount; itemId++ )
{
wxVariant var;
model->GetValueByRow( var, itemId, uuidCol );
if( lastUUIDs.find( var.GetString() ) != lastUUIDs.end() )
newSelections.push_back( model->GetItem( itemId ) );
}
dataView->SetSelections( newSelections );
}
}
wxDataViewCtrl* DIALOG_GENERATORS::addPage( const wxString& aName, const wxString& aTitle )
{
wxPanel* panelPage =
new wxPanel( m_Notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
panelPage->SetName( aName );
wxBoxSizer* bSizerPage1;
bSizerPage1 = new wxBoxSizer( wxVERTICAL );
bSizerPage1->SetMinSize( wxSize( -1, 320 ) );
wxDataViewCtrl* dataView = new wxDataViewCtrl( panelPage, wxID_ANY, wxDefaultPosition,
wxDefaultSize, wxDV_MULTIPLE | wxDV_ROW_LINES );
dataView->Bind( wxEVT_DATAVIEW_SELECTION_CHANGED, &DIALOG_GENERATORS::OnItemSelected, this );
bSizerPage1->Add( dataView, 1, wxEXPAND | wxALL, 5 );
bSizerPage1->Add( 0, 8, 0, wxEXPAND, 5 );
panelPage->SetSizer( bSizerPage1 );
panelPage->Layout();
bSizerPage1->Fit( panelPage );
m_Notebook->AddPage( panelPage, aTitle, false );
return dataView;
}
void DIALOG_GENERATORS::onUnitsChanged( wxCommandEvent& event )
{
m_units = m_frame->GetUserUnits();
RebuildModels();
event.Skip();
}
void DIALOG_GENERATORS::onBoardChanged( wxCommandEvent& event )
{
m_currentBoard = m_frame->GetBoard();
if( m_currentBoard != nullptr )
m_currentBoard->AddListener( this );
RebuildModels();
event.Skip();
}
void DIALOG_GENERATORS::OnBoardItemAdded( BOARD& aBoard, BOARD_ITEM* aBoardItem )
{
RebuildModels();
}
void DIALOG_GENERATORS::OnBoardItemsAdded( BOARD& aBoard, std::vector<BOARD_ITEM*>& aBoardItems )
{
RebuildModels();
}
void DIALOG_GENERATORS::OnBoardItemRemoved( BOARD& aBoard, BOARD_ITEM* aBoardItem )
{
RebuildModels();
}
void DIALOG_GENERATORS::OnBoardItemsRemoved( BOARD& aBoard, std::vector<BOARD_ITEM*>& aBoardItems )
{
RebuildModels();
}
void DIALOG_GENERATORS::OnBoardItemChanged( BOARD& aBoard, BOARD_ITEM* aBoardItem )
{
RebuildModels();
}
void DIALOG_GENERATORS::OnBoardItemsChanged( BOARD& aBoard, std::vector<BOARD_ITEM*>& aBoardItems )
{
RebuildModels();
}
DIALOG_GENERATORS::DIALOG_GENERATORS( PCB_EDIT_FRAME* aEditorFrame, wxWindow* aParent ) :
DIALOG_GENERATORS_BASE( aParent )
{
SetName( DIALOG_GENERATORS_WINDOW_NAME );
m_frame = aEditorFrame;
m_currentBoard = m_frame->GetBoard();
m_Notebook->DeleteAllPages();
RebuildModels();
Bind( EDA_EVT_UNITS_CHANGED, &DIALOG_GENERATORS::onUnitsChanged, this );
Bind( EDA_EVT_BOARD_CHANGED, &DIALOG_GENERATORS::onBoardChanged, this );
if( m_currentBoard != nullptr )
{
m_currentBoard->AddListener( this );
}
}
DIALOG_GENERATORS::~DIALOG_GENERATORS()
{
clearModels();
if( m_currentBoard != nullptr )
m_currentBoard->RemoveListener( this );
}
wxDataViewListStore* DIALOG_GENERATORS::getCurrentModel()
{
wxString pageName = m_Notebook->GetCurrentPage()->GetName();
return m_dataModels[pageName];
}
void DIALOG_GENERATORS::OnItemSelected( wxDataViewEvent& aEvent )
{
wxDataViewListStore* model = getCurrentModel();
wxString pageName = m_Notebook->GetCurrentPage()->GetName();
wxDataViewCtrl* dataView = m_dataViews[pageName];
if( !model )
return;
int uuidCol = dataView->GetColumnCount() - 1;
std::vector<BOARD_ITEM*> boardItems;
EDA_ITEMS edaItems;
wxDataViewItemArray selections;
dataView->GetSelections( selections );
for( wxDataViewItem& viewItem : selections )
{
wxVariant var;
model->GetValue( var, viewItem, uuidCol );
BOARD_ITEM* brdItem = m_currentBoard->GetItem( var.GetString() );
if( !brdItem || brdItem->Type() != KICAD_T::PCB_GENERATOR_T )
continue;
boardItems.push_back( brdItem );
edaItems.push_back( brdItem );
}
m_frame->GetToolManager()->RunAction( PCB_ACTIONS::selectionClear );
m_frame->GetToolManager()->RunAction<EDA_ITEMS*>( PCB_ACTIONS::selectItems, &edaItems );
m_frame->FocusOnItems( boardItems );
}
void DIALOG_GENERATORS::OnRebuildSelectedClick( wxCommandEvent& event )
{
RebuildModels();
}
void DIALOG_GENERATORS::OnRebuildTypeClick( wxCommandEvent& event )
{
wxDataViewListStore* model = getCurrentModel();
wxString pageName = m_Notebook->GetCurrentPage()->GetName();
if( !model )
return;
int uuidCol = m_columnNameTypes[pageName].size() - 1;
EDA_ITEMS items;
for( size_t row = 0; row < model->GetItemCount(); row++ )
{
wxVariant var;
model->GetValueByRow( var, row, uuidCol );
BOARD_ITEM* item = m_currentBoard->GetItem( var.GetString() );
if( !item || item->Type() != KICAD_T::PCB_GENERATOR_T )
continue;
items.push_back( item );
}
m_frame->GetToolManager()->RunAction( PCB_ACTIONS::selectionClear );
m_frame->GetToolManager()->RunAction<EDA_ITEMS*>( PCB_ACTIONS::selectItems, &items );
m_frame->GetToolManager()->RunAction( PCB_ACTIONS::regenerateSelected );
RebuildModels();
}
void DIALOG_GENERATORS::OnRebuildAllClick( wxCommandEvent& event )
{
m_frame->GetToolManager()->RunAction( PCB_ACTIONS::regenerateAll );
RebuildModels();
}
void DIALOG_GENERATORS::OnCancelClick( wxCommandEvent& event )
{
GENERATOR_TOOL* genTool = m_frame->GetToolManager()->GetTool<GENERATOR_TOOL>();
genTool->DestroyManagerDialog();
}

View File

@ -0,0 +1,84 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2023 Alex Shvartzkop <dudesuchamazing@gmail.com>
* Copyright (C) 2023 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 2
* 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, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef DIALOG_GENERATORS_H_
#define DIALOG_GENERATORS_H_
#include "dialog_generators_base.h"
#include <widgets/progress_reporter_base.h>
#include <board.h>
class PCB_EDIT_FRAME;
#define DIALOG_GENERATORS_WINDOW_NAME wxT( "DialogGeneratorsWindowName" )
class DIALOG_GENERATORS : public DIALOG_GENERATORS_BASE, public BOARD_LISTENER
{
public:
DIALOG_GENERATORS( PCB_EDIT_FRAME* aEditorFrame, wxWindow* aParent );
~DIALOG_GENERATORS();
void RebuildModels();
private:
void OnItemSelected( wxDataViewEvent& aEvent );
void OnRebuildSelectedClick( wxCommandEvent& event ) override;
void OnRebuildTypeClick( wxCommandEvent& event ) override;
void OnRebuildAllClick( wxCommandEvent& event ) override;
void OnCancelClick( wxCommandEvent& aEvent ) override;
wxDataViewListStore* getCurrentModel();
void clearModels();
void clearModel( const wxString& aName );
void deleteModel( const wxString& aName );
wxDataViewCtrl* addPage( const wxString& aName, const wxString& aTitle );
void onUnitsChanged( wxCommandEvent& event );
void onBoardChanged( wxCommandEvent& event );
virtual void OnBoardItemAdded( BOARD& aBoard, BOARD_ITEM* aBoardItem ) override;
virtual void OnBoardItemsAdded( BOARD& aBoard, std::vector<BOARD_ITEM*>& aBoardItems ) override;
virtual void OnBoardItemRemoved( BOARD& aBoard, BOARD_ITEM* aBoardItem ) override;
virtual void OnBoardItemsRemoved( BOARD& aBoard,
std::vector<BOARD_ITEM*>& aBoardItems ) override;
virtual void OnBoardItemChanged( BOARD& aBoard, BOARD_ITEM* aBoardItem ) override;
virtual void OnBoardItemsChanged( BOARD& aBoard,
std::vector<BOARD_ITEM*>& aBoardItems ) override;
std::map<wxString, std::vector<std::pair<wxString, wxString>>> m_columnNameTypes;
std::map<wxString, wxDataViewListStore*> m_dataModels;
std::map<wxString, wxDataViewCtrl*> m_dataViews;
BOARD* m_currentBoard;
PCB_EDIT_FRAME* m_frame;
};
#endif // DIALOG_GENERATORS_H_

View File

@ -0,0 +1,101 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version 3.10.1-0-g8feb16b3)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#include "dialog_generators_base.h"
///////////////////////////////////////////////////////////////////////////
DIALOG_GENERATORS_BASE::DIALOG_GENERATORS_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style )
{
this->SetSizeHints( wxSize( -1,-1 ), wxDefaultSize );
wxBoxSizer* m_MainSizer;
m_MainSizer = new wxBoxSizer( wxVERTICAL );
wxBoxSizer* bSizer13;
bSizer13 = new wxBoxSizer( wxVERTICAL );
m_Notebook = new wxNotebook( this, ID_NOTEBOOK1, wxDefaultPosition, wxDefaultSize, 0 );
m_Notebook->SetMinSize( wxSize( 640,-1 ) );
m_panelPage1 = new wxPanel( m_Notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
wxBoxSizer* bSizerPage1;
bSizerPage1 = new wxBoxSizer( wxVERTICAL );
bSizerPage1->SetMinSize( wxSize( -1,320 ) );
m_dataview1 = new wxDataViewCtrl( m_panelPage1, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
m_dataview1->SetToolTip( _("Click on items to highlight them on the board.") );
bSizerPage1->Add( m_dataview1, 1, wxEXPAND|wxALL, 5 );
bSizerPage1->Add( 0, 8, 0, wxEXPAND, 5 );
m_panelPage1->SetSizer( bSizerPage1 );
m_panelPage1->Layout();
bSizerPage1->Fit( m_panelPage1 );
m_Notebook->AddPage( m_panelPage1, _("Generators A (%s)"), false );
bSizer13->Add( m_Notebook, 1, wxEXPAND, 10 );
m_MainSizer->Add( bSizer13, 1, wxEXPAND, 5 );
m_sizerButtons = new wxBoxSizer( wxHORIZONTAL );
m_rebuildSelected = new wxButton( this, wxID_ANY, _("Rebuild selected"), wxDefaultPosition, wxDefaultSize, 0 );
m_sizerButtons->Add( m_rebuildSelected, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5 );
m_rebuildThisType = new wxButton( this, wxID_ANY, _("Rebuild this type"), wxDefaultPosition, wxDefaultSize, 0 );
m_rebuildThisType->Hide();
m_sizerButtons->Add( m_rebuildThisType, 0, wxTOP|wxBOTTOM|wxRIGHT, 5 );
m_sizerButtons->Add( 0, 8, 1, wxEXPAND, 5 );
m_rebuildAll = new wxButton( this, wxID_ANY, _("Rebuild All"), wxDefaultPosition, wxDefaultSize, 0 );
m_sizerButtons->Add( m_rebuildAll, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
m_sdbSizer = new wxStdDialogButtonSizer();
m_sdbSizerCancel = new wxButton( this, wxID_CANCEL );
m_sdbSizer->AddButton( m_sdbSizerCancel );
m_sdbSizer->Realize();
m_sizerButtons->Add( m_sdbSizer, 0, wxEXPAND|wxALL, 5 );
m_MainSizer->Add( m_sizerButtons, 0, wxEXPAND|wxLEFT, 5 );
this->SetSizer( m_MainSizer );
this->Layout();
m_MainSizer->Fit( this );
// Connect Events
this->Connect( wxEVT_ACTIVATE, wxActivateEventHandler( DIALOG_GENERATORS_BASE::OnActivateDlg ) );
this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_GENERATORS_BASE::OnClose ) );
m_Notebook->Connect( wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, wxNotebookEventHandler( DIALOG_GENERATORS_BASE::OnChangingNotebookPage ), NULL, this );
m_rebuildSelected->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GENERATORS_BASE::OnRebuildSelectedClick ), NULL, this );
m_rebuildThisType->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GENERATORS_BASE::OnRebuildTypeClick ), NULL, this );
m_rebuildAll->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GENERATORS_BASE::OnRebuildAllClick ), NULL, this );
m_sdbSizerCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GENERATORS_BASE::OnCancelClick ), NULL, this );
}
DIALOG_GENERATORS_BASE::~DIALOG_GENERATORS_BASE()
{
// Disconnect Events
this->Disconnect( wxEVT_ACTIVATE, wxActivateEventHandler( DIALOG_GENERATORS_BASE::OnActivateDlg ) );
this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_GENERATORS_BASE::OnClose ) );
m_Notebook->Disconnect( wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, wxNotebookEventHandler( DIALOG_GENERATORS_BASE::OnChangingNotebookPage ), NULL, this );
m_rebuildSelected->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GENERATORS_BASE::OnRebuildSelectedClick ), NULL, this );
m_rebuildThisType->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GENERATORS_BASE::OnRebuildTypeClick ), NULL, this );
m_rebuildAll->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GENERATORS_BASE::OnRebuildAllClick ), NULL, this );
m_sdbSizerCancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GENERATORS_BASE::OnCancelClick ), NULL, this );
}

View File

@ -0,0 +1,502 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<wxFormBuilder_Project>
<FileVersion major="1" minor="16" />
<object class="Project" expanded="1">
<property name="class_decoration"></property>
<property name="code_generation">C++</property>
<property name="disconnect_events">1</property>
<property name="disconnect_mode">source_name</property>
<property name="disconnect_php_events">0</property>
<property name="disconnect_python_events">0</property>
<property name="embedded_files_path">res</property>
<property name="encoding">UTF-8</property>
<property name="event_generation">connect</property>
<property name="file">dialog_generators_base</property>
<property name="first_id">1000</property>
<property name="help_provider">none</property>
<property name="image_path_wrapper_function_name"></property>
<property name="indent_with_spaces"></property>
<property name="internationalize">1</property>
<property name="name">dialog_generators_base</property>
<property name="namespace"></property>
<property name="path">.</property>
<property name="precompiled_header"></property>
<property name="relative_path">1</property>
<property name="skip_lua_events">1</property>
<property name="skip_php_events">1</property>
<property name="skip_python_events">1</property>
<property name="ui_table">UI</property>
<property name="use_array_enum">0</property>
<property name="use_enum">0</property>
<property name="use_microsoft_bom">0</property>
<object class="Dialog" expanded="1">
<property name="aui_managed">0</property>
<property name="aui_manager_style">wxAUI_MGR_DEFAULT</property>
<property name="bg"></property>
<property name="center"></property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="enabled">1</property>
<property name="event_handler">impl_virtual</property>
<property name="extra_style"></property>
<property name="fg"></property>
<property name="font"></property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="maximum_size"></property>
<property name="minimum_size">-1,-1</property>
<property name="name">DIALOG_GENERATORS_BASE</property>
<property name="pos"></property>
<property name="size">-1,-1</property>
<property name="style">wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER</property>
<property name="subclass">DIALOG_SHIM; dialog_shim.h</property>
<property name="title">Generator Objects</property>
<property name="tooltip"></property>
<property name="two_step_creation">0</property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnActivate">OnActivateDlg</event>
<event name="OnClose">OnClose</event>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">m_MainSizer</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">1</property>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">bSizer13</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">10</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">1</property>
<object class="wxNotebook" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="bitmapsize"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">ID_NOTEBOOK1</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size">640,-1</property>
<property name="moveable">1</property>
<property name="name">m_Notebook</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnNotebookPageChanged">OnChangingNotebookPage</event>
<object class="notebookpage" expanded="1">
<property name="bitmap"></property>
<property name="label">Generators A (%s)</property>
<property name="select">0</property>
<object class="wxPanel" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_panelPage1</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="subclass">; </property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style">wxTAB_TRAVERSAL</property>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size">-1,320</property>
<property name="name">bSizerPage1</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxALL</property>
<property name="proportion">1</property>
<object class="wxDataViewCtrl" expanded="0">
<property name="bg"></property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="font"></property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="name">m_dataview1</property>
<property name="permission">protected</property>
<property name="pos"></property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass">; ; forward_declare</property>
<property name="tooltip">Click on items to highlight them on the board.</property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
</object>
</object>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">0</property>
<object class="spacer" expanded="0">
<property name="height">8</property>
<property name="permission">protected</property>
<property name="width">0</property>
</object>
</object>
</object>
</object>
</object>
</object>
</object>
</object>
</object>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxBoxSizer" expanded="0">
<property name="minimum_size"></property>
<property name="name">m_sizerButtons</property>
<property name="orient">wxHORIZONTAL</property>
<property name="permission">protected</property>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT</property>
<property name="proportion">0</property>
<object class="wxButton" expanded="0">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="auth_needed">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="bitmap"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="current"></property>
<property name="default">0</property>
<property name="default_pane">0</property>
<property name="disabled"></property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="focus"></property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Rebuild selected</property>
<property name="margins"></property>
<property name="markup">0</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_rebuildSelected</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="position"></property>
<property name="pressed"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass">; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnButtonClick">OnRebuildSelectedClick</event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxTOP|wxBOTTOM|wxRIGHT</property>
<property name="proportion">0</property>
<object class="wxButton" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="auth_needed">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="bitmap"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="current"></property>
<property name="default">0</property>
<property name="default_pane">0</property>
<property name="disabled"></property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="focus"></property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">1</property>
<property name="id">wxID_ANY</property>
<property name="label">Rebuild this type</property>
<property name="margins"></property>
<property name="markup">0</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_rebuildThisType</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="position"></property>
<property name="pressed"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass">; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnButtonClick">OnRebuildTypeClick</event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">1</property>
<object class="spacer" expanded="1">
<property name="height">8</property>
<property name="permission">protected</property>
<property name="width">0</property>
</object>
</object>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxRIGHT</property>
<property name="proportion">0</property>
<object class="wxButton" expanded="0">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="auth_needed">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="bitmap"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="current"></property>
<property name="default">0</property>
<property name="default_pane">0</property>
<property name="disabled"></property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="focus"></property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Rebuild All</property>
<property name="margins"></property>
<property name="markup">0</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_rebuildAll</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="position"></property>
<property name="pressed"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass">; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnButtonClick">OnRebuildAllClick</event>
</object>
</object>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxALL</property>
<property name="proportion">0</property>
<object class="wxStdDialogButtonSizer" expanded="0">
<property name="Apply">0</property>
<property name="Cancel">1</property>
<property name="ContextHelp">0</property>
<property name="Help">0</property>
<property name="No">0</property>
<property name="OK">0</property>
<property name="Save">0</property>
<property name="Yes">0</property>
<property name="minimum_size"></property>
<property name="name">m_sdbSizer</property>
<property name="permission">protected</property>
<event name="OnCancelButtonClick">OnCancelClick</event>
</object>
</object>
</object>
</object>
</object>
</object>
</object>
</wxFormBuilder_Project>

View File

@ -0,0 +1,68 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version 3.10.1-0-g8feb16b3)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#pragma once
#include <wx/artprov.h>
#include <wx/xrc/xmlres.h>
#include <wx/intl.h>
#include "dialog_shim.h"
#include <wx/dataview.h>
#include <wx/gdicmn.h>
#include <wx/font.h>
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/string.h>
#include <wx/sizer.h>
#include <wx/panel.h>
#include <wx/bitmap.h>
#include <wx/image.h>
#include <wx/icon.h>
#include <wx/notebook.h>
#include <wx/button.h>
#include <wx/dialog.h>
///////////////////////////////////////////////////////////////////////////
#define ID_NOTEBOOK1 1000
///////////////////////////////////////////////////////////////////////////////
/// Class DIALOG_GENERATORS_BASE
///////////////////////////////////////////////////////////////////////////////
class DIALOG_GENERATORS_BASE : public DIALOG_SHIM
{
private:
protected:
wxNotebook* m_Notebook;
wxPanel* m_panelPage1;
wxDataViewCtrl* m_dataview1;
wxBoxSizer* m_sizerButtons;
wxButton* m_rebuildSelected;
wxButton* m_rebuildThisType;
wxButton* m_rebuildAll;
wxStdDialogButtonSizer* m_sdbSizer;
wxButton* m_sdbSizerCancel;
// Virtual event handlers, override them in your derived class
virtual void OnActivateDlg( wxActivateEvent& event ) { event.Skip(); }
virtual void OnClose( wxCloseEvent& event ) { event.Skip(); }
virtual void OnChangingNotebookPage( wxNotebookEvent& event ) { event.Skip(); }
virtual void OnRebuildSelectedClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnRebuildTypeClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnRebuildAllClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnCancelClick( wxCommandEvent& event ) { event.Skip(); }
public:
DIALOG_GENERATORS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Generator Objects"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_GENERATORS_BASE();
};

View File

@ -2418,6 +2418,14 @@ TOOL_ACTION PCB_ACTIONS::genRemove( TOOL_ACTION_ARGS()
.Scope( AS_CONTEXT ) );
TOOL_ACTION PCB_ACTIONS::generatorsShowManager( TOOL_ACTION_ARGS()
.Name( "pcbnew.Generator.showManager" )
.Scope( AS_GLOBAL )
.MenuText( _( "Generators Manager" ) )
.Tooltip( _( "Show a manager dialog for Generator objects" ) )
.Icon( BITMAPS::pin_table ) );
// LENGTH_TUNER_TOOL
//
TOOL_ACTION PCB_ACTIONS::ddAppendBoard( TOOL_ACTION_ARGS()

View File

@ -281,6 +281,8 @@ public:
static TOOL_ACTION genRevertEdit;
static TOOL_ACTION genRemove;
static TOOL_ACTION generatorsShowManager;
// Point Editor
static TOOL_ACTION pointEditorAddCorner;
static TOOL_ACTION pointEditorRemoveCorner;