Schematic Setup: add BOM Preset importing
This commit is contained in:
parent
cb115189f6
commit
0000fcbe50
|
@ -149,6 +149,8 @@ set( EESCHEMA_DLGS
|
|||
dialogs/dialog_update_symbol_fields_base.cpp
|
||||
dialogs/dialog_wire_bus_properties.cpp
|
||||
dialogs/dialog_wire_bus_properties_base.cpp
|
||||
dialogs/panel_bom_presets.cpp
|
||||
dialogs/panel_bom_presets_base.cpp
|
||||
dialogs/panel_eeschema_color_settings.cpp
|
||||
dialogs/panel_eeschema_display_options.cpp
|
||||
dialogs/panel_eeschema_display_options_base.cpp
|
||||
|
|
|
@ -86,4 +86,6 @@ void DIALOG_SCH_IMPORT_SETTINGS::OnSelectAll( wxCommandEvent& event )
|
|||
m_PinMapOpt->SetValue( true );
|
||||
m_SeveritiesOpt->SetValue( true );
|
||||
m_NetClassesOpt->SetValue( true );
|
||||
m_BomPresetsOpt->SetValue( true );
|
||||
m_BomFmtPresetsOpt->SetValue( true );
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version 3.10.1-0-g8feb16b)
|
||||
// C++ code generated with wxFormBuilder (version 3.10.1-0-g8feb16b3)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||
|
@ -55,10 +55,16 @@ DIALOG_SCH_IMPORT_SETTINGS_BASE::DIALOG_SCH_IMPORT_SETTINGS_BASE( wxWindow* pare
|
|||
bmiddleSizer->Add( m_PinMapOpt, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
m_SeveritiesOpt = new wxCheckBox( this, wxID_ANY, _("Violation severities"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
bmiddleSizer->Add( m_SeveritiesOpt, 0, wxRIGHT|wxLEFT, 5 );
|
||||
bmiddleSizer->Add( m_SeveritiesOpt, 0, wxBOTTOM|wxLEFT|wxRIGHT, 5 );
|
||||
|
||||
m_NetClassesOpt = new wxCheckBox( this, wxID_ANY, _("Net classes"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
bmiddleSizer->Add( m_NetClassesOpt, 0, wxALL, 5 );
|
||||
bmiddleSizer->Add( m_NetClassesOpt, 0, wxBOTTOM|wxLEFT|wxRIGHT, 5 );
|
||||
|
||||
m_BomPresetsOpt = new wxCheckBox( this, wxID_ANY, _("BOM Presets"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
bmiddleSizer->Add( m_BomPresetsOpt, 0, wxBOTTOM|wxLEFT|wxRIGHT, 5 );
|
||||
|
||||
m_BomFmtPresetsOpt = new wxCheckBox( this, wxID_ANY, _("BOM Format Presets"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
bmiddleSizer->Add( m_BomFmtPresetsOpt, 0, wxBOTTOM|wxLEFT|wxRIGHT, 5 );
|
||||
|
||||
|
||||
m_MainSizer->Add( bmiddleSizer, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 10 );
|
||||
|
|
|
@ -535,7 +535,7 @@
|
|||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxRIGHT|wxLEFT</property>
|
||||
<property name="flag">wxBOTTOM|wxLEFT|wxRIGHT</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxCheckBox" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
|
@ -599,7 +599,7 @@
|
|||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALL</property>
|
||||
<property name="flag">wxBOTTOM|wxLEFT|wxRIGHT</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxCheckBox" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
|
@ -661,6 +661,134 @@
|
|||
<property name="window_style"></property>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxBOTTOM|wxLEFT|wxRIGHT</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxCheckBox" 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="checked">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="label">BOM Presets</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_BomPresetsOpt</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">public</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">; ; 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>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxBOTTOM|wxLEFT|wxRIGHT</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxCheckBox" 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="checked">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="label">BOM Format Presets</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_BomFmtPresetsOpt</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">public</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">; ; 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>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version 3.10.1-0-g8feb16b)
|
||||
// C++ code generated with wxFormBuilder (version 3.10.1-0-g8feb16b3)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||
|
@ -59,6 +59,8 @@ class DIALOG_SCH_IMPORT_SETTINGS_BASE : public DIALOG_SHIM
|
|||
wxCheckBox* m_PinMapOpt;
|
||||
wxCheckBox* m_SeveritiesOpt;
|
||||
wxCheckBox* m_NetClassesOpt;
|
||||
wxCheckBox* m_BomPresetsOpt;
|
||||
wxCheckBox* m_BomFmtPresetsOpt;
|
||||
|
||||
DIALOG_SCH_IMPORT_SETTINGS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Import Settings"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
|
||||
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
#include <panel_setup_pinmap.h>
|
||||
#include <erc_item.h>
|
||||
#include <panel_text_variables.h>
|
||||
#include <panel_bom_presets.h>
|
||||
#include <project/project_file.h>
|
||||
#include <project/net_settings.h>
|
||||
#include <settings/settings_manager.h>
|
||||
|
@ -66,6 +67,15 @@ DIALOG_SCHEMATIC_SETUP::DIALOG_SCHEMATIC_SETUP( SCH_EDIT_FRAME* aFrame ) :
|
|||
return new PANEL_TEMPLATE_FIELDNAMES( aParent, &settings.m_TemplateFieldNames );
|
||||
}, _( "Field Name Templates" ) );
|
||||
|
||||
m_bomPresetsPage = m_treebook->GetPageCount();
|
||||
m_treebook->AddLazySubPage(
|
||||
[this]( wxWindow* aParent ) -> wxWindow*
|
||||
{
|
||||
SCHEMATIC_SETTINGS& settings = m_frame->Schematic().Settings();
|
||||
return new PANEL_BOM_PRESETS( aParent, settings );
|
||||
}, _( "BOM Presets" ) );
|
||||
|
||||
|
||||
m_treebook->AddPage( new wxPanel( GetTreebook() ), _( "Electrical Rules" ) );
|
||||
|
||||
m_severitiesPage = m_treebook->GetPageCount();
|
||||
|
@ -208,6 +218,18 @@ void DIALOG_SCHEMATIC_SETUP::onAuxiliaryAction( wxCommandEvent& event )
|
|||
->ImportSettingsFrom( file.m_NetSettings );
|
||||
}
|
||||
|
||||
if( importDlg.m_BomPresetsOpt->GetValue() )
|
||||
{
|
||||
static_cast<PANEL_BOM_PRESETS*>( m_treebook->ResolvePage( m_bomPresetsPage ) )
|
||||
->ImportBomPresetsFrom( *file.m_SchematicSettings );
|
||||
}
|
||||
|
||||
if( importDlg.m_BomFmtPresetsOpt->GetValue() )
|
||||
{
|
||||
static_cast<PANEL_BOM_PRESETS*>( m_treebook->ResolvePage( m_bomPresetsPage ) )
|
||||
->ImportBomFmtPresetsFrom( *file.m_SchematicSettings );
|
||||
}
|
||||
|
||||
if( !alreadyLoaded )
|
||||
m_frame->GetSettingsManager()->UnloadProject( otherPrj, false );
|
||||
}
|
||||
|
|
|
@ -51,6 +51,7 @@ protected:
|
|||
|
||||
size_t m_formattingPage;
|
||||
size_t m_fieldNameTemplatesPage;
|
||||
size_t m_bomPresetsPage;
|
||||
size_t m_pinMapPage;
|
||||
size_t m_busesPage;
|
||||
size_t m_severitiesPage;
|
||||
|
|
|
@ -1153,6 +1153,12 @@ BOM_FMT_PRESET DIALOG_SYMBOL_FIELDS_TABLE::GetCurrentBomFmtSettings()
|
|||
}
|
||||
|
||||
|
||||
void DIALOG_SYMBOL_FIELDS_TABLE::ShowEditTab()
|
||||
{
|
||||
m_nbPages->SetSelection( 0 );
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_SYMBOL_FIELDS_TABLE::ShowExportTab()
|
||||
{
|
||||
m_nbPages->SetSelection( 1 );
|
||||
|
@ -1260,13 +1266,20 @@ void DIALOG_SYMBOL_FIELDS_TABLE::OnExport( wxCommandEvent& aEvent )
|
|||
}
|
||||
|
||||
|
||||
void DIALOG_SYMBOL_FIELDS_TABLE::OnCancel( wxCommandEvent& event )
|
||||
void DIALOG_SYMBOL_FIELDS_TABLE::OnCancel( wxCommandEvent& aEvent )
|
||||
{
|
||||
Close();
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_SYMBOL_FIELDS_TABLE::OnClose( wxCloseEvent& event )
|
||||
void DIALOG_SYMBOL_FIELDS_TABLE::OnOk( wxCommandEvent& aEvent )
|
||||
{
|
||||
TransferDataFromWindow();
|
||||
Close();
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_SYMBOL_FIELDS_TABLE::OnClose( wxCloseEvent& aEvent )
|
||||
{
|
||||
// This is a cancel, so commit quietly as we're going to throw the results away anyway.
|
||||
m_grid->CommitPendingChanges( true );
|
||||
|
@ -1279,7 +1292,7 @@ void DIALOG_SYMBOL_FIELDS_TABLE::OnClose( wxCloseEvent& event )
|
|||
return TransferDataFromWindow();
|
||||
} ) )
|
||||
{
|
||||
event.Veto();
|
||||
aEvent.Veto();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -86,6 +86,7 @@ private:
|
|||
void OnSaveAndContinue( wxCommandEvent& aEvent ) override;
|
||||
void OnCancel( wxCommandEvent& aEvent ) override;
|
||||
void OnClose( wxCloseEvent& aEvent ) override;
|
||||
void OnOk( wxCommandEvent& aEvent ) override;
|
||||
void OnFilterText( wxCommandEvent& aEvent ) override;
|
||||
void OnFilterMouseMoved( wxMouseEvent& event ) override;
|
||||
void OnFieldsCtrlSelectionChanged( wxDataViewEvent& event ) override;
|
||||
|
|
|
@ -392,6 +392,7 @@ DIALOG_SYMBOL_FIELDS_TABLE_BASE::DIALOG_SYMBOL_FIELDS_TABLE_BASE( wxWindow* pare
|
|||
m_buttonExport->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SYMBOL_FIELDS_TABLE_BASE::OnExport ), NULL, this );
|
||||
m_buttonApply->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SYMBOL_FIELDS_TABLE_BASE::OnSaveAndContinue ), NULL, this );
|
||||
m_sdbSizerCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SYMBOL_FIELDS_TABLE_BASE::OnCancel ), NULL, this );
|
||||
m_sdbSizerOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SYMBOL_FIELDS_TABLE_BASE::OnOk ), NULL, this );
|
||||
}
|
||||
|
||||
DIALOG_SYMBOL_FIELDS_TABLE_BASE::~DIALOG_SYMBOL_FIELDS_TABLE_BASE()
|
||||
|
@ -429,5 +430,6 @@ DIALOG_SYMBOL_FIELDS_TABLE_BASE::~DIALOG_SYMBOL_FIELDS_TABLE_BASE()
|
|||
m_buttonExport->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SYMBOL_FIELDS_TABLE_BASE::OnExport ), NULL, this );
|
||||
m_buttonApply->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SYMBOL_FIELDS_TABLE_BASE::OnSaveAndContinue ), NULL, this );
|
||||
m_sdbSizerCancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SYMBOL_FIELDS_TABLE_BASE::OnCancel ), NULL, this );
|
||||
m_sdbSizerOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SYMBOL_FIELDS_TABLE_BASE::OnOk ), NULL, this );
|
||||
|
||||
}
|
||||
|
|
|
@ -3600,6 +3600,7 @@
|
|||
<property name="name">m_sdbSizer</property>
|
||||
<property name="permission">protected</property>
|
||||
<event name="OnCancelButtonClick">OnCancel</event>
|
||||
<event name="OnOKButtonClick">OnOk</event>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
|
|
|
@ -132,6 +132,7 @@ class DIALOG_SYMBOL_FIELDS_TABLE_BASE : public DIALOG_SHIM
|
|||
virtual void OnExport( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void OnSaveAndContinue( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void OnCancel( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void OnOk( wxCommandEvent& event ) { event.Skip(); }
|
||||
|
||||
|
||||
public:
|
||||
|
|
|
@ -0,0 +1,116 @@
|
|||
/*
|
||||
* This program source code file is part of KICAD, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2023 Mike Williams <mike@mikebwilliams.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 <panel_bom_presets.h>
|
||||
|
||||
#include <wx/grid.h>
|
||||
#include <widgets/wx_grid.h>
|
||||
#include <bitmaps.h>
|
||||
#include <widgets/std_bitmap_button.h>
|
||||
|
||||
|
||||
PANEL_BOM_PRESETS::PANEL_BOM_PRESETS( wxWindow* aWindow, SCHEMATIC_SETTINGS& aSettings ) :
|
||||
PANEL_BOM_PRESETS_BASE( aWindow ), m_settings( aSettings )
|
||||
{
|
||||
m_btnDeleteBomPreset->SetBitmap( KiBitmap( BITMAPS::small_trash ) );
|
||||
m_btnDeleteBomFmtPreset->SetBitmap( KiBitmap( BITMAPS::small_trash ) );
|
||||
}
|
||||
|
||||
|
||||
bool PANEL_BOM_PRESETS::TransferDataToWindow()
|
||||
{
|
||||
m_bomPresets = m_settings.m_BomPresets;
|
||||
m_bomFmtPresets = m_settings.m_BomFmtPresets;
|
||||
|
||||
BuildGrid();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool PANEL_BOM_PRESETS::TransferDataFromWindow()
|
||||
{
|
||||
m_settings.m_BomPresets = m_bomPresets;
|
||||
m_settings.m_BomFmtPresets = m_bomFmtPresets;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void PANEL_BOM_PRESETS::BuildGrid()
|
||||
{
|
||||
m_bomPresetsGrid->ClearRows();
|
||||
m_bomFmtPresetsGrid->ClearRows();
|
||||
|
||||
for( const BOM_PRESET& p : m_bomPresets )
|
||||
{
|
||||
m_bomPresetsGrid->AppendRows( 1 );
|
||||
m_bomPresetsGrid->SetCellValue( m_bomPresetsGrid->GetNumberRows() - 1, 0, p.name );
|
||||
}
|
||||
|
||||
for( const BOM_FMT_PRESET& p : m_bomFmtPresets )
|
||||
{
|
||||
m_bomFmtPresetsGrid->AppendRows( 1 );
|
||||
m_bomFmtPresetsGrid->SetCellValue( m_bomFmtPresetsGrid->GetNumberRows() - 1, 0, p.name );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void PANEL_BOM_PRESETS::OnDeleteBomPreset( wxCommandEvent& event )
|
||||
{
|
||||
int curRow = m_bomPresetsGrid->GetGridCursorRow();
|
||||
|
||||
if( curRow < 0 || m_bomPresetsGrid->GetNumberRows() <= curRow )
|
||||
return;
|
||||
|
||||
m_bomPresetsGrid->DeleteRows( curRow, 1 );
|
||||
m_bomPresets.erase( m_bomPresets.begin() + curRow );
|
||||
}
|
||||
|
||||
|
||||
void PANEL_BOM_PRESETS::OnDeleteBomFmtPreset( wxCommandEvent& event )
|
||||
{
|
||||
int curRow = m_bomFmtPresetsGrid->GetGridCursorRow();
|
||||
|
||||
if( curRow < 0 || m_bomFmtPresetsGrid->GetNumberRows() <= curRow )
|
||||
return;
|
||||
|
||||
m_bomFmtPresetsGrid->DeleteRows( curRow, 1 );
|
||||
// Erase the bom preset from the bom presets list.
|
||||
m_bomFmtPresets.erase( m_bomFmtPresets.begin() + curRow );
|
||||
}
|
||||
|
||||
|
||||
void PANEL_BOM_PRESETS::ImportBomPresetsFrom( SCHEMATIC_SETTINGS& aSettings )
|
||||
{
|
||||
m_bomPresets = aSettings.m_BomPresets;
|
||||
BuildGrid();
|
||||
}
|
||||
|
||||
|
||||
void PANEL_BOM_PRESETS::ImportBomFmtPresetsFrom( SCHEMATIC_SETTINGS& aSettings )
|
||||
{
|
||||
m_bomFmtPresets = aSettings.m_BomFmtPresets;
|
||||
BuildGrid();
|
||||
}
|
|
@ -0,0 +1,531 @@
|
|||
<?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">panel_bom_presets_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">PanelBomPresets</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">1</property>
|
||||
<property name="use_microsoft_bom">0</property>
|
||||
<object class="Panel" expanded="1">
|
||||
<property name="aui_managed">0</property>
|
||||
<property name="aui_manager_style">wxAUI_MGR_DEFAULT</property>
|
||||
<property name="bg"></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="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">PANEL_BOM_PRESETS_BASE</property>
|
||||
<property name="pos"></property>
|
||||
<property name="size">-1,-1</property>
|
||||
<property name="subclass">; forward_declare</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">wxTAB_TRAVERSAL</property>
|
||||
<object class="wxBoxSizer" expanded="1">
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">bPanelSizer</property>
|
||||
<property name="orient">wxVERTICAL</property>
|
||||
<property name="permission">none</property>
|
||||
<object class="sizeritem" expanded="0">
|
||||
<property name="border">8</property>
|
||||
<property name="flag">wxTOP|wxLEFT|wxEXPAND</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxStaticText" 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="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="label">Bill of Materials Presets:</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_bomTitle</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">; ; forward_declare</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>
|
||||
<property name="wrap">-1</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">3</property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="width">0</property>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="0">
|
||||
<property name="border">10</property>
|
||||
<property name="flag">wxEXPAND</property>
|
||||
<property name="proportion">1</property>
|
||||
<object class="wxGrid" 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="autosize_cols">0</property>
|
||||
<property name="autosize_rows">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="cell_bg"></property>
|
||||
<property name="cell_font"></property>
|
||||
<property name="cell_horiz_alignment">wxALIGN_LEFT</property>
|
||||
<property name="cell_text"></property>
|
||||
<property name="cell_vert_alignment">wxALIGN_CENTER</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="col_label_horiz_alignment">wxALIGN_CENTER</property>
|
||||
<property name="col_label_size">wxGRID_AUTOSIZE</property>
|
||||
<property name="col_label_values">"Name"</property>
|
||||
<property name="col_label_vert_alignment">wxALIGN_CENTER</property>
|
||||
<property name="cols">1</property>
|
||||
<property name="column_sizes">420</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="drag_col_move">0</property>
|
||||
<property name="drag_col_size">1</property>
|
||||
<property name="drag_grid_size">0</property>
|
||||
<property name="drag_row_size">1</property>
|
||||
<property name="editing">0</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="grid_line_color"></property>
|
||||
<property name="grid_lines">1</property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label_bg"></property>
|
||||
<property name="label_font"></property>
|
||||
<property name="label_text"></property>
|
||||
<property name="margin_height">0</property>
|
||||
<property name="margin_width">0</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size">-1,-1</property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size">-1,180</property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_bomPresetsGrid</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="row_label_horiz_alignment">wxALIGN_CENTER</property>
|
||||
<property name="row_label_size">0</property>
|
||||
<property name="row_label_values"></property>
|
||||
<property name="row_label_vert_alignment">wxALIGN_CENTER</property>
|
||||
<property name="row_sizes"></property>
|
||||
<property name="rows">0</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="subclass">WX_GRID; widgets/wx_grid.h; forward_declare</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="OnSize">OnSizeGrid</event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="0">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALL</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxBitmapButton" 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">Delete Field</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">-1,-1</property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_btnDeleteBomPreset</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">STD_BITMAP_BUTTON; widgets/std_bitmap_button.h; 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">OnDeleteBomPreset</event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">8</property>
|
||||
<property name="flag">wxEXPAND|wxLEFT|wxTOP</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxStaticText" 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="label">Bill of Materials Formatting Presets:</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_bomFmtTitle</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">; ; forward_declare</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>
|
||||
<property name="wrap">-1</property>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="spacer" expanded="1">
|
||||
<property name="height">3</property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="width">0</property>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">10</property>
|
||||
<property name="flag">wxEXPAND</property>
|
||||
<property name="proportion">1</property>
|
||||
<object class="wxGrid" 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="autosize_cols">0</property>
|
||||
<property name="autosize_rows">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="cell_bg"></property>
|
||||
<property name="cell_font"></property>
|
||||
<property name="cell_horiz_alignment">wxALIGN_LEFT</property>
|
||||
<property name="cell_text"></property>
|
||||
<property name="cell_vert_alignment">wxALIGN_CENTER</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="col_label_horiz_alignment">wxALIGN_CENTER</property>
|
||||
<property name="col_label_size">wxGRID_AUTOSIZE</property>
|
||||
<property name="col_label_values">"Name"</property>
|
||||
<property name="col_label_vert_alignment">wxALIGN_CENTER</property>
|
||||
<property name="cols">1</property>
|
||||
<property name="column_sizes">420</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="drag_col_move">0</property>
|
||||
<property name="drag_col_size">1</property>
|
||||
<property name="drag_grid_size">0</property>
|
||||
<property name="drag_row_size">1</property>
|
||||
<property name="editing">0</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="grid_line_color"></property>
|
||||
<property name="grid_lines">1</property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label_bg"></property>
|
||||
<property name="label_font"></property>
|
||||
<property name="label_text"></property>
|
||||
<property name="margin_height">0</property>
|
||||
<property name="margin_width">0</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size">-1,-1</property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size">-1,180</property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_bomFmtPresetsGrid</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="row_label_horiz_alignment">wxALIGN_CENTER</property>
|
||||
<property name="row_label_size">0</property>
|
||||
<property name="row_label_values"></property>
|
||||
<property name="row_label_vert_alignment">wxALIGN_CENTER</property>
|
||||
<property name="row_sizes"></property>
|
||||
<property name="rows">0</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="subclass">WX_GRID; widgets/wx_grid.h; forward_declare</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="OnSize">OnSizeGrid</event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALL</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxBitmapButton" 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">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">Delete Field</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">-1,-1</property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_btnDeleteBomFmtPreset</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">STD_BITMAP_BUTTON; widgets/std_bitmap_button.h; 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">OnDeleteBomFmtPreset</event>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</wxFormBuilder_Project>
|
|
@ -0,0 +1,54 @@
|
|||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2023 Mike Williams <mike@mikebwilliams.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 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/>.
|
||||
*/
|
||||
|
||||
#ifndef PANEL_EESCHEMA_BOM_PRESETS_H
|
||||
#define PANEL_EESCHEMA_BOM_PRESETS_H
|
||||
|
||||
#include <panel_bom_presets_base.h>
|
||||
#include <schematic_settings.h>
|
||||
|
||||
class SCH_EDIT_FRAME;
|
||||
|
||||
|
||||
class PANEL_BOM_PRESETS : public PANEL_BOM_PRESETS_BASE
|
||||
{
|
||||
public:
|
||||
PANEL_BOM_PRESETS( wxWindow* aWindow, SCHEMATIC_SETTINGS& aSettings );
|
||||
|
||||
void ImportBomPresetsFrom( SCHEMATIC_SETTINGS& aSettings );
|
||||
void ImportBomFmtPresetsFrom( SCHEMATIC_SETTINGS& aSettings );
|
||||
|
||||
protected:
|
||||
void OnDeleteBomPreset( wxCommandEvent& event ) override;
|
||||
void OnDeleteBomFmtPreset( wxCommandEvent& event ) override;
|
||||
|
||||
private:
|
||||
bool TransferDataToWindow() override;
|
||||
bool TransferDataFromWindow() override;
|
||||
void BuildGrid();
|
||||
|
||||
protected:
|
||||
SCHEMATIC_SETTINGS& m_settings;
|
||||
std::vector<BOM_PRESET> m_bomPresets;
|
||||
std::vector<BOM_FMT_PRESET> m_bomFmtPresets;
|
||||
};
|
||||
|
||||
|
||||
#endif //PANEL_EESCHEMA_DEFUALT_FIELDS_H
|
|
@ -0,0 +1,120 @@
|
|||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version 3.10.1-0-g8feb16b3)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "widgets/std_bitmap_button.h"
|
||||
#include "widgets/wx_grid.h"
|
||||
|
||||
#include "panel_bom_presets_base.h"
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
PANEL_BOM_PRESETS_BASE::PANEL_BOM_PRESETS_BASE( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name ) : wxPanel( parent, id, pos, size, style, name )
|
||||
{
|
||||
wxBoxSizer* bPanelSizer;
|
||||
bPanelSizer = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
m_bomTitle = new wxStaticText( this, wxID_ANY, _("Bill of Materials Presets:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_bomTitle->Wrap( -1 );
|
||||
bPanelSizer->Add( m_bomTitle, 0, wxTOP|wxLEFT|wxEXPAND, 8 );
|
||||
|
||||
|
||||
bPanelSizer->Add( 0, 3, 0, wxEXPAND, 5 );
|
||||
|
||||
m_bomPresetsGrid = new WX_GRID( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
|
||||
// Grid
|
||||
m_bomPresetsGrid->CreateGrid( 0, 1 );
|
||||
m_bomPresetsGrid->EnableEditing( false );
|
||||
m_bomPresetsGrid->EnableGridLines( true );
|
||||
m_bomPresetsGrid->EnableDragGridSize( false );
|
||||
m_bomPresetsGrid->SetMargins( 0, 0 );
|
||||
|
||||
// Columns
|
||||
m_bomPresetsGrid->SetColSize( 0, 420 );
|
||||
m_bomPresetsGrid->EnableDragColMove( false );
|
||||
m_bomPresetsGrid->EnableDragColSize( true );
|
||||
m_bomPresetsGrid->SetColLabelValue( 0, _("Name") );
|
||||
m_bomPresetsGrid->SetColLabelSize( wxGRID_AUTOSIZE );
|
||||
m_bomPresetsGrid->SetColLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
|
||||
|
||||
// Rows
|
||||
m_bomPresetsGrid->EnableDragRowSize( true );
|
||||
m_bomPresetsGrid->SetRowLabelSize( 0 );
|
||||
m_bomPresetsGrid->SetRowLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
|
||||
|
||||
// Label Appearance
|
||||
|
||||
// Cell Defaults
|
||||
m_bomPresetsGrid->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_CENTER );
|
||||
m_bomPresetsGrid->SetMinSize( wxSize( -1,180 ) );
|
||||
|
||||
bPanelSizer->Add( m_bomPresetsGrid, 1, wxEXPAND, 10 );
|
||||
|
||||
m_btnDeleteBomPreset = new STD_BITMAP_BUTTON( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 );
|
||||
bPanelSizer->Add( m_btnDeleteBomPreset, 0, wxALL, 5 );
|
||||
|
||||
m_bomFmtTitle = new wxStaticText( this, wxID_ANY, _("Bill of Materials Formatting Presets:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_bomFmtTitle->Wrap( -1 );
|
||||
bPanelSizer->Add( m_bomFmtTitle, 0, wxEXPAND|wxLEFT|wxTOP, 8 );
|
||||
|
||||
|
||||
bPanelSizer->Add( 0, 3, 0, wxEXPAND, 5 );
|
||||
|
||||
m_bomFmtPresetsGrid = new WX_GRID( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
|
||||
// Grid
|
||||
m_bomFmtPresetsGrid->CreateGrid( 0, 1 );
|
||||
m_bomFmtPresetsGrid->EnableEditing( false );
|
||||
m_bomFmtPresetsGrid->EnableGridLines( true );
|
||||
m_bomFmtPresetsGrid->EnableDragGridSize( false );
|
||||
m_bomFmtPresetsGrid->SetMargins( 0, 0 );
|
||||
|
||||
// Columns
|
||||
m_bomFmtPresetsGrid->SetColSize( 0, 420 );
|
||||
m_bomFmtPresetsGrid->EnableDragColMove( false );
|
||||
m_bomFmtPresetsGrid->EnableDragColSize( true );
|
||||
m_bomFmtPresetsGrid->SetColLabelValue( 0, _("Name") );
|
||||
m_bomFmtPresetsGrid->SetColLabelSize( wxGRID_AUTOSIZE );
|
||||
m_bomFmtPresetsGrid->SetColLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
|
||||
|
||||
// Rows
|
||||
m_bomFmtPresetsGrid->EnableDragRowSize( true );
|
||||
m_bomFmtPresetsGrid->SetRowLabelSize( 0 );
|
||||
m_bomFmtPresetsGrid->SetRowLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
|
||||
|
||||
// Label Appearance
|
||||
|
||||
// Cell Defaults
|
||||
m_bomFmtPresetsGrid->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_CENTER );
|
||||
m_bomFmtPresetsGrid->SetMinSize( wxSize( -1,180 ) );
|
||||
|
||||
bPanelSizer->Add( m_bomFmtPresetsGrid, 1, wxEXPAND, 10 );
|
||||
|
||||
m_btnDeleteBomFmtPreset = new STD_BITMAP_BUTTON( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 );
|
||||
bPanelSizer->Add( m_btnDeleteBomFmtPreset, 0, wxALL, 5 );
|
||||
|
||||
|
||||
this->SetSizer( bPanelSizer );
|
||||
this->Layout();
|
||||
bPanelSizer->Fit( this );
|
||||
|
||||
// Connect Events
|
||||
m_bomPresetsGrid->Connect( wxEVT_SIZE, wxSizeEventHandler( PANEL_BOM_PRESETS_BASE::OnSizeGrid ), NULL, this );
|
||||
m_btnDeleteBomPreset->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_BOM_PRESETS_BASE::OnDeleteBomPreset ), NULL, this );
|
||||
m_bomFmtPresetsGrid->Connect( wxEVT_SIZE, wxSizeEventHandler( PANEL_BOM_PRESETS_BASE::OnSizeGrid ), NULL, this );
|
||||
m_btnDeleteBomFmtPreset->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_BOM_PRESETS_BASE::OnDeleteBomFmtPreset ), NULL, this );
|
||||
}
|
||||
|
||||
PANEL_BOM_PRESETS_BASE::~PANEL_BOM_PRESETS_BASE()
|
||||
{
|
||||
// Disconnect Events
|
||||
m_bomPresetsGrid->Disconnect( wxEVT_SIZE, wxSizeEventHandler( PANEL_BOM_PRESETS_BASE::OnSizeGrid ), NULL, this );
|
||||
m_btnDeleteBomPreset->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_BOM_PRESETS_BASE::OnDeleteBomPreset ), NULL, this );
|
||||
m_bomFmtPresetsGrid->Disconnect( wxEVT_SIZE, wxSizeEventHandler( PANEL_BOM_PRESETS_BASE::OnSizeGrid ), NULL, this );
|
||||
m_btnDeleteBomFmtPreset->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_BOM_PRESETS_BASE::OnDeleteBomFmtPreset ), NULL, this );
|
||||
|
||||
}
|
|
@ -0,0 +1,61 @@
|
|||
///////////////////////////////////////////////////////////////////////////
|
||||
// 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>
|
||||
class STD_BITMAP_BUTTON;
|
||||
class WX_GRID;
|
||||
|
||||
#include <wx/string.h>
|
||||
#include <wx/stattext.h>
|
||||
#include <wx/gdicmn.h>
|
||||
#include <wx/font.h>
|
||||
#include <wx/colour.h>
|
||||
#include <wx/settings.h>
|
||||
#include <wx/grid.h>
|
||||
#include <wx/bmpbuttn.h>
|
||||
#include <wx/bitmap.h>
|
||||
#include <wx/image.h>
|
||||
#include <wx/icon.h>
|
||||
#include <wx/button.h>
|
||||
#include <wx/sizer.h>
|
||||
#include <wx/panel.h>
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
/// Class PANEL_BOM_PRESETS_BASE
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
class PANEL_BOM_PRESETS_BASE : public wxPanel
|
||||
{
|
||||
private:
|
||||
|
||||
protected:
|
||||
wxStaticText* m_bomTitle;
|
||||
WX_GRID* m_bomPresetsGrid;
|
||||
STD_BITMAP_BUTTON* m_btnDeleteBomPreset;
|
||||
wxStaticText* m_bomFmtTitle;
|
||||
WX_GRID* m_bomFmtPresetsGrid;
|
||||
STD_BITMAP_BUTTON* m_btnDeleteBomFmtPreset;
|
||||
|
||||
// Virtual event handlers, override them in your derived class
|
||||
virtual void OnSizeGrid( wxSizeEvent& event ) { event.Skip(); }
|
||||
virtual void OnDeleteBomPreset( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void OnDeleteBomFmtPreset( wxCommandEvent& event ) { event.Skip(); }
|
||||
|
||||
|
||||
public:
|
||||
|
||||
PANEL_BOM_PRESETS_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 );
|
||||
|
||||
~PANEL_BOM_PRESETS_BASE();
|
||||
|
||||
};
|
||||
|
Loading…
Reference in New Issue