2009-11-05 19:26:52 +00:00
|
|
|
/*********************************************************/
|
|
|
|
/* cvstruct.h */
|
|
|
|
/*********************************************************/
|
2007-05-06 16:03:28 +00:00
|
|
|
|
|
|
|
#ifndef CVSTRUCT_H
|
|
|
|
#define CVSTRUCT_H
|
|
|
|
|
2012-01-23 04:33:36 +00:00
|
|
|
#include <wx/listctrl.h>
|
|
|
|
#include <cvpcb.h>
|
2007-05-06 16:03:28 +00:00
|
|
|
|
|
|
|
/* Forward declarations of all top-level window classes. */
|
2011-02-05 16:15:48 +00:00
|
|
|
class CVPCB_MAINFRAME;
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2009-08-20 11:44:06 +00:00
|
|
|
/*********************************************************************/
|
|
|
|
/* ListBox (base class) to display lists of components or footprints */
|
|
|
|
/*********************************************************************/
|
|
|
|
class ITEMS_LISTBOX_BASE : public wxListView
|
2007-05-06 16:03:28 +00:00
|
|
|
{
|
|
|
|
public:
|
2011-02-05 16:15:48 +00:00
|
|
|
ITEMS_LISTBOX_BASE( CVPCB_MAINFRAME* aParent, wxWindowID aId,
|
2012-09-26 15:36:48 +00:00
|
|
|
const wxPoint& aLocation, const wxSize& aSize,
|
|
|
|
long aStyle = wxLC_SINGLE_SEL);
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2009-08-20 11:44:06 +00:00
|
|
|
~ITEMS_LISTBOX_BASE();
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2009-08-20 11:44:06 +00:00
|
|
|
int GetSelection();
|
|
|
|
void OnSize( wxSizeEvent& event );
|
2009-05-21 17:42:42 +00:00
|
|
|
|
2011-02-05 16:15:48 +00:00
|
|
|
virtual CVPCB_MAINFRAME* GetParent();
|
2007-05-06 16:03:28 +00:00
|
|
|
};
|
|
|
|
|
2009-08-20 11:44:06 +00:00
|
|
|
/******************************************/
|
|
|
|
/* ListBox showing the list of footprints */
|
|
|
|
/******************************************/
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2009-08-20 11:44:06 +00:00
|
|
|
class FOOTPRINTS_LISTBOX : public ITEMS_LISTBOX_BASE
|
2007-05-06 16:03:28 +00:00
|
|
|
{
|
|
|
|
private:
|
2008-04-17 16:25:29 +00:00
|
|
|
wxArrayString m_FullFootprintList;
|
|
|
|
wxArrayString m_FilteredFootprintList;
|
2007-05-06 16:03:28 +00:00
|
|
|
public:
|
2008-04-17 16:25:29 +00:00
|
|
|
wxArrayString* m_ActiveFootprintList;
|
|
|
|
bool m_UseFootprintFullList;
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2007-05-06 16:03:28 +00:00
|
|
|
public:
|
2011-02-05 16:15:48 +00:00
|
|
|
FOOTPRINTS_LISTBOX( CVPCB_MAINFRAME* parent, wxWindowID id,
|
2009-08-20 11:44:06 +00:00
|
|
|
const wxPoint& loc, const wxSize& size,
|
|
|
|
int nbitems, wxString choice[] );
|
|
|
|
~FOOTPRINTS_LISTBOX();
|
|
|
|
|
|
|
|
int GetCount();
|
2012-01-22 17:20:22 +00:00
|
|
|
void SetSelection( unsigned index, bool State = true );
|
2009-08-20 11:44:06 +00:00
|
|
|
void SetString( unsigned linecount, const wxString& text );
|
|
|
|
void AppendLine( const wxString& text );
|
|
|
|
void SetFootprintFullList( FOOTPRINT_LIST& list );
|
2012-02-01 19:49:37 +00:00
|
|
|
void SetFootprintFilteredList( COMPONENT_INFO* Component,
|
2009-08-20 11:44:06 +00:00
|
|
|
FOOTPRINT_LIST& list );
|
2012-03-15 18:20:22 +00:00
|
|
|
void SetFootprintFilteredByPinCount( COMPONENT_INFO* Component,
|
|
|
|
FOOTPRINT_LIST& list );
|
2012-01-22 17:20:22 +00:00
|
|
|
void SetActiveFootprintList( bool FullList, bool Redraw = false );
|
2009-08-20 11:44:06 +00:00
|
|
|
|
|
|
|
wxString GetSelectedFootprint();
|
|
|
|
wxString OnGetItemText( long item, long column ) const;
|
|
|
|
|
|
|
|
// Events functions:
|
|
|
|
void OnLeftClick( wxListEvent& event );
|
|
|
|
void OnLeftDClick( wxListEvent& event );
|
|
|
|
void OnChar( wxKeyEvent& event );
|
2008-04-17 16:25:29 +00:00
|
|
|
|
|
|
|
DECLARE_EVENT_TABLE()
|
2007-05-06 16:03:28 +00:00
|
|
|
};
|
|
|
|
|
2009-08-20 11:44:06 +00:00
|
|
|
/****************************************************/
|
|
|
|
/* ListBox showing the list of schematic components */
|
|
|
|
/****************************************************/
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2009-08-20 11:44:06 +00:00
|
|
|
class COMPONENTS_LISTBOX : public ITEMS_LISTBOX_BASE
|
2007-05-06 16:03:28 +00:00
|
|
|
{
|
|
|
|
public:
|
2008-04-17 16:25:29 +00:00
|
|
|
wxArrayString m_ComponentList;
|
2011-02-05 16:15:48 +00:00
|
|
|
CVPCB_MAINFRAME* m_Parent;
|
2007-05-06 16:03:28 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
|
2011-02-05 16:15:48 +00:00
|
|
|
COMPONENTS_LISTBOX( CVPCB_MAINFRAME* parent, wxWindowID id,
|
2009-08-20 11:44:06 +00:00
|
|
|
const wxPoint& loc, const wxSize& size,
|
|
|
|
int nbitems, wxString choice[] );
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2009-08-20 11:44:06 +00:00
|
|
|
~COMPONENTS_LISTBOX();
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2009-08-20 11:44:06 +00:00
|
|
|
void Clear();
|
|
|
|
int GetCount();
|
|
|
|
wxString OnGetItemText( long item, long column ) const;
|
2012-01-22 17:20:22 +00:00
|
|
|
void SetSelection( unsigned index, bool State = true );
|
2009-08-20 11:44:06 +00:00
|
|
|
void SetString( unsigned linecount, const wxString& text );
|
|
|
|
void AppendLine( const wxString& text );
|
|
|
|
|
|
|
|
// Events functions:
|
|
|
|
void OnChar( wxKeyEvent& event );
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2008-04-17 16:25:29 +00:00
|
|
|
DECLARE_EVENT_TABLE()
|
2007-05-06 16:03:28 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2008-04-17 16:25:29 +00:00
|
|
|
#endif //#ifndef CVSTRUCT_H
|