Commit a23dcccc authored by Michal Jahelka's avatar Michal Jahelka Committed by Wayne Stambaugh

Add filtering footprint list by library to CvPcb

* Add third list control with library names.
* Add button to toolbar to select filter by library name.
* Add bitmap for filter by library name toolbar button.
* Remove custom UI colors from list controls.
parent 5c989519
......@@ -359,6 +359,7 @@ set( BMAPS_MID
module_full_list
module_options
module_pin_filtered_list
module_library_list
module_ratsnest
module
modview_icon
......
/* Do not modify this file, it was automatically generated by the
* PNG2cpp CMake script, using a *.png file as input.
*/
#include <bitmaps.h>
static const unsigned char png[] = {
0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52,
0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x1a, 0x08, 0x06, 0x00, 0x00, 0x00, 0xa9, 0x4a, 0x4c,
0xce, 0x00, 0x00, 0x00, 0x04, 0x73, 0x42, 0x49, 0x54, 0x08, 0x08, 0x08, 0x08, 0x7c, 0x08, 0x64,
0x88, 0x00, 0x00, 0x00, 0x09, 0x70, 0x48, 0x59, 0x73, 0x00, 0x00, 0x0d, 0xd7, 0x00, 0x00, 0x0d,
0xd7, 0x01, 0x42, 0x28, 0x9b, 0x78, 0x00, 0x00, 0x00, 0x19, 0x74, 0x45, 0x58, 0x74, 0x53, 0x6f,
0x66, 0x74, 0x77, 0x61, 0x72, 0x65, 0x00, 0x77, 0x77, 0x77, 0x2e, 0x69, 0x6e, 0x6b, 0x73, 0x63,
0x61, 0x70, 0x65, 0x2e, 0x6f, 0x72, 0x67, 0x9b, 0xee, 0x3c, 0x1a, 0x00, 0x00, 0x03, 0xd2, 0x49,
0x44, 0x41, 0x54, 0x48, 0x89, 0xbd, 0x96, 0x5d, 0x48, 0x5b, 0x67, 0x18, 0xc7, 0x7f, 0xe7, 0x23,
0x59, 0xac, 0x4e, 0x4f, 0xac, 0x46, 0x11, 0xa9, 0xab, 0x8d, 0xd2, 0xb1, 0xd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x9a, 0x70, 0xd8, 0xcf, 0xad, 0xfa, 0xfa, 0x7a, 0x1f, 0x70, 0x66,
0x1f, 0xa9, 0xf7, 0x26, 0x26, 0x26, 0xec, 0x87, 0x36, 0x3a, 0xa8, 0xc4, 0x37, 0xe2, 0x02, 0xfc,
0x0f, 0xfd, 0x66, 0x6b, 0x49, 0xc9, 0xd5, 0xed, 0x5a, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e,
0x44, 0xae, 0x42, 0x60, 0x82
};
const BITMAP_OPAQUE module_library_list_xpm[1] = {{ png, sizeof( png ), "module_library_list_xpm" }};
//EOF
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
height="26"
width="26"
version="1.1"
viewBox="0 0 26 26"
id="svg2"
inkscape:version="0.48.4 r9939"
sodipodi:docname="module_filtered_list.svg">
<metadata
id="metadata56">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs54" />
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1920"
inkscape:window-height="1015"
id="namedview52"
showgrid="true"
inkscape:zoom="13.906434"
inkscape:cx="19.918756"
inkscape:cy="24.624712"
inkscape:window-x="-4"
inkscape:window-y="-4"
inkscape:window-maximized="1"
inkscape:current-layer="svg2"
inkscape:snap-to-guides="false"
inkscape:snap-grids="false">
<inkscape:grid
type="xygrid"
id="grid3033"
empspacing="5"
visible="true"
enabled="true"
snapvisiblegridlinesonly="true" />
</sodipodi:namedview>
<rect
transform="matrix(0,-1,1,0,0,0)"
height="21.994465"
width="12.99073"
y="1.5596062"
x="-17.520231"
id="rect8"
style="fill:#ffffff;stroke:#484848;stroke-width:0.99127513000000000;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<path
d="m 1.5927632,8.9410802 a 2.0341261,1.8090857 0 1 1 0.012585,3.6181538"
id="path10"
inkscape:connector-curvature="0"
style="fill:none;stroke:#484848;stroke-width:0.99127518999999997;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<rect
transform="matrix(0,-1,1,0,0,0)"
height="3.9761357"
width="5.9874525"
y="3.5188339"
x="-20.502354"
id="rect30"
style="fill:#ff7800;stroke:#484848;stroke-width:1;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<path
d="m 5.5071146,16.522119 a 0.98526485,0.92342205 0 0 1 0,1.846844 0.98526485,0.92342205 0 1 1 0,-1.846844 z"
id="path32"
inkscape:connector-curvature="0"
style="fill:#ffede0;stroke:#484848;stroke-width:1;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<rect
transform="matrix(0,-1,1,0,0,0)"
height="3.9761357"
width="5.9874525"
y="10.507601"
x="-20.513519"
id="rect30-5"
style="fill:#ff7800;stroke:#484848;stroke-width:1;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<path
d="m 12.495882,16.533284 a 0.98526485,0.92342205 0 0 1 0,1.846845 0.98526485,0.92342205 0 1 1 0,-1.846845 z"
id="path32-4"
inkscape:connector-curvature="0"
style="fill:#ffede0;stroke:#484848;stroke-width:1;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<rect
transform="matrix(0,-1,1,0,0,0)"
height="3.9761357"
width="5.9874525"
y="17.499128"
x="-20.488094"
id="rect30-2"
style="fill:#ff7800;stroke:#484848;stroke-width:1;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<path
d="m 19.487408,16.507861 a 0.98526485,0.92342205 0 0 1 0,1.846844 0.98526485,0.92342205 0 1 1 0,-1.846844 z"
id="path32-0"
inkscape:connector-curvature="0"
style="fill:#ffede0;stroke:#484848;stroke-width:1;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<rect
transform="matrix(0,-1,1,0,0,0)"
height="3.9761357"
width="5.9874525"
y="3.5339792"
x="-7.5303874"
id="rect30-1"
style="fill:#ff7800;stroke:#484848;stroke-width:1;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<path
d="m 5.5222603,3.5501532 a 0.98526485,0.92342205 0 0 1 0,1.8468441 0.98526485,0.92342205 0 1 1 0,-1.8468441 z"
id="path32-3"
inkscape:connector-curvature="0"
style="fill:#ffede0;stroke:#484848;stroke-width:1;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<rect
transform="matrix(0,-1,1,0,0,0)"
height="3.9761357"
width="5.9874525"
y="10.522747"
x="-7.5415525"
id="rect30-5-6"
style="fill:#ff7800;stroke:#484848;stroke-width:1;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<path
d="m 12.511028,3.5613187 a 0.98526485,0.92342205 0 0 1 0,1.8468441 0.98526485,0.92342205 0 1 1 0,-1.8468441 z"
id="path32-4-0"
inkscape:connector-curvature="0"
style="fill:#ffede0;stroke:#484848;stroke-width:1;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<rect
transform="matrix(0,-1,1,0,0,0)"
height="3.9761357"
width="5.9874525"
y="17.514275"
x="-7.516129"
id="rect30-2-8"
style="fill:#ff7800;stroke:#484848;stroke-width:1;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<path
d="m 19.502554,3.535895 a 0.98526485,0.92342205 0 0 1 0,1.8468441 0.98526485,0.92342205 0 1 1 0,-1.8468441 z"
id="path32-0-4"
inkscape:connector-curvature="0"
style="fill:#ffede0;stroke:#484848;stroke-width:1;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<rect
ry="0.95373797"
height="13.958503"
width="11.03963"
y="10.016949"
x="13.978938"
id="rect42"
style="fill:#3e3e3e" />
<rect
style="color:#000000;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
id="rect3003"
width="8.413372"
height="11.649284"
x="15.316651"
y="11.114803" />
<path
style="fill:none;stroke:#008000;stroke-width:1.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none"
d="m 17.97729,13.415897 0,7.119007 3.523549,0"
id="path3005"
inkscape:connector-curvature="0" />
</svg>
......@@ -34,6 +34,7 @@ set(CVPCB_SRCS
class_components_listbox.cpp
class_DisplayFootprintsFrame.cpp
class_footprints_listbox.cpp
class_library_listbox.cpp
cvframe.cpp
cvpcb.cpp
listboxes.cpp
......
......@@ -8,9 +8,10 @@
#include <common.h>
#include <gestfich.h>
#include <param_config.h>
#include <wildcards_and_files_ext.h>
#include <cvpcb.h>
#include <cvpcb_mainframe.h>
#include <wildcards_and_files_ext.h>
#define GROUP wxT("/cvpcb")
......
......@@ -113,13 +113,16 @@ void COMPONENTS_LISTBOX::OnChar( wxKeyEvent& event )
{
case WXK_HOME:
case WXK_END:
case WXK_UP:
case WXK_UP:
case WXK_DOWN:
case WXK_PAGEUP:
case WXK_PAGEDOWN:
event.Skip();
return;
case WXK_LEFT:
case WXK_NUMPAD_LEFT:
event.Skip();
GetParent()->m_LibraryList->SetFocus();
return;
case WXK_RIGHT:
......
......@@ -30,6 +30,8 @@
#include <fctsys.h>
#include <wxstruct.h>
#include <macros.h>
#include <appl_wxstruct.h>
#include <wildcards_and_files_ext.h>
#include <cvpcb.h>
#include <cvpcb_mainframe.h>
......@@ -233,7 +235,49 @@ void FOOTPRINTS_LISTBOX::SetFootprintFilteredByPinCount( COMPONENT* aCompon
Refresh();
}
void FOOTPRINTS_LISTBOX::SetFootprintFilteredByLibraryList( FOOTPRINT_LIST& list,
wxString SelectedLibrary ) {
wxString msg;
int oldSelection = GetSelection();
bool hasItem = false;
wxFileName filename = SelectedLibrary;
filename.SetExt( LegacyFootprintLibPathExtension );
wxString FullLibraryName = wxGetApp().FindLibraryPath( filename );
m_FilteredFootprintList.Clear();
for( unsigned ii = 0; ii < list.GetCount(); ii++ )
{
FOOTPRINT_INFO& footprint = list.GetItem(ii);
wxString LibName = footprint.m_libPath;
if( LibName.Matches( FullLibraryName ) )
{
msg.Printf( wxT( "%3d %s" ), m_FilteredFootprintList.GetCount() + 1,
footprint.m_Module.GetData() );
m_FilteredFootprintList.Add( msg );
hasItem = true;
}
}
if( hasItem )
SetActiveFootprintList( false );
else
SetActiveFootprintList( true );
if( ( GetCount() == 0 ) || ( oldSelection >= GetCount() ) )
SetSelection( 0, true );
Refresh();
}
/** Set the footprint list. We can have 2 footprint list:
* The full footprint list
* The filtered footprint list (if the current selected component has a
* filter for footprints)
* @param FullList true = full footprint list, false = filtered footprint list
* @param Redraw = true to redraw the window
*/
void FOOTPRINTS_LISTBOX::SetActiveFootprintList( bool FullList, bool Redraw )
{
bool old_selection = m_UseFootprintFullList;
......
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 1992-2012 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
*/
/**
* @file class_library_listbox.cpp
* class to display used library and selecting it
*/
#include <fctsys.h>
#include <wxstruct.h>
#include <macros.h>
#include <cvpcb.h>
#include <cvpcb_mainframe.h>
#include <cvstruct.h>
/***************************************/
/* ListBox handling the library list */
/***************************************/
LIBRARY_LISTBOX::LIBRARY_LISTBOX( CVPCB_MAINFRAME* parent,
wxWindowID id, const wxPoint& loc,
const wxSize& size,
int nbitems, wxString choice[] ) :
ITEMS_LISTBOX_BASE( parent, id, loc, size )
{
//ListLibraries();
}
LIBRARY_LISTBOX::~LIBRARY_LISTBOX()
{
}
/*
* Return number of items
*/
int LIBRARY_LISTBOX::GetCount()
{
return m_LibraryList.Count();
}
/*
* Change an item text
*/
void LIBRARY_LISTBOX::SetString( unsigned linecount, const wxString& text )
{
if( linecount >= m_LibraryList.Count() )
linecount = m_LibraryList.Count() - 1;
if( linecount >= 0 )
m_LibraryList[linecount] = text;
}
wxString LIBRARY_LISTBOX::GetSelectedLibrary()
{
wxString libraryName;
int ii = GetFirstSelected();
if( ii >= 0 )
{
libraryName = m_LibraryList[ii];
}
return libraryName;
}
void LIBRARY_LISTBOX::AppendLine( const wxString& text )
{
m_LibraryList.Add( text );
SetItemCount( m_LibraryList.Count() );
}
/*
* Overlaid function: MUST be provided in wxLC_VIRTUAL mode
* because real data is not handled by ITEMS_LISTBOX_BASE
*/
wxString LIBRARY_LISTBOX::OnGetItemText( long item, long column ) const
{
return m_LibraryList.Item( item );
}
/*
* Enable or disable an item
*/
void LIBRARY_LISTBOX::SetSelection( unsigned index, bool State )
{
if( (int) index >= GetCount() )
index = GetCount() - 1;
if( (index >= 0) && (GetCount() > 0) )
{
#ifndef __WXMAC__
Select( index, State );
#endif
EnsureVisible( index );
#ifdef __WXMAC__
Refresh();
#endif
}
}
void LIBRARY_LISTBOX::SetLibraryList( wxArrayString list )
{
wxString msg;
int oldSelection = GetSelection();
m_LibraryList.Clear();
for( unsigned ii = 0; ii < list.GetCount(); ii++ )
{
msg = list.Item(ii);
m_LibraryList.Add( msg );
}
SetItemCount(list.GetCount());
if( GetCount() == 0 || oldSelection < 0 || oldSelection >= GetCount() )
SetSelection( 0, true );
Refresh();
}
/**************************************/
/* Event table for the library list */
/**************************************/
BEGIN_EVENT_TABLE( LIBRARY_LISTBOX, ITEMS_LISTBOX_BASE )
EVT_SIZE( ITEMS_LISTBOX_BASE::OnSize )
EVT_CHAR( LIBRARY_LISTBOX::OnChar )
END_EVENT_TABLE()
/**
* Function OnChar
* called on a key pressed
* Call default handler for some special keys,
* and for "ascii" keys, select the first footprint
* that the name starts by the letter.
* This is the defaut behaviour of a listbox, but because we use
* virtual lists, the listbox does not know anything to what is displayed,
* we must handle this behaviour here.
* Furthermore the footprint name is not at the beginning of
* displayed lines (the first word is the line number)
*/
void LIBRARY_LISTBOX::OnChar( wxKeyEvent& event )
{
int key = event.GetKeyCode();
switch( key )
{
case WXK_RIGHT:
case WXK_NUMPAD_RIGHT:
GetParent()->m_ListCmp->SetFocus();
return;
case WXK_HOME:
case WXK_END:
case WXK_UP:
case WXK_DOWN:
case WXK_PAGEUP:
case WXK_PAGEDOWN:
case WXK_LEFT:
case WXK_NUMPAD_LEFT:
event.Skip();
return;
default:
break;
}
// Search for an item name starting by the key code:
key = toupper(key);
for( unsigned ii = 0; ii < m_LibraryList.GetCount(); ii++ )
{
wxString text = m_LibraryList.Item(ii);
/* search for the start char of the footprint name.
* we must skip the line number
*/
text.Trim(false); // Remove leading spaces in line
unsigned jj = 0;
for( ; jj < text.Len(); jj++ )
{
// skip line number
if( text[jj] == ' ' )
break;
}
for( ; jj < text.Len(); jj++ )
{ // skip blanks
if( text[jj] != ' ' )
break;
}
int start_char = toupper( text[jj] );
if( key == start_char )
{
Focus( ii );
SetSelection( ii, true ); // Ensure visible
break;
}
}
}
......@@ -85,6 +85,8 @@ BEGIN_EVENT_TABLE( CVPCB_MAINFRAME, EDA_BASE_FRAME )
CVPCB_MAINFRAME::OnSelectFilteringFootprint )
EVT_TOOL( ID_CVPCB_FOOTPRINT_DISPLAY_PIN_FILTERED_LIST,
CVPCB_MAINFRAME::OnSelectFilteringFootprint )
EVT_TOOL( ID_CVPCB_FOOTPRINT_DISPLAY_BY_LIBRARY_LIST,
CVPCB_MAINFRAME::OnSelectFilteringFootprint )
EVT_TOOL( ID_CVPCB_FOOTPRINT_DISPLAY_FULL_LIST,
CVPCB_MAINFRAME::OnSelectFilteringFootprint )
......@@ -97,6 +99,7 @@ BEGIN_EVENT_TABLE( CVPCB_MAINFRAME, EDA_BASE_FRAME )
EVT_LIST_ITEM_SELECTED( ID_CVPCB_FOOTPRINT_LIST, CVPCB_MAINFRAME::OnLeftClick )
EVT_LIST_ITEM_ACTIVATED( ID_CVPCB_FOOTPRINT_LIST, CVPCB_MAINFRAME::OnLeftDClick )
EVT_LIST_ITEM_SELECTED( ID_CVPCB_COMPONENT_LIST, CVPCB_MAINFRAME::OnSelectComponent )
EVT_LIST_ITEM_SELECTED( ID_CVPCB_LIBRARY_LIST, CVPCB_MAINFRAME::OnSelectComponent )
EVT_UPDATE_UI( ID_CVPCB_CONFIG_KEEP_OPEN_ON_SAVE, CVPCB_MAINFRAME::OnUpdateKeepOpenOnSave )
END_EVENT_TABLE()
......@@ -112,6 +115,7 @@ CVPCB_MAINFRAME::CVPCB_MAINFRAME( const wxString& title, long style ) :
m_ListCmp = NULL;
m_FootprintList = NULL;
m_LibraryList = NULL;
m_DisplayFootprintFrame = NULL;
m_mainToolBar = NULL;
m_modified = false;
......@@ -160,6 +164,7 @@ CVPCB_MAINFRAME::CVPCB_MAINFRAME( const wxString& title, long style ) :
// Create list of available modules and components of the schematic
BuildCmpListBox();
BuildFOOTPRINTS_LISTBOX();
BuildLIBRARY_LISTBOX();
m_auimgr.SetManagedWindow( this );
......@@ -179,10 +184,15 @@ CVPCB_MAINFRAME::CVPCB_MAINFRAME( const wxString& title, long style ) :
m_auimgr.AddPane( m_ListCmp,
wxAuiPaneInfo( horiz ).Name( wxT( "m_ListCmp" ) ).CentrePane() );
if( m_LibraryList)
m_auimgr.AddPane( m_LibraryList,
wxAuiPaneInfo( info ).Name( wxT( "m_LibraryList" ) ).
Left().BestSize( (int) ( m_FrameSize.x * 0.20 ), m_FrameSize.y ) );
if( m_FootprintList )
m_auimgr.AddPane( m_FootprintList,
wxAuiPaneInfo( info ).Name( wxT( "m_FootprintList" ) ).
Right().BestSize( (int) ( m_FrameSize.x * 0.36 ), m_FrameSize.y ) );
Right().BestSize( (int) ( m_FrameSize.x * 0.30 ), m_FrameSize.y ) );
m_auimgr.Update();
}
......@@ -523,9 +533,11 @@ void CVPCB_MAINFRAME::OnSelectComponent( wxListEvent& event )
#define REDRAW_LIST true
#define SELECT_FULL_LIST true
int selection = -1;
wxString SelectedLibrary;
if( !m_mainToolBar->GetToolToggled( ID_CVPCB_FOOTPRINT_DISPLAY_FILTERED_LIST )
&& !m_mainToolBar->GetToolToggled( ID_CVPCB_FOOTPRINT_DISPLAY_PIN_FILTERED_LIST )
&& !m_mainToolBar->GetToolToggled( ID_CVPCB_FOOTPRINT_DISPLAY_BY_LIBRARY_LIST )
)
m_FootprintList->SetActiveFootprintList( SELECT_FULL_LIST, REDRAW_LIST );
......@@ -548,6 +560,12 @@ void CVPCB_MAINFRAME::OnSelectComponent( wxListEvent& event )
m_footprints );
}
else
if( m_mainToolBar->GetToolToggled( ID_CVPCB_FOOTPRINT_DISPLAY_BY_LIBRARY_LIST ) )
{
SelectedLibrary=m_LibraryList->GetSelectedLibrary();
m_FootprintList->SetFootprintFilteredByLibraryList( m_footprints, SelectedLibrary );
}
else
{
m_FootprintList->SetFootprintFilteredList( m_netlist.GetComponent( selection ),
m_footprints );
......@@ -610,14 +628,23 @@ void CVPCB_MAINFRAME::OnSelectFilteringFootprint( wxCommandEvent& event )
case ID_CVPCB_FOOTPRINT_DISPLAY_PIN_FILTERED_LIST:
m_mainToolBar->ToggleTool( ID_CVPCB_FOOTPRINT_DISPLAY_FULL_LIST, false );
m_mainToolBar->ToggleTool( ID_CVPCB_FOOTPRINT_DISPLAY_FILTERED_LIST, false );
m_mainToolBar->ToggleTool( ID_CVPCB_FOOTPRINT_DISPLAY_BY_LIBRARY_LIST, false );
break;
case ID_CVPCB_FOOTPRINT_DISPLAY_FILTERED_LIST:
m_mainToolBar->ToggleTool( ID_CVPCB_FOOTPRINT_DISPLAY_FULL_LIST, false );
m_mainToolBar->ToggleTool( ID_CVPCB_FOOTPRINT_DISPLAY_PIN_FILTERED_LIST, false );
m_mainToolBar->ToggleTool( ID_CVPCB_FOOTPRINT_DISPLAY_BY_LIBRARY_LIST, false );
break;
case ID_CVPCB_FOOTPRINT_DISPLAY_FULL_LIST:
m_mainToolBar->ToggleTool( ID_CVPCB_FOOTPRINT_DISPLAY_FILTERED_LIST, false );
m_mainToolBar->ToggleTool( ID_CVPCB_FOOTPRINT_DISPLAY_PIN_FILTERED_LIST, false );
m_mainToolBar->ToggleTool( ID_CVPCB_FOOTPRINT_DISPLAY_BY_LIBRARY_LIST, false );
break;
case ID_CVPCB_FOOTPRINT_DISPLAY_BY_LIBRARY_LIST:
m_mainToolBar->ToggleTool( ID_CVPCB_FOOTPRINT_DISPLAY_FULL_LIST, false );
m_mainToolBar->ToggleTool( ID_CVPCB_FOOTPRINT_DISPLAY_FILTERED_LIST, false );
m_mainToolBar->ToggleTool( ID_CVPCB_FOOTPRINT_DISPLAY_PIN_FILTERED_LIST, false );
break;
......
......@@ -101,6 +101,7 @@ bool EDA_APP::OnInit()
frame->LoadProjectFile( filename.GetFullPath() );
frame->Show( true );
frame->BuildFOOTPRINTS_LISTBOX();
frame->BuildLIBRARY_LISTBOX();
if( filename.IsOk() && filename.FileExists() )
{
......
......@@ -30,5 +30,7 @@ enum id_cvpcb_frm
ID_CVPCB_FOOTPRINT_DISPLAY_FULL_LIST,
ID_CVPCB_FOOTPRINT_DISPLAY_FILTERED_LIST,
ID_CVPCB_FOOTPRINT_DISPLAY_PIN_FILTERED_LIST,
ID_CVPCB_CONFIG_KEEP_OPEN_ON_SAVE
ID_CVPCB_FOOTPRINT_DISPLAY_BY_LIBRARY_LIST,
ID_CVPCB_CONFIG_KEEP_OPEN_ON_SAVE,
ID_CVPCB_LIBRARY_LIST
};
......@@ -32,17 +32,18 @@
#include <wx/listctrl.h>
#include <wx/filename.h>
#include <netlist_reader.h>
#include <footprint_info.h>
#include <wxBasePcbFrame.h>
#include <param_config.h>
#include <cvpcb.h>
#include <footprint_info.h>
/* Forward declarations of all top-level window classes. */
class wxAuiToolBar;
class FOOTPRINTS_LISTBOX;
class COMPONENTS_LISTBOX;
class LIBRARY_LISTBOX;
class DISPLAY_FOOTPRINTS_FRAME;
......@@ -55,6 +56,7 @@ public:
bool m_KeepCvpcbOpen;
FOOTPRINTS_LISTBOX* m_FootprintList;
LIBRARY_LISTBOX* m_LibraryList;
COMPONENTS_LISTBOX* m_ListCmp;
DISPLAY_FOOTPRINTS_FRAME* m_DisplayFootprintFrame;
wxAuiToolBar* m_mainToolBar;
......@@ -156,6 +158,7 @@ public:
void SetNewPkg( const wxString& aFootprintName );
void BuildCmpListBox();
void BuildFOOTPRINTS_LISTBOX();
void BuildLIBRARY_LISTBOX();
/**
* Create or Update the frame showing the current highlighted footprint
......
......@@ -34,6 +34,7 @@
/* Forward declarations of all top-level window classes. */
class CVPCB_MAINFRAME;
class COMPONENT;
class FOOTPRINT_LIST;
/*********************************************************************/
......@@ -82,6 +83,8 @@ public:
FOOTPRINT_LIST& aList );
void SetFootprintFilteredByPinCount( COMPONENT* aComponent,
FOOTPRINT_LIST& aList );
void SetFootprintFilteredByLibraryList( FOOTPRINT_LIST& list,
wxString SelectedLibrary );
/**
* Set the footprint list. We can have 2 footprint list:
......@@ -99,19 +102,39 @@ public:
// Events functions:
void OnLeftClick( wxListEvent& event );
void OnLeftDClick( wxListEvent& event );
void OnChar( wxKeyEvent& event );
/**
* Function OnChar
* called on a key pressed
* Call default handler for some special keys,
* and for "ascii" keys, select the first footprint
* that the name starts by the letter.
* This is the default behavior of a listbox, but because we use
* virtual lists, the listbox does not know anything to what is displayed,
* we must handle this behavior here.
* Furthermore the footprint name is not at the beginning of
* displayed lines (the first word is the line number)
*/
DECLARE_EVENT_TABLE()
};
/******************************************/
/* ListBox showing the list of library */
/******************************************/
class LIBRARY_LISTBOX : public ITEMS_LISTBOX_BASE
{
//private:
public:
wxArrayString m_LibraryList;
public:
LIBRARY_LISTBOX( CVPCB_MAINFRAME* parent, wxWindowID id,
const wxPoint& loc, const wxSize& size,
int nbitems, wxString choice[] );
~LIBRARY_LISTBOX();
int GetCount();
void SetSelection( unsigned index, bool State = true );
void SetString( unsigned linecount, const wxString& text );
void AppendLine( const wxString& text );
void SetLibraryList( wxArrayString list );
wxString GetSelectedLibrary();
wxString OnGetItemText( long item, long column ) const;
// Events functions:
void OnLeftClick( wxListEvent& event );
void OnChar( wxKeyEvent& event );
DECLARE_EVENT_TABLE()
......
......@@ -156,6 +156,7 @@ void DIALOG_CVPCB_CONFIG::OnOkClick( wxCommandEvent& event )
m_Parent->LoadFootprintFiles();
m_Parent->BuildFOOTPRINTS_LISTBOX();
m_Parent->BuildLIBRARY_LISTBOX();
}
wxCommandEvent evt( ID_SAVE_PROJECT );
......
......@@ -31,7 +31,6 @@
#include <common.h>
#include <cvpcb.h>
#include <class_drawpanel.h>
#include <footprint_info.h>
#include <cvstruct.h>
#include <class_DisplayFootprintsFrame.h>
......
......@@ -100,8 +100,6 @@ void CVPCB_MAINFRAME::BuildCmpListBox()
m_ListCmp = new COMPONENTS_LISTBOX( this, ID_CVPCB_COMPONENT_LIST,
wxDefaultPosition, size,
0, NULL );
m_ListCmp->SetBackgroundColour( wxColour( 225, 255, 255 ) );
m_ListCmp->SetForegroundColour( wxColour( 0, 0, 0 ) );
m_ListCmp->SetFont( wxFont( guiFont.GetPointSize(),
wxFONTFAMILY_MODERN,
wxFONTSTYLE_NORMAL,
......@@ -140,8 +138,6 @@ void CVPCB_MAINFRAME::BuildFOOTPRINTS_LISTBOX()
m_FootprintList = new FOOTPRINTS_LISTBOX( this, ID_CVPCB_FOOTPRINT_LIST,
wxDefaultPosition, size,
0, NULL );
m_FootprintList->SetBackgroundColour( wxColour( 225, 255, 225 ) );
m_FootprintList->SetForegroundColour( wxColour( 0, 0, 0 ) );
m_FootprintList->SetFont( wxFont( guiFont.GetPointSize(),
wxFONTFAMILY_MODERN,
wxFONTSTYLE_NORMAL,
......@@ -151,3 +147,26 @@ void CVPCB_MAINFRAME::BuildFOOTPRINTS_LISTBOX()
m_FootprintList->SetFootprintFullList( m_footprints );
DisplayStatus();
}
/*
* Create or update the library list.
*/
void CVPCB_MAINFRAME::BuildLIBRARY_LISTBOX()
{
wxString msg;
wxSize size( 10, 10 );
wxFont guiFont = wxSystemSettings::GetFont( wxSYS_DEFAULT_GUI_FONT );
if( m_LibraryList == NULL )
{
m_LibraryList = new LIBRARY_LISTBOX( this, ID_CVPCB_LIBRARY_LIST,
wxDefaultPosition, size,
0 , NULL );
m_LibraryList->SetFont( wxFont( guiFont.GetPointSize(),
wxFONTFAMILY_MODERN,
wxFONTSTYLE_NORMAL,
wxFONTWEIGHT_NORMAL ) );
}
m_LibraryList->SetLibraryList( m_ModuleLibNames );
}
......@@ -124,6 +124,7 @@ bool CVPCB_MAINFRAME::ReadNetListAndLinkFiles()
LoadProjectFile( m_NetlistFileName.GetFullPath() );
LoadFootprintFiles();
BuildFOOTPRINTS_LISTBOX();
BuildLIBRARY_LISTBOX();
m_ListCmp->Clear();
m_undefinedComponentCnt = 0;
......
......@@ -104,6 +104,12 @@ void CVPCB_MAINFRAME::ReCreateHToolbar()
_( "Display the filtered footprint list by pin count for the current component" ),
wxEmptyString );
m_mainToolBar->AddTool( ID_CVPCB_FOOTPRINT_DISPLAY_BY_LIBRARY_LIST,
KiBitmap( module_library_list_xpm ),
wxNullBitmap, true, NULL,
_( "Display the footprint list from selected library" ),
wxEmptyString );
m_mainToolBar->AddTool( ID_CVPCB_FOOTPRINT_DISPLAY_FULL_LIST,
KiBitmap( module_full_list_xpm ),
wxNullBitmap, true, NULL,
......@@ -114,6 +120,7 @@ void CVPCB_MAINFRAME::ReCreateHToolbar()
{
wxString key = wxT( FILTERFOOTPRINTKEY );
int opt = config->Read( key, (long) 1 );
m_mainToolBar->ToggleTool( ID_CVPCB_FOOTPRINT_DISPLAY_BY_LIBRARY_LIST, opt == 3 );
m_mainToolBar->ToggleTool( ID_CVPCB_FOOTPRINT_DISPLAY_PIN_FILTERED_LIST, opt == 2 );
m_mainToolBar->ToggleTool( ID_CVPCB_FOOTPRINT_DISPLAY_FILTERED_LIST, opt == 1 );
m_mainToolBar->ToggleTool( ID_CVPCB_FOOTPRINT_DISPLAY_FULL_LIST, opt == 0 );
......
......@@ -279,6 +279,7 @@ EXTERN_BITMAP( module_editor_xpm )
EXTERN_BITMAP( module_wizard_xpm )
EXTERN_BITMAP( module_filtered_list_xpm )
EXTERN_BITMAP( module_pin_filtered_list_xpm )
EXTERN_BITMAP( module_library_list_xpm )
EXTERN_BITMAP( module_full_list_xpm )
EXTERN_BITMAP( module_options_xpm )
EXTERN_BITMAP( module_ratsnest_xpm )
......
......@@ -45,10 +45,9 @@ class FP_LIB_TABLE;
*/
class FOOTPRINT_INFO
{
public:
wxString m_libName; ///< Name of the library containing this module excluding path and ext.
wxString m_libPath; ///< The full library name and path associated the footprint.
public:
wxString m_Module; ///< Module name.
int m_Num; ///< Order number in the display list.
wxString m_Doc; ///< Footprint description.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment