KiCad PCB EDA Suite
toolbars_cvpcb.cpp
Go to the documentation of this file.
1 /*
2  * This program source code file is part of KiCad, a free EDA CAD application.
3  *
4  * Copyright (C) 2016 Jean-Pierre Charras, jp.charras at wanadoo.fr
5  * Copyright (C) 2011 Wayne Stambaugh <stambaughw@verizon.net>
6  * Copyright (C) 2007-2019 KiCad Developers, see AUTHORS.txt for contributors.
7  *
8  * This program is free software: you can redistribute it and/or modify it
9  * under the terms of the GNU General Public License as published by the
10  * Free Software Foundation, either version 3 of the License, or (at your
11  * option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful, but
14  * WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License along
19  * with this program. If not, see <http://www.gnu.org/licenses/>.
20  */
21 
26 #include <bitmaps.h>
27 #include <tool/action_toolbar.h>
28 #include <tool/actions.h>
29 
30 #include <cvpcb_id.h>
31 #include <cvpcb_mainframe.h>
32 #include <tools/cvpcb_actions.h>
33 
34 
36 {
37  if( m_mainToolBar )
38  m_mainToolBar->Clear();
39  else
40  m_mainToolBar = new ACTION_TOOLBAR( this, ID_H_TOOLBAR, wxDefaultPosition, wxDefaultSize,
41  KICAD_AUI_TB_STYLE | wxAUI_TB_HORZ_LAYOUT );
42 
44 
47 
48 
52 
58 
59  // Add tools for footprint names filtering:
61  m_mainToolBar->AddSpacer( 15 );
62  wxStaticText* text = new wxStaticText( m_mainToolBar, wxID_ANY,
63  _( "Footprint Filters:" ) );
64  text->SetFont( m_mainToolBar->GetFont().Bold() );
65  m_mainToolBar->AddControl( text );
66 
70 
73 
75 
76  m_mainToolBar->AddControl( m_tcFilterString );
77 
78 
79  // after adding the buttons to the toolbar, must call Realize() to reflect the changes
80  m_mainToolBar->Realize();
81 }
82 
83 
85 {
86 #define filterActive( filt ) ( m_filteringOptions & filt )
87 
90 
99  m_mainToolBar->Refresh();
100 }
static TOOL_ACTION showFootprintViewer
Open the footprint viewer.
Definition: cvpcb_actions.h:52
Class ACTION_TOOLBAR.
#define filterActive(filt)
static TOOL_ACTION gotoNextNA
Definition: cvpcb_actions.h:56
static TOOL_ACTION gotoPreviousNA
Navigate the component tree.
Definition: cvpcb_actions.h:55
void Add(const TOOL_ACTION &aAction, bool aIsToggleEntry=false)
Function Add() Adds a TOOL_ACTION-based button to the toolbar.
static TOOL_ACTION filterFPbyDisplayName
Definition: cvpcb_actions.h:72
void SyncToolbars() override
Syncronize the toolbar state with the current tool state.
wxTextCtrl * m_tcFilterString
static TOOL_ACTION deleteAll
Definition: cvpcb_actions.h:65
static TOOL_ACTION showFootprintLibTable
Definition: actions.h:163
ACTION_TOOLBAR * m_mainToolBar
CVPCB_UNDO_REDO_LIST m_undoList
#define _(s)
static TOOL_ACTION autoAssociate
Footprint Association actions.
Definition: cvpcb_actions.h:63
static TOOL_ACTION redo
Definition: actions.h:68
static TOOL_ACTION filterFPbyPin
Definition: cvpcb_actions.h:70
CVPCB_UNDO_REDO_LIST m_redoList
void Toggle(const TOOL_ACTION &aAction, bool aState)
Applies the default toggle action.
void KiScaledSeparator(wxAuiToolBar *aToolbar, EDA_BASE_FRAME *aWindow)
Add a separator to the given toolbar scaled the same way as KiScaledBitmap.
Definition: bitmap.cpp:167
static constexpr int KICAD_AUI_TB_STYLE
Default style flags used for wxAUI toolbars
static TOOL_ACTION undo
Definition: actions.h:67
static TOOL_ACTION filterFPbyLibrary
Definition: cvpcb_actions.h:71
static TOOL_ACTION filterFPbyKeywords
Footprint Filtering actions.
Definition: cvpcb_actions.h:69