2008-04-17 16:25:29 +00:00
|
|
|
/***********************************************************/
|
2009-04-23 15:02:18 +00:00
|
|
|
/* cvstruct.h : */
|
2008-04-17 16:25:29 +00:00
|
|
|
/* descriptions des principales classes derivees utilisees */
|
|
|
|
/***********************************************************/
|
2007-05-06 16:03:28 +00:00
|
|
|
|
|
|
|
#ifndef CVSTRUCT_H
|
|
|
|
#define CVSTRUCT_H
|
|
|
|
|
2007-06-05 12:10:51 +00:00
|
|
|
#include "wx/listctrl.h"
|
2009-04-05 20:49:15 +00:00
|
|
|
#include <wx/filename.h>
|
2009-04-23 15:02:18 +00:00
|
|
|
#include "param_config.h"
|
|
|
|
#include "cvpcb.h"
|
2007-05-06 16:03:28 +00:00
|
|
|
|
|
|
|
/* Forward declarations of all top-level window classes. */
|
|
|
|
class FootprintListBox;
|
|
|
|
class ListBoxCmp;
|
|
|
|
class WinEDA_DisplayFrame;
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2008-04-17 16:25:29 +00:00
|
|
|
/******************************************************/
|
|
|
|
/* classe derivee pour la Fenetre principale de cvpcb */
|
|
|
|
/******************************************************/
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2008-04-17 16:25:29 +00:00
|
|
|
class WinEDA_CvpcbFrame : public WinEDA_BasicFrame
|
2007-05-06 16:03:28 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
2009-04-23 15:02:18 +00:00
|
|
|
bool m_KeepCvpcbOpen;
|
2008-04-17 16:25:29 +00:00
|
|
|
FootprintListBox* m_FootprintList;
|
|
|
|
ListBoxCmp* m_ListCmp;
|
|
|
|
WinEDA_DisplayFrame* DrawFrame;
|
|
|
|
WinEDA_Toolbar* m_HToolBar; // Toolbar horizontal haut d'ecran
|
2009-04-05 20:49:15 +00:00
|
|
|
wxFileName m_NetlistFileName;
|
2009-04-23 15:02:18 +00:00
|
|
|
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
|
|
|
|
2008-04-17 16:25:29 +00:00
|
|
|
// Constructor and destructor
|
2007-05-06 16:03:28 +00:00
|
|
|
public:
|
2008-12-08 15:27:13 +00:00
|
|
|
WinEDA_CvpcbFrame( const wxString &title,
|
|
|
|
long style = KICAD_DEFAULT_DRAWFRAME_STYLE );
|
2008-04-17 16:25:29 +00:00
|
|
|
~WinEDA_CvpcbFrame();
|
|
|
|
|
|
|
|
void OnLeftClick( wxListEvent& event );
|
|
|
|
void OnLeftDClick( wxListEvent& event );
|
|
|
|
void OnSelectComponent( wxListEvent& event );
|
|
|
|
|
|
|
|
void Update_Config( wxCommandEvent& event ); /* enregistrement de la config */
|
|
|
|
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 );
|
2009-04-23 15:02:18 +00:00
|
|
|
void OnKeepOpenOnSave( wxCommandEvent& event );
|
2008-04-17 16:25:29 +00:00
|
|
|
void DisplayModule( wxCommandEvent& event );
|
|
|
|
void AssocieModule( wxCommandEvent& event );
|
|
|
|
void WriteStuffList( wxCommandEvent& event );
|
|
|
|
void DisplayDocFile( wxCommandEvent& event );
|
|
|
|
void OnSelectFilteringFootprint( wxCommandEvent& event );
|
2009-04-23 15:02:18 +00:00
|
|
|
|
|
|
|
void OnUpdateKeepOpenOnSave( wxUpdateUIEvent& event );
|
|
|
|
|
2008-04-17 16:25:29 +00:00
|
|
|
void SetNewPkg( const wxString& package );
|
|
|
|
void BuildCmpListBox();
|
|
|
|
void BuildFootprintListBox();
|
|
|
|
void CreateScreenCmp();
|
|
|
|
int SaveNetList( const wxString& FullFileName );
|
|
|
|
int SaveComponentList( const wxString& FullFileName );
|
2009-04-05 20:49:15 +00:00
|
|
|
bool ReadNetList();
|
2008-04-17 16:25:29 +00:00
|
|
|
int rdpcad();
|
|
|
|
int ReadSchematicNetlist();
|
|
|
|
int ReadFootprintFilterList( FILE* f );
|
|
|
|
int ReadViewlogicWirList();
|
|
|
|
int ReadViewlogicNetList();
|
2009-04-23 15:02:18 +00:00
|
|
|
void LoadProjectFile( const wxString& FileName );
|
|
|
|
void SaveProjectFile( const wxString& fileName );
|
|
|
|
virtual void LoadSettings();
|
|
|
|
virtual void SaveSettings();
|
|
|
|
|
2009-05-21 17:42:42 +00:00
|
|
|
PARAM_CFG_ARRAY& GetProjectFileParameters( void );
|
2008-04-17 16:25:29 +00:00
|
|
|
|
|
|
|
DECLARE_EVENT_TABLE()
|
2007-05-06 16:03:28 +00:00
|
|
|
};
|
|
|
|
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2007-05-06 16:03:28 +00:00
|
|
|
/***********************************************/
|
|
|
|
/* ListBox derivee pour l'affichage des listes */
|
|
|
|
/***********************************************/
|
2009-05-21 17:42:42 +00:00
|
|
|
class ListBoxBase : public wxListView
|
2007-05-06 16:03:28 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
2008-04-17 16:25:29 +00:00
|
|
|
ListBoxBase( WinEDA_CvpcbFrame * parent, wxWindowID id,
|
2009-04-23 15:02:18 +00:00
|
|
|
const wxPoint &loc, const wxSize &size );
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2008-04-17 16:25:29 +00:00
|
|
|
~ListBoxBase();
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2008-04-17 16:25:29 +00:00
|
|
|
int GetSelection();
|
|
|
|
void OnSize( wxSizeEvent& event );
|
2009-05-21 17:42:42 +00:00
|
|
|
|
|
|
|
virtual WinEDA_CvpcbFrame* GetParent();
|
|
|
|
|
2007-05-06 16:03:28 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/************************************************************/
|
|
|
|
/* ListBox derivee pour l'affichage de la liste des Modules */
|
|
|
|
/************************************************************/
|
|
|
|
|
2008-04-17 16:25:29 +00:00
|
|
|
class FootprintListBox : public ListBoxBase
|
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:
|
2009-04-23 15:02:18 +00:00
|
|
|
FootprintListBox( WinEDA_CvpcbFrame * parent, wxWindowID id,
|
|
|
|
const wxPoint &loc, const wxSize &size,
|
|
|
|
int nbitems, wxString choice[] );
|
2008-04-17 16:25:29 +00:00
|
|
|
~FootprintListBox();
|
|
|
|
|
|
|
|
int GetCount();
|
|
|
|
void SetSelection( unsigned index, bool State = TRUE );
|
|
|
|
void SetString( unsigned linecount, const wxString& text );
|
|
|
|
void AppendLine( const wxString& text );
|
2009-04-23 15:02:18 +00:00
|
|
|
void SetFootprintFullList( FOOTPRINT_LIST& list );
|
|
|
|
void SetFootprintFilteredList( COMPONENT* Component,
|
|
|
|
FOOTPRINT_LIST& list );
|
2008-04-17 16:25:29 +00:00
|
|
|
void SetActiveFootprintList( bool FullList, bool Redraw = FALSE );
|
|
|
|
|
|
|
|
wxString GetSelectedFootprint();
|
|
|
|
wxString OnGetItemText( long item, long column ) const;
|
|
|
|
void OnLeftClick( wxListEvent& event );
|
|
|
|
void OnLeftDClick( wxListEvent& event );
|
|
|
|
|
|
|
|
DECLARE_EVENT_TABLE()
|
2007-05-06 16:03:28 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/***************************************************************/
|
|
|
|
/* ListBox derivee pour l'affichage de la liste des Composants */
|
|
|
|
/***************************************************************/
|
|
|
|
|
2008-04-17 16:25:29 +00:00
|
|
|
class ListBoxCmp : public ListBoxBase
|
2007-05-06 16:03:28 +00:00
|
|
|
{
|
|
|
|
public:
|
2008-04-17 16:25:29 +00:00
|
|
|
wxArrayString m_ComponentList;
|
|
|
|
WinEDA_CvpcbFrame* m_Parent;
|
2007-05-06 16:03:28 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
|
2008-04-17 16:25:29 +00:00
|
|
|
ListBoxCmp( WinEDA_CvpcbFrame * parent, wxWindowID id,
|
2009-04-23 15:02:18 +00:00
|
|
|
const wxPoint &loc, const wxSize &size,
|
|
|
|
int nbitems, wxString choice[] );
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2008-04-17 16:25:29 +00:00
|
|
|
~ListBoxCmp();
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2008-04-17 16:25:29 +00:00
|
|
|
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 );
|
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
|
|
|
/*******************************************************/
|
|
|
|
/* class WWinEDA_DisplayFrame: public WinEDA_DrawFrame */
|
|
|
|
/*******************************************************/
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2008-04-17 16:25:29 +00:00
|
|
|
class WinEDA_DisplayFrame : public WinEDA_BasePcbFrame
|
2007-05-06 16:03:28 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
public:
|
2009-04-05 20:49:15 +00:00
|
|
|
WinEDA_DisplayFrame( WinEDA_CvpcbFrame* father,
|
2008-12-08 15:27:13 +00:00
|
|
|
const wxString &title,
|
|
|
|
const wxPoint &pos, const wxSize &size,
|
|
|
|
long style = KICAD_DEFAULT_DRAWFRAME_STYLE );
|
2008-04-17 16:25:29 +00:00
|
|
|
|
|
|
|
~WinEDA_DisplayFrame();
|
|
|
|
|
|
|
|
void OnCloseWindow( wxCloseEvent& Event );
|
|
|
|
void RedrawActiveWindow( wxDC* DC, bool EraseBg );
|
|
|
|
void ReCreateHToolbar();
|
|
|
|
void ReCreateVToolbar();
|
|
|
|
void RecreateMenuBar();
|
|
|
|
void OnLeftClick( wxDC* DC, const wxPoint& MousePos );
|
|
|
|
void OnLeftDClick( wxDC* DC, const wxPoint& MousePos );
|
|
|
|
bool OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu );
|
|
|
|
void SetToolbars();
|
|
|
|
void GeneralControle( wxDC* DC, wxPoint Mouse );
|
|
|
|
void InstallOptionsDisplay( wxCommandEvent& event );
|
|
|
|
MODULE* Get_Module( const wxString& CmpName );
|
|
|
|
|
|
|
|
void Process_Settings( wxCommandEvent& event );
|
|
|
|
void Show3D_Frame( wxCommandEvent& event );
|
|
|
|
|
|
|
|
DECLARE_EVENT_TABLE()
|
2007-05-06 16:03:28 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2008-04-17 16:25:29 +00:00
|
|
|
#endif //#ifndef CVSTRUCT_H
|