Merge lp:~michal-jahelka/kicad/kicad into lp:kicad/product

Proposed by Michal Jahelka
Status: Merged
Merged at revision: 4182
Proposed branch: lp:~michal-jahelka/kicad/kicad
Merge into: lp:kicad/product
Diff against target: 970 lines (+676/-4)
19 files modified
bitmaps_png/CMakeLists.txt (+1/-0)
bitmaps_png/cpp_26/module_library_list.cpp (+83/-0)
bitmaps_png/sources/module_library_list.svg (+172/-0)
cvpcb/CMakeLists.txt (+1/-0)
cvpcb/class_components_listbox.cpp (+5/-2)
cvpcb/class_footprints_listbox.cpp (+38/-0)
cvpcb/class_library_listbox.cpp (+204/-0)
cvpcb/cvframe.cpp (+28/-1)
cvpcb/cvpcb.cpp (+1/-0)
cvpcb/cvpcb_id.h (+3/-1)
cvpcb/cvpcb_mainframe.h (+4/-0)
cvpcb/cvstruct.h (+34/-0)
cvpcb/dialogs/dialog_cvpcb_config.cpp (+1/-0)
cvpcb/dialogs/dialog_display_options.cpp (+1/-0)
cvpcb/listboxes.cpp (+26/-0)
cvpcb/readwrite_dlgs.cpp (+1/-0)
cvpcb/tool_cvpcb.cpp (+7/-0)
include/bitmaps.h (+1/-0)
include/library_select.h (+65/-0)
To merge this branch: bzr merge lp:~michal-jahelka/kicad/kicad
Reviewer Review Type Date Requested Status
KiCad Lead Developers Pending
Review via email: mp+156331@code.launchpad.net

Description of the change

Implements library selection in CVPCB. I Added new icon with L (library) symbol (between filtred by pincount and full list). New column i9s on left and contains selected libraries. When is library icon active I can see only footprints from selected library from left column. Now is possible to select from libraries such as inductors,resistors, diodes, mechanical,etc.

To post a comment you must log in.
Revision history for this message
Wayne Stambaugh (stambaughw) wrote :

This merge request no longer applies cleanly to the head of the testing branch. If you would like me to consider this merge request, please update your branch and fix any conflicts. I will soon be working on the footprint library table code for CvPcb so if you do not update this reasonably soon, I suspect there will be some considerable divergence from the current CvPcb code which will make maintaining your changes more difficult. Also, I noticed a few issues with this merge request. Doxygen comments should be placed in the header file (LIBRARY_LISTBOX::OnChar()) and your editor appears to be leaving trailing white space. Thank you for your interest in help KiCad.

Wayne

Revision history for this message
Michal Jahelka (michal-jahelka) wrote :

Hello,

my branch is done.

But I am not programmer (i only program microcontrollers), so i do not
understand what did you mean with doxygen. I tried to program it in the
same style like other source code in kicad (taken for example
class_footprint_listbox, copied to class_library_listbox and
rename/rewrite parts of code). I tried to repair some spaces, what i saw
in kdiff. KiCAD programming was my first c++ and first wx programming
(first branch taken 4 months).

Branch is in
https://code.launchpad.net/~michal-jahelka/kicad/LibrarySelect, sending
patch too.
Should I delete old branch, or you do? When tried update it didnt want,
wrote different. So I had to make new branch, it is 4176.

Second thing, I created some libraries, modules and 3D packages. Is
something similar like launchpad to put it there? I know about
kicadlib.org, but it has no member access, like bzr.

Michal Jahelka

Dne 24.5.2013 17:12, Wayne Stambaugh napsal(a):
> This merge request no longer applies cleanly to the head of the testing branch. If you would like me to consider this merge request, please update your branch and fix any conflicts. I will soon be working on the footprint library table code for CvPcb so if you do not update this reasonably soon, I suspect there will be some considerable divergence from the current CvPcb code which will make maintaining your changes more difficult. Also, I noticed a few issues with this merge request. Doxygen comments should be placed in the header file (LIBRARY_LISTBOX::OnChar()) and your editor appears to be leaving trailing white space. Thank you for your interest in help KiCad.
>
> Wayne

1=== modified file 'bitmaps_png/CMakeLists.txt'
2--- bitmaps_png/CMakeLists.txt 2013-03-01 19:59:29 +0000
3+++ bitmaps_png/CMakeLists.txt 2013-05-29 09:23:32 +0000
4@@ -359,6 +359,7 @@
5 module_full_list
6 module_options
7 module_pin_filtered_list
8+ module_library_list
9 module_ratsnest
10 module
11 modview_icon
12
13=== added file 'bitmaps_png/cpp_26/module_library_list.cpp'
14--- bitmaps_png/cpp_26/module_library_list.cpp 1970-01-01 00:00:00 +0000
15+++ bitmaps_png/cpp_26/module_library_list.cpp 2013-05-29 08:23:09 +0000
16@@ -0,0 +1,83 @@
17+
18+/* Do not modify this file, it was automatically generated by the
19+ * PNG2cpp CMake script, using a *.png file as input.
20+ */
21+
22+#include <bitmaps.h>
23+
24+static const unsigned char png[] = {
25+ 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52,
26+ 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x1a, 0x08, 0x06, 0x00, 0x00, 0x00, 0xa9, 0x4a, 0x4c,
27+ 0xce, 0x00, 0x00, 0x00, 0x04, 0x73, 0x42, 0x49, 0x54, 0x08, 0x08, 0x08, 0x08, 0x7c, 0x08, 0x64,
28+ 0x88, 0x00, 0x00, 0x00, 0x09, 0x70, 0x48, 0x59, 0x73, 0x00, 0x00, 0x0d, 0xd7, 0x00, 0x00, 0x0d,
29+ 0xd7, 0x01, 0x42, 0x28, 0x9b, 0x78, 0x00, 0x00, 0x00, 0x19, 0x74, 0x45, 0x58, 0x74, 0x53, 0x6f,
30+ 0x66, 0x74, 0x77, 0x61, 0x72, 0x65, 0x00, 0x77, 0x77, 0x77, 0x2e, 0x69, 0x6e, 0x6b, 0x73, 0x63,
31+ 0x61, 0x70, 0x65, 0x2e, 0x6f, 0x72, 0x67, 0x9b, 0xee, 0x3c, 0x1a, 0x00, 0x00, 0x03, 0xd2, 0x49,
32+ 0x44, 0x41, 0x54, 0x48, 0x89, 0xbd, 0x96, 0x5d, 0x48, 0x5b, 0x67, 0x18, 0xc7, 0x7f, 0xe7, 0x23,
33+ 0x59, 0xac, 0x4e, 0x4f, 0xac, 0x46, 0x11, 0xa9, 0xab, 0x8d, 0xd2, 0xb1, 0xd1, 0x3b, 0xc7, 0x7a,
34+ 0xb1, 0x3a, 0xb5, 0x89, 0x66, 0xcd, 0x56, 0x99, 0x05, 0xe9, 0x10, 0xec, 0xcd, 0xae, 0xa4, 0x20,
35+ 0x82, 0xd7, 0xcd, 0x95, 0x17, 0xdd, 0xc5, 0x7a, 0xd1, 0x1b, 0x19, 0x42, 0x07, 0x19, 0x63, 0x5e,
36+ 0x18, 0xd3, 0xe9, 0x9c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, 0x9a, 0x70, 0xd8, 0xcf, 0xad, 0xfa, 0xfa, 0x7a, 0x1f, 0x70, 0x66,
92+ 0x1f, 0xa9, 0xf7, 0x26, 0x26, 0x26, 0xec, 0x87, 0x36, 0x3a, 0xa8, 0xc4, 0x37, 0xe2, 0x02, 0xfc,
93+ 0x0f, 0xfd, 0x66, 0x6b, 0x49, 0xc9, 0xd5, 0xed, 0x5a, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e,
94+ 0x44, 0xae, 0x42, 0x60, 0x82
95+};
96+
97+const BITMAP_OPAQUE module_library_list_xpm[1] = {{ png, sizeof( png ), "module_library_list_xpm" }};
98+
99+//EOF
100
101=== added file 'bitmaps_png/sources/module_library_list.svg'
102--- bitmaps_png/sources/module_library_list.svg 1970-01-01 00:00:00 +0000
103+++ bitmaps_png/sources/module_library_list.svg 2013-05-29 08:26:21 +0000
104@@ -0,0 +1,172 @@
105+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
106+<svg
107+ xmlns:dc="http://purl.org/dc/elements/1.1/"
108+ xmlns:cc="http://creativecommons.org/ns#"
109+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
110+ xmlns:svg="http://www.w3.org/2000/svg"
111+ xmlns="http://www.w3.org/2000/svg"
112+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
113+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
114+ height="26"
115+ width="26"
116+ version="1.1"
117+ viewBox="0 0 26 26"
118+ id="svg2"
119+ inkscape:version="0.48.4 r9939"
120+ sodipodi:docname="module_filtered_list.svg">
121+ <metadata
122+ id="metadata56">
123+ <rdf:RDF>
124+ <cc:Work
125+ rdf:about="">
126+ <dc:format>image/svg+xml</dc:format>
127+ <dc:type
128+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
129+ <dc:title />
130+ </cc:Work>
131+ </rdf:RDF>
132+ </metadata>
133+ <defs
134+ id="defs54" />
135+ <sodipodi:namedview
136+ pagecolor="#ffffff"
137+ bordercolor="#666666"
138+ borderopacity="1"
139+ objecttolerance="10"
140+ gridtolerance="10"
141+ guidetolerance="10"
142+ inkscape:pageopacity="0"
143+ inkscape:pageshadow="2"
144+ inkscape:window-width="1920"
145+ inkscape:window-height="1015"
146+ id="namedview52"
147+ showgrid="true"
148+ inkscape:zoom="13.906434"
149+ inkscape:cx="19.918756"
150+ inkscape:cy="24.624712"
151+ inkscape:window-x="-4"
152+ inkscape:window-y="-4"
153+ inkscape:window-maximized="1"
154+ inkscape:current-layer="svg2"
155+ inkscape:snap-to-guides="false"
156+ inkscape:snap-grids="false">
157+ <inkscape:grid
158+ type="xygrid"
159+ id="grid3033"
160+ empspacing="5"
161+ visible="true"
162+ enabled="true"
163+ snapvisiblegridlinesonly="true" />
164+ </sodipodi:namedview>
165+ <rect
166+ transform="matrix(0,-1,1,0,0,0)"
167+ height="21.994465"
168+ width="12.99073"
169+ y="1.5596062"
170+ x="-17.520231"
171+ id="rect8"
172+ style="fill:#ffffff;stroke:#484848;stroke-width:0.99127513000000000;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
173+ <path
174+ d="m 1.5927632,8.9410802 a 2.0341261,1.8090857 0 1 1 0.012585,3.6181538"
175+ id="path10"
176+ inkscape:connector-curvature="0"
177+ style="fill:none;stroke:#484848;stroke-width:0.99127518999999997;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
178+ <rect
179+ transform="matrix(0,-1,1,0,0,0)"
180+ height="3.9761357"
181+ width="5.9874525"
182+ y="3.5188339"
183+ x="-20.502354"
184+ id="rect30"
185+ style="fill:#ff7800;stroke:#484848;stroke-width:1;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
186+ <path
187+ 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"
188+ id="path32"
189+ inkscape:connector-curvature="0"
190+ style="fill:#ffede0;stroke:#484848;stroke-width:1;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
191+ <rect
192+ transform="matrix(0,-1,1,0,0,0)"
193+ height="3.9761357"
194+ width="5.9874525"
195+ y="10.507601"
196+ x="-20.513519"
197+ id="rect30-5"
198+ style="fill:#ff7800;stroke:#484848;stroke-width:1;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
199+ <path
200+ 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"
201+ id="path32-4"
202+ inkscape:connector-curvature="0"
203+ style="fill:#ffede0;stroke:#484848;stroke-width:1;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
204+ <rect
205+ transform="matrix(0,-1,1,0,0,0)"
206+ height="3.9761357"
207+ width="5.9874525"
208+ y="17.499128"
209+ x="-20.488094"
210+ id="rect30-2"
211+ style="fill:#ff7800;stroke:#484848;stroke-width:1;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
212+ <path
213+ 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"
214+ id="path32-0"
215+ inkscape:connector-curvature="0"
216+ style="fill:#ffede0;stroke:#484848;stroke-width:1;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
217+ <rect
218+ transform="matrix(0,-1,1,0,0,0)"
219+ height="3.9761357"
220+ width="5.9874525"
221+ y="3.5339792"
222+ x="-7.5303874"
223+ id="rect30-1"
224+ style="fill:#ff7800;stroke:#484848;stroke-width:1;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
225+ <path
226+ 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"
227+ id="path32-3"
228+ inkscape:connector-curvature="0"
229+ style="fill:#ffede0;stroke:#484848;stroke-width:1;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
230+ <rect
231+ transform="matrix(0,-1,1,0,0,0)"
232+ height="3.9761357"
233+ width="5.9874525"
234+ y="10.522747"
235+ x="-7.5415525"
236+ id="rect30-5-6"
237+ style="fill:#ff7800;stroke:#484848;stroke-width:1;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
238+ <path
239+ 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"
240+ id="path32-4-0"
241+ inkscape:connector-curvature="0"
242+ style="fill:#ffede0;stroke:#484848;stroke-width:1;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
243+ <rect
244+ transform="matrix(0,-1,1,0,0,0)"
245+ height="3.9761357"
246+ width="5.9874525"
247+ y="17.514275"
248+ x="-7.516129"
249+ id="rect30-2-8"
250+ style="fill:#ff7800;stroke:#484848;stroke-width:1;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
251+ <path
252+ 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"
253+ id="path32-0-4"
254+ inkscape:connector-curvature="0"
255+ style="fill:#ffede0;stroke:#484848;stroke-width:1;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
256+ <rect
257+ ry="0.95373797"
258+ height="13.958503"
259+ width="11.03963"
260+ y="10.016949"
261+ x="13.978938"
262+ id="rect42"
263+ style="fill:#3e3e3e" />
264+ <rect
265+ 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"
266+ id="rect3003"
267+ width="8.413372"
268+ height="11.649284"
269+ x="15.316651"
270+ y="11.114803" />
271+ <path
272+ style="fill:none;stroke:#008000;stroke-width:1.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none"
273+ d="m 17.97729,13.415897 0,7.119007 3.523549,0"
274+ id="path3005"
275+ inkscape:connector-curvature="0" />
276+</svg>
277
278=== modified file 'cvpcb/CMakeLists.txt'
279--- cvpcb/CMakeLists.txt 2013-05-01 19:01:14 +0000
280+++ cvpcb/CMakeLists.txt 2013-05-28 08:25:47 +0000
281@@ -34,6 +34,7 @@
282 class_components_listbox.cpp
283 class_DisplayFootprintsFrame.cpp
284 class_footprints_listbox.cpp
285+ class_library_listbox.cpp
286 cvframe.cpp
287 cvpcb.cpp
288 listboxes.cpp
289
290=== modified file 'cvpcb/class_components_listbox.cpp'
291--- cvpcb/class_components_listbox.cpp 2012-11-28 15:24:53 +0000
292+++ cvpcb/class_components_listbox.cpp 2013-05-28 08:16:44 +0000
293@@ -113,13 +113,16 @@
294 {
295 case WXK_HOME:
296 case WXK_END:
297- case WXK_UP:
298+ case WXK_UP:
299 case WXK_DOWN:
300 case WXK_PAGEUP:
301 case WXK_PAGEDOWN:
302+ event.Skip();
303+ return;
304+
305 case WXK_LEFT:
306 case WXK_NUMPAD_LEFT:
307- event.Skip();
308+ GetParent()->m_LibraryList->SetFocus();
309 return;
310
311 case WXK_RIGHT:
312
313=== modified file 'cvpcb/class_footprints_listbox.cpp'
314--- cvpcb/class_footprints_listbox.cpp 2013-04-25 16:29:35 +0000
315+++ cvpcb/class_footprints_listbox.cpp 2013-05-29 10:04:49 +0000
316@@ -30,6 +30,8 @@
317 #include <fctsys.h>
318 #include <wxstruct.h>
319 #include <macros.h>
320+#include <appl_wxstruct.h>
321+#include <wildcards_and_files_ext.h>
322
323 #include <cvpcb.h>
324 #include <cvpcb_mainframe.h>
325@@ -233,7 +235,49 @@
326 Refresh();
327 }
328
329-
330+void FOOTPRINTS_LISTBOX::SetFootprintFilteredByLibraryList( FOOTPRINT_LIST& list,
331+ wxString SelectedLibrary ) {
332+ wxString msg;
333+ int oldSelection = GetSelection();
334+ bool hasItem = false;
335+
336+ wxFileName filename = SelectedLibrary;
337+ filename.SetExt( LegacyFootprintLibPathExtension );
338+ wxString FullLibraryName = wxGetApp().FindLibraryPath( filename );
339+
340+ m_FilteredFootprintList.Clear();
341+
342+ for( unsigned ii = 0; ii < list.GetCount(); ii++ )
343+ {
344+ FOOTPRINT_INFO& footprint = list.GetItem(ii);
345+ wxString LibName = footprint.m_libPath;
346+ if( LibName.Matches( FullLibraryName ) )
347+ {
348+ msg.Printf( wxT( "%3d %s" ), m_FilteredFootprintList.GetCount() + 1,
349+ footprint.m_Module.GetData() );
350+ m_FilteredFootprintList.Add( msg );
351+ hasItem = true;
352+ }
353+ }
354+
355+ if( hasItem )
356+ SetActiveFootprintList( false );
357+ else
358+ SetActiveFootprintList( true );
359+
360+ if( ( GetCount() == 0 ) || ( oldSelection >= GetCount() ) )
361+ SetSelection( 0, true );
362+
363+ Refresh();
364+}
365+
366+/** Set the footprint list. We can have 2 footprint list:
367+ * The full footprint list
368+ * The filtered footprint list (if the current selected component has a
369+ * filter for footprints)
370+ * @param FullList true = full footprint list, false = filtered footprint list
371+ * @param Redraw = true to redraw the window
372+ */
373 void FOOTPRINTS_LISTBOX::SetActiveFootprintList( bool FullList, bool Redraw )
374 {
375 bool old_selection = m_UseFootprintFullList;
376
377=== added file 'cvpcb/class_library_listbox.cpp'
378--- cvpcb/class_library_listbox.cpp 1970-01-01 00:00:00 +0000
379+++ cvpcb/class_library_listbox.cpp 2013-05-28 07:23:23 +0000
380@@ -0,0 +1,204 @@
381+/**
382+ * @file class_library_listbox.cpp
383+ * class to display used library and selecting it
384+ */
385+
386+#include <fctsys.h>
387+#include <wxstruct.h>
388+#include <macros.h>
389+
390+#include <cvpcb.h>
391+#include <cvpcb_mainframe.h>
392+#include <cvstruct.h>
393+
394+
395+/***************************************/
396+/* ListBox handling the library list */
397+/***************************************/
398+
399+LIBRARY_LISTBOX::LIBRARY_LISTBOX( CVPCB_MAINFRAME* parent,
400+ wxWindowID id, const wxPoint& loc,
401+ const wxSize& size,
402+ int nbitems, wxString choice[] ) :
403+ ITEMS_LISTBOX_BASE( parent, id, loc, size )
404+{
405+ //ListLibraries();
406+}
407+
408+
409+LIBRARY_LISTBOX::~LIBRARY_LISTBOX()
410+{
411+}
412+
413+
414+/*
415+ * Return number of items
416+ */
417+int LIBRARY_LISTBOX::GetCount()
418+{
419+ return m_LibraryList.Count();
420+}
421+
422+
423+/*
424+ * Change an item text
425+ */
426+void LIBRARY_LISTBOX::SetString( unsigned linecount, const wxString& text )
427+{
428+ if( linecount >= m_LibraryList.Count() )
429+ linecount = m_LibraryList.Count() - 1;
430+ if( linecount >= 0 )
431+ m_LibraryList[linecount] = text;
432+}
433+
434+
435+wxString LIBRARY_LISTBOX::GetSelectedLibrary()
436+{
437+ wxString libraryName;
438+ int ii = GetFirstSelected();
439+
440+ if( ii >= 0 )
441+ {
442+ libraryName = m_LibraryList[ii];
443+ }
444+
445+ return libraryName;
446+}
447+
448+
449+void LIBRARY_LISTBOX::AppendLine( const wxString& text )
450+{
451+ m_LibraryList.Add( text );
452+ SetItemCount( m_LibraryList.Count() );
453+}
454+
455+
456+/*
457+ * Overlaid function: MUST be provided in wxLC_VIRTUAL mode
458+ * because real data is not handled by ITEMS_LISTBOX_BASE
459+ */
460+wxString LIBRARY_LISTBOX::OnGetItemText( long item, long column ) const
461+{
462+ return m_LibraryList.Item( item );
463+}
464+
465+/*
466+ * Enable or disable an item
467+ */
468+void LIBRARY_LISTBOX::SetSelection( unsigned index, bool State )
469+{
470+ if( (int) index >= GetCount() )
471+ index = GetCount() - 1;
472+
473+ if( (index >= 0) && (GetCount() > 0) )
474+ {
475+#ifndef __WXMAC__
476+ Select( index, State );
477+#endif
478+ EnsureVisible( index );
479+#ifdef __WXMAC__
480+ Refresh();
481+#endif
482+ }
483+}
484+
485+
486+void LIBRARY_LISTBOX::SetLibraryList( wxArrayString list )
487+{
488+ wxString msg;
489+ int oldSelection = GetSelection();
490+
491+ m_LibraryList.Clear();
492+
493+ for( unsigned ii = 0; ii < list.GetCount(); ii++ )
494+ {
495+ msg = list.Item(ii);
496+ m_LibraryList.Add( msg );
497+ }
498+
499+ SetItemCount(list.GetCount());
500+
501+ if( GetCount() == 0 || oldSelection < 0 || oldSelection >= GetCount() )
502+ SetSelection( 0, true );
503+ Refresh();
504+}
505+
506+
507+/**************************************/
508+/* Event table for the library list */
509+/**************************************/
510+
511+BEGIN_EVENT_TABLE( LIBRARY_LISTBOX, ITEMS_LISTBOX_BASE )
512+EVT_SIZE( ITEMS_LISTBOX_BASE::OnSize )
513+EVT_CHAR( LIBRARY_LISTBOX::OnChar )
514+END_EVENT_TABLE()
515+
516+
517+/**
518+ * Function OnChar
519+ * called on a key pressed
520+ * Call default handler for some special keys,
521+ * and for "ascii" keys, select the first footprint
522+ * that the name starts by the letter.
523+ * This is the defaut behaviour of a listbox, but because we use
524+ * virtual lists, the listbox does not know anything to what is displayed,
525+ * we must handle this behaviour here.
526+ * Furthermore the footprint name is not at the beginning of
527+ * displayed lines (the first word is the line number)
528+ */
529+void LIBRARY_LISTBOX::OnChar( wxKeyEvent& event )
530+{
531+ int key = event.GetKeyCode();
532+ switch( key )
533+ {
534+ case WXK_RIGHT:
535+ case WXK_NUMPAD_RIGHT:
536+ GetParent()->m_ListCmp->SetFocus();
537+ return;
538+
539+ case WXK_HOME:
540+ case WXK_END:
541+ case WXK_UP:
542+ case WXK_DOWN:
543+ case WXK_PAGEUP:
544+ case WXK_PAGEDOWN:
545+ case WXK_LEFT:
546+ case WXK_NUMPAD_LEFT:
547+ event.Skip();
548+ return;
549+
550+ default:
551+ break;
552+ }
553+ // Search for an item name starting by the key code:
554+ key = toupper(key);
555+ for( unsigned ii = 0; ii < m_LibraryList.GetCount(); ii++ )
556+ {
557+ wxString text = m_LibraryList.Item(ii);
558+ /* search for the start char of the footprint name.
559+ * we must skip the line number
560+ */
561+ text.Trim(false); // Remove leading spaces in line
562+ unsigned jj = 0;
563+ for( ; jj < text.Len(); jj++ )
564+ {
565+ // skip line number
566+ if( text[jj] == ' ' )
567+ break;
568+ }
569+
570+ for( ; jj < text.Len(); jj++ )
571+ { // skip blanks
572+ if( text[jj] != ' ' )
573+ break;
574+ }
575+
576+ int start_char = toupper( text[jj] );
577+ if( key == start_char )
578+ {
579+ Focus( ii );
580+ SetSelection( ii, true ); // Ensure visible
581+ break;
582+ }
583+ }
584+}
585
586=== modified file 'cvpcb/cvframe.cpp'
587--- cvpcb/cvframe.cpp 2013-05-25 10:41:24 +0000
588+++ cvpcb/cvframe.cpp 2013-05-28 08:33:00 +0000
589@@ -85,6 +85,8 @@
590 CVPCB_MAINFRAME::OnSelectFilteringFootprint )
591 EVT_TOOL( ID_CVPCB_FOOTPRINT_DISPLAY_PIN_FILTERED_LIST,
592 CVPCB_MAINFRAME::OnSelectFilteringFootprint )
593+ EVT_TOOL( ID_CVPCB_FOOTPRINT_DISPLAY_BY_LIBRARY_LIST,
594+ CVPCB_MAINFRAME::OnSelectFilteringFootprint )
595 EVT_TOOL( ID_CVPCB_FOOTPRINT_DISPLAY_FULL_LIST,
596 CVPCB_MAINFRAME::OnSelectFilteringFootprint )
597
598@@ -97,6 +99,7 @@
599 EVT_LIST_ITEM_SELECTED( ID_CVPCB_FOOTPRINT_LIST, CVPCB_MAINFRAME::OnLeftClick )
600 EVT_LIST_ITEM_ACTIVATED( ID_CVPCB_FOOTPRINT_LIST, CVPCB_MAINFRAME::OnLeftDClick )
601 EVT_LIST_ITEM_SELECTED( ID_CVPCB_COMPONENT_LIST, CVPCB_MAINFRAME::OnSelectComponent )
602+ EVT_LIST_ITEM_SELECTED( ID_CVPCB_LIBRARY_LIST, CVPCB_MAINFRAME::OnSelectComponent )
603
604 EVT_UPDATE_UI( ID_CVPCB_CONFIG_KEEP_OPEN_ON_SAVE, CVPCB_MAINFRAME::OnUpdateKeepOpenOnSave )
605 END_EVENT_TABLE()
606@@ -112,6 +115,7 @@
607
608 m_ListCmp = NULL;
609 m_FootprintList = NULL;
610+ m_LibraryList = NULL;
611 m_DisplayFootprintFrame = NULL;
612 m_mainToolBar = NULL;
613 m_modified = false;
614@@ -160,6 +164,7 @@
615 // Create list of available modules and components of the schematic
616 BuildCmpListBox();
617 BuildFOOTPRINTS_LISTBOX();
618+ BuildLIBRARY_LISTBOX();
619
620 m_auimgr.SetManagedWindow( this );
621
622@@ -179,10 +184,15 @@
623 m_auimgr.AddPane( m_ListCmp,
624 wxAuiPaneInfo( horiz ).Name( wxT( "m_ListCmp" ) ).CentrePane() );
625
626+ if( m_LibraryList)
627+ m_auimgr.AddPane( m_LibraryList,
628+ wxAuiPaneInfo( info ).Name( wxT( "m_LibraryList" ) ).
629+ Left().BestSize( (int) ( m_FrameSize.x * 0.20 ), m_FrameSize.y ) );
630+
631 if( m_FootprintList )
632 m_auimgr.AddPane( m_FootprintList,
633 wxAuiPaneInfo( info ).Name( wxT( "m_FootprintList" ) ).
634- Right().BestSize( (int) ( m_FrameSize.x * 0.36 ), m_FrameSize.y ) );
635+ Right().BestSize( (int) ( m_FrameSize.x * 0.30 ), m_FrameSize.y ) );
636
637 m_auimgr.Update();
638 }
639@@ -523,9 +533,11 @@
640 #define REDRAW_LIST true
641 #define SELECT_FULL_LIST true
642 int selection = -1;
643+ wxString SelectedLibrary;
644
645 if( !m_mainToolBar->GetToolToggled( ID_CVPCB_FOOTPRINT_DISPLAY_FILTERED_LIST )
646 && !m_mainToolBar->GetToolToggled( ID_CVPCB_FOOTPRINT_DISPLAY_PIN_FILTERED_LIST )
647+ && !m_mainToolBar->GetToolToggled( ID_CVPCB_FOOTPRINT_DISPLAY_BY_LIBRARY_LIST )
648 )
649 m_FootprintList->SetActiveFootprintList( SELECT_FULL_LIST, REDRAW_LIST );
650
651@@ -548,6 +560,12 @@
652 m_footprints );
653 }
654 else
655+ if( m_mainToolBar->GetToolToggled( ID_CVPCB_FOOTPRINT_DISPLAY_BY_LIBRARY_LIST ) )
656+ {
657+ SelectedLibrary=m_LibraryList->GetSelectedLibrary();
658+ m_FootprintList->SetFootprintFilteredByLibraryList( m_footprints, SelectedLibrary );
659+ }
660+ else
661 {
662 m_FootprintList->SetFootprintFilteredList( m_netlist.GetComponent( selection ),
663 m_footprints );
664@@ -610,16 +628,25 @@
665 case ID_CVPCB_FOOTPRINT_DISPLAY_PIN_FILTERED_LIST:
666 m_mainToolBar->ToggleTool( ID_CVPCB_FOOTPRINT_DISPLAY_FULL_LIST, false );
667 m_mainToolBar->ToggleTool( ID_CVPCB_FOOTPRINT_DISPLAY_FILTERED_LIST, false );
668+ m_mainToolBar->ToggleTool( ID_CVPCB_FOOTPRINT_DISPLAY_BY_LIBRARY_LIST, false );
669 break;
670
671 case ID_CVPCB_FOOTPRINT_DISPLAY_FILTERED_LIST:
672 m_mainToolBar->ToggleTool( ID_CVPCB_FOOTPRINT_DISPLAY_FULL_LIST, false );
673 m_mainToolBar->ToggleTool( ID_CVPCB_FOOTPRINT_DISPLAY_PIN_FILTERED_LIST, false );
674+ m_mainToolBar->ToggleTool( ID_CVPCB_FOOTPRINT_DISPLAY_BY_LIBRARY_LIST, false );
675 break;
676
677 case ID_CVPCB_FOOTPRINT_DISPLAY_FULL_LIST:
678 m_mainToolBar->ToggleTool( ID_CVPCB_FOOTPRINT_DISPLAY_FILTERED_LIST, false );
679 m_mainToolBar->ToggleTool( ID_CVPCB_FOOTPRINT_DISPLAY_PIN_FILTERED_LIST, false );
680+ m_mainToolBar->ToggleTool( ID_CVPCB_FOOTPRINT_DISPLAY_BY_LIBRARY_LIST, false );
681+ break;
682+
683+ case ID_CVPCB_FOOTPRINT_DISPLAY_BY_LIBRARY_LIST:
684+ m_mainToolBar->ToggleTool( ID_CVPCB_FOOTPRINT_DISPLAY_FULL_LIST, false );
685+ m_mainToolBar->ToggleTool( ID_CVPCB_FOOTPRINT_DISPLAY_FILTERED_LIST, false );
686+ m_mainToolBar->ToggleTool( ID_CVPCB_FOOTPRINT_DISPLAY_PIN_FILTERED_LIST, false );
687 break;
688
689 default:
690
691=== modified file 'cvpcb/cvpcb.cpp'
692--- cvpcb/cvpcb.cpp 2013-04-09 17:49:01 +0000
693+++ cvpcb/cvpcb.cpp 2013-05-28 08:33:50 +0000
694@@ -101,6 +101,7 @@
695 frame->LoadProjectFile( filename.GetFullPath() );
696 frame->Show( true );
697 frame->BuildFOOTPRINTS_LISTBOX();
698+ frame->BuildLIBRARY_LISTBOX();
699
700 if( filename.IsOk() && filename.FileExists() )
701 {
702
703=== modified file 'cvpcb/cvpcb_id.h'
704--- cvpcb/cvpcb_id.h 2013-05-26 04:36:44 +0000
705+++ cvpcb/cvpcb_id.h 2013-05-29 08:20:09 +0000
706@@ -1,34 +1,36 @@
707-/**
708- * @file cvpcb_id.h
709- */
710-/*
711- * Command IDs for CvPcb.
712- *
713- * Please add IDs that are unique to the component library viewer here and
714- * not in the global id.h file. This will prevent the entire project from
715- * being rebuilt when adding new commands to the component library viewer.
716- */
717-
718-// Generic IDs:
719-#include <id.h>
720-
721-// specific IDs
722-enum id_cvpcb_frm
723-{
724- ID_CVPCB_QUIT = ID_END_LIST,
725- ID_CVPCB_READ_INPUT_NETLIST,
726- ID_CVPCB_SAVEQUITCVPCB,
727- ID_CVPCB_CREATE_CONFIGWINDOW,
728- ID_CVPCB_CREATE_SCREENCMP,
729- ID_CVPCB_GOTO_FIRSTNA,
730- ID_CVPCB_GOTO_PREVIOUSNA,
731- ID_CVPCB_DEL_ASSOCIATIONS,
732- ID_CVPCB_AUTO_ASSOCIE,
733- ID_CVPCB_COMPONENT_LIST,
734- ID_CVPCB_FOOTPRINT_LIST,
735- ID_CVPCB_SHOW3D_FRAME,
736- ID_CVPCB_FOOTPRINT_DISPLAY_FULL_LIST,
737- ID_CVPCB_FOOTPRINT_DISPLAY_FILTERED_LIST,
738- ID_CVPCB_FOOTPRINT_DISPLAY_PIN_FILTERED_LIST,
739- ID_CVPCB_CONFIG_KEEP_OPEN_ON_SAVE
740-};
741+/**
742+ * @file cvpcb_id.h
743+ */
744+/*
745+ * Command IDs for CvPcb.
746+ *
747+ * Please add IDs that are unique to the component library viewer here and
748+ * not in the global id.h file. This will prevent the entire project from
749+ * being rebuilt when adding new commands to the component library viewer.
750+ */
751+
752+// Generic IDs:
753+#include <id.h>
754+
755+// specific IDs
756+enum id_cvpcb_frm
757+{
758+ ID_CVPCB_QUIT = ID_END_LIST,
759+ ID_CVPCB_READ_INPUT_NETLIST,
760+ ID_CVPCB_SAVEQUITCVPCB,
761+ ID_CVPCB_CREATE_CONFIGWINDOW,
762+ ID_CVPCB_CREATE_SCREENCMP,
763+ ID_CVPCB_GOTO_FIRSTNA,
764+ ID_CVPCB_GOTO_PREVIOUSNA,
765+ ID_CVPCB_DEL_ASSOCIATIONS,
766+ ID_CVPCB_AUTO_ASSOCIE,
767+ ID_CVPCB_COMPONENT_LIST,
768+ ID_CVPCB_FOOTPRINT_LIST,
769+ ID_CVPCB_SHOW3D_FRAME,
770+ ID_CVPCB_FOOTPRINT_DISPLAY_FULL_LIST,
771+ ID_CVPCB_FOOTPRINT_DISPLAY_FILTERED_LIST,
772+ ID_CVPCB_FOOTPRINT_DISPLAY_PIN_FILTERED_LIST,
773+ ID_CVPCB_FOOTPRINT_DISPLAY_BY_LIBRARY_LIST,
774+ ID_CVPCB_CONFIG_KEEP_OPEN_ON_SAVE,
775+ ID_CVPCB_LIBRARY_LIST
776+};
777
778=== modified file 'cvpcb/cvpcb_mainframe.h'
779--- cvpcb/cvpcb_mainframe.h 2013-04-26 15:11:52 +0000
780+++ cvpcb/cvpcb_mainframe.h 2013-05-29 06:57:38 +0000
781@@ -37,12 +37,14 @@
782 #include <param_config.h>
783 #include <cvpcb.h>
784 #include <footprint_info.h>
785+#include <library_select.h>
786
787
788 /* Forward declarations of all top-level window classes. */
789 class wxAuiToolBar;
790 class FOOTPRINTS_LISTBOX;
791 class COMPONENTS_LISTBOX;
792+class LIBRARY_LISTBOX;
793 class DISPLAY_FOOTPRINTS_FRAME;
794
795
796@@ -55,6 +57,7 @@
797
798 bool m_KeepCvpcbOpen;
799 FOOTPRINTS_LISTBOX* m_FootprintList;
800+ LIBRARY_LISTBOX* m_LibraryList;
801 COMPONENTS_LISTBOX* m_ListCmp;
802 DISPLAY_FOOTPRINTS_FRAME* m_DisplayFootprintFrame;
803 wxAuiToolBar* m_mainToolBar;
804@@ -156,6 +159,7 @@
805 void SetNewPkg( const wxString& aFootprintName );
806 void BuildCmpListBox();
807 void BuildFOOTPRINTS_LISTBOX();
808+ void BuildLIBRARY_LISTBOX();
809
810 /**
811 * Create or Update the frame showing the current highlighted footprint
812
813=== modified file 'cvpcb/cvstruct.h'
814--- cvpcb/cvstruct.h 2013-04-25 16:29:35 +0000
815+++ cvpcb/cvstruct.h 2013-05-28 08:42:14 +0000
816@@ -82,6 +82,8 @@
817 FOOTPRINT_LIST& aList );
818 void SetFootprintFilteredByPinCount( COMPONENT* aComponent,
819 FOOTPRINT_LIST& aList );
820+ void SetFootprintFilteredByLibraryList( FOOTPRINT_LIST& list,
821+ wxString SelectedLibrary );
822
823 /**
824 * Set the footprint list. We can have 2 footprint list:
825@@ -99,19 +101,38 @@
826 // Events functions:
827 void OnLeftClick( wxListEvent& event );
828 void OnLeftDClick( wxListEvent& event );
829-
830- /**
831- * Function OnChar
832- * called on a key pressed
833- * Call default handler for some special keys,
834- * and for "ascii" keys, select the first footprint
835- * that the name starts by the letter.
836- * This is the default behavior of a listbox, but because we use
837- * virtual lists, the listbox does not know anything to what is displayed,
838- * we must handle this behavior here.
839- * Furthermore the footprint name is not at the beginning of
840- * displayed lines (the first word is the line number)
841- */
842+ void OnChar( wxKeyEvent& event );
843+
844+ DECLARE_EVENT_TABLE()
845+};
846+
847+/******************************************/
848+/* ListBox showing the list of library */
849+/******************************************/
850+
851+class LIBRARY_LISTBOX : public ITEMS_LISTBOX_BASE
852+{
853+//private:
854+
855+public:
856+ wxArrayString m_LibraryList;
857+public:
858+ LIBRARY_LISTBOX( CVPCB_MAINFRAME* parent, wxWindowID id,
859+ const wxPoint& loc, const wxSize& size,
860+ int nbitems, wxString choice[] );
861+ ~LIBRARY_LISTBOX();
862+
863+ int GetCount();
864+ void SetSelection( unsigned index, bool State = true );
865+ void SetString( unsigned linecount, const wxString& text );
866+ void AppendLine( const wxString& text );
867+ void SetLibraryList( wxArrayString list );
868+
869+ wxString GetSelectedLibrary();
870+ wxString OnGetItemText( long item, long column ) const;
871+
872+ // Events functions:
873+ void OnLeftClick( wxListEvent& event );
874 void OnChar( wxKeyEvent& event );
875
876 DECLARE_EVENT_TABLE()
877
878=== modified file 'cvpcb/dialogs/dialog_cvpcb_config.cpp'
879--- cvpcb/dialogs/dialog_cvpcb_config.cpp 2013-04-09 17:49:01 +0000
880+++ cvpcb/dialogs/dialog_cvpcb_config.cpp 2013-05-28 08:02:33 +0000
881@@ -156,6 +156,7 @@
882
883 m_Parent->LoadFootprintFiles();
884 m_Parent->BuildFOOTPRINTS_LISTBOX();
885+ m_Parent->BuildLIBRARY_LISTBOX();
886 }
887
888 wxCommandEvent evt( ID_SAVE_PROJECT );
889
890=== modified file 'cvpcb/dialogs/dialog_display_options.cpp'
891--- cvpcb/dialogs/dialog_display_options.cpp 2013-02-02 19:10:48 +0000
892+++ cvpcb/dialogs/dialog_display_options.cpp 2013-05-28 08:07:57 +0000
893@@ -32,6 +32,7 @@
894 #include <cvpcb.h>
895 #include <class_drawpanel.h>
896 #include <footprint_info.h>
897+#include <library_select.h>
898 #include <cvstruct.h>
899 #include <class_DisplayFootprintsFrame.h>
900
901
902=== modified file 'cvpcb/listboxes.cpp'
903--- cvpcb/listboxes.cpp 2013-04-28 20:20:40 +0000
904+++ cvpcb/listboxes.cpp 2013-05-28 08:43:18 +0000
905@@ -151,3 +151,29 @@
906 m_FootprintList->SetFootprintFullList( m_footprints );
907 DisplayStatus();
908 }
909+
910+/*
911+ * Create or update the library list.
912+ */
913+void CVPCB_MAINFRAME::BuildLIBRARY_LISTBOX()
914+{
915+ wxString msg;
916+ wxSize size( 10, 10 );
917+ wxFont guiFont = wxSystemSettings::GetFont( wxSYS_DEFAULT_GUI_FONT );
918+
919+ if( m_LibraryList == NULL )
920+ {
921+ m_LibraryList = new LIBRARY_LISTBOX( this, ID_CVPCB_LIBRARY_LIST,
922+ wxDefaultPosition, size,
923+ 0 , NULL );
924+ m_LibraryList->SetBackgroundColour( wxColour( 255, 255, 255 ) );
925+ m_LibraryList->SetForegroundColour( wxColour( 0, 0, 0 ) );
926+ m_LibraryList->SetFont( wxFont( guiFont.GetPointSize(),
927+ wxFONTFAMILY_MODERN,
928+ wxFONTSTYLE_NORMAL,
929+ wxFONTWEIGHT_NORMAL ) );
930+ //m_LibraryList->SetSingleStyle(wxLC_SINGLE_SEL,0); Does not work? Causes empty list. Why?
931+ }
932+
933+ m_LibraryList->SetLibraryList(m_ModuleLibNames);
934+}
935
936=== modified file 'cvpcb/readwrite_dlgs.cpp'
937--- cvpcb/readwrite_dlgs.cpp 2013-04-29 16:50:10 +0000
938+++ cvpcb/readwrite_dlgs.cpp 2013-05-29 10:15:05 +0000
939@@ -124,6 +124,7 @@
940 LoadProjectFile( m_NetlistFileName.GetFullPath() );
941 LoadFootprintFiles();
942 BuildFOOTPRINTS_LISTBOX();
943+ BuildLIBRARY_LISTBOX();
944
945 m_ListCmp->Clear();
946 m_undefinedComponentCnt = 0;
947
948=== modified file 'cvpcb/tool_cvpcb.cpp'
949--- cvpcb/tool_cvpcb.cpp 2013-02-02 17:39:59 +0000
950+++ cvpcb/tool_cvpcb.cpp 2013-05-28 08:45:44 +0000
951@@ -104,6 +104,12 @@
952 _( "Display the filtered footprint list by pin count for the current component" ),
953 wxEmptyString );
954
955+ m_mainToolBar->AddTool( ID_CVPCB_FOOTPRINT_DISPLAY_BY_LIBRARY_LIST,
956+ KiBitmap( module_library_list_xpm ),
957+ wxNullBitmap, true, NULL,
958+ _( "Display the footprint list from selected library" ),
959+ wxEmptyString );
960+
961 m_mainToolBar->AddTool( ID_CVPCB_FOOTPRINT_DISPLAY_FULL_LIST,
962 KiBitmap( module_full_list_xpm ),
963 wxNullBitmap, true, NULL,
964@@ -114,6 +120,7 @@
965 {
966 wxString key = wxT( FILTERFOOTPRINTKEY );
967 int opt = config->Read( key, (long) 1 );
968+ m_mainToolBar->ToggleTool( ID_CVPCB_FOOTPRINT_DISPLAY_BY_LIBRARY_LIST, opt == 3 );
969 m_mainToolBar->ToggleTool( ID_CVPCB_FOOTPRINT_DISPLAY_PIN_FILTERED_LIST, opt == 2 );
970 m_mainToolBar->ToggleTool( ID_CVPCB_FOOTPRINT_DISPLAY_FILTERED_LIST, opt == 1 );
971 m_mainToolBar->ToggleTool( ID_CVPCB_FOOTPRINT_DISPLAY_FULL_LIST, opt == 0 );
972
973=== modified file 'include/bitmaps.h'
974--- include/bitmaps.h 2013-03-01 19:59:29 +0000
975+++ include/bitmaps.h 2013-05-29 08:34:00 +0000
976@@ -279,6 +279,7 @@
977 EXTERN_BITMAP( module_wizard_xpm )
978 EXTERN_BITMAP( module_filtered_list_xpm )
979 EXTERN_BITMAP( module_pin_filtered_list_xpm )
980+EXTERN_BITMAP( module_library_list_xpm )
981 EXTERN_BITMAP( module_full_list_xpm )
982 EXTERN_BITMAP( module_options_xpm )
983 EXTERN_BITMAP( module_ratsnest_xpm )
984
985=== modified file 'include/footprint_info.h'
986--- include/footprint_info.h 2013-05-28 16:54:59 +0000
987+++ include/footprint_info.h 2013-05-29 08:16:02 +0000
988@@ -45,10 +45,9 @@
989 */
990 class FOOTPRINT_INFO
991 {
992+public:
993 wxString m_libName; ///< Name of the library containing this module excluding path and ext.
994 wxString m_libPath; ///< The full library name and path associated the footprint.
995-
996-public:
997 wxString m_Module; ///< Module name.
998 int m_Num; ///< Order number in the display list.
999 wxString m_Doc; ///< Footprint description.
1000
1001=== added file 'include/library_select.h'
1002--- include/library_select.h 1970-01-01 00:00:00 +0000
1003+++ include/library_select.h 2013-05-29 06:35:40 +0000
1004@@ -0,0 +1,65 @@
1005+/*
1006+ * @file library_select.h
1007+ */
1008+
1009+#ifndef LIBRARY_SELECT_H_
1010+#define LIBRARY_SELECT_H_
1011+
1012+#include <boost/ptr_container/ptr_vector.hpp>
1013+#include <boost/foreach.hpp>
1014+
1015+#include <kicad_string.h>
1016+
1017+/*
1018+ * Class LIBRARY_SELECT
1019+ * is a helper class to handle the list of libraries
1020+ */
1021+
1022+class LIBRARY_INFO
1023+{
1024+public:
1025+ wxString m_LibName; ///< Full name (with path) of the library
1026+ int m_Num; ///< Order number in the display list.
1027+ LIBRARY_INFO()
1028+ {
1029+ m_Num = 0;
1030+ }
1031+};
1032+
1033+class LIBRARY_LIST
1034+{
1035+public:
1036+ boost::ptr_vector< LIBRARY_INFO > m_List;
1037+ wxString m_filesNotFound;
1038+ wxString m_filesInvalid;
1039+
1040+public:
1041+
1042+ /**
1043+ * Function GetCount
1044+ * @return the number of items stored in list
1045+ */
1046+ unsigned GetCount() const { return m_List.size(); }
1047+
1048+ /**
1049+ * Function GetItem
1050+ * @return the aIdx item in list
1051+ * @param aIdx = index of the given item
1052+ */
1053+ LIBRARY_INFO & GetItem( unsigned aIdx )
1054+ {
1055+ return m_List[aIdx];
1056+ }
1057+
1058+ /**
1059+ * Function AddItem
1060+ * add aItem in list
1061+ * @param aItem = item to add
1062+ */
1063+ void AddItem( LIBRARY_INFO* aItem )
1064+ {
1065+ m_List.push_back( aItem);
1066+ }
1067+};
1068+
1069+#endif // LIBRARY_SELECT_H_
Revision history for this message
Wayne Stambaugh (stambaughw) wrote :

On 5/29/2013 10:43 AM, Michal Jahelka wrote:
> Hello,
>
> my branch is done.
>
> But I am not programmer (i only program microcontrollers), so i do not
> understand what did you mean with doxygen. I tried to program it in the
> same style like other source code in kicad (taken for example
> class_footprint_listbox, copied to class_library_listbox and
> rename/rewrite parts of code). I tried to repair some spaces, what i saw
> in kdiff. KiCAD programming was my first c++ and first wx programming
> (first branch taken 4 months).

Doxygen comments are used to create the developers documentation in
HTML. The coding policy which can be found in the KiCad sources states
that Doxygen comments should be put in the header file. The only
exception is for static functions that are only defined in the source
file. Since you copied them from another file to create your patch, you
get a free pass this time :)

>
> Branch is in
> https://code.launchpad.net/~michal-jahelka/kicad/LibrarySelect, sending
> patch too.
> Should I delete old branch, or you do? When tried update it didnt want,
> wrote different. So I had to make new branch, it is 4176.

Once the patch is committed, you can delete your branch from Launchpad
if your not going to use it for anything else.

>
> Second thing, I created some libraries, modules and 3D packages. Is
> something similar like launchpad to put it there? I know about
> kicadlib.org, but it has no member access, like bzr.

You can create a patch and hopefully one of the library maintainers will
review and apply your patch.

>
> Michal Jahelka
>
>
>
>
>
> Dne 24.5.2013 17:12, Wayne Stambaugh napsal(a):
>> This merge request no longer applies cleanly to the head of the testing branch. If you would like me to consider this merge request, please update your branch and fix any conflicts. I will soon be working on the footprint library table code for CvPcb so if you do not update this reasonably soon, I suspect there will be some considerable divergence from the current CvPcb code which will make maintaining your changes more difficult. Also, I noticed a few issues with this merge request. Doxygen comments should be placed in the header file (LIBRARY_LISTBOX::OnChar()) and your editor appears to be leaving trailing white space. Thank you for your interest in help KiCad.
>>
>> Wayne
>
>

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bitmaps_png/CMakeLists.txt'
2--- bitmaps_png/CMakeLists.txt 2013-03-01 19:59:29 +0000
3+++ bitmaps_png/CMakeLists.txt 2013-04-01 07:55:27 +0000
4@@ -359,6 +359,7 @@
5 module_full_list
6 module_options
7 module_pin_filtered_list
8+ module_library_list
9 module_ratsnest
10 module
11 modview_icon
12
13=== added file 'bitmaps_png/cpp_26/module_library_list.cpp'
14--- bitmaps_png/cpp_26/module_library_list.cpp 1970-01-01 00:00:00 +0000
15+++ bitmaps_png/cpp_26/module_library_list.cpp 2013-04-01 07:55:27 +0000
16@@ -0,0 +1,83 @@
17+
18+/* Do not modify this file, it was automatically generated by the
19+ * PNG2cpp CMake script, using a *.png file as input.
20+ */
21+
22+#include <bitmaps.h>
23+
24+static const unsigned char png[] = {
25+ 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52,
26+ 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x1a, 0x08, 0x06, 0x00, 0x00, 0x00, 0xa9, 0x4a, 0x4c,
27+ 0xce, 0x00, 0x00, 0x00, 0x04, 0x73, 0x42, 0x49, 0x54, 0x08, 0x08, 0x08, 0x08, 0x7c, 0x08, 0x64,
28+ 0x88, 0x00, 0x00, 0x00, 0x09, 0x70, 0x48, 0x59, 0x73, 0x00, 0x00, 0x0d, 0xd7, 0x00, 0x00, 0x0d,
29+ 0xd7, 0x01, 0x42, 0x28, 0x9b, 0x78, 0x00, 0x00, 0x00, 0x19, 0x74, 0x45, 0x58, 0x74, 0x53, 0x6f,
30+ 0x66, 0x74, 0x77, 0x61, 0x72, 0x65, 0x00, 0x77, 0x77, 0x77, 0x2e, 0x69, 0x6e, 0x6b, 0x73, 0x63,
31+ 0x61, 0x70, 0x65, 0x2e, 0x6f, 0x72, 0x67, 0x9b, 0xee, 0x3c, 0x1a, 0x00, 0x00, 0x03, 0xd2, 0x49,
32+ 0x44, 0x41, 0x54, 0x48, 0x89, 0xbd, 0x96, 0x5d, 0x48, 0x5b, 0x67, 0x18, 0xc7, 0x7f, 0xe7, 0x23,
33+ 0x59, 0xac, 0x4e, 0x4f, 0xac, 0x46, 0x11, 0xa9, 0xab, 0x8d, 0xd2, 0xb1, 0xd1, 0x3b, 0xc7, 0x7a,
34+ 0xb1, 0x3a, 0xb5, 0x89, 0x66, 0xcd, 0x56, 0x99, 0x05, 0xe9, 0x10, 0xec, 0xcd, 0xae, 0xa4, 0x20,
35+ 0x82, 0xd7, 0xcd, 0x95, 0x17, 0xdd, 0xc5, 0x7a, 0xd1, 0x1b, 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, 0x73, 0x73, 0x93, 0xc0, 0x52,
91+ 0x80, 0x85, 0x85, 0x05, 0xfd, 0x9a, 0x70, 0xd8, 0xcf, 0xad, 0xfa, 0xfa, 0x7a, 0x1f, 0x70, 0x66,
92+ 0x1f, 0xa9, 0xf7, 0x26, 0x26, 0x26, 0xec, 0x87, 0x36, 0x3a, 0xa8, 0xc4, 0x37, 0xe2, 0x02, 0xfc,
93+ 0x0f, 0xfd, 0x66, 0x6b, 0x49, 0xc9, 0xd5, 0xed, 0x5a, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e,
94+ 0x44, 0xae, 0x42, 0x60, 0x82
95+};
96+
97+const BITMAP_OPAQUE module_library_list_xpm[1] = {{ png, sizeof( png ), "module_library_list_xpm" }};
98+
99+//EOF
100
101=== added file 'bitmaps_png/sources/module_library_list.svg'
102--- bitmaps_png/sources/module_library_list.svg 1970-01-01 00:00:00 +0000
103+++ bitmaps_png/sources/module_library_list.svg 2013-04-01 07:55:27 +0000
104@@ -0,0 +1,172 @@
105+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
106+<svg
107+ xmlns:dc="http://purl.org/dc/elements/1.1/"
108+ xmlns:cc="http://creativecommons.org/ns#"
109+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
110+ xmlns:svg="http://www.w3.org/2000/svg"
111+ xmlns="http://www.w3.org/2000/svg"
112+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
113+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
114+ height="26"
115+ width="26"
116+ version="1.1"
117+ viewBox="0 0 26 26"
118+ id="svg2"
119+ inkscape:version="0.48.4 r9939"
120+ sodipodi:docname="module_filtered_list.svg">
121+ <metadata
122+ id="metadata56">
123+ <rdf:RDF>
124+ <cc:Work
125+ rdf:about="">
126+ <dc:format>image/svg+xml</dc:format>
127+ <dc:type
128+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
129+ <dc:title />
130+ </cc:Work>
131+ </rdf:RDF>
132+ </metadata>
133+ <defs
134+ id="defs54" />
135+ <sodipodi:namedview
136+ pagecolor="#ffffff"
137+ bordercolor="#666666"
138+ borderopacity="1"
139+ objecttolerance="10"
140+ gridtolerance="10"
141+ guidetolerance="10"
142+ inkscape:pageopacity="0"
143+ inkscape:pageshadow="2"
144+ inkscape:window-width="1920"
145+ inkscape:window-height="1015"
146+ id="namedview52"
147+ showgrid="true"
148+ inkscape:zoom="13.906434"
149+ inkscape:cx="19.918756"
150+ inkscape:cy="24.624712"
151+ inkscape:window-x="-4"
152+ inkscape:window-y="-4"
153+ inkscape:window-maximized="1"
154+ inkscape:current-layer="svg2"
155+ inkscape:snap-to-guides="false"
156+ inkscape:snap-grids="false">
157+ <inkscape:grid
158+ type="xygrid"
159+ id="grid3033"
160+ empspacing="5"
161+ visible="true"
162+ enabled="true"
163+ snapvisiblegridlinesonly="true" />
164+ </sodipodi:namedview>
165+ <rect
166+ transform="matrix(0,-1,1,0,0,0)"
167+ height="21.994465"
168+ width="12.99073"
169+ y="1.5596062"
170+ x="-17.520231"
171+ id="rect8"
172+ style="fill:#ffffff;stroke:#484848;stroke-width:0.99127513000000000;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
173+ <path
174+ d="m 1.5927632,8.9410802 a 2.0341261,1.8090857 0 1 1 0.012585,3.6181538"
175+ id="path10"
176+ inkscape:connector-curvature="0"
177+ style="fill:none;stroke:#484848;stroke-width:0.99127518999999997;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
178+ <rect
179+ transform="matrix(0,-1,1,0,0,0)"
180+ height="3.9761357"
181+ width="5.9874525"
182+ y="3.5188339"
183+ x="-20.502354"
184+ id="rect30"
185+ style="fill:#ff7800;stroke:#484848;stroke-width:1;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
186+ <path
187+ 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"
188+ id="path32"
189+ inkscape:connector-curvature="0"
190+ style="fill:#ffede0;stroke:#484848;stroke-width:1;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
191+ <rect
192+ transform="matrix(0,-1,1,0,0,0)"
193+ height="3.9761357"
194+ width="5.9874525"
195+ y="10.507601"
196+ x="-20.513519"
197+ id="rect30-5"
198+ style="fill:#ff7800;stroke:#484848;stroke-width:1;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
199+ <path
200+ 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"
201+ id="path32-4"
202+ inkscape:connector-curvature="0"
203+ style="fill:#ffede0;stroke:#484848;stroke-width:1;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
204+ <rect
205+ transform="matrix(0,-1,1,0,0,0)"
206+ height="3.9761357"
207+ width="5.9874525"
208+ y="17.499128"
209+ x="-20.488094"
210+ id="rect30-2"
211+ style="fill:#ff7800;stroke:#484848;stroke-width:1;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
212+ <path
213+ 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"
214+ id="path32-0"
215+ inkscape:connector-curvature="0"
216+ style="fill:#ffede0;stroke:#484848;stroke-width:1;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
217+ <rect
218+ transform="matrix(0,-1,1,0,0,0)"
219+ height="3.9761357"
220+ width="5.9874525"
221+ y="3.5339792"
222+ x="-7.5303874"
223+ id="rect30-1"
224+ style="fill:#ff7800;stroke:#484848;stroke-width:1;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
225+ <path
226+ 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"
227+ id="path32-3"
228+ inkscape:connector-curvature="0"
229+ style="fill:#ffede0;stroke:#484848;stroke-width:1;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
230+ <rect
231+ transform="matrix(0,-1,1,0,0,0)"
232+ height="3.9761357"
233+ width="5.9874525"
234+ y="10.522747"
235+ x="-7.5415525"
236+ id="rect30-5-6"
237+ style="fill:#ff7800;stroke:#484848;stroke-width:1;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
238+ <path
239+ 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"
240+ id="path32-4-0"
241+ inkscape:connector-curvature="0"
242+ style="fill:#ffede0;stroke:#484848;stroke-width:1;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
243+ <rect
244+ transform="matrix(0,-1,1,0,0,0)"
245+ height="3.9761357"
246+ width="5.9874525"
247+ y="17.514275"
248+ x="-7.516129"
249+ id="rect30-2-8"
250+ style="fill:#ff7800;stroke:#484848;stroke-width:1;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
251+ <path
252+ 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"
253+ id="path32-0-4"
254+ inkscape:connector-curvature="0"
255+ style="fill:#ffede0;stroke:#484848;stroke-width:1;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
256+ <rect
257+ ry="0.95373797"
258+ height="13.958503"
259+ width="11.03963"
260+ y="10.016949"
261+ x="13.978938"
262+ id="rect42"
263+ style="fill:#3e3e3e" />
264+ <rect
265+ 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"
266+ id="rect3003"
267+ width="8.413372"
268+ height="11.649284"
269+ x="15.316651"
270+ y="11.114803" />
271+ <path
272+ style="fill:none;stroke:#008000;stroke-width:1.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none"
273+ d="m 17.97729,13.415897 0,7.119007 3.523549,0"
274+ id="path3005"
275+ inkscape:connector-curvature="0" />
276+</svg>
277
278=== modified file 'cvpcb/CMakeLists.txt'
279--- cvpcb/CMakeLists.txt 2012-12-29 09:54:25 +0000
280+++ cvpcb/CMakeLists.txt 2013-04-01 07:55:27 +0000
281@@ -36,6 +36,7 @@
282 class_components_listbox.cpp
283 class_DisplayFootprintsFrame.cpp
284 class_footprints_listbox.cpp
285+ class_library_listbox.cpp
286 cvframe.cpp
287 cvpcb.cpp
288 listboxes.cpp
289
290=== modified file 'cvpcb/class_components_listbox.cpp'
291--- cvpcb/class_components_listbox.cpp 2012-11-28 15:24:53 +0000
292+++ cvpcb/class_components_listbox.cpp 2013-04-01 07:55:27 +0000
293@@ -113,13 +113,16 @@
294 {
295 case WXK_HOME:
296 case WXK_END:
297- case WXK_UP:
298+ case WXK_UP:
299 case WXK_DOWN:
300 case WXK_PAGEUP:
301 case WXK_PAGEDOWN:
302+ event.Skip();
303+ return;
304+
305 case WXK_LEFT:
306 case WXK_NUMPAD_LEFT:
307- event.Skip();
308+ GetParent()->m_LibraryList->SetFocus();
309 return;
310
311 case WXK_RIGHT:
312
313=== modified file 'cvpcb/class_footprints_listbox.cpp'
314--- cvpcb/class_footprints_listbox.cpp 2012-05-25 06:58:52 +0000
315+++ cvpcb/class_footprints_listbox.cpp 2013-04-01 07:55:27 +0000
316@@ -6,6 +6,8 @@
317 #include <fctsys.h>
318 #include <wxstruct.h>
319 #include <macros.h>
320+#include <appl_wxstruct.h>
321+#include <wildcards_and_files_ext.h>
322
323 #include <cvpcb.h>
324 #include <cvpcb_mainframe.h>
325@@ -204,6 +206,42 @@
326 Refresh();
327 }
328
329+void FOOTPRINTS_LISTBOX::SetFootprintFilteredByLibraryList( FOOTPRINT_LIST& list,
330+ wxString SelectedLibrary ) {
331+ wxString msg;
332+ int oldSelection = GetSelection();
333+ bool hasItem = false;
334+
335+ wxFileName filename = SelectedLibrary;
336+ filename.SetExt( LegacyFootprintLibPathExtension );
337+ wxString FullLibraryName = wxGetApp().FindLibraryPath( filename );
338+
339+ m_FilteredFootprintList.Clear();
340+
341+ for( unsigned ii = 0; ii < list.GetCount(); ii++ )
342+ {
343+ FOOTPRINT_INFO& footprint = list.GetItem(ii);
344+ wxString LibName = footprint.m_LibName;
345+ if( LibName.Matches( FullLibraryName ) )
346+ {
347+ msg.Printf( wxT( "%3d %s" ), m_FilteredFootprintList.GetCount() + 1,
348+ footprint.m_Module.GetData() );
349+ m_FilteredFootprintList.Add( msg );
350+ hasItem = true;
351+ }
352+ }
353+
354+ if( hasItem )
355+ SetActiveFootprintList( false );
356+ else
357+ SetActiveFootprintList( true );
358+
359+ if( ( GetCount() == 0 ) || ( oldSelection >= GetCount() ) )
360+ SetSelection( 0, true );
361+
362+ Refresh();
363+}
364+
365 /** Set the footprint list. We can have 2 footprint list:
366 * The full footprint list
367 * The filtered footprint list (if the current selected component has a
368
369=== added file 'cvpcb/class_library_listbox.cpp'
370--- cvpcb/class_library_listbox.cpp 1970-01-01 00:00:00 +0000
371+++ cvpcb/class_library_listbox.cpp 2013-04-01 07:55:27 +0000
372@@ -0,0 +1,204 @@
373+/**
374+ * @file class_library_listbox.cpp
375+ * class to display used library and selecting it
376+ */
377+
378+#include <fctsys.h>
379+#include <wxstruct.h>
380+#include <macros.h>
381+
382+#include <cvpcb.h>
383+#include <cvpcb_mainframe.h>
384+#include <cvstruct.h>
385+
386+
387+/***************************************/
388+/* ListBox handling the library list */
389+/***************************************/
390+
391+LIBRARY_LISTBOX::LIBRARY_LISTBOX( CVPCB_MAINFRAME* parent,
392+ wxWindowID id, const wxPoint& loc,
393+ const wxSize& size,
394+ int nbitems, wxString choice[] ) :
395+ ITEMS_LISTBOX_BASE( parent, id, loc, size )
396+{
397+ //ListLibraries();
398+}
399+
400+
401+LIBRARY_LISTBOX::~LIBRARY_LISTBOX()
402+{
403+}
404+
405+
406+/*
407+ * Return number of items
408+ */
409+int LIBRARY_LISTBOX::GetCount()
410+{
411+ return m_LibraryList.Count();
412+}
413+
414+
415+/*
416+ * Change an item text
417+ */
418+void LIBRARY_LISTBOX::SetString( unsigned linecount, const wxString& text )
419+{
420+ if( linecount >= m_LibraryList.Count() )
421+ linecount = m_LibraryList.Count() - 1;
422+ if( linecount >= 0 )
423+ m_LibraryList[linecount] = text;
424+}
425+
426+
427+wxString LIBRARY_LISTBOX::GetSelectedLibrary()
428+{
429+ wxString libraryName;
430+ int ii = GetFirstSelected();
431+
432+ if( ii >= 0 )
433+ {
434+ libraryName = m_LibraryList[ii];
435+ }
436+
437+ return libraryName;
438+}
439+
440+
441+void LIBRARY_LISTBOX::AppendLine( const wxString& text )
442+{
443+ m_LibraryList.Add( text );
444+ SetItemCount( m_LibraryList.Count() );
445+}
446+
447+
448+/*
449+ * Overlaid function: MUST be provided in wxLC_VIRTUAL mode
450+ * because real data is not handled by ITEMS_LISTBOX_BASE
451+ */
452+wxString LIBRARY_LISTBOX::OnGetItemText( long item, long column ) const
453+{
454+ return m_LibraryList.Item( item );
455+}
456+
457+/*
458+ * Enable or disable an item
459+ */
460+void LIBRARY_LISTBOX::SetSelection( unsigned index, bool State )
461+{
462+ if( (int) index >= GetCount() )
463+ index = GetCount() - 1;
464+
465+ if( (index >= 0) && (GetCount() > 0) )
466+ {
467+#ifndef __WXMAC__
468+ Select( index, State );
469+#endif
470+ EnsureVisible( index );
471+#ifdef __WXMAC__
472+ Refresh();
473+#endif
474+ }
475+}
476+
477+
478+void LIBRARY_LISTBOX::SetLibraryList( wxArrayString list )
479+{
480+ wxString msg;
481+ int oldSelection = GetSelection();
482+
483+ m_LibraryList.Clear();
484+
485+ for( unsigned ii = 0; ii < list.GetCount(); ii++ )
486+ {
487+ msg = list.Item(ii);
488+ m_LibraryList.Add( msg );
489+ }
490+
491+ SetItemCount(list.GetCount());
492+
493+ if( GetCount() == 0 || oldSelection < 0 || oldSelection >= GetCount() )
494+ SetSelection( 0, true );
495+ Refresh();
496+}
497+
498+
499+/**************************************/
500+/* Event table for the library list */
501+/**************************************/
502+
503+BEGIN_EVENT_TABLE( LIBRARY_LISTBOX, ITEMS_LISTBOX_BASE )
504+EVT_SIZE( ITEMS_LISTBOX_BASE::OnSize )
505+EVT_CHAR( LIBRARY_LISTBOX::OnChar )
506+END_EVENT_TABLE()
507+
508+
509+/**
510+ * Function OnChar
511+ * called on a key pressed
512+ * Call default handler for some special keys,
513+ * and for "ascii" keys, select the first footprint
514+ * that the name starts by the letter.
515+ * This is the defaut behaviour of a listbox, but because we use
516+ * virtual lists, the listbox does not know anything to what is displayed,
517+ * we must handle this behaviour here.
518+ * Furthermore the footprint name is not at the beginning of
519+ * displayed lines (the first word is the line number)
520+ */
521+void LIBRARY_LISTBOX::OnChar( wxKeyEvent& event )
522+{
523+ int key = event.GetKeyCode();
524+ switch( key )
525+ {
526+ case WXK_RIGHT:
527+ case WXK_NUMPAD_RIGHT:
528+ GetParent()->m_ListCmp->SetFocus();
529+ return;
530+
531+ case WXK_HOME:
532+ case WXK_END:
533+ case WXK_UP:
534+ case WXK_DOWN:
535+ case WXK_PAGEUP:
536+ case WXK_PAGEDOWN:
537+ case WXK_LEFT:
538+ case WXK_NUMPAD_LEFT:
539+ event.Skip();
540+ return;
541+
542+ default:
543+ break;
544+ }
545+ // Search for an item name starting by the key code:
546+ key = toupper(key);
547+ for( unsigned ii = 0; ii < m_LibraryList.GetCount(); ii++ )
548+ {
549+ wxString text = m_LibraryList.Item(ii);
550+ /* search for the start char of the footprint name.
551+ * we must skip the line number
552+ */
553+ text.Trim(false); // Remove leading spaces in line
554+ unsigned jj = 0;
555+ for( ; jj < text.Len(); jj++ )
556+ {
557+ // skip line number
558+ if( text[jj] == ' ' )
559+ break;
560+ }
561+
562+ for( ; jj < text.Len(); jj++ )
563+ { // skip blanks
564+ if( text[jj] != ' ' )
565+ break;
566+ }
567+
568+ int start_char = toupper( text[jj] );
569+ if( key == start_char )
570+ {
571+ Focus( ii );
572+ SetSelection( ii, true ); // Ensure visible
573+ break;
574+ }
575+ }
576+}
577
578=== modified file 'cvpcb/cvframe.cpp'
579--- cvpcb/cvframe.cpp 2013-02-02 17:39:59 +0000
580+++ cvpcb/cvframe.cpp 2013-04-01 07:55:27 +0000
581@@ -85,6 +85,8 @@
582 CVPCB_MAINFRAME::OnSelectFilteringFootprint )
583 EVT_TOOL( ID_CVPCB_FOOTPRINT_DISPLAY_PIN_FILTERED_LIST,
584 CVPCB_MAINFRAME::OnSelectFilteringFootprint )
585+ EVT_TOOL( ID_CVPCB_FOOTPRINT_DISPLAY_BY_LIBRARY_LIST,
586+ CVPCB_MAINFRAME::OnSelectFilteringFootprint )
587 EVT_TOOL( ID_CVPCB_FOOTPRINT_DISPLAY_FULL_LIST,
588 CVPCB_MAINFRAME::OnSelectFilteringFootprint )
589
590@@ -97,6 +99,7 @@
591 EVT_LIST_ITEM_SELECTED( ID_CVPCB_FOOTPRINT_LIST, CVPCB_MAINFRAME::OnLeftClick )
592 EVT_LIST_ITEM_ACTIVATED( ID_CVPCB_FOOTPRINT_LIST, CVPCB_MAINFRAME::OnLeftDClick )
593 EVT_LIST_ITEM_SELECTED( ID_CVPCB_COMPONENT_LIST, CVPCB_MAINFRAME::OnSelectComponent )
594+ EVT_LIST_ITEM_SELECTED( ID_CVPCB_LIBRARY_LIST, CVPCB_MAINFRAME::OnSelectComponent )
595
596 EVT_UPDATE_UI( ID_CVPCB_CONFIG_KEEP_OPEN_ON_SAVE, CVPCB_MAINFRAME::OnUpdateKeepOpenOnSave )
597 END_EVENT_TABLE()
598@@ -112,6 +115,7 @@
599
600 m_ListCmp = NULL;
601 m_FootprintList = NULL;
602+ m_LibraryList = NULL;
603 m_DisplayFootprintFrame = NULL;
604 m_mainToolBar = NULL;
605 m_modified = false;
606@@ -160,6 +164,7 @@
607 // Create list of available modules and components of the schematic
608 BuildCmpListBox();
609 BuildFOOTPRINTS_LISTBOX();
610+ BuildLIBRARY_LISTBOX();
611
612 m_auimgr.SetManagedWindow( this );
613
614@@ -179,10 +184,15 @@
615 m_auimgr.AddPane( m_ListCmp,
616 wxAuiPaneInfo( horiz ).Name( wxT( "m_ListCmp" ) ).CentrePane() );
617
618+ if( m_LibraryList)
619+ m_auimgr.AddPane( m_LibraryList,
620+ wxAuiPaneInfo( info ).Name( wxT( "m_LibraryList" ) ).
621+ Left().BestSize( (int) ( m_FrameSize.x * 0.20 ), m_FrameSize.y ) );
622+
623 if( m_FootprintList )
624 m_auimgr.AddPane( m_FootprintList,
625 wxAuiPaneInfo( info ).Name( wxT( "m_FootprintList" ) ).
626- Right().BestSize( (int) ( m_FrameSize.x * 0.36 ), m_FrameSize.y ) );
627+ Right().BestSize( (int) ( m_FrameSize.x * 0.30 ), m_FrameSize.y ) );
628
629 m_auimgr.Update();
630 }
631@@ -523,9 +533,11 @@
632 #define REDRAW_LIST true
633 #define SELECT_FULL_LIST true
634 int selection = -1;
635+ wxString SelectedLibrary;
636
637 if( !m_mainToolBar->GetToolToggled( ID_CVPCB_FOOTPRINT_DISPLAY_FILTERED_LIST )
638 && !m_mainToolBar->GetToolToggled( ID_CVPCB_FOOTPRINT_DISPLAY_PIN_FILTERED_LIST )
639+ && !m_mainToolBar->GetToolToggled( ID_CVPCB_FOOTPRINT_DISPLAY_BY_LIBRARY_LIST )
640 )
641 m_FootprintList->SetActiveFootprintList( SELECT_FULL_LIST, REDRAW_LIST );
642
643@@ -548,6 +560,12 @@
644 m_footprints );
645 }
646 else
647+ if( m_mainToolBar->GetToolToggled( ID_CVPCB_FOOTPRINT_DISPLAY_BY_LIBRARY_LIST ) )
648+ {
649+ SelectedLibrary=m_LibraryList->GetSelectedLibrary();
650+ m_FootprintList->SetFootprintFilteredByLibraryList( m_footprints, SelectedLibrary );
651+ }
652+ else
653 {
654 m_FootprintList->SetFootprintFilteredList( &m_components[ selection ],
655 m_footprints );
656@@ -610,16 +628,25 @@
657 case ID_CVPCB_FOOTPRINT_DISPLAY_PIN_FILTERED_LIST:
658 m_mainToolBar->ToggleTool( ID_CVPCB_FOOTPRINT_DISPLAY_FULL_LIST, false );
659 m_mainToolBar->ToggleTool( ID_CVPCB_FOOTPRINT_DISPLAY_FILTERED_LIST, false );
660+ m_mainToolBar->ToggleTool( ID_CVPCB_FOOTPRINT_DISPLAY_BY_LIBRARY_LIST, false );
661 break;
662
663 case ID_CVPCB_FOOTPRINT_DISPLAY_FILTERED_LIST:
664 m_mainToolBar->ToggleTool( ID_CVPCB_FOOTPRINT_DISPLAY_FULL_LIST, false );
665 m_mainToolBar->ToggleTool( ID_CVPCB_FOOTPRINT_DISPLAY_PIN_FILTERED_LIST, false );
666+ m_mainToolBar->ToggleTool( ID_CVPCB_FOOTPRINT_DISPLAY_BY_LIBRARY_LIST, false );
667 break;
668
669 case ID_CVPCB_FOOTPRINT_DISPLAY_FULL_LIST:
670 m_mainToolBar->ToggleTool( ID_CVPCB_FOOTPRINT_DISPLAY_FILTERED_LIST, false );
671 m_mainToolBar->ToggleTool( ID_CVPCB_FOOTPRINT_DISPLAY_PIN_FILTERED_LIST, false );
672+ m_mainToolBar->ToggleTool( ID_CVPCB_FOOTPRINT_DISPLAY_BY_LIBRARY_LIST, false );
673+ break;
674+
675+ case ID_CVPCB_FOOTPRINT_DISPLAY_BY_LIBRARY_LIST:
676+ m_mainToolBar->ToggleTool( ID_CVPCB_FOOTPRINT_DISPLAY_FULL_LIST, false );
677+ m_mainToolBar->ToggleTool( ID_CVPCB_FOOTPRINT_DISPLAY_FILTERED_LIST, false );
678+ m_mainToolBar->ToggleTool( ID_CVPCB_FOOTPRINT_DISPLAY_PIN_FILTERED_LIST, false );
679 break;
680
681 default:
682
683=== modified file 'cvpcb/cvpcb.cpp'
684--- cvpcb/cvpcb.cpp 2012-05-10 06:25:27 +0000
685+++ cvpcb/cvpcb.cpp 2013-04-01 07:55:27 +0000
686@@ -102,6 +102,7 @@
687 frame->LoadProjectFile( filename.GetFullPath() );
688 frame->Show( true );
689 frame->BuildFOOTPRINTS_LISTBOX();
690+ frame->BuildLIBRARY_LISTBOX();
691
692 if( filename.IsOk() && filename.FileExists() )
693 {
694
695=== modified file 'cvpcb/cvpcb_id.h'
696--- cvpcb/cvpcb_id.h 2013-02-02 17:39:59 +0000
697+++ cvpcb/cvpcb_id.h 2013-04-01 07:55:27 +0000
698@@ -30,5 +30,7 @@
699 ID_CVPCB_FOOTPRINT_DISPLAY_FULL_LIST,
700 ID_CVPCB_FOOTPRINT_DISPLAY_FILTERED_LIST,
701 ID_CVPCB_FOOTPRINT_DISPLAY_PIN_FILTERED_LIST,
702- ID_CVPCB_CONFIG_KEEP_OPEN_ON_SAVE
703+ ID_CVPCB_FOOTPRINT_DISPLAY_BY_LIBRARY_LIST,
704+ ID_CVPCB_CONFIG_KEEP_OPEN_ON_SAVE,
705+ ID_CVPCB_LIBRARY_LIST
706 };
707
708=== modified file 'cvpcb/cvpcb_mainframe.h'
709--- cvpcb/cvpcb_mainframe.h 2013-02-02 17:39:59 +0000
710+++ cvpcb/cvpcb_mainframe.h 2013-04-01 07:55:27 +0000
711@@ -12,12 +12,14 @@
712 #include <param_config.h>
713 #include <cvpcb.h>
714 #include <footprint_info.h>
715+#include <library_select.h>
716
717
718 /* Forward declarations of all top-level window classes. */
719 class wxAuiToolBar;
720 class FOOTPRINTS_LISTBOX;
721 class COMPONENTS_LISTBOX;
722+class LIBRARY_LISTBOX;
723 class DISPLAY_FOOTPRINTS_FRAME;
724
725
726@@ -30,6 +32,7 @@
727
728 bool m_KeepCvpcbOpen;
729 FOOTPRINTS_LISTBOX* m_FootprintList;
730+ LIBRARY_LISTBOX* m_LibraryList;
731 COMPONENTS_LISTBOX* m_ListCmp;
732 DISPLAY_FOOTPRINTS_FRAME* m_DisplayFootprintFrame;
733 wxAuiToolBar* m_mainToolBar;
734@@ -131,6 +134,7 @@
735 void SetNewPkg( const wxString& aFootprintName );
736 void BuildCmpListBox();
737 void BuildFOOTPRINTS_LISTBOX();
738+ void BuildLIBRARY_LISTBOX();
739 void CreateScreenCmp();
740
741 /**
742
743=== modified file 'cvpcb/cvstruct.h'
744--- cvpcb/cvstruct.h 2012-09-26 15:36:48 +0000
745+++ cvpcb/cvstruct.h 2013-04-01 07:55:27 +0000
746@@ -57,6 +57,8 @@
747 FOOTPRINT_LIST& list );
748 void SetFootprintFilteredByPinCount( COMPONENT_INFO* Component,
749 FOOTPRINT_LIST& list );
750+ void SetFootprintFilteredByLibraryList( FOOTPRINT_LIST& list,
751+ wxString SelectedLibrary );
752 void SetActiveFootprintList( bool FullList, bool Redraw = false );
753
754 wxString GetSelectedFootprint();
755@@ -70,6 +72,38 @@
756 DECLARE_EVENT_TABLE()
757 };
758
759+/******************************************/
760+/* ListBox showing the list of library */
761+/******************************************/
762+
763+class LIBRARY_LISTBOX : public ITEMS_LISTBOX_BASE
764+{
765+//private:
766+
767+public:
768+ wxArrayString m_LibraryList;
769+public:
770+ LIBRARY_LISTBOX( CVPCB_MAINFRAME* parent, wxWindowID id,
771+ const wxPoint& loc, const wxSize& size,
772+ int nbitems, wxString choice[] );
773+ ~LIBRARY_LISTBOX();
774+
775+ int GetCount();
776+ void SetSelection( unsigned index, bool State = true );
777+ void SetString( unsigned linecount, const wxString& text );
778+ void AppendLine( const wxString& text );
779+ void SetLibraryList( wxArrayString list );
780+
781+ wxString GetSelectedLibrary();
782+ wxString OnGetItemText( long item, long column ) const;
783+
784+ // Events functions:
785+ void OnLeftClick( wxListEvent& event );
786+ void OnChar( wxKeyEvent& event );
787+
788+ DECLARE_EVENT_TABLE()
789+};
790+
791 /****************************************************/
792 /* ListBox showing the list of schematic components */
793 /****************************************************/
794
795=== modified file 'cvpcb/dialogs/dialog_cvpcb_config.cpp'
796--- cvpcb/dialogs/dialog_cvpcb_config.cpp 2012-11-19 16:19:38 +0000
797+++ cvpcb/dialogs/dialog_cvpcb_config.cpp 2013-04-01 07:55:27 +0000
798@@ -156,6 +156,7 @@
799
800 m_Parent->LoadFootprintFiles();
801 m_Parent->BuildFOOTPRINTS_LISTBOX();
802+ m_Parent->BuildLIBRARY_LISTBOX();
803 }
804
805 wxCommandEvent evt( ID_SAVE_PROJECT );
806
807=== modified file 'cvpcb/dialogs/dialog_display_options.cpp'
808--- cvpcb/dialogs/dialog_display_options.cpp 2013-02-02 19:10:48 +0000
809+++ cvpcb/dialogs/dialog_display_options.cpp 2013-04-01 07:55:27 +0000
810@@ -32,6 +32,7 @@
811 #include <cvpcb.h>
812 #include <class_drawpanel.h>
813 #include <footprint_info.h>
814+#include <library_select.h>
815 #include <cvstruct.h>
816 #include <class_DisplayFootprintsFrame.h>
817
818
819=== modified file 'cvpcb/listboxes.cpp'
820--- cvpcb/listboxes.cpp 2012-11-19 21:34:25 +0000
821+++ cvpcb/listboxes.cpp 2013-04-01 07:55:27 +0000
822@@ -124,3 +124,29 @@
823 m_FootprintList->SetFootprintFullList( m_footprints );
824 DisplayStatus();
825 }
826+
827+/*
828+ * Create or update the library list.
829+ */
830+void CVPCB_MAINFRAME::BuildLIBRARY_LISTBOX()
831+{
832+ wxString msg;
833+ wxSize size( 10, 10 );
834+ wxFont guiFont = wxSystemSettings::GetFont( wxSYS_DEFAULT_GUI_FONT );
835+
836+ if( m_LibraryList == NULL )
837+ {
838+ m_LibraryList = new LIBRARY_LISTBOX( this, ID_CVPCB_LIBRARY_LIST,
839+ wxDefaultPosition, size,
840+ 0 , NULL );
841+ m_LibraryList->SetBackgroundColour( wxColour( 255, 255, 255 ) );
842+ m_LibraryList->SetForegroundColour( wxColour( 0, 0, 0 ) );
843+ m_LibraryList->SetFont( wxFont( guiFont.GetPointSize(),
844+ wxFONTFAMILY_MODERN,
845+ wxFONTSTYLE_NORMAL,
846+ wxFONTWEIGHT_NORMAL ) );
847+ //m_LibraryList->SetSingleStyle(wxLC_SINGLE_SEL,0); Does not work? Causes empty list. Why?
848+ }
849+
850+ m_LibraryList->SetLibraryList(m_ModuleLibNames);
851+}
852
853=== modified file 'cvpcb/readwrite_dlgs.cpp'
854--- cvpcb/readwrite_dlgs.cpp 2013-02-02 17:39:59 +0000
855+++ cvpcb/readwrite_dlgs.cpp 2013-04-01 07:55:27 +0000
856@@ -136,6 +136,7 @@
857 LoadProjectFile( m_NetlistFileName.GetFullPath() );
858 LoadFootprintFiles();
859 BuildFOOTPRINTS_LISTBOX();
860+ BuildLIBRARY_LISTBOX();
861
862 m_ListCmp->Clear();
863 m_undefinedComponentCnt = 0;
864
865=== modified file 'cvpcb/tool_cvpcb.cpp'
866--- cvpcb/tool_cvpcb.cpp 2013-02-02 17:39:59 +0000
867+++ cvpcb/tool_cvpcb.cpp 2013-04-01 07:55:27 +0000
868@@ -103,6 +103,12 @@
869 true, NULL,
870 _( "Display the filtered footprint list by pin count for the current component" ),
871 wxEmptyString );
872+
873+ m_mainToolBar->AddTool( ID_CVPCB_FOOTPRINT_DISPLAY_BY_LIBRARY_LIST,
874+ KiBitmap( module_library_list_xpm ),
875+ wxNullBitmap, true, NULL,
876+ _( "Display the footprint list from selected library" ),
877+ wxEmptyString );
878
879 m_mainToolBar->AddTool( ID_CVPCB_FOOTPRINT_DISPLAY_FULL_LIST,
880 KiBitmap( module_full_list_xpm ),
881@@ -114,6 +120,7 @@
882 {
883 wxString key = wxT( FILTERFOOTPRINTKEY );
884 int opt = config->Read( key, (long) 1 );
885+ m_mainToolBar->ToggleTool( ID_CVPCB_FOOTPRINT_DISPLAY_BY_LIBRARY_LIST, opt == 3 );
886 m_mainToolBar->ToggleTool( ID_CVPCB_FOOTPRINT_DISPLAY_PIN_FILTERED_LIST, opt == 2 );
887 m_mainToolBar->ToggleTool( ID_CVPCB_FOOTPRINT_DISPLAY_FILTERED_LIST, opt == 1 );
888 m_mainToolBar->ToggleTool( ID_CVPCB_FOOTPRINT_DISPLAY_FULL_LIST, opt == 0 );
889
890=== modified file 'include/bitmaps.h'
891--- include/bitmaps.h 2013-03-01 19:59:29 +0000
892+++ include/bitmaps.h 2013-04-01 07:55:27 +0000
893@@ -279,6 +279,7 @@
894 EXTERN_BITMAP( module_wizard_xpm )
895 EXTERN_BITMAP( module_filtered_list_xpm )
896 EXTERN_BITMAP( module_pin_filtered_list_xpm )
897+EXTERN_BITMAP( module_library_list_xpm )
898 EXTERN_BITMAP( module_full_list_xpm )
899 EXTERN_BITMAP( module_options_xpm )
900 EXTERN_BITMAP( module_ratsnest_xpm )
901
902=== added file 'include/library_select.h'
903--- include/library_select.h 1970-01-01 00:00:00 +0000
904+++ include/library_select.h 2013-04-01 07:55:27 +0000
905@@ -0,0 +1,65 @@
906+/*
907+ * @file library_select.h
908+ */
909+
910+#ifndef LIBRARY_SELECT_H_
911+#define LIBRARY_SELECT_H_
912+
913+#include <boost/ptr_container/ptr_vector.hpp>
914+#include <boost/foreach.hpp>
915+
916+#include <kicad_string.h>
917+
918+/*
919+ * Class LIBRARY_SELECT
920+ * is a helper class to handle the list of libraries
921+ */
922+
923+class LIBRARY_INFO
924+{
925+public:
926+ wxString m_LibName; ///< Full name (with path) of the library
927+ int m_Num; ///< Order number in the display list.
928+ LIBRARY_INFO()
929+ {
930+ m_Num = 0;
931+ }
932+};
933+
934+class LIBRARY_LIST
935+{
936+public:
937+ boost::ptr_vector< LIBRARY_INFO > m_List;
938+ wxString m_filesNotFound;
939+ wxString m_filesInvalid;
940+
941+public:
942+
943+ /**
944+ * Function GetCount
945+ * @return the number of items stored in list
946+ */
947+ unsigned GetCount() const { return m_List.size(); }
948+
949+ /**
950+ * Function GetItem
951+ * @return the aIdx item in list
952+ * @param aIdx = index of the given item
953+ */
954+ LIBRARY_INFO & GetItem( unsigned aIdx )
955+ {
956+ return m_List[aIdx];
957+ }
958+
959+ /**
960+ * Function AddItem
961+ * add aItem in list
962+ * @param aItem = item to add
963+ */
964+ void AddItem( LIBRARY_INFO* aItem )
965+ {
966+ m_List.push_back( aItem);
967+ }
968+};
969+
970+#endif // LIBRARY_SELECT_H_