2011-12-16 13:32:23 +00:00
|
|
|
/*
|
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
|
|
*
|
2016-02-25 09:52:29 +00:00
|
|
|
* Copyright (C) 2016 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
2011-12-16 13:32:23 +00:00
|
|
|
* Copyright (C) 2011 Wayne Stambaugh <stambaughw@verizon.net>
|
2019-03-18 17:49:52 +00:00
|
|
|
* Copyright (C) 2007-2019 KiCad Developers, see AUTHORS.txt for contributors.
|
2011-12-16 13:32:23 +00:00
|
|
|
*
|
2018-01-08 04:05:03 +00:00
|
|
|
* 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.
|
2011-12-16 13:32:23 +00:00
|
|
|
*
|
2018-01-08 04:05:03 +00:00
|
|
|
* 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.
|
2011-12-16 13:32:23 +00:00
|
|
|
*
|
2018-01-08 04:05:03 +00:00
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
2011-12-16 13:32:23 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @file tool_cvpcb.cpp
|
|
|
|
*/
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2019-07-18 21:47:01 +00:00
|
|
|
#include <bitmaps.h>
|
|
|
|
#include <tool/action_toolbar.h>
|
|
|
|
#include <tool/actions.h>
|
2012-01-23 04:33:36 +00:00
|
|
|
|
|
|
|
#include <cvpcb_id.h>
|
2019-07-18 21:47:01 +00:00
|
|
|
#include <cvpcb_mainframe.h>
|
|
|
|
#include <tools/cvpcb_actions.h>
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
|
2011-02-05 16:15:48 +00:00
|
|
|
void CVPCB_MAINFRAME::ReCreateHToolbar()
|
2007-06-05 12:10:51 +00:00
|
|
|
{
|
2018-01-08 04:05:03 +00:00
|
|
|
if( m_mainToolBar )
|
2020-06-23 10:42:23 +00:00
|
|
|
m_mainToolBar->ClearToolbar();
|
2018-01-08 04:05:03 +00:00
|
|
|
else
|
2019-07-18 21:47:01 +00:00
|
|
|
m_mainToolBar = new ACTION_TOOLBAR( this, ID_H_TOOLBAR, wxDefaultPosition, wxDefaultSize,
|
|
|
|
KICAD_AUI_TB_STYLE | wxAUI_TB_HORZ_LAYOUT );
|
2008-12-08 15:27:13 +00:00
|
|
|
|
2019-12-19 15:35:11 +00:00
|
|
|
m_mainToolBar->Add( CVPCB_ACTIONS::saveAssociations );
|
|
|
|
|
2020-06-17 11:03:25 +00:00
|
|
|
m_mainToolBar->AddScaledSeparator( this );
|
2019-07-18 21:47:01 +00:00
|
|
|
m_mainToolBar->Add( ACTIONS::showFootprintLibTable );
|
2008-12-08 15:27:13 +00:00
|
|
|
|
2020-06-17 11:03:25 +00:00
|
|
|
m_mainToolBar->AddScaledSeparator( this );
|
2019-07-18 21:47:01 +00:00
|
|
|
m_mainToolBar->Add( CVPCB_ACTIONS::showFootprintViewer );
|
2008-12-08 15:27:13 +00:00
|
|
|
|
|
|
|
|
2020-06-17 11:03:25 +00:00
|
|
|
m_mainToolBar->AddScaledSeparator( this );
|
2019-07-18 21:47:01 +00:00
|
|
|
m_mainToolBar->Add( CVPCB_ACTIONS::gotoPreviousNA );
|
|
|
|
m_mainToolBar->Add( CVPCB_ACTIONS::gotoNextNA );
|
2015-01-11 17:22:45 +00:00
|
|
|
|
2020-06-17 11:03:25 +00:00
|
|
|
m_mainToolBar->AddScaledSeparator( this );
|
2019-07-26 18:58:20 +00:00
|
|
|
m_mainToolBar->Add( ACTIONS::undo );
|
|
|
|
m_mainToolBar->Add( ACTIONS::redo );
|
2019-07-18 21:47:01 +00:00
|
|
|
m_mainToolBar->Add( CVPCB_ACTIONS::autoAssociate );
|
|
|
|
m_mainToolBar->Add( CVPCB_ACTIONS::deleteAll );
|
2011-12-16 13:32:23 +00:00
|
|
|
|
2019-03-18 17:49:52 +00:00
|
|
|
// Add tools for footprint names filtering:
|
2020-06-17 11:03:25 +00:00
|
|
|
m_mainToolBar->AddScaledSeparator( this );
|
|
|
|
|
2020-02-20 11:48:23 +00:00
|
|
|
// wxGTK with GTK3 has a serious issue with bold texts: strings are incorrectly sized
|
|
|
|
// and truncated after the first space.
|
|
|
|
// so use SetLabelMarkup is a trick to fix this issue.
|
2019-03-18 17:49:52 +00:00
|
|
|
m_mainToolBar->AddSpacer( 15 );
|
2020-02-20 11:48:23 +00:00
|
|
|
wxString msg_bold = _( "Footprint Filters:" );
|
|
|
|
wxStaticText* text = new wxStaticText( m_mainToolBar, wxID_ANY, msg_bold );
|
2019-03-18 17:49:52 +00:00
|
|
|
text->SetFont( m_mainToolBar->GetFont().Bold() );
|
2020-02-20 11:48:23 +00:00
|
|
|
#ifdef __WXGTK3__
|
|
|
|
text->SetLabelMarkup( "<b>" + msg_bold + "</b>" );
|
|
|
|
#endif
|
2019-03-18 17:49:52 +00:00
|
|
|
m_mainToolBar->AddControl( text );
|
|
|
|
|
2020-07-29 23:50:25 +00:00
|
|
|
m_mainToolBar->Add( CVPCB_ACTIONS::FilterFPbyFPFilters, ACTION_TOOLBAR::TOGGLE );
|
|
|
|
m_mainToolBar->Add( CVPCB_ACTIONS::filterFPbyPin, ACTION_TOOLBAR::TOGGLE );
|
|
|
|
m_mainToolBar->Add( CVPCB_ACTIONS::FilterFPbyLibrary, ACTION_TOOLBAR::TOGGLE );
|
2008-12-08 15:27:13 +00:00
|
|
|
|
2020-06-17 11:03:25 +00:00
|
|
|
m_mainToolBar->AddScaledSeparator( this );
|
2008-12-08 15:27:13 +00:00
|
|
|
|
2020-07-09 13:21:28 +00:00
|
|
|
m_tcFilterString = new wxTextCtrl( m_mainToolBar, ID_CVPCB_FILTER_TEXT_EDIT, wxEmptyString,
|
|
|
|
wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER );
|
2016-02-25 13:57:59 +00:00
|
|
|
|
2020-07-09 13:21:28 +00:00
|
|
|
m_tcFilterString->Bind( wxEVT_TEXT_ENTER, &CVPCB_MAINFRAME::OnEnterFilteringText, this );
|
2016-02-25 13:57:59 +00:00
|
|
|
|
2020-07-09 13:21:28 +00:00
|
|
|
m_mainToolBar->AddControl( m_tcFilterString );
|
2016-02-25 13:57:59 +00:00
|
|
|
|
2011-08-24 19:44:05 +00:00
|
|
|
// after adding the buttons to the toolbar, must call Realize() to reflect the changes
|
2011-12-16 13:32:23 +00:00
|
|
|
m_mainToolBar->Realize();
|
2007-06-05 12:10:51 +00:00
|
|
|
}
|