mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-04-11 14:50:11 +00:00
Sym edit: add copy/paste/cut/etc actions to fp filter table
Implemented as a "TRICKS" class that could wrap any wxListBox with similar effects.
This commit is contained in:
parent
646d2b26a6
commit
8abbae9dc2
@ -419,6 +419,7 @@ set( COMMON_WIDGET_SRCS
|
||||
widgets/layer_box_selector.cpp
|
||||
widgets/layer_presentation.cpp
|
||||
widgets/lib_tree.cpp
|
||||
widgets/listbox_tricks.cpp
|
||||
widgets/mathplot.cpp
|
||||
widgets/msgpanel.cpp
|
||||
widgets/paged_dialog.cpp
|
||||
|
311
common/widgets/listbox_tricks.cpp
Normal file
311
common/widgets/listbox_tricks.cpp
Normal file
@ -0,0 +1,311 @@
|
||||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2024 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 "widgets/listbox_tricks.h"
|
||||
|
||||
#include <wx/clipbrd.h>
|
||||
#include <wx/listbox.h>
|
||||
#include <wx/menu.h>
|
||||
#include <wx/window.h>
|
||||
|
||||
#include <bitmaps.h>
|
||||
#include <bitmaps/bitmaps_list.h>
|
||||
#include <widgets/ui_common.h>
|
||||
|
||||
|
||||
wxDEFINE_EVENT( EDA_EVT_LISTBOX_COPY, wxCommandEvent );
|
||||
wxDEFINE_EVENT( EDA_EVT_LISTBOX_CUT, wxCommandEvent );
|
||||
wxDEFINE_EVENT( EDA_EVT_LISTBOX_PASTE, wxCommandEvent );
|
||||
wxDEFINE_EVENT( EDA_EVT_LISTBOX_DELETE, wxCommandEvent );
|
||||
wxDEFINE_EVENT( EDA_EVT_LISTBOX_DUPLICATE, wxCommandEvent );
|
||||
|
||||
wxDEFINE_EVENT( EDA_EVT_LISTBOX_CHANGED, wxCommandEvent );
|
||||
|
||||
|
||||
LISTBOX_TRICKS::LISTBOX_TRICKS( wxWindow& aParent, wxListBox& aListBox ) :
|
||||
m_parent( aParent ), m_listBox( aListBox )
|
||||
{
|
||||
// Init default menu labels
|
||||
m_menuStrings = { {
|
||||
{ ID_COPY, _( "Copy" ) },
|
||||
{ ID_PASTE, _( "Paste" ) },
|
||||
{ ID_CUT, _( "Cut" ) },
|
||||
{ ID_DUPLICATE, _( "Duplicate" ) },
|
||||
{ ID_DELETE, _( "Delete" ) },
|
||||
} };
|
||||
|
||||
|
||||
m_listBox.Connect( wxEVT_RIGHT_DOWN, wxMouseEventHandler( LISTBOX_TRICKS::OnListBoxRDown ),
|
||||
nullptr, this );
|
||||
m_listBox.Connect( wxEVT_KEY_DOWN, wxKeyEventHandler( LISTBOX_TRICKS::OnListBoxKeyDown ),
|
||||
nullptr, this );
|
||||
|
||||
Connect( EDA_EVT_LISTBOX_DELETE, wxCommandEventHandler( LISTBOX_TRICKS::OnListBoxDelete ) );
|
||||
Connect( EDA_EVT_LISTBOX_COPY, wxCommandEventHandler( LISTBOX_TRICKS::OnListBoxCopy ) );
|
||||
Connect( EDA_EVT_LISTBOX_CUT, wxCommandEventHandler( LISTBOX_TRICKS::OnListBoxCut ) );
|
||||
Connect( EDA_EVT_LISTBOX_PASTE, wxCommandEventHandler( LISTBOX_TRICKS::OnListBoxPaste ) );
|
||||
Connect( EDA_EVT_LISTBOX_DUPLICATE, wxCommandEventHandler( LISTBOX_TRICKS::OnListBoxDuplicate ) );
|
||||
}
|
||||
|
||||
|
||||
LISTBOX_TRICKS::~LISTBOX_TRICKS()
|
||||
{
|
||||
m_listBox.Disconnect( wxEVT_RIGHT_DOWN, wxMouseEventHandler( LISTBOX_TRICKS::OnListBoxRDown ),
|
||||
nullptr, this );
|
||||
m_listBox.Disconnect( wxEVT_KEY_DOWN, wxKeyEventHandler( LISTBOX_TRICKS::OnListBoxKeyDown ),
|
||||
nullptr, this );
|
||||
|
||||
Disconnect( EDA_EVT_LISTBOX_DELETE, wxCommandEventHandler( LISTBOX_TRICKS::OnListBoxDelete ) );
|
||||
Disconnect( EDA_EVT_LISTBOX_COPY, wxCommandEventHandler( LISTBOX_TRICKS::OnListBoxCopy ) );
|
||||
Disconnect( EDA_EVT_LISTBOX_CUT, wxCommandEventHandler( LISTBOX_TRICKS::OnListBoxCut ) );
|
||||
Disconnect( EDA_EVT_LISTBOX_PASTE, wxCommandEventHandler( LISTBOX_TRICKS::OnListBoxPaste ) );
|
||||
Disconnect( EDA_EVT_LISTBOX_DUPLICATE, wxCommandEventHandler( LISTBOX_TRICKS::OnListBoxDuplicate ) );
|
||||
}
|
||||
|
||||
|
||||
void LISTBOX_TRICKS::SetMenuLabels( const std::map<MENU_ID, wxString>& aItems )
|
||||
{
|
||||
for( const auto& [id, string] : aItems )
|
||||
{
|
||||
m_menuStrings[id] = string;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
wxArrayInt LISTBOX_TRICKS::listBoxDeleteSelected()
|
||||
{
|
||||
wxArrayInt selections;
|
||||
m_listBox.GetSelections( selections );
|
||||
|
||||
std::sort( selections.begin(), selections.end() );
|
||||
|
||||
for( int ii = selections.GetCount() - 1; ii >= 0; ii-- )
|
||||
m_listBox.Delete( selections[ii] );
|
||||
|
||||
m_listBox.SetSelection( wxNOT_FOUND );
|
||||
if( m_listBox.GetCount() > 0 )
|
||||
m_listBox.SetSelection( std::max( 0, selections[0] - 1 ) );
|
||||
|
||||
wxPostEvent( &m_listBox, wxCommandEvent( EDA_EVT_LISTBOX_CHANGED ) );
|
||||
return selections;
|
||||
}
|
||||
|
||||
|
||||
wxArrayString LISTBOX_TRICKS::listBoxGetSelected() const
|
||||
{
|
||||
wxArrayInt selections;
|
||||
m_listBox.GetSelections( selections );
|
||||
|
||||
wxArrayString result;
|
||||
for( size_t ii = 0; ii < selections.GetCount(); ii++ )
|
||||
result.Add( m_listBox.GetString( selections[ii] ) );
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
void LISTBOX_TRICKS::listBoxDuplicateSelected()
|
||||
{
|
||||
wxArrayInt selections;
|
||||
m_listBox.GetSelections( selections );
|
||||
|
||||
int insertAt = selections.GetCount() > 0 ? selections.back() + 1 : m_listBox.GetCount();
|
||||
|
||||
m_listBox.SetSelection( wxNOT_FOUND );
|
||||
|
||||
for( size_t ii = 0; ii < selections.GetCount(); ii++ )
|
||||
{
|
||||
wxString filter = m_listBox.GetString( selections[ii] );
|
||||
m_listBox.Insert( filter, insertAt );
|
||||
m_listBox.SetSelection( insertAt );
|
||||
insertAt++;
|
||||
}
|
||||
|
||||
wxPostEvent( &m_listBox, wxCommandEvent( EDA_EVT_LISTBOX_CHANGED ) );
|
||||
}
|
||||
|
||||
|
||||
void LISTBOX_TRICKS::listBoxCopy()
|
||||
{
|
||||
wxArrayString filters = listBoxGetSelected();
|
||||
|
||||
wxString result;
|
||||
for( const wxString& filter : filters )
|
||||
{
|
||||
result += filter + wxT( "\n" );
|
||||
}
|
||||
|
||||
if( wxTheClipboard->Open() )
|
||||
{
|
||||
wxTheClipboard->SetData( new wxTextDataObject( result ) );
|
||||
wxTheClipboard->Close();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void LISTBOX_TRICKS::listBoxPaste()
|
||||
{
|
||||
wxArrayString lines;
|
||||
if( wxTheClipboard->Open() )
|
||||
{
|
||||
wxTextDataObject data;
|
||||
wxTheClipboard->GetData( data );
|
||||
|
||||
wxString text = data.GetText();
|
||||
text.Trim( false );
|
||||
text.Trim( true );
|
||||
lines = wxSplit( text, '\n' );
|
||||
|
||||
wxTheClipboard->Close();
|
||||
}
|
||||
|
||||
wxArrayInt selections;
|
||||
m_listBox.GetSelections( selections );
|
||||
int insertAt = selections.GetCount() > 0 ? selections.back() + 1 : m_listBox.GetCount();
|
||||
|
||||
for( wxString& line : lines )
|
||||
{
|
||||
line.Trim( false );
|
||||
line.Trim( true );
|
||||
}
|
||||
|
||||
m_listBox.InsertItems( lines, insertAt );
|
||||
|
||||
m_listBox.SetSelection( wxNOT_FOUND );
|
||||
for( size_t ii = insertAt; ii < insertAt + lines.GetCount(); ii++ )
|
||||
m_listBox.SetSelection( ii );
|
||||
|
||||
wxPostEvent( &m_listBox, wxCommandEvent( EDA_EVT_LISTBOX_CHANGED ) );
|
||||
}
|
||||
|
||||
|
||||
void LISTBOX_TRICKS::listBoxCut()
|
||||
{
|
||||
listBoxCopy();
|
||||
wxArrayInt deleted = listBoxDeleteSelected();
|
||||
|
||||
size_t select = deleted.GetCount() > 0 ? deleted[0] : m_listBox.GetCount();
|
||||
|
||||
m_listBox.SetSelection( wxNOT_FOUND );
|
||||
m_listBox.SetSelection( std::min( select, (size_t) m_listBox.GetCount() - 1 ) );
|
||||
}
|
||||
|
||||
|
||||
void LISTBOX_TRICKS::OnListBoxRDown( wxMouseEvent& aEvent )
|
||||
{
|
||||
wxMenu menu;
|
||||
|
||||
const auto mstr = [&]( const MENU_ID& id )
|
||||
{
|
||||
return m_menuStrings[id];
|
||||
};
|
||||
|
||||
// clang-format off
|
||||
KIUI::AddMenuItem( &menu, ID_COPY,
|
||||
mstr( ID_COPY ) + "\tCtrl+C",
|
||||
KiBitmap( BITMAPS::copy ) );
|
||||
KIUI::AddMenuItem( &menu, ID_CUT,
|
||||
mstr( ID_CUT ) + "\tCtrl+X",
|
||||
KiBitmap( BITMAPS::cut ) );
|
||||
KIUI::AddMenuItem( &menu, ID_PASTE,
|
||||
mstr( ID_PASTE ) + "\tCtrl+V",
|
||||
KiBitmap( BITMAPS::paste ) );
|
||||
KIUI::AddMenuItem( &menu, ID_DUPLICATE,
|
||||
mstr( ID_DUPLICATE ) + "\tCtrl+D",
|
||||
KiBitmap( BITMAPS::duplicate ) );
|
||||
KIUI::AddMenuItem( &menu, ID_DELETE,
|
||||
mstr( ID_DELETE ) + "\tDel",
|
||||
KiBitmap( BITMAPS::trash ) );
|
||||
// clang-format on
|
||||
|
||||
menu.Bind( wxEVT_COMMAND_MENU_SELECTED,
|
||||
[&]( wxCommandEvent& aCmd )
|
||||
{
|
||||
switch( aEvent.GetId() )
|
||||
{
|
||||
case ID_COPY: listBoxCopy(); break;
|
||||
case ID_PASTE: listBoxPaste(); break;
|
||||
case ID_CUT: listBoxCut(); break;
|
||||
case ID_DELETE: listBoxDeleteSelected(); break;
|
||||
case ID_DUPLICATE: listBoxDuplicateSelected(); break;
|
||||
default: aEvent.Skip();
|
||||
}
|
||||
} );
|
||||
|
||||
m_parent.PopupMenu( &menu );
|
||||
}
|
||||
|
||||
|
||||
void LISTBOX_TRICKS::OnListBoxKeyDown( wxKeyEvent& aEvent )
|
||||
{
|
||||
if( aEvent.GetKeyCode() == WXK_DELETE )
|
||||
{
|
||||
listBoxDeleteSelected();
|
||||
}
|
||||
else
|
||||
{
|
||||
if( aEvent.ControlDown() )
|
||||
{
|
||||
switch( aEvent.GetKeyCode() )
|
||||
{
|
||||
case 'C': listBoxCopy(); break;
|
||||
case 'V': listBoxPaste(); break;
|
||||
case 'X': listBoxCut(); break;
|
||||
case 'D': listBoxDuplicateSelected(); break;
|
||||
default: aEvent.Skip();
|
||||
}
|
||||
}
|
||||
else
|
||||
aEvent.Skip();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void LISTBOX_TRICKS::OnListBoxDelete( wxCommandEvent& aEvent )
|
||||
{
|
||||
listBoxDeleteSelected();
|
||||
}
|
||||
|
||||
|
||||
void LISTBOX_TRICKS::OnListBoxCopy( wxCommandEvent& aEvent )
|
||||
{
|
||||
listBoxCopy();
|
||||
}
|
||||
|
||||
|
||||
void LISTBOX_TRICKS::OnListBoxCut( wxCommandEvent& aEvent )
|
||||
{
|
||||
listBoxCut();
|
||||
}
|
||||
|
||||
|
||||
void LISTBOX_TRICKS::OnListBoxPaste( wxCommandEvent& aEvent )
|
||||
{
|
||||
listBoxPaste();
|
||||
}
|
||||
|
||||
|
||||
void LISTBOX_TRICKS::OnListBoxDuplicate( wxCommandEvent& aEvent )
|
||||
{
|
||||
listBoxDuplicateSelected();
|
||||
}
|
@ -21,6 +21,8 @@
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include "dialog_lib_symbol_properties.h"
|
||||
|
||||
#include <pgm_base.h>
|
||||
#include <eeschema_settings.h>
|
||||
#include <bitmaps.h>
|
||||
@ -41,9 +43,11 @@
|
||||
#include <dialog_sim_model.h>
|
||||
|
||||
#include <panel_embedded_files.h>
|
||||
#include <dialog_lib_symbol_properties.h>
|
||||
#include <settings/settings_manager.h>
|
||||
#include <symbol_editor_settings.h>
|
||||
#include <widgets/listbox_tricks.h>
|
||||
|
||||
#include <wx/clipbrd.h>
|
||||
#include <wx/msgdlg.h>
|
||||
|
||||
|
||||
@ -62,7 +66,8 @@ DIALOG_LIB_SYMBOL_PROPERTIES::DIALOG_LIB_SYMBOL_PROPERTIES( SYMBOL_EDIT_FRAME* a
|
||||
m_delayedFocusGrid( nullptr ),
|
||||
m_delayedFocusRow( -1 ),
|
||||
m_delayedFocusColumn( -1 ),
|
||||
m_delayedFocusPage( -1 )
|
||||
m_delayedFocusPage( -1 ),
|
||||
m_fpFilterTricks( std::make_unique<LISTBOX_TRICKS>( *this, *m_FootprintFilterListBox ) )
|
||||
{
|
||||
m_embeddedFiles = new PANEL_EMBEDDED_FILES( m_NoteBook, m_libEntry );
|
||||
m_NoteBook->AddPage( m_embeddedFiles, _( "Embedded Files" ) );
|
||||
@ -111,6 +116,21 @@ DIALOG_LIB_SYMBOL_PROPERTIES::DIALOG_LIB_SYMBOL_PROPERTIES( SYMBOL_EDIT_FRAME* a
|
||||
wxGridEventHandler( DIALOG_LIB_SYMBOL_PROPERTIES::OnGridCellChanging ),
|
||||
nullptr, this );
|
||||
|
||||
// Forward the delete button to the tricks
|
||||
m_deleteFilterButton->Bind( wxEVT_BUTTON,
|
||||
[&]( wxCommandEvent& aEvent )
|
||||
{
|
||||
wxCommandEvent cmdEvent( EDA_EVT_LISTBOX_DELETE );
|
||||
m_fpFilterTricks->ProcessEvent( cmdEvent );
|
||||
} );
|
||||
|
||||
// When the filter tricks modifies something, update outselves
|
||||
m_FootprintFilterListBox->Bind( EDA_EVT_LISTBOX_CHANGED,
|
||||
[&]( wxCommandEvent& aEvent )
|
||||
{
|
||||
OnModify();
|
||||
} );
|
||||
|
||||
if( m_lastLayout != DIALOG_LIB_SYMBOL_PROPERTIES::LAST_LAYOUT::NONE )
|
||||
{
|
||||
if( ( m_lastLayout == DIALOG_LIB_SYMBOL_PROPERTIES::LAST_LAYOUT::ALIAS
|
||||
@ -740,9 +760,9 @@ void DIALOG_LIB_SYMBOL_PROPERTIES::OnEditSpiceModel( wxCommandEvent& event )
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_LIB_SYMBOL_PROPERTIES::OnFilterDClick( wxMouseEvent& event )
|
||||
void DIALOG_LIB_SYMBOL_PROPERTIES::OnFpFilterDClick( wxMouseEvent& event )
|
||||
{
|
||||
int idx = m_FootprintFilterListBox->HitTest( event.GetPosition() );
|
||||
int idx = m_FootprintFilterListBox->HitTest( event.GetPosition() );
|
||||
wxCommandEvent dummy;
|
||||
|
||||
if( idx >= 0 )
|
||||
@ -780,31 +800,16 @@ void DIALOG_LIB_SYMBOL_PROPERTIES::OnAddFootprintFilter( wxCommandEvent& event )
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_LIB_SYMBOL_PROPERTIES::OnDeleteFootprintFilter( wxCommandEvent& event )
|
||||
{
|
||||
int ii = m_FootprintFilterListBox->GetSelection();
|
||||
|
||||
if( ii >= 0 )
|
||||
{
|
||||
m_FootprintFilterListBox->Delete( (unsigned) ii );
|
||||
|
||||
if( m_FootprintFilterListBox->GetCount() == 0 )
|
||||
m_FootprintFilterListBox->SetSelection( wxNOT_FOUND );
|
||||
else
|
||||
m_FootprintFilterListBox->SetSelection( std::max( 0, ii - 1 ) );
|
||||
}
|
||||
|
||||
OnModify();
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_LIB_SYMBOL_PROPERTIES::OnEditFootprintFilter( wxCommandEvent& event )
|
||||
{
|
||||
int idx = m_FootprintFilterListBox->GetSelection();
|
||||
wxArrayInt selections;
|
||||
int n = m_FootprintFilterListBox->GetSelections( selections );
|
||||
|
||||
if( idx >= 0 )
|
||||
if( n > 0 )
|
||||
{
|
||||
wxString filter = m_FootprintFilterListBox->GetStringSelection();
|
||||
// Just edit the first one
|
||||
int idx = selections[0];
|
||||
wxString filter = m_FootprintFilterListBox->GetString( idx );
|
||||
|
||||
WX_TEXT_ENTRY_DIALOG dlg( this, _( "Filter:" ), _( "Edit Footprint Filter" ), filter );
|
||||
|
||||
|
@ -22,8 +22,9 @@
|
||||
*/
|
||||
|
||||
|
||||
#ifndef DIALOG_LIB_SYMBOL_PROPERTIES_H
|
||||
#define DIALOG_LIB_SYMBOL_PROPERTIES_H
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include <fields_grid_table.h>
|
||||
#include <widgets/unit_binder.h>
|
||||
@ -32,6 +33,7 @@
|
||||
|
||||
class SYMBOL_EDIT_FRAME;
|
||||
class LIB_SYMBOL;
|
||||
class LISTBOX_TRICKS;
|
||||
class PANEL_EMBEDDED_FILES;
|
||||
class WX_GRID;
|
||||
|
||||
@ -63,15 +65,14 @@ private:
|
||||
void OnSymbolNameKillFocus( wxFocusEvent& event ) override;
|
||||
void OnSymbolNameText( wxCommandEvent& event ) override;
|
||||
void OnAddFootprintFilter( wxCommandEvent& event ) override;
|
||||
void OnDeleteFootprintFilter( wxCommandEvent& event ) override;
|
||||
void OnEditFootprintFilter( wxCommandEvent& event ) override;
|
||||
void OnSizeGrid( wxSizeEvent& event ) override;
|
||||
void OnGridCellChanging( wxGridEvent& event );
|
||||
void OnEditSpiceModel( wxCommandEvent& event ) override;
|
||||
void OnUpdateUI( wxUpdateUIEvent& event ) override;
|
||||
void OnFilterDClick( wxMouseEvent& event ) override;
|
||||
void OnCancelButtonClick( wxCommandEvent& event ) override;
|
||||
void OnPageChanging( wxNotebookEvent& event ) override;
|
||||
void OnFpFilterDClick( wxMouseEvent& event ) override;
|
||||
|
||||
void adjustGridColumns();
|
||||
void syncControlStates( bool aIsAlias );
|
||||
@ -107,6 +108,6 @@ private:
|
||||
};
|
||||
|
||||
static LAST_LAYOUT m_lastLayout;
|
||||
};
|
||||
|
||||
#endif // DIALOG_LIB_SYMBOL_PROPERTIES_H
|
||||
std::unique_ptr<LISTBOX_TRICKS> m_fpFilterTricks;
|
||||
};
|
||||
|
@ -1,5 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version 4.0.0-0-g0efcecf)
|
||||
// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||
@ -292,7 +292,7 @@ DIALOG_LIB_SYMBOL_PROPERTIES_BASE::DIALOG_LIB_SYMBOL_PROPERTIES_BASE( wxWindow*
|
||||
m_PanelBasic->SetSizer( bSizerBasicPanel );
|
||||
m_PanelBasic->Layout();
|
||||
bSizerBasicPanel->Fit( m_PanelBasic );
|
||||
m_NoteBook->AddPage( m_PanelBasic, _("General"), true );
|
||||
m_NoteBook->AddPage( m_PanelBasic, _("General"), false );
|
||||
m_PanelFootprintFilter = new wxPanel( m_NoteBook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
|
||||
wxBoxSizer* bPanelFpFilterBoxSizer;
|
||||
bPanelFpFilterBoxSizer = new wxBoxSizer( wxHORIZONTAL );
|
||||
@ -306,7 +306,7 @@ DIALOG_LIB_SYMBOL_PROPERTIES_BASE::DIALOG_LIB_SYMBOL_PROPERTIES_BASE( wxWindow*
|
||||
|
||||
bFpFilterLeftBoxSizer->Add( m_staticTextFootprints, 0, wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
m_FootprintFilterListBox = new wxListBox( m_PanelFootprintFilter, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 );
|
||||
m_FootprintFilterListBox = new wxListBox( m_PanelFootprintFilter, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, NULL, wxLB_MULTIPLE );
|
||||
bFpFilterLeftBoxSizer->Add( m_FootprintFilterListBox, 1, wxEXPAND|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
wxBoxSizer* bFpFilterRightBoxSizer;
|
||||
@ -340,7 +340,7 @@ DIALOG_LIB_SYMBOL_PROPERTIES_BASE::DIALOG_LIB_SYMBOL_PROPERTIES_BASE( wxWindow*
|
||||
m_PanelFootprintFilter->SetSizer( bPanelFpFilterBoxSizer );
|
||||
m_PanelFootprintFilter->Layout();
|
||||
bPanelFpFilterBoxSizer->Fit( m_PanelFootprintFilter );
|
||||
m_NoteBook->AddPage( m_PanelFootprintFilter, _("Footprint Filters"), false );
|
||||
m_NoteBook->AddPage( m_PanelFootprintFilter, _("Footprint Filters"), true );
|
||||
|
||||
bUpperSizer->Add( m_NoteBook, 1, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 10 );
|
||||
|
||||
@ -401,11 +401,10 @@ DIALOG_LIB_SYMBOL_PROPERTIES_BASE::DIALOG_LIB_SYMBOL_PROPERTIES_BASE( wxWindow*
|
||||
m_excludeFromSimCheckBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LIB_SYMBOL_PROPERTIES_BASE::OnCheckBox ), NULL, this );
|
||||
m_excludeFromBomCheckBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LIB_SYMBOL_PROPERTIES_BASE::OnCheckBox ), NULL, this );
|
||||
m_excludeFromBoardCheckBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LIB_SYMBOL_PROPERTIES_BASE::OnCheckBox ), NULL, this );
|
||||
m_FootprintFilterListBox->Connect( wxEVT_LEFT_DCLICK, wxMouseEventHandler( DIALOG_LIB_SYMBOL_PROPERTIES_BASE::OnFilterDClick ), NULL, this );
|
||||
m_FootprintFilterListBox->Connect( wxEVT_LEFT_DCLICK, wxMouseEventHandler( DIALOG_LIB_SYMBOL_PROPERTIES_BASE::OnFpFilterDClick ), NULL, this );
|
||||
m_FootprintFilterListBox->Connect( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, wxCommandEventHandler( DIALOG_LIB_SYMBOL_PROPERTIES_BASE::OnEditFootprintFilter ), NULL, this );
|
||||
m_addFilterButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LIB_SYMBOL_PROPERTIES_BASE::OnAddFootprintFilter ), NULL, this );
|
||||
m_editFilterButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LIB_SYMBOL_PROPERTIES_BASE::OnEditFootprintFilter ), NULL, this );
|
||||
m_deleteFilterButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LIB_SYMBOL_PROPERTIES_BASE::OnDeleteFootprintFilter ), NULL, this );
|
||||
m_spiceFieldsButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LIB_SYMBOL_PROPERTIES_BASE::OnEditSpiceModel ), NULL, this );
|
||||
m_stdSizerButtonCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LIB_SYMBOL_PROPERTIES_BASE::OnCancelButtonClick ), NULL, this );
|
||||
}
|
||||
@ -437,11 +436,10 @@ DIALOG_LIB_SYMBOL_PROPERTIES_BASE::~DIALOG_LIB_SYMBOL_PROPERTIES_BASE()
|
||||
m_excludeFromSimCheckBox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LIB_SYMBOL_PROPERTIES_BASE::OnCheckBox ), NULL, this );
|
||||
m_excludeFromBomCheckBox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LIB_SYMBOL_PROPERTIES_BASE::OnCheckBox ), NULL, this );
|
||||
m_excludeFromBoardCheckBox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LIB_SYMBOL_PROPERTIES_BASE::OnCheckBox ), NULL, this );
|
||||
m_FootprintFilterListBox->Disconnect( wxEVT_LEFT_DCLICK, wxMouseEventHandler( DIALOG_LIB_SYMBOL_PROPERTIES_BASE::OnFilterDClick ), NULL, this );
|
||||
m_FootprintFilterListBox->Disconnect( wxEVT_LEFT_DCLICK, wxMouseEventHandler( DIALOG_LIB_SYMBOL_PROPERTIES_BASE::OnFpFilterDClick ), NULL, this );
|
||||
m_FootprintFilterListBox->Disconnect( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, wxCommandEventHandler( DIALOG_LIB_SYMBOL_PROPERTIES_BASE::OnEditFootprintFilter ), NULL, this );
|
||||
m_addFilterButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LIB_SYMBOL_PROPERTIES_BASE::OnAddFootprintFilter ), NULL, this );
|
||||
m_editFilterButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LIB_SYMBOL_PROPERTIES_BASE::OnEditFootprintFilter ), NULL, this );
|
||||
m_deleteFilterButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LIB_SYMBOL_PROPERTIES_BASE::OnDeleteFootprintFilter ), NULL, this );
|
||||
m_spiceFieldsButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LIB_SYMBOL_PROPERTIES_BASE::OnEditSpiceModel ), NULL, this );
|
||||
m_stdSizerButtonCancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LIB_SYMBOL_PROPERTIES_BASE::OnCancelButtonClick ), NULL, this );
|
||||
|
||||
|
@ -1,34 +1,36 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<wxFormBuilder_Project>
|
||||
<FileVersion major="1" minor="17"/>
|
||||
<FileVersion major="1" minor="18"/>
|
||||
<object class="Project" expanded="true">
|
||||
<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="cpp_class_decoration"></property>
|
||||
<property name="cpp_disconnect_events">1</property>
|
||||
<property name="cpp_event_generation">connect</property>
|
||||
<property name="cpp_help_provider">none</property>
|
||||
<property name="cpp_namespace"></property>
|
||||
<property name="cpp_precompiled_header"></property>
|
||||
<property name="cpp_use_array_enum">0</property>
|
||||
<property name="cpp_use_enum">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_lib_symbol_properties_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="first_id">6000</property>
|
||||
<property name="internationalize">1</property>
|
||||
<property name="lua_skip_events">1</property>
|
||||
<property name="lua_ui_table">UI</property>
|
||||
<property name="name">DIALOG_LIB_SYMBOL_PROPERTIES</property>
|
||||
<property name="namespace"></property>
|
||||
<property name="path">.</property>
|
||||
<property name="precompiled_header"></property>
|
||||
<property name="php_disconnect_events">0</property>
|
||||
<property name="php_disconnect_mode">source_name</property>
|
||||
<property name="php_skip_events">1</property>
|
||||
<property name="python_disconnect_events">0</property>
|
||||
<property name="python_disconnect_mode">source_name</property>
|
||||
<property name="python_image_path_wrapper_function_name"></property>
|
||||
<property name="python_indent_with_spaces"></property>
|
||||
<property name="python_skip_events">1</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>
|
||||
<property name="use_native_eol">0</property>
|
||||
<object class="Dialog" expanded="true">
|
||||
<property name="aui_managed">0</property>
|
||||
<property name="aui_manager_style">wxAUI_MGR_DEFAULT</property>
|
||||
@ -81,10 +83,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="bitmapsize"></property>
|
||||
@ -134,16 +136,16 @@
|
||||
<object class="notebookpage" expanded="true">
|
||||
<property name="bitmap"></property>
|
||||
<property name="label">General</property>
|
||||
<property name="select">1</property>
|
||||
<property name="select">0</property>
|
||||
<object class="wxPanel" expanded="true">
|
||||
<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_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@ -213,10 +215,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="autosize_cols">0</property>
|
||||
<property name="autosize_rows">0</property>
|
||||
<property name="best_size"></property>
|
||||
@ -312,10 +314,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="auth_needed">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
@ -387,10 +389,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="auth_needed">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
@ -462,10 +464,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="auth_needed">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
@ -547,10 +549,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="auth_needed">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
@ -651,10 +653,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@ -713,10 +715,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@ -740,7 +742,7 @@
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="maxlength"></property>
|
||||
<property name="maxlength">0</property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
@ -780,10 +782,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@ -842,10 +844,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@ -869,7 +871,7 @@
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="maxlength"></property>
|
||||
<property name="maxlength">0</property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
@ -908,10 +910,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@ -970,10 +972,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@ -1081,10 +1083,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@ -1143,10 +1145,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@ -1210,10 +1212,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@ -1286,10 +1288,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@ -1362,10 +1364,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@ -1453,10 +1455,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@ -1519,10 +1521,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@ -1595,10 +1597,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@ -1670,10 +1672,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@ -1732,10 +1734,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@ -1759,7 +1761,7 @@
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="maxlength"></property>
|
||||
<property name="maxlength">0</property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
@ -1798,10 +1800,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@ -1897,10 +1899,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@ -1973,10 +1975,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@ -2039,10 +2041,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@ -2108,16 +2110,16 @@
|
||||
<object class="notebookpage" expanded="true">
|
||||
<property name="bitmap"></property>
|
||||
<property name="label">Footprint Filters</property>
|
||||
<property name="select">0</property>
|
||||
<property name="select">1</property>
|
||||
<object class="wxPanel" expanded="true">
|
||||
<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_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@ -2184,10 +2186,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@ -2246,10 +2248,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@ -2288,7 +2290,7 @@
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="style">wxLB_MULTIPLE</property>
|
||||
<property name="subclass"></property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
@ -2299,7 +2301,7 @@
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnLeftDClick">OnFilterDClick</event>
|
||||
<event name="OnLeftDClick">OnFpFilterDClick</event>
|
||||
<event name="OnListBoxDClick">OnEditFootprintFilter</event>
|
||||
</object>
|
||||
</object>
|
||||
@ -2321,10 +2323,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="auth_needed">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
@ -2396,10 +2398,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="auth_needed">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
@ -2481,10 +2483,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="auth_needed">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
@ -2544,7 +2546,6 @@
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnButtonClick">OnDeleteFootprintFilter</event>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
@ -2586,10 +2587,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="auth_needed">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
|
@ -1,5 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version 4.0.0-0-g0efcecf)
|
||||
// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||
@ -39,7 +39,7 @@ class WX_GRID;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#define ID_LIBEDIT_NOTEBOOK 1000
|
||||
#define ID_LIBEDIT_NOTEBOOK 6000
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
/// Class DIALOG_LIB_SYMBOL_PROPERTIES_BASE
|
||||
@ -104,10 +104,9 @@ class DIALOG_LIB_SYMBOL_PROPERTIES_BASE : public DIALOG_SHIM
|
||||
virtual void OnSpinCtrlText( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void OnCheckBox( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void onPowerCheckBox( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void OnFilterDClick( wxMouseEvent& event ) { event.Skip(); }
|
||||
virtual void OnFpFilterDClick( wxMouseEvent& event ) { event.Skip(); }
|
||||
virtual void OnEditFootprintFilter( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void OnAddFootprintFilter( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void OnDeleteFootprintFilter( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void OnEditSpiceModel( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void OnCancelButtonClick( wxCommandEvent& event ) { event.Skip(); }
|
||||
|
||||
|
99
include/widgets/listbox_tricks.h
Normal file
99
include/widgets/listbox_tricks.h
Normal file
@ -0,0 +1,99 @@
|
||||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2024 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
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <map>
|
||||
|
||||
#include <wx/event.h>
|
||||
#include <wx/window.h>
|
||||
|
||||
class wxListBox;
|
||||
|
||||
|
||||
// Declare LISTBOX_TRICKS events
|
||||
wxDECLARE_EVENT( EDA_EVT_LISTBOX_COPY, wxCommandEvent );
|
||||
wxDECLARE_EVENT( EDA_EVT_LISTBOX_CUT, wxCommandEvent );
|
||||
wxDECLARE_EVENT( EDA_EVT_LISTBOX_PASTE, wxCommandEvent );
|
||||
wxDECLARE_EVENT( EDA_EVT_LISTBOX_DELETE, wxCommandEvent );
|
||||
wxDECLARE_EVENT( EDA_EVT_LISTBOX_DUPLICATE, wxCommandEvent );
|
||||
|
||||
// The event when the tricks change something
|
||||
wxDECLARE_EVENT( EDA_EVT_LISTBOX_CHANGED, wxCommandEvent );
|
||||
|
||||
|
||||
class LISTBOX_TRICKS : public wxEvtHandler
|
||||
{
|
||||
public:
|
||||
LISTBOX_TRICKS( wxWindow& aWindow, wxListBox& aListBox );
|
||||
~LISTBOX_TRICKS();
|
||||
|
||||
/**
|
||||
* These are the ids for the menu.
|
||||
*/
|
||||
enum MENU_ID
|
||||
{
|
||||
ID_COPY = wxID_HIGHEST + 1,
|
||||
ID_CUT,
|
||||
ID_PASTE,
|
||||
ID_DELETE,
|
||||
ID_DUPLICATE,
|
||||
};
|
||||
|
||||
void SetMenuLabels( const std::map<MENU_ID, wxString>& aItems );
|
||||
|
||||
private:
|
||||
// Custom event handlers
|
||||
void OnListBoxCopy( wxCommandEvent& aEvent );
|
||||
void OnListBoxCut( wxCommandEvent& aEvent );
|
||||
void OnListBoxPaste( wxCommandEvent& aEvent );
|
||||
void OnListBoxDelete( wxCommandEvent& aEvent );
|
||||
void OnListBoxDuplicate( wxCommandEvent& aEvent );
|
||||
|
||||
// UI event handlers
|
||||
void OnListBoxRDown( wxMouseEvent& aEvent );
|
||||
void OnListBoxKeyDown( wxKeyEvent& aEvent );
|
||||
|
||||
// Internals
|
||||
void listBoxCopy();
|
||||
void listBoxCut();
|
||||
void listBoxPaste();
|
||||
|
||||
wxArrayString listBoxGetSelected() const;
|
||||
/**
|
||||
* Delete the selected filters.
|
||||
*
|
||||
* Returns the indexes of the deleted filters (which won't be valid anymore).
|
||||
*/
|
||||
wxArrayInt listBoxDeleteSelected();
|
||||
|
||||
/**
|
||||
* Duplicate the selected filters.
|
||||
*/
|
||||
void listBoxDuplicateSelected();
|
||||
|
||||
std::map<MENU_ID, wxString> m_menuStrings;
|
||||
|
||||
wxWindow& m_parent;
|
||||
wxListBox& m_listBox;
|
||||
};
|
Loading…
Reference in New Issue
Block a user