kicad/cvpcb/cvstruct.h

193 lines
6.5 KiB
C
Raw Normal View History

/*********************************************************/
/* cvstruct.h */
/*********************************************************/
2007-05-06 16:03:28 +00:00
#ifndef CVSTRUCT_H
#define CVSTRUCT_H
#include "wx/listctrl.h"
#include <wx/filename.h>
#include "param_config.h"
#include "cvpcb.h"
2007-05-06 16:03:28 +00:00
/* Forward declarations of all top-level window classes. */
class FOOTPRINTS_LISTBOX;
class COMPONENTS_LISTBOX;
2010-02-01 21:23:27 +00:00
class DISPLAY_FOOTPRINTS_FRAME;
2007-05-06 16:03:28 +00:00
/**
* The CVPcb application main window.
*/
class WinEDA_CvpcbFrame : public WinEDA_BasicFrame
2007-05-06 16:03:28 +00:00
{
public:
bool m_KeepCvpcbOpen;
FOOTPRINTS_LISTBOX* m_FootprintList;
COMPONENTS_LISTBOX* m_ListCmp;
2010-02-01 21:23:27 +00:00
DISPLAY_FOOTPRINTS_FRAME* DrawFrame;
WinEDA_Toolbar* m_HToolBar;
wxFileName m_NetlistFileName;
wxArrayString m_ModuleLibNames;
wxArrayString m_AliasLibNames;
wxString m_UserLibraryPath;
wxString m_NetlistFileExtension;
wxString m_DocModulesFileName;
FOOTPRINT_LIST m_footprints;
COMPONENT_LIST m_components;
protected:
int m_undefinedComponentCnt;
bool m_modified;
bool m_rightJustify;
bool m_isEESchemaNetlist;
PARAM_CFG_ARRAY m_projectFileParams;
2007-05-06 16:03:28 +00:00
public:
WinEDA_CvpcbFrame( const wxString& title,
long style = KICAD_DEFAULT_DRAWFRAME_STYLE );
~WinEDA_CvpcbFrame();
void OnLeftClick( wxListEvent& event );
void OnLeftDClick( wxListEvent& event );
void OnSelectComponent( wxListEvent& event );
void Update_Config( wxCommandEvent& event );
void OnQuit( wxCommandEvent& event );
void OnCloseWindow( wxCloseEvent& Event );
void OnSize( wxSizeEvent& SizeEvent );
void OnChar( wxKeyEvent& event );
void ReCreateHToolbar();
virtual void ReCreateMenuBar();
void SetLanguage( wxCommandEvent& event );
void ToFirstNA( wxCommandEvent& event );
void ToPreviousNA( wxCommandEvent& event );
void DelAssociations( wxCommandEvent& event );
void SaveQuitCvpcb( wxCommandEvent& event );
void LoadNetList( wxCommandEvent& event );
void ConfigCvpcb( wxCommandEvent& event );
void OnKeepOpenOnSave( wxCommandEvent& event );
void DisplayModule( wxCommandEvent& event );
void AssocieModule( wxCommandEvent& event );
void WriteStuffList( wxCommandEvent& event );
void DisplayDocFile( wxCommandEvent& event );
void OnSelectFilteringFootprint( wxCommandEvent& event );
void OnUpdateKeepOpenOnSave( wxUpdateUIEvent& event );
void SetNewPkg( const wxString& package );
void BuildCmpListBox();
void BuildFOOTPRINTS_LISTBOX();
void CreateScreenCmp();
int SaveNetList( const wxString& FullFileName );
int SaveComponentList( const wxString& FullFileName );
bool ReadNetList();
int ReadSchematicNetlist();
void LoadProjectFile( const wxString& FileName );
void SaveProjectFile( const wxString& fileName );
virtual void LoadSettings();
virtual void SaveSettings();
/** DisplayStatus()
* Displays info to the status line at bottom of the main frame
*/
void DisplayStatus();
PARAM_CFG_ARRAY& GetProjectFileParameters( void );
DECLARE_EVENT_TABLE()
2007-05-06 16:03:28 +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:
ITEMS_LISTBOX_BASE( WinEDA_CvpcbFrame* aParent, wxWindowID aId,
const wxPoint& aLocation, const wxSize& aSize );
2007-05-06 16:03:28 +00:00
~ITEMS_LISTBOX_BASE();
2007-05-06 16:03:28 +00:00
int GetSelection();
void OnSize( wxSizeEvent& event );
virtual WinEDA_CvpcbFrame* GetParent();
2007-05-06 16:03:28 +00:00
};
/******************************************/
/* ListBox showing the list of footprints */
/******************************************/
2007-05-06 16:03:28 +00:00
class FOOTPRINTS_LISTBOX : public ITEMS_LISTBOX_BASE
2007-05-06 16:03:28 +00:00
{
private:
wxArrayString m_FullFootprintList;
wxArrayString m_FilteredFootprintList;
2007-05-06 16:03:28 +00:00
public:
wxArrayString* m_ActiveFootprintList;
bool m_UseFootprintFullList;
2007-05-06 16:03:28 +00:00
public:
FOOTPRINTS_LISTBOX( WinEDA_CvpcbFrame* parent, wxWindowID id,
const wxPoint& loc, const wxSize& size,
int nbitems, wxString choice[] );
~FOOTPRINTS_LISTBOX();
int GetCount();
void SetSelection( unsigned index, bool State = TRUE );
void SetString( unsigned linecount, const wxString& text );
void AppendLine( const wxString& text );
void SetFootprintFullList( FOOTPRINT_LIST& list );
void SetFootprintFilteredList( COMPONENT* Component,
FOOTPRINT_LIST& list );
void SetActiveFootprintList( bool FullList, bool Redraw = FALSE );
wxString GetSelectedFootprint();
wxString OnGetItemText( long item, long column ) const;
// Events functions:
void OnLeftClick( wxListEvent& event );
void OnLeftDClick( wxListEvent& event );
void OnChar( wxKeyEvent& event );
DECLARE_EVENT_TABLE()
2007-05-06 16:03:28 +00:00
};
/****************************************************/
/* ListBox showing the list of schematic components */
/****************************************************/
2007-05-06 16:03:28 +00:00
class COMPONENTS_LISTBOX : public ITEMS_LISTBOX_BASE
2007-05-06 16:03:28 +00:00
{
public:
wxArrayString m_ComponentList;
WinEDA_CvpcbFrame* m_Parent;
2007-05-06 16:03:28 +00:00
public:
COMPONENTS_LISTBOX( WinEDA_CvpcbFrame* parent, wxWindowID id,
const wxPoint& loc, const wxSize& size,
int nbitems, wxString choice[] );
2007-05-06 16:03:28 +00:00
~COMPONENTS_LISTBOX();
void Clear();
int GetCount();
wxString OnGetItemText( long item, long column ) const;
void SetSelection( unsigned index, bool State = TRUE );
void SetString( unsigned linecount, const wxString& text );
void AppendLine( const wxString& text );
// Events functions:
void OnChar( wxKeyEvent& event );
DECLARE_EVENT_TABLE()
2007-05-06 16:03:28 +00:00
};
#endif //#ifndef CVSTRUCT_H