~cern-kicad/kicad/kicad-pns-tom

3308 by Wayne Stambaugh
More encapsulation work and other minor improvements.
1
/*
2
 * This program source code file is part of KiCad, a free EDA CAD application.
3
 *
3928 by jean-pierre charras
Changes for CvPcb to eeschema stuff file: the stuff file generation from CvPcb is removed. Eeschema now imports footprints names from the .cmp usual file created by CvPcb or by Pcbnew (Why to use 2 file formats for the same thing?) .
4
 * Copyright (C) 2013 Jean-Pierre Charras, jp.charras at wanadoo.fr
3308 by Wayne Stambaugh
More encapsulation work and other minor improvements.
5
 * Copyright (C) 2011 Wayne Stambaugh <stambaughw@verizon.net>
3928 by jean-pierre charras
Changes for CvPcb to eeschema stuff file: the stuff file generation from CvPcb is removed. Eeschema now imports footprints names from the .cmp usual file created by CvPcb or by Pcbnew (Why to use 2 file formats for the same thing?) .
6
 * Copyright (C) 2007-2013 KiCad Developers, see AUTHORS.txt for contributors.
3308 by Wayne Stambaugh
More encapsulation work and other minor improvements.
7
 *
8
 * This program is free software; you can redistribute it and/or
9
 * modify it under the terms of the GNU General Public License
10
 * as published by the Free Software Foundation; either version 2
11
 * of the License, or (at your option) any later version.
12
 *
13
 * This program is distributed in the hope that it will be useful,
14
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
 * GNU General Public License for more details.
17
 *
18
 * You should have received a copy of the GNU General Public License
19
 * along with this program; if not, you may find one here:
20
 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
21
 * or you may search the http://www.gnu.org website for the version 2 license,
22
 * or you may write to the Free Software Foundation, Inc.,
23
 * 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
24
 */
25
26
/**
27
 * @file tool_cvpcb.cpp
28
 */
9 by raburton
add files not currently available in source (e.g. docs, modules, etc.)
29
3372.1.3 by Dick Hollenbeck
switch to <> for includes from "" per conversation with Jean-Pierre and Wayne, adjust search paths
30
#include <fctsys.h>
31
#include <appl_wxstruct.h>
32
#include <common.h>
1457 by stambaughw
More header file realignments to reduce recompiling and general code cleaning.
33
3372.1.3 by Dick Hollenbeck
switch to <> for includes from "" per conversation with Jean-Pierre and Wayne, adjust search paths
34
#include <bitmaps.h>
35
#include <cvpcb.h>
36
#include <cvpcb_mainframe.h>
37
#include <cvpcb_id.h>
9 by raburton
add files not currently available in source (e.g. docs, modules, etc.)
38
3392 by jean-pierre charras
Pcbnew and Cvpcb: more about new netlist support: see CHANGELOG (important changes).
39
#include <common_help_msg.h>
40
9 by raburton
add files not currently available in source (e.g. docs, modules, etc.)
41
2793.1.1 by jean-pierre charras
CvPcb: Code cleanup. Rename WinEDA_CvpcbFrame to CVPCB_MAINFRAME, according to coding style policy.
42
void CVPCB_MAINFRAME::ReCreateHToolbar()
9 by raburton
add files not currently available in source (e.g. docs, modules, etc.)
43
{
3311 by Wayne Stambaugh
Encapsulate EDA_APP class.
44
    wxConfig* config = wxGetApp().GetSettings();
1358 by stambaughw
Convert global and embedded application pointers to wxGetApp()
45
3308 by Wayne Stambaugh
More encapsulation work and other minor improvements.
46
    if( m_mainToolBar != NULL )
1358 by stambaughw
Convert global and embedded application pointers to wxGetApp()
47
        return;
48
3308 by Wayne Stambaugh
More encapsulation work and other minor improvements.
49
    m_mainToolBar = new wxAuiToolBar( this, ID_H_TOOLBAR, wxDefaultPosition, wxDefaultSize,
50
                                      wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_HORZ_LAYOUT );
51
52
    m_mainToolBar->AddTool( ID_CVPCB_READ_INPUT_NETLIST, wxEmptyString,
3392 by jean-pierre charras
Pcbnew and Cvpcb: more about new netlist support: see CHANGELOG (important changes).
53
                            KiBitmap( open_document_xpm ), LOAD_FILE_HELP );
3308 by Wayne Stambaugh
More encapsulation work and other minor improvements.
54
55
    m_mainToolBar->AddTool( wxID_SAVE, wxEmptyString, KiBitmap( save_xpm ),
3392 by jean-pierre charras
Pcbnew and Cvpcb: more about new netlist support: see CHANGELOG (important changes).
56
                            SAVE_HLP_MSG );
3308 by Wayne Stambaugh
More encapsulation work and other minor improvements.
57
58
    m_mainToolBar->AddSeparator();
59
    m_mainToolBar->AddTool( ID_CVPCB_CREATE_CONFIGWINDOW, wxEmptyString,
60
                            KiBitmap( config_xpm ),
61
                            _( "Configuration" ) );
62
63
    m_mainToolBar->AddSeparator();
64
    m_mainToolBar->AddTool( ID_CVPCB_CREATE_SCREENCMP, wxEmptyString,
65
                            KiBitmap( show_footprint_xpm ),
66
                            _( "View selected footprint" ) );
67
68
    m_mainToolBar->AddTool( ID_CVPCB_AUTO_ASSOCIE, wxEmptyString,
69
                            KiBitmap( auto_associe_xpm ),
70
                            _( "Perform automatic footprint association" ) );
71
72
    m_mainToolBar->AddSeparator();
73
    m_mainToolBar->AddTool( ID_CVPCB_GOTO_PREVIOUSNA, wxEmptyString,
74
                            KiBitmap( left_xpm ),
75
                            _( "Select previous free component" ) );
76
77
    m_mainToolBar->AddTool( ID_CVPCB_GOTO_FIRSTNA, wxEmptyString,
78
                            KiBitmap( right_xpm ),
79
                            _( "Select next free component" ) );
80
81
    m_mainToolBar->AddSeparator();
82
    m_mainToolBar->AddTool( ID_CVPCB_DEL_ASSOCIATIONS, wxEmptyString,
83
                            KiBitmap( delete_association_xpm ),
84
                            _( "Delete all associations" ) );
85
86
    m_mainToolBar->AddSeparator();
87
    m_mainToolBar->AddTool( ID_PCB_DISPLAY_FOOTPRINT_DOC, wxEmptyString,
88
                            KiBitmap( datasheet_xpm ),
89
                            _( "Display footprints list documentation" ) );
90
91
    m_mainToolBar->AddSeparator();
92
    m_mainToolBar->AddSeparator();
93
    m_mainToolBar->AddTool( ID_CVPCB_FOOTPRINT_DISPLAY_FILTERED_LIST,
94
                            KiBitmap( module_filtered_list_xpm ),
95
                            wxNullBitmap,
96
                            true, NULL,
4024.1.169 by Wayne Stambaugh
CvPcb filtering and other minor improvements.
97
                            _( "Filter the footprint list for the current component key words" ),
3308 by Wayne Stambaugh
More encapsulation work and other minor improvements.
98
                            wxEmptyString );
99
3460.1.1 by Joe Ferner
Added a toolbar button to cvpcb to filter by pin/pad count.
100
    m_mainToolBar->AddTool( ID_CVPCB_FOOTPRINT_DISPLAY_PIN_FILTERED_LIST,
101
                            KiBitmap( module_pin_filtered_list_xpm ),
102
                            wxNullBitmap,
103
                            true, NULL,
4024.1.169 by Wayne Stambaugh
CvPcb filtering and other minor improvements.
104
                            _( "Filter the footprint list by pin count for the current component" ),
3460.1.1 by Joe Ferner
Added a toolbar button to cvpcb to filter by pin/pad count.
105
                            wxEmptyString );
106
4024.1.158 by Michal Jahelka
Add filtering footprint list by library to CvPcb
107
    m_mainToolBar->AddTool( ID_CVPCB_FOOTPRINT_DISPLAY_BY_LIBRARY_LIST,
108
                            KiBitmap( module_library_list_xpm ),
109
                            wxNullBitmap, true, NULL,
4024.1.169 by Wayne Stambaugh
CvPcb filtering and other minor improvements.
110
                            _( "Filter the footprint list by the selected library" ),
3308 by Wayne Stambaugh
More encapsulation work and other minor improvements.
111
                            wxEmptyString );
1358 by stambaughw
Convert global and embedded application pointers to wxGetApp()
112
113
    if( config )
114
    {
115
        wxString key = wxT( FILTERFOOTPRINTKEY );
116
        int      opt = config->Read( key, (long) 1 );
4024.1.169 by Wayne Stambaugh
CvPcb filtering and other minor improvements.
117
118
        m_mainToolBar->ToggleTool( ID_CVPCB_FOOTPRINT_DISPLAY_BY_LIBRARY_LIST, opt & 4 );
119
        m_mainToolBar->ToggleTool( ID_CVPCB_FOOTPRINT_DISPLAY_PIN_FILTERED_LIST, opt & 2 );
120
        m_mainToolBar->ToggleTool( ID_CVPCB_FOOTPRINT_DISPLAY_FILTERED_LIST, opt & 1 );
1358 by stambaughw
Convert global and embedded application pointers to wxGetApp()
121
    }
122
3081 by Wayne Stambaugh
Add user write permission tests to CVPcb and other minor fixes.
123
    // after adding the buttons to the toolbar, must call Realize() to reflect the changes
3308 by Wayne Stambaugh
More encapsulation work and other minor improvements.
124
    m_mainToolBar->Realize();
9 by raburton
add files not currently available in source (e.g. docs, modules, etc.)
125
}