From 18d83b768cc1ec4bf1bcfa90c9e6a29643a07e0b Mon Sep 17 00:00:00 2001 From: dickelbeck Date: Thu, 13 Sep 2007 11:55:46 +0000 Subject: [PATCH] See my change_log.txt 2007-Sep-13 UPDATE --- 3d-viewer/3d_aux.cpp | 10 +- 3d-viewer/3d_class.cpp | 8 +- 3d-viewer/3d_draw.cpp | 2 +- 3d-viewer/3d_frame.cpp | 10 +- 3d-viewer/3d_read_mesh.cpp | 2 +- 3d-viewer/3d_struct.h | 16 +- 3d-viewer/3d_viewer.h | 36 +- change_log.txt | 11 + common/basicframe.cpp | 8 +- common/common_plot_functions.cpp | 2 +- common/displlst.cpp | 6 +- common/eda_doc.cpp | 4 +- common/edaappl.cpp | 14 +- common/edamenu.cpp | 2 +- common/get_component_dialog.cpp | 2 +- common/msgpanel.cpp | 4 +- common/pyhandler.cpp | 2 +- common/selcolor.cpp | 2 +- common/string.cpp | 2 +- common/svg_print.cpp | 2 +- common/svg_print.h | 2 +- common/wxwineda.cpp | 22 +- cvpcb/autosel.cpp | 2 +- cvpcb/class_cvpcb.cpp | 8 +- cvpcb/cvframe.cpp | 2 +- cvpcb/cvpcb.cpp | 2 +- cvpcb/cvpcb.h | 8 +- cvpcb/cvstruct.h | 52 +- cvpcb/dialog_cvpcb_config.h | 4 +- cvpcb/displayframe.cpp | 8 +- cvpcb/genorcad.cpp | 2 +- cvpcb/init.cpp | 2 +- cvpcb/listboxes.cpp | 22 +- cvpcb/listlib.cpp | 2 +- cvpcb/memoire.cpp | 4 +- cvpcb/menucfg.cpp | 6 +- cvpcb/protos.h | 18 +- cvpcb/rdpcad.cpp | 6 +- cvpcb/readschematicnetlist.cpp | 2 +- cvpcb/savecmp.cpp | 2 +- cvpcb/setvisu.cpp | 2 +- cvpcb/tool_cvpcb.cpp | 4 +- cvpcb/viewlnet.cpp | 4 +- cvpcb/viewlogi.cpp | 2 +- cvpcb/writenetlistpcbnew.cpp | 2 +- eeschema/component_class.cpp | 14 +- eeschema/component_class.h | 145 +-- eeschema/dialog_build_BOM.cpp | 4 +- eeschema/dialog_build_BOM.h | 4 +- eeschema/dialog_create_component.h | 2 +- eeschema/dialog_edit_component_in_lib.h | 16 +- eeschema/dialog_edit_component_in_schematic.h | 10 +- eeschema/dialog_eeschema_config.cpp | 4 +- eeschema/dialog_eeschema_config.h | 4 +- eeschema/dialog_erc.h | 2 +- eeschema/edit_component_in_lib.cpp | 18 +- eeschema/eelayer.cpp | 591 ++++----- eeschema/eestatus.cpp | 6 +- eeschema/erc.cpp | 2 +- eeschema/fieldedi.cpp | 28 +- eeschema/files-io.cpp | 2 +- eeschema/genliste.cpp | 6 +- eeschema/hierarch.cpp | 8 +- eeschema/lib_export.cpp | 2 +- eeschema/libedit.cpp | 14 +- eeschema/libedit_undo_redo.cpp | 4 +- eeschema/libedpart.cpp | 18 +- eeschema/libframe.cpp | 6 +- eeschema/menubar.cpp | 2 +- eeschema/netlist.cpp | 2 +- eeschema/netlist_control.cpp | 16 +- eeschema/options.cpp | 2 +- eeschema/pinedit.cpp | 2 +- eeschema/plothpgl.cpp | 2 +- eeschema/plothpgl.h | 2 +- eeschema/plotps.cpp | 2 +- eeschema/plotps.h | 2 +- eeschema/protos.h | 8 +- eeschema/schframe.cpp | 6 +- eeschema/tool_viewlib.cpp | 4 +- eeschema/viewlib_frame.cpp | 8 +- eeschema/viewlibs.cpp | 4 +- eeschema/wxprint.h | 2 +- gerbview/controle.cpp | 2 +- gerbview/dcode.cpp | 14 +- gerbview/gerberframe.cpp | 6 +- gerbview/gerbview.cpp | 2 +- gerbview/gerbview.h | 12 +- gerbview/gerbview_config.cpp | 4 +- gerbview/options.cpp | 4 +- gerbview/pcbtexte.cpp | 2 +- gerbview/process_config.cpp | 4 +- gerbview/protos.h | 6 +- gerbview/reglage.cpp | 2 +- gerbview/select_layers_to_pcb.cpp | 2 +- gerbview/set_color.cpp | 2 +- include/common.h | 696 ++++++----- include/fctsys.h | 44 +- include/gr_basic.h | 4 +- include/plot_common.h | 2 +- kicad/buildmnu.cpp | 440 +++---- kicad/files-io.cpp | 472 ++++---- kicad/kicad.cpp | 244 ++-- kicad/kicad.h | 368 +++--- kicad/mdiframe.cpp | 2 +- kicad/prjconfig.cpp | 4 +- kicad/treeprj_datas.cpp | 471 ++++---- kicad/treeprj_frame.cpp | 1057 ++++++++++------- pcbnew/ar_protos.h | 2 +- pcbnew/autorout.h | 8 +- pcbnew/dialog_edit_mod_text.cpp | 2 +- pcbnew/dialog_edit_mod_text.h | 2 +- pcbnew/dialog_edit_module.h | 8 +- pcbnew/dialog_pad_edit.h | 4 +- pcbnew/dialog_setup_libs.cpp | 2 +- pcbnew/dialog_setup_libs.h | 2 +- pcbnew/dialog_track_options.cpp | 2 +- pcbnew/dialog_track_options.h | 2 +- pcbnew/drag.h | 4 +- pcbnew/dragsegm.cpp | 4 +- pcbnew/editpads.cpp | 4 +- pcbnew/gendrill.cpp | 22 +- pcbnew/globaleditpad.cpp | 2 +- pcbnew/librairi.cpp | 2 +- pcbnew/menubarmodedit.cpp | 2 +- pcbnew/menubarpcb.cpp | 2 +- pcbnew/pcbpiste.cpp | 2 +- pcbnew/plotgerb.cpp | 4 +- pcbnew/protos.h | 2 +- pcbnew/queue.cpp | 6 +- pcbnew/reglage.cpp | 6 +- pcbnew/solve.cpp | 2 +- pcbnew/work.cpp | 16 +- share/dialog_print.h | 10 +- share/gr_basic.cpp | 2 +- share/setpage.cpp | 2 +- share/setpage.h | 2 +- share/svg_print.cpp | 4 +- share/svg_print.h | 2 +- share/wxprint.cpp | 14 +- todo.txt | 18 +- 141 files changed, 2866 insertions(+), 2477 deletions(-) diff --git a/3d-viewer/3d_aux.cpp b/3d-viewer/3d_aux.cpp index e35e4817c4..cedb43db8b 100644 --- a/3d-viewer/3d_aux.cpp +++ b/3d-viewer/3d_aux.cpp @@ -113,7 +113,7 @@ GLfloat ax,ay,az,bx,by,bz,nx,ny,nz,r; /**********************************************/ -GLuint Pcb3D_GLCanvas::DisplayCubeforTest(void) +GLuint Pcb3D_GLCanvas::DisplayCubeforTest() /**********************************************/ { GLuint gllist = glGenLists( 1 ); @@ -158,7 +158,7 @@ GLuint gllist = glGenLists( 1 ); /**********************/ /* Constructor */ -Info_3D_Visu::Info_3D_Visu(void) +Info_3D_Visu::Info_3D_Visu() { int ii; m_Beginx = m_Beginy = 0.0; /* position of mouse */ @@ -170,7 +170,7 @@ int ii; } -Info_3D_Visu::~Info_3D_Visu(void) +Info_3D_Visu::~Info_3D_Visu() { } @@ -216,13 +216,13 @@ wxStaticText * msgtitle; GridSizer->Add(m_ZValueCtrl, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5); } -WinEDA_VertexCtrl::~WinEDA_VertexCtrl(void) +WinEDA_VertexCtrl::~WinEDA_VertexCtrl() { } /*******************************************/ -S3D_Vertex WinEDA_VertexCtrl::GetValue(void) +S3D_Vertex WinEDA_VertexCtrl::GetValue() /*******************************************/ /* Retourne (en unites internes) les coordonnes entrees (en unites utilisateur) */ diff --git a/3d-viewer/3d_class.cpp b/3d-viewer/3d_class.cpp index 99e9c0921e..1ea95d3f08 100644 --- a/3d-viewer/3d_class.cpp +++ b/3d-viewer/3d_class.cpp @@ -17,7 +17,7 @@ /****************************/ -S3D_Vertex::S3D_Vertex(void) +S3D_Vertex::S3D_Vertex() /****************************/ { x = y = z = 0.0; @@ -38,7 +38,7 @@ S3D_Material::S3D_Material( Struct3D_Master * father, const wxString & name ): } /***********************************/ -void S3D_Material::SetMaterial(void) +void S3D_Material::SetMaterial() /***********************************/ { glColorMaterial(GL_FRONT_AND_BACK,GL_AMBIENT_AND_DIFFUSE); @@ -77,7 +77,7 @@ Struct3D_Master::Struct3D_Master(EDA_BaseStruct * StructFather): /***************************************/ -Struct3D_Master:: ~Struct3D_Master(void) +Struct3D_Master:: ~Struct3D_Master() /***************************************/ { Struct3D_Shape * next; @@ -110,7 +110,7 @@ Struct3D_Shape::Struct3D_Shape(EDA_BaseStruct * StructFather): /***************************************/ -Struct3D_Shape:: ~Struct3D_Shape(void) +Struct3D_Shape:: ~Struct3D_Shape() /***************************************/ { delete m_3D_Coord; diff --git a/3d-viewer/3d_draw.cpp b/3d-viewer/3d_draw.cpp index 1ef5ea68fe..774d999f9a 100644 --- a/3d-viewer/3d_draw.cpp +++ b/3d-viewer/3d_draw.cpp @@ -72,7 +72,7 @@ void Pcb3D_GLCanvas::Redraw( bool finish ) } /**********************************************/ -GLuint Pcb3D_GLCanvas::CreateDrawGL_List(void) +GLuint Pcb3D_GLCanvas::CreateDrawGL_List() /**********************************************/ /* Creation de la liste des elements a afficher */ diff --git a/3d-viewer/3d_frame.cpp b/3d-viewer/3d_frame.cpp index 5a28fe2228..bd2aeb0cef 100644 --- a/3d-viewer/3d_frame.cpp +++ b/3d-viewer/3d_frame.cpp @@ -95,7 +95,7 @@ void WinEDA3D_DrawFrame::OnCloseWindow(wxCloseEvent & Event) /******************************************/ -void WinEDA3D_DrawFrame::GetSettings(void) +void WinEDA3D_DrawFrame::GetSettings() /******************************************/ { wxString text; @@ -122,7 +122,7 @@ wxConfig * Config = m_ParentAppl->m_EDA_Config; // Current config used by appl } /*******************************************/ -void WinEDA3D_DrawFrame::SaveSettings(void) +void WinEDA3D_DrawFrame::SaveSettings() /*******************************************/ { wxString text; @@ -200,7 +200,7 @@ void WinEDA3D_DrawFrame::OnRightClick(const wxPoint& MousePos, wxMenu * PopMenu) } /************************************/ -int WinEDA3D_DrawFrame::BestZoom(void) +int WinEDA3D_DrawFrame::BestZoom() /************************************/ // Retourne le meilleur zoom { @@ -288,7 +288,7 @@ void WinEDA3D_DrawFrame::Process_Special_Functions(wxCommandEvent& event) /*****************************************/ -void WinEDA3D_DrawFrame::NewDisplay(void) +void WinEDA3D_DrawFrame::NewDisplay() /*****************************************/ { m_Canvas->ClearLists(); @@ -299,7 +299,7 @@ void WinEDA3D_DrawFrame::NewDisplay(void) /******************************************/ -void WinEDA3D_DrawFrame::Set3DBgColor(void) +void WinEDA3D_DrawFrame::Set3DBgColor() /******************************************/ /* called to set the background color of the 3D scene */ diff --git a/3d-viewer/3d_read_mesh.cpp b/3d-viewer/3d_read_mesh.cpp index ec9bee9bf6..df27281634 100644 --- a/3d-viewer/3d_read_mesh.cpp +++ b/3d-viewer/3d_read_mesh.cpp @@ -19,7 +19,7 @@ /***********************************/ -int Struct3D_Master:: ReadData(void) +int Struct3D_Master:: ReadData() /************************************/ { char line[1024], *text; diff --git a/3d-viewer/3d_struct.h b/3d-viewer/3d_struct.h index 9c4b30deac..db5431f512 100644 --- a/3d-viewer/3d_struct.h +++ b/3d-viewer/3d_struct.h @@ -21,7 +21,7 @@ class S3D_Color /* This is a 3D color (R, G, G) 3 floats range 0 to 1.0*/ public: double m_Red, m_Green, m_Blue; public: - S3D_Color(void) + S3D_Color() { m_Red = m_Green = m_Blue = 0; } @@ -32,7 +32,7 @@ class S3D_Vertex /* This is a 3D coordinate (3 float numbers: x,y,z coordinates) public: double x, y, z; public: - S3D_Vertex(void); + S3D_Vertex(); }; class S3D_Material: public EDA_BaseStruct /* openGL "material" data*/ @@ -48,7 +48,7 @@ public: public: S3D_Material(Struct3D_Master * father, const wxString & name); - void SetMaterial(void); + void SetMaterial(); }; /*******************************************/ @@ -67,10 +67,10 @@ public: public: Struct3D_Master(EDA_BaseStruct * StructFather); - ~Struct3D_Master(void); + ~Struct3D_Master(); void Copy(Struct3D_Master * pattern); - int ReadData(void); + int ReadData(); int ReadMaterial(FILE * file, int *LineNum); int ReadChildren(FILE * file, int *LineNum); int ReadShape(FILE * file, int *LineNum); @@ -94,7 +94,7 @@ public: public: Struct3D_Shape(EDA_BaseStruct * StructFather); - ~Struct3D_Shape(void); + ~Struct3D_Shape(); int ReadData(FILE * file, int *LineNum); }; @@ -123,9 +123,9 @@ public: wxBoxSizer * BoxSizer, int units, int internal_unit); - ~WinEDA_VertexCtrl(void); + ~WinEDA_VertexCtrl(); - S3D_Vertex GetValue(void); + S3D_Vertex GetValue(); void SetValue(S3D_Vertex vertex); void Enable(bool enbl); void SetToolTip(const wxString & text); diff --git a/3d-viewer/3d_viewer.h b/3d-viewer/3d_viewer.h index e1bb17636f..5cec5f3a8c 100644 --- a/3d-viewer/3d_viewer.h +++ b/3d-viewer/3d_viewer.h @@ -61,8 +61,8 @@ public: when scaled tey are between -1.0 and +1.0 */ float m_LayerZcoord[32]; public: - Info_3D_Visu(void); - ~Info_3D_Visu(void); + Info_3D_Visu(); + ~Info_3D_Visu(); }; @@ -78,9 +78,9 @@ private: public: Pcb3D_GLCanvas(WinEDA3D_DrawFrame *parent, const wxWindowID id = -1, int* gl_attrib = NULL); - ~Pcb3D_GLCanvas(void); + ~Pcb3D_GLCanvas(); - void ClearLists(void); + void ClearLists(); void OnPaint(wxPaintEvent& event); void OnSize(wxSizeEvent& event); @@ -91,16 +91,16 @@ public: void OnPopUpMenu(wxCommandEvent & event); void TakeScreenshot(wxCommandEvent & event); void SetView3D(int keycode); - void DisplayStatus(void); + void DisplayStatus(); void Redraw(bool finish = false); - GLuint DisplayCubeforTest(void); + GLuint DisplayCubeforTest(); void OnEnterWindow( wxMouseEvent& event ); void Render(); - GLuint CreateDrawGL_List(void); - void InitGL(void); - void SetLights(void); + GLuint CreateDrawGL_List(); + void InitGL(); + void SetLights(); void Draw3D_Track(TRACK * track); void Draw3D_Via(SEGVIA * via); void Draw3D_DrawSegment(DRAWSEGMENT * segment); @@ -132,23 +132,23 @@ public: void Exit3DFrame(wxCommandEvent& event); void OnCloseWindow(wxCloseEvent & Event); - void ReCreateMenuBar(void); - void ReCreateHToolbar(void); - void ReCreateVToolbar(void); - void SetToolbars(void); - void GetSettings(void); - void SaveSettings(void); + void ReCreateMenuBar(); + void ReCreateHToolbar(); + void ReCreateVToolbar(); + void SetToolbars(); + void GetSettings(); + void SaveSettings(); void OnLeftClick(wxDC * DC, const wxPoint& MousePos); void OnRightClick(const wxPoint& MousePos, wxMenu * PopMenu); void OnKeyEvent(wxKeyEvent& event); - int BestZoom(void); // Retourne le meilleur zoom + int BestZoom(); // Retourne le meilleur zoom void RedrawActiveWindow(wxDC * DC, bool EraseBg); void Process_Special_Functions(wxCommandEvent& event); void Process_Zoom(wxCommandEvent& event); - void NewDisplay(void); - void Set3DBgColor(void); + void NewDisplay(); + void Set3DBgColor(); DECLARE_EVENT_TABLE() }; diff --git a/change_log.txt b/change_log.txt index d6247405c1..e7a4f2c0fb 100644 --- a/change_log.txt +++ b/change_log.txt @@ -4,6 +4,17 @@ Started 2007-June-11 Please add newer entries at the top, list the date and your name with email address. +2007-Sep-13 UPDATE Dick Hollenbeck +================================================================================ ++ kicad + * Inverted the logic associated with filters. Filters now enable a file + in the project manager. The default is to ignore all files. + * The filter for *.sch files is smarter, in that it looks to display only + top level *.sch files, rather than all *.sch files. ++ Others + More beautification + + 2007-sept-13 UPDATE Jean-Pierre Charras ================================================================================ + all diff --git a/common/basicframe.cpp b/common/basicframe.cpp index 2578abade2..b472af0cb0 100644 --- a/common/basicframe.cpp +++ b/common/basicframe.cpp @@ -48,7 +48,7 @@ wxSize minsize; } /******************************************/ -WinEDA_BasicFrame::~WinEDA_BasicFrame(void) +WinEDA_BasicFrame::~WinEDA_BasicFrame() /******************************************/ { if ( m_Parent->m_HtmlCtrl ) delete m_Parent->m_HtmlCtrl; @@ -56,7 +56,7 @@ WinEDA_BasicFrame::~WinEDA_BasicFrame(void) } /********************************************/ -void WinEDA_BasicFrame::ReCreateMenuBar(void) +void WinEDA_BasicFrame::ReCreateMenuBar() /********************************************/ // Virtual function { @@ -64,7 +64,7 @@ void WinEDA_BasicFrame::ReCreateMenuBar(void) /*********************************************/ -void WinEDA_BasicFrame::GetSettings(void) +void WinEDA_BasicFrame::GetSettings() /*********************************************/ { wxString text; @@ -94,7 +94,7 @@ int Ypos_min; /*****************************************/ -void WinEDA_BasicFrame::SaveSettings(void) +void WinEDA_BasicFrame::SaveSettings() /*****************************************/ { wxString text; diff --git a/common/common_plot_functions.cpp b/common/common_plot_functions.cpp index 47eaeff783..ddd8e03d24 100644 --- a/common/common_plot_functions.cpp +++ b/common/common_plot_functions.cpp @@ -27,7 +27,7 @@ int PlotOrientOptions, etat_plume; static Ki_PageDescr * SheetPS; /*************************/ -void ForcePenReinit(void) +void ForcePenReinit() /*************************/ /* set the flag g_CurrentPenWidth to -1 in order to force a pen width redefinition for the next draw command diff --git a/common/displlst.cpp b/common/displlst.cpp index 7cea8d3bb3..1108933358 100644 --- a/common/displlst.cpp +++ b/common/displlst.cpp @@ -133,13 +133,13 @@ int ii; } -WinEDAListBox:: ~WinEDAListBox(void) +WinEDAListBox:: ~WinEDAListBox() { } /******************************************/ -void WinEDAListBox::MoveMouseToOrigin(void) +void WinEDAListBox::MoveMouseToOrigin() /******************************************/ { int x, y, w, h; @@ -153,7 +153,7 @@ int orgy = m_List->GetRect().GetTop(); } /*********************************************/ -wxString WinEDAListBox::GetTextSelection(void) +wxString WinEDAListBox::GetTextSelection() /*********************************************/ { wxString text = m_List->GetStringSelection(); diff --git a/common/eda_doc.cpp b/common/eda_doc.cpp index b3050fd013..ad306a7d9c 100644 --- a/common/eda_doc.cpp +++ b/common/eda_doc.cpp @@ -22,7 +22,7 @@ #include "common.h" /*****************************************/ -void WinEDA_App::ReadPdfBrowserInfos(void) +void WinEDA_App::ReadPdfBrowserInfos() /*****************************************/ /* Read from Common config the Pdf browser choice */ @@ -36,7 +36,7 @@ void WinEDA_App::ReadPdfBrowserInfos(void) } /*****************************************/ -void WinEDA_App::WritePdfBrowserInfos(void) +void WinEDA_App::WritePdfBrowserInfos() /*****************************************/ /* Write into Common config the Pdf browser choice */ diff --git a/common/edaappl.cpp b/common/edaappl.cpp index 7de06b85ab..f4e67718c7 100644 --- a/common/edaappl.cpp +++ b/common/edaappl.cpp @@ -56,7 +56,7 @@ /* Constructeur de WinEDA_App */ /*****************************/ -WinEDA_App::WinEDA_App(void) +WinEDA_App::WinEDA_App() { m_Checker = NULL; m_MainFrame = NULL; @@ -84,7 +84,7 @@ WinEDA_App::WinEDA_App(void) /* Destructeur de WinEDA_App */ /*****************************/ -WinEDA_App::~WinEDA_App(void) +WinEDA_App::~WinEDA_App() { SaveSettings(); @@ -166,7 +166,7 @@ bool succes = SetLanguage(TRUE); /*****************************************/ -void WinEDA_App::InitOnLineHelp(void) +void WinEDA_App::InitOnLineHelp() /*****************************************/ /* Init On Line Help */ @@ -187,7 +187,7 @@ wxString fullfilename = FindKicadHelpPath(); /*******************************/ -bool WinEDA_App::SetBinDir(void) +bool WinEDA_App::SetBinDir() /*******************************/ /* Analyse la ligne de commande pour retrouver le chemin de l'executable @@ -236,7 +236,7 @@ int ii; /*********************************/ -void WinEDA_App::GetSettings(void) +void WinEDA_App::GetSettings() /*********************************/ /* Lit les infos utiles sauvees lors de la derniere utilisation du logiciel */ @@ -305,7 +305,7 @@ unsigned ii; /**********************************/ -void WinEDA_App::SaveSettings(void) +void WinEDA_App::SaveSettings() /**********************************/ { unsigned int ii; @@ -583,7 +583,7 @@ wxMenuItem * item; } -int WinEDA_App::OnRun(void) +int WinEDA_App::OnRun() /* Run init scripts */ { #ifdef KICAD_PYTHON diff --git a/common/edamenu.cpp b/common/edamenu.cpp index 29f842883b..0156399405 100644 --- a/common/edamenu.cpp +++ b/common/edamenu.cpp @@ -43,7 +43,7 @@ double value; } /**********************/ -wxString GenDate(void) +wxString GenDate() /**********************/ /* Retourne la chaine de caractere donnant la date */ { diff --git a/common/get_component_dialog.cpp b/common/get_component_dialog.cpp index a5184ccfc4..d4379f4e37 100644 --- a/common/get_component_dialog.cpp +++ b/common/get_component_dialog.cpp @@ -46,7 +46,7 @@ public: WinEDA_SelectCmp(WinEDA_DrawFrame *parent, const wxPoint& framepos, wxArrayString & HistoryList, const wxString & Title, bool show_extra_tool ); - ~WinEDA_SelectCmp(void) {}; + ~WinEDA_SelectCmp() {}; private: void Accept(wxCommandEvent& event); diff --git a/common/msgpanel.cpp b/common/msgpanel.cpp index 684a201f8c..7a186a22e4 100644 --- a/common/msgpanel.cpp +++ b/common/msgpanel.cpp @@ -34,7 +34,7 @@ WinEDA_MsgPanel::WinEDA_MsgPanel(WinEDA_DrawFrame *parent, int id, -WinEDA_MsgPanel::~WinEDA_MsgPanel(void) +WinEDA_MsgPanel::~WinEDA_MsgPanel() { } @@ -110,7 +110,7 @@ wxClientDC dc(this); } /****************************************/ -void WinEDA_MsgPanel::EraseMsgBox(void) +void WinEDA_MsgPanel::EraseMsgBox() /****************************************/ /* Effacement de la fenetre d'affichage des messages de bas d'ecran */ diff --git a/common/pyhandler.cpp b/common/pyhandler.cpp index 56f96fe84a..d0a0919bf0 100644 --- a/common/pyhandler.cpp +++ b/common/pyhandler.cpp @@ -55,7 +55,7 @@ static void RegisterCb( str objKey, object callback ) static void UnRegisterCb( str objKey, object callback ) { PyHandler::GetInstance()->UnRegisterCallback( PyHandler::MakeStr(objKey), callback ); } -static void init_base_utils(void) +static void init_base_utils() { def ( "ChooseFile", &ChooseFile ); def ( "RegisterCallback", &RegisterCb ); diff --git a/common/selcolor.cpp b/common/selcolor.cpp index e05b88eef6..014cf0a0d9 100644 --- a/common/selcolor.cpp +++ b/common/selcolor.cpp @@ -30,7 +30,7 @@ public: // Constructor and destructor WinEDA_SelColorFrame(wxWindow *parent, const wxPoint& framepos, int OldColor); - ~WinEDA_SelColorFrame(void) {}; + ~WinEDA_SelColorFrame() {}; private: void OnCancel(wxCommandEvent& event); diff --git a/common/string.cpp b/common/string.cpp index f76f4377c2..f35f314697 100644 --- a/common/string.cpp +++ b/common/string.cpp @@ -96,7 +96,7 @@ struct tm * Date; } /*******************************/ -wxString DateAndTime(void) +wxString DateAndTime() /*******************************/ /* Retourne la chaine de caractere donnant date+heure */ { diff --git a/common/svg_print.cpp b/common/svg_print.cpp index f739c151b4..f7d83fa263 100644 --- a/common/svg_print.cpp +++ b/common/svg_print.cpp @@ -279,7 +279,7 @@ wxIcon WinEDA_PrintSVGFrame::GetIconResource( const wxString& name ) /******************************************************/ -wxString WinEDA_PrintSVGFrame::ReturnFullFileName(void) +wxString WinEDA_PrintSVGFrame::ReturnFullFileName() /******************************************************/ { wxString name, ext; diff --git a/common/svg_print.h b/common/svg_print.h index 5bef6ea0ae..046cf467da 100644 --- a/common/svg_print.h +++ b/common/svg_print.h @@ -122,7 +122,7 @@ public: void PrintSVGDoc(wxCommandEvent& event); bool DrawPage(const wxString & FullFileName); void SetPenWidth(wxSpinEvent& event); - wxString ReturnFullFileName(void); + wxString ReturnFullFileName(); ////@begin WinEDA_PrintSVGFrame member variables wxSpinCtrl* m_ButtPenWidth; diff --git a/common/wxwineda.cpp b/common/wxwineda.cpp index 36e987fa10..185d30f95d 100644 --- a/common/wxwineda.cpp +++ b/common/wxwineda.cpp @@ -31,7 +31,7 @@ WinEDA_EnterText::WinEDA_EnterText(wxWindow *parent, const wxString &Title, /****************************************/ -wxString WinEDA_EnterText::GetValue(void) +wxString WinEDA_EnterText::GetValue() /****************************************/ { m_Modify = m_FrameText->IsModified(); @@ -101,7 +101,7 @@ WinEDA_GraphicTextCtrl::WinEDA_GraphicTextCtrl(wxWindow *parent, } -WinEDA_GraphicTextCtrl::~WinEDA_GraphicTextCtrl(void) +WinEDA_GraphicTextCtrl::~WinEDA_GraphicTextCtrl() { delete m_FrameText; delete m_Title; @@ -126,13 +126,13 @@ void WinEDA_GraphicTextCtrl::SetValue(int value) } -wxString WinEDA_GraphicTextCtrl::GetText(void) +wxString WinEDA_GraphicTextCtrl::GetText() { wxString text = m_FrameText->GetValue(); return text; } -int WinEDA_GraphicTextCtrl::GetTextSize(void) +int WinEDA_GraphicTextCtrl::GetTextSize() { int textsize; double dtmp; @@ -188,7 +188,7 @@ wxString text; } -WinEDA_PositionCtrl::~WinEDA_PositionCtrl(void) +WinEDA_PositionCtrl::~WinEDA_PositionCtrl() { delete m_TextX; delete m_TextY; @@ -197,7 +197,7 @@ WinEDA_PositionCtrl::~WinEDA_PositionCtrl(void) } /******************************************/ -wxPoint WinEDA_PositionCtrl::GetValue(void) +wxPoint WinEDA_PositionCtrl::GetValue() /******************************************/ /* Retourne (en unites internes) les coordonnes entrees (en unites utilisateur) */ @@ -254,7 +254,7 @@ WinEDA_SizeCtrl::WinEDA_SizeCtrl(wxWindow *parent, const wxString & title, } /*************************************/ -wxSize WinEDA_SizeCtrl::GetValue(void) +wxSize WinEDA_SizeCtrl::GetValue() /*************************************/ { wxPoint pos = WinEDA_PositionCtrl::GetValue(); @@ -293,14 +293,14 @@ wxString stringvalue = ReturnStringFromValue(m_Units, m_Value,m_Internal_Unit); BoxSizer->Add(m_ValueCtrl, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxBOTTOM, 5); } -WinEDA_ValueCtrl::~WinEDA_ValueCtrl(void) +WinEDA_ValueCtrl::~WinEDA_ValueCtrl() { delete m_ValueCtrl; delete m_Text; } /***********************************/ -int WinEDA_ValueCtrl::GetValue(void) +int WinEDA_ValueCtrl::GetValue() /***********************************/ { int coord; @@ -347,13 +347,13 @@ wxString label = title; BoxSizer->Add(m_ValueCtrl, 0, wxGROW|wxLEFT|wxRIGHT|wxBOTTOM, 5); } -WinEDA_DFloatValueCtrl::~WinEDA_DFloatValueCtrl(void) +WinEDA_DFloatValueCtrl::~WinEDA_DFloatValueCtrl() { delete m_ValueCtrl; delete m_Text; } -double WinEDA_DFloatValueCtrl::GetValue(void) +double WinEDA_DFloatValueCtrl::GetValue() { double coord = 0; diff --git a/cvpcb/autosel.cpp b/cvpcb/autosel.cpp index 1f29010c54..f8343d2dc9 100644 --- a/cvpcb/autosel.cpp +++ b/cvpcb/autosel.cpp @@ -22,7 +22,7 @@ public: wxString m_LibName; wxString m_Library; - AUTOMODULE(void) { m_Type = 0; Pnext = NULL; } + AUTOMODULE() { m_Type = 0; Pnext = NULL; } } ; diff --git a/cvpcb/class_cvpcb.cpp b/cvpcb/class_cvpcb.cpp index 57597fd649..c7e76f602e 100644 --- a/cvpcb/class_cvpcb.cpp +++ b/cvpcb/class_cvpcb.cpp @@ -20,7 +20,7 @@ #include "cvpcb.h" -STORECMP::STORECMP(void) +STORECMP::STORECMP() { Pnext = Pback = NULL; m_Type = STRUCT_COMPONENT; @@ -29,7 +29,7 @@ STORECMP::STORECMP(void) m_Multi = 0; } -STORECMP::~STORECMP(void) +STORECMP::~STORECMP() { STOREPIN * Pin, * NextPin; @@ -41,7 +41,7 @@ STOREPIN * Pin, * NextPin; -STOREMOD::STOREMOD(void) +STOREMOD::STOREMOD() { Pnext = Pback = NULL; m_Type = STRUCT_MODULE; @@ -49,7 +49,7 @@ STOREMOD::STOREMOD(void) } -STOREPIN::STOREPIN(void) +STOREPIN::STOREPIN() { m_Type = STRUCT_PIN; /* Type de la structure */ Pnext = NULL; /* Chainage avant */ diff --git a/cvpcb/cvframe.cpp b/cvpcb/cvframe.cpp index 2181507b5d..7a85074add 100644 --- a/cvpcb/cvframe.cpp +++ b/cvpcb/cvframe.cpp @@ -82,7 +82,7 @@ int dims[3] = { -1, -1, 250}; /******************************************/ -WinEDA_CvpcbFrame::~WinEDA_CvpcbFrame(void) +WinEDA_CvpcbFrame::~WinEDA_CvpcbFrame() /******************************************/ { if( m_Parent->m_EDA_Config ) diff --git a/cvpcb/cvpcb.cpp b/cvpcb/cvpcb.cpp index 5753a3686b..325f92c18e 100644 --- a/cvpcb/cvpcb.cpp +++ b/cvpcb/cvpcb.cpp @@ -28,7 +28,7 @@ IMPLEMENT_APP(WinEDA_App) /* Called to initialize the program */ /************************************/ -bool WinEDA_App::OnInit(void) +bool WinEDA_App::OnInit() { wxString msg; wxString currCWD = wxGetCwd(); diff --git a/cvpcb/cvpcb.h b/cvpcb/cvpcb.h index 72a18405ea..b31e37f067 100644 --- a/cvpcb/cvpcb.h +++ b/cvpcb/cvpcb.h @@ -40,7 +40,7 @@ public: wxString m_PinName; wxString m_Repere; /* utilise selon formats de netliste */ - STOREPIN(void); + STOREPIN(); } ; class STORECMP @@ -60,8 +60,8 @@ public: wxArrayString m_FootprintFilter; /* List of allowed footprints (wildcart allowed if void: no filtering */ - STORECMP(void); - ~STORECMP(void); + STORECMP(); + ~STORECMP(); } ; class STOREMOD @@ -76,7 +76,7 @@ public: wxString m_Doc; /* Doc associee */ wxString m_KeyWord; /* Mots cles associes */ - STOREMOD(void); + STOREMOD(); }; diff --git a/cvpcb/cvstruct.h b/cvpcb/cvstruct.h index 3f2a7e21ac..de16b61312 100644 --- a/cvpcb/cvstruct.h +++ b/cvpcb/cvstruct.h @@ -40,7 +40,7 @@ private: // Constructor and destructor public: WinEDA_CvpcbFrame(WinEDA_App * parent, const wxString & title); - ~WinEDA_CvpcbFrame(void); + ~WinEDA_CvpcbFrame(); void OnLeftClick(wxListEvent & event); void OnLeftDClick(wxListEvent & event); @@ -51,8 +51,8 @@ public: void OnCloseWindow(wxCloseEvent & Event); void OnSize(wxSizeEvent& SizeEvent); void OnChar(wxKeyEvent& event); - void ReCreateHToolbar(void); - virtual void ReCreateMenuBar(void); + void ReCreateHToolbar(); + virtual void ReCreateMenuBar(); void SetLanguage(wxCommandEvent& event); void AddFontSelectionMenu(wxMenu * main_menu); void ProcessFontPreferences(wxCommandEvent& event); @@ -69,19 +69,19 @@ public: void DisplayDocFile(wxCommandEvent & event); void OnSelectFilteringFootprint(wxCommandEvent & event); void SetNewPkg(const wxString & package); - void BuildCmpListBox(void); - void BuildFootprintListBox(void); - void CreateScreenCmp(void); - void CreateConfigWindow(void); + void BuildCmpListBox(); + void BuildFootprintListBox(); + void CreateScreenCmp(); + void CreateConfigWindow(); int SaveNetList(const wxString & FullFileName); int SaveComponentList(const wxString & FullFileName); bool ReadInputNetList(const wxString & FullFileName); - void ReadNetListe(void); - int rdpcad(void); - int ReadSchematicNetlist(void); + void ReadNetListe(); + int rdpcad(); + int ReadSchematicNetlist(); int ReadFootprintFilterList( FILE * f); - int ReadViewlogicWirList(void); - int ReadViewlogicNetList(void); + int ReadViewlogicWirList(); + int ReadViewlogicNetList(); DECLARE_EVENT_TABLE() }; @@ -100,9 +100,9 @@ public: ListBoxBase(WinEDA_CvpcbFrame * parent, wxWindowID id, const wxPoint& loc, const wxSize& size); - ~ListBoxBase(void); + ~ListBoxBase(); - int GetSelection(void); + int GetSelection(); void OnSize(wxSizeEvent& event); }; @@ -123,17 +123,17 @@ public: FootprintListBox(WinEDA_CvpcbFrame * parent, wxWindowID id, const wxPoint& loc, const wxSize& size, int nbitems, wxString choice[]); - ~FootprintListBox(void); + ~FootprintListBox(); - int GetCount(void); + int GetCount(); void SetSelection(unsigned index, bool State = TRUE); void SetString(unsigned linecount, const wxString & text); void AppendLine(const wxString & text); - void SetFootprintFullList(void); + void SetFootprintFullList(); void SetFootprintFilteredList(STORECMP * Component); void SetActiveFootprintList(bool FullList, bool Redraw = FALSE); - wxString GetSelectedFootprint(void); + wxString GetSelectedFootprint(); wxString OnGetItemText(long item, long column) const; void OnLeftClick(wxListEvent & event); void OnLeftDClick(wxListEvent & event); @@ -156,10 +156,10 @@ public: const wxPoint& loc, const wxSize& size, int nbitems, wxString choice[]); - ~ListBoxCmp(void); + ~ListBoxCmp(); - void Clear(void); - int GetCount(void); + 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); @@ -182,18 +182,18 @@ public: const wxString & title, const wxPoint& pos, const wxSize& size); - ~WinEDA_DisplayFrame(void); + ~WinEDA_DisplayFrame(); void OnCloseWindow(wxCloseEvent & Event); void Process_Special_Functions(wxCommandEvent& event); void RedrawActiveWindow(wxDC * DC, bool EraseBg); - void ReCreateHToolbar(void); - void ReCreateVToolbar(void); - void RecreateMenuBar(void); + void ReCreateHToolbar(); + void ReCreateVToolbar(); + void RecreateMenuBar(); void OnLeftClick(wxDC * DC, const wxPoint& MousePos); void OnLeftDClick(wxDC * DC, const wxPoint& MousePos); void OnRightClick(const wxPoint& MousePos, wxMenu * PopMenu); - void SetToolbars(void); + void SetToolbars(); void InstallOptionsDisplay(wxCommandEvent& event); MODULE * Get_Module(const wxString & CmpName); diff --git a/cvpcb/dialog_cvpcb_config.h b/cvpcb/dialog_cvpcb_config.h index d854193d04..3e2c0061d1 100644 --- a/cvpcb/dialog_cvpcb_config.h +++ b/cvpcb/dialog_cvpcb_config.h @@ -128,7 +128,7 @@ public: /// Should we show tooltips? static bool ShowToolTips(); - void Update(void); + void Update(); void AcceptCfg(wxCommandEvent& event); void SaveCfg(wxCommandEvent& event); void ReadOldCfg(wxCommandEvent& event); @@ -137,7 +137,7 @@ public: void EquDelFct(wxCommandEvent& event); void EquAddFct(wxCommandEvent& event); void ReturnNetFormat(wxCommandEvent& event); - void SetDialogDatas(void); + void SetDialogDatas(); ////@begin KiConfigCvpcbFrame member variables diff --git a/cvpcb/displayframe.cpp b/cvpcb/displayframe.cpp index 7eabef5f95..2a149a77df 100644 --- a/cvpcb/displayframe.cpp +++ b/cvpcb/displayframe.cpp @@ -64,7 +64,7 @@ WinEDA_DisplayFrame::WinEDA_DisplayFrame( wxWindow * father, WinEDA_App *parent, /* Fonctions de base de WinEDA_DisplayFrame */ /*****************************************/ // Destructeur -WinEDA_DisplayFrame::~WinEDA_DisplayFrame(void) +WinEDA_DisplayFrame::~WinEDA_DisplayFrame() { if ( m_Pcb->m_Modules ) DeleteStructure( m_Pcb->m_Modules ); m_Pcb->m_Modules = NULL; @@ -93,14 +93,14 @@ wxSize size; /************************************************/ -void WinEDA_DisplayFrame::ReCreateVToolbar(void) +void WinEDA_DisplayFrame::ReCreateVToolbar() /************************************************/ { } /************************************************/ -void WinEDA_DisplayFrame::ReCreateHToolbar(void) +void WinEDA_DisplayFrame::ReCreateHToolbar() /************************************************/ { if ( m_HToolBar != NULL ) return; @@ -137,7 +137,7 @@ void WinEDA_DisplayFrame::ReCreateHToolbar(void) /*******************************************/ -void WinEDA_DisplayFrame::SetToolbars(void) +void WinEDA_DisplayFrame::SetToolbars() /*******************************************/ { } diff --git a/cvpcb/genorcad.cpp b/cvpcb/genorcad.cpp index 2fb3df84a6..a0e3cfdf46 100644 --- a/cvpcb/genorcad.cpp +++ b/cvpcb/genorcad.cpp @@ -25,7 +25,7 @@ static void ChangePinNet( wxString & PinNet ); int NetNumCode; /* Nombre utilise pour cree des NetNames lors de reaffectation de NetNames */ -int genorcad(void) +int genorcad() { char Line[1024]; STOREPIN * Pin; diff --git a/cvpcb/init.cpp b/cvpcb/init.cpp index 35a665583d..0f0d34faa3 100644 --- a/cvpcb/init.cpp +++ b/cvpcb/init.cpp @@ -67,7 +67,7 @@ wxString Line; } /********************************************/ -void WinEDA_CvpcbFrame::ReadNetListe(void) +void WinEDA_CvpcbFrame::ReadNetListe() /*******************************************/ /* Lecture de la netliste selon format, ainsi que du fichier des composants */ diff --git a/cvpcb/listboxes.cpp b/cvpcb/listboxes.cpp index 15f3b1982a..15a5860ec5 100644 --- a/cvpcb/listboxes.cpp +++ b/cvpcb/listboxes.cpp @@ -29,7 +29,7 @@ ListBoxBase::ListBoxBase(WinEDA_CvpcbFrame * parent, -ListBoxBase::~ListBoxBase(void) +ListBoxBase::~ListBoxBase() { } @@ -50,7 +50,7 @@ int width = 0; /*********************************/ -int ListBoxBase::GetSelection(void) +int ListBoxBase::GetSelection() /*********************************/ // Return an index for the selected item { @@ -72,13 +72,13 @@ FootprintListBox::FootprintListBox(WinEDA_CvpcbFrame * parent, -FootprintListBox::~FootprintListBox(void) +FootprintListBox::~FootprintListBox() { } /**********************************/ -int FootprintListBox::GetCount(void) +int FootprintListBox::GetCount() /**********************************/ // Return number of items { @@ -97,7 +97,7 @@ void FootprintListBox::SetString(unsigned linecount, const wxString & text) } /***************************************************/ -wxString FootprintListBox::GetSelectedFootprint(void) +wxString FootprintListBox::GetSelectedFootprint() /***************************************************/ // Return an index for the selected item { @@ -165,7 +165,7 @@ ListBoxCmp::ListBoxCmp(WinEDA_CvpcbFrame * parent, wxWindowID id, -ListBoxCmp::~ListBoxCmp(void) +ListBoxCmp::~ListBoxCmp() { } @@ -181,7 +181,7 @@ BEGIN_EVENT_TABLE(ListBoxCmp, LIST_BOX_TYPE) END_EVENT_TABLE() /****************************/ -void ListBoxCmp::Clear(void) +void ListBoxCmp::Clear() /****************************/ // Reset ALL datas { @@ -190,7 +190,7 @@ void ListBoxCmp::Clear(void) } /******************************/ -int ListBoxCmp::GetCount(void) +int ListBoxCmp::GetCount() /******************************/ // Return number of items { @@ -243,7 +243,7 @@ void ListBoxCmp::SetSelection(unsigned index, bool State) } /********************************************/ -void WinEDA_CvpcbFrame::BuildCmpListBox(void) +void WinEDA_CvpcbFrame::BuildCmpListBox() /********************************************/ /* Construit la fenetre d'affichage de la liste des composant. dimx et dimy sont les dimensions de la surface totale d'affichage @@ -283,7 +283,7 @@ wxSize size(10,10); /*************************************************************/ -void WinEDA_CvpcbFrame::BuildFootprintListBox(void) +void WinEDA_CvpcbFrame::BuildFootprintListBox() /*************************************************************/ /* Construit la fenetre d'affichage de la liste des Modules. dimx et dimy sont les dimensions de la surface totale d'affichage @@ -313,7 +313,7 @@ wxSize size(10,10); /************************************************/ -void FootprintListBox::SetFootprintFullList(void) +void FootprintListBox::SetFootprintFullList() /************************************************/ { STOREMOD * FootprintItem; diff --git a/cvpcb/listlib.cpp b/cvpcb/listlib.cpp index 09d592db68..7d51b75ace 100644 --- a/cvpcb/listlib.cpp +++ b/cvpcb/listlib.cpp @@ -25,7 +25,7 @@ static STOREMOD * TriListeModules(STOREMOD * BaseListe, int nbitems); /**/ /*********************/ -int listlib(void) +int listlib() /*********************/ /* Routine lisant la liste des librairies, et generant la liste chainee des modules disponibles diff --git a/cvpcb/memoire.cpp b/cvpcb/memoire.cpp index 7bbcfcf341..832130158f 100644 --- a/cvpcb/memoire.cpp +++ b/cvpcb/memoire.cpp @@ -11,7 +11,7 @@ /********************************/ -void FreeMemoryModules(void) +void FreeMemoryModules() /********************************/ /* Routine de liberation memoire de la liste des modules @@ -34,7 +34,7 @@ STOREMOD * Module, * NextMod; } /***********************************/ -void FreeMemoryComponants(void) +void FreeMemoryComponants() /***********************************/ /* Routine de liberation memoire de la liste des composants diff --git a/cvpcb/menucfg.cpp b/cvpcb/menucfg.cpp index 950368a00a..51bb99b98e 100644 --- a/cvpcb/menucfg.cpp +++ b/cvpcb/menucfg.cpp @@ -35,7 +35,7 @@ /***************************************************/ -void WinEDA_CvpcbFrame::CreateConfigWindow(void) +void WinEDA_CvpcbFrame::CreateConfigWindow() /***************************************************/ /* Creation de la fenetre de configuration de CVPCB */ { @@ -45,7 +45,7 @@ KiConfigCvpcbFrame * ConfigFrame = new KiConfigCvpcbFrame(this); /*********************************************/ -void KiConfigCvpcbFrame::SetDialogDatas(void) +void KiConfigCvpcbFrame::SetDialogDatas() /*********************************************/ { m_ListLibr->InsertItems(g_LibName_List,0); @@ -124,7 +124,7 @@ void KiConfigCvpcbFrame::AcceptCfg(wxCommandEvent& event) } /**********************************/ -void KiConfigCvpcbFrame::Update(void) +void KiConfigCvpcbFrame::Update() /**********************************/ { wxString msg; diff --git a/cvpcb/protos.h b/cvpcb/protos.h index 2086a03410..24c0952cb1 100644 --- a/cvpcb/protos.h +++ b/cvpcb/protos.h @@ -8,9 +8,9 @@ class DESCR_EDGE; int reaffect( char *ib, char *net) ; -int GenNetlistPcbnew(void) ; -int loadcmp(void) ; -int listlib(void) ; +int GenNetlistPcbnew() ; +int loadcmp() ; +int listlib() ; STOREMOD * GetModuleDescrByName(const wxString & FootprintName); /***********/ @@ -41,12 +41,12 @@ void DeleteStructure( void * GenericStructure ); /**************/ /* MEMOIRE.CC */ /**************/ -void FreeMemoryComponants(void); +void FreeMemoryComponants(); /* Routine de liberation memoire de la liste des composants - remet a NULL BaseListeMod - remet a 0 NbComp */ -void FreeMemoryModules(void); +void FreeMemoryModules(); /* Routine de liberation memoire de la liste des modules - remet a NULL g_BaseListePkg - rement a 0 NbLib; */ @@ -91,12 +91,12 @@ int CmpCompare( void * cmp1, void * cmp2); /* routine pour qsort() /***************/ /* viewlogi.cc */ /***************/ -int ReadViewlogicWirList(void); +int ReadViewlogicWirList(); /***************/ /* viewlnet.cc */ /***************/ -int ReadViewlogicNetList(void); +int ReadViewlogicNetList(); /***************/ /* TRACEMOD.CC */ @@ -117,8 +117,8 @@ void Display_1_Texte(WinEDA_DrawPanel * panel, wxDC * DC, /**********/ /* COLORS */ /**********/ -void BuildPensBrushes(void); -void FreePensBrushes(void); +void BuildPensBrushes(); +void FreePensBrushes(); int GetNewColor(wxWindow * Frame, int OldColor = -1); /* Routine de selection d'une couleur */ /***********/ diff --git a/cvpcb/rdpcad.cpp b/cvpcb/rdpcad.cpp index 1b3fe8fc43..e6c03b70f3 100644 --- a/cvpcb/rdpcad.cpp +++ b/cvpcb/rdpcad.cpp @@ -18,10 +18,10 @@ assure la reaffectation des alimentations selon le format : #define SEPARATEUR '|' /* routines locales : */ -int pin(void) ; +int pin() ; /***************************************/ -int WinEDA_CvpcbFrame::rdpcad(void) +int WinEDA_CvpcbFrame::rdpcad() /***************************************/ { int i , j , k ,l ; @@ -146,7 +146,7 @@ for ( ;; ) /* pin() : analyse liste des pines */ /***********************************/ -int pin(void) +int pin() { int i , j , k ; char numpin[9] , net[9] ; diff --git a/cvpcb/readschematicnetlist.cpp b/cvpcb/readschematicnetlist.cpp index fb7958e404..3bb0492478 100644 --- a/cvpcb/readschematicnetlist.cpp +++ b/cvpcb/readschematicnetlist.cpp @@ -23,7 +23,7 @@ static int pin_orcad(STORECMP * CurrentCmp); /************************************************/ -int WinEDA_CvpcbFrame::ReadSchematicNetlist(void) +int WinEDA_CvpcbFrame::ReadSchematicNetlist() /************************************************/ { int i , j , k ,l ; diff --git a/cvpcb/savecmp.cpp b/cvpcb/savecmp.cpp index a9c32bb333..e7c6ffad71 100644 --- a/cvpcb/savecmp.cpp +++ b/cvpcb/savecmp.cpp @@ -54,7 +54,7 @@ wxString Title = g_Main_Title + wxT(" ") + GetBuildVersion(); } /****************/ -int loadcmp(void) +int loadcmp() /***************/ /* recupere la liste des associations composants/empreintes */ diff --git a/cvpcb/setvisu.cpp b/cvpcb/setvisu.cpp index f2c9c6b863..93b7f88ea1 100644 --- a/cvpcb/setvisu.cpp +++ b/cvpcb/setvisu.cpp @@ -14,7 +14,7 @@ #include "protos.h" /*******************************************/ -void WinEDA_CvpcbFrame::CreateScreenCmp(void) +void WinEDA_CvpcbFrame::CreateScreenCmp() /*******************************************/ /* Creation de la fenetre d'affichage du composant */ diff --git a/cvpcb/tool_cvpcb.cpp b/cvpcb/tool_cvpcb.cpp index 118339f057..06a920172d 100644 --- a/cvpcb/tool_cvpcb.cpp +++ b/cvpcb/tool_cvpcb.cpp @@ -23,7 +23,7 @@ /*********************************************/ -void WinEDA_CvpcbFrame::ReCreateHToolbar(void) +void WinEDA_CvpcbFrame::ReCreateHToolbar() /*********************************************/ { if ( m_HToolBar != NULL ) return; @@ -93,7 +93,7 @@ void WinEDA_CvpcbFrame::ReCreateHToolbar(void) /*******************************************/ -void WinEDA_CvpcbFrame::ReCreateMenuBar(void) +void WinEDA_CvpcbFrame::ReCreateMenuBar() /*******************************************/ /* Creation des menus de la fenetre principale */ diff --git a/cvpcb/viewlnet.cpp b/cvpcb/viewlnet.cpp index a285fee8fb..13fbf5ff61 100644 --- a/cvpcb/viewlnet.cpp +++ b/cvpcb/viewlnet.cpp @@ -36,10 +36,10 @@ static int GenListeComposants(FILE * PkgFile); /* Variables Locales */ /******************************/ - /* int ReadViewlogicNet(void) */ + /* int ReadViewlogicNet() */ /******************************/ -int WinEDA_CvpcbFrame::ReadViewlogicNetList(void) +int WinEDA_CvpcbFrame::ReadViewlogicNetList() { int ii, LineNum; char Line[1024], *Text; diff --git a/cvpcb/viewlogi.cpp b/cvpcb/viewlogi.cpp index b758da984f..69a76cf986 100644 --- a/cvpcb/viewlogi.cpp +++ b/cvpcb/viewlogi.cpp @@ -33,7 +33,7 @@ STORECMP * BasePseudoCmp; /* Stockage des descriptions generales */ /************************************************/ -int WinEDA_CvpcbFrame::ReadViewlogicWirList(void) +int WinEDA_CvpcbFrame::ReadViewlogicWirList() /************************************************/ { int ii, Type = 0, error, Header; diff --git a/cvpcb/writenetlistpcbnew.cpp b/cvpcb/writenetlistpcbnew.cpp index b699f639b4..d65f4be977 100644 --- a/cvpcb/writenetlistpcbnew.cpp +++ b/cvpcb/writenetlistpcbnew.cpp @@ -27,7 +27,7 @@ int NetNumCode; /* Nombre utilise pour cree des NetNames lors de /*************************/ -int GenNetlistPcbnew(void) +int GenNetlistPcbnew() /*************************/ { #define NETLIST_HEAD_STRING "EESchema Netlist Version 1.1" diff --git a/eeschema/component_class.cpp b/eeschema/component_class.cpp index 0281275a9a..e1d9a1ff4a 100644 --- a/eeschema/component_class.cpp +++ b/eeschema/component_class.cpp @@ -32,7 +32,7 @@ DrawPartStruct::DrawPartStruct( KICAD_T struct_type, const wxPoint & pos): } /************************************/ -DrawPartStruct::~DrawPartStruct(void) +DrawPartStruct::~DrawPartStruct() /************************************/ { } @@ -221,7 +221,7 @@ void EDA_SchComponentStruct::Place(WinEDA_DrawFrame * frame, wxDC * DC) /***************************************************/ -void EDA_SchComponentStruct::ClearAnnotation(void) +void EDA_SchComponentStruct::ClearAnnotation() /***************************************************/ /* Suppress annotation ( i.i IC23 changed to IC? and part reset to 1) */ @@ -241,7 +241,7 @@ EDA_LibComponentStruct *Entry; } /**************************************************************/ -EDA_SchComponentStruct * EDA_SchComponentStruct::GenCopy(void) +EDA_SchComponentStruct * EDA_SchComponentStruct::GenCopy() /**************************************************************/ { EDA_SchComponentStruct * new_item = new EDA_SchComponentStruct( m_Pos ); @@ -411,7 +411,7 @@ bool Transform = FALSE; /****************************************************/ -int EDA_SchComponentStruct::GetRotationMiroir(void) +int EDA_SchComponentStruct::GetRotationMiroir() /****************************************************/ { int type_rotate = CMP_ORIENT_0; @@ -500,7 +500,7 @@ PartTextStruct::PartTextStruct(const wxPoint & pos, const wxString & text): } /************************************/ -PartTextStruct::~PartTextStruct(void) +PartTextStruct::~PartTextStruct() /************************************/ { } @@ -524,7 +524,7 @@ void PartTextStruct::PartTextCopy(PartTextStruct * target) /*********************************/ -bool PartTextStruct::IsVoid(void) +bool PartTextStruct::IsVoid() /*********************************/ /* return True if The field is void, i.e.: contains wxEmptyString or "~" @@ -536,7 +536,7 @@ bool PartTextStruct::IsVoid(void) /********************************************/ -EDA_Rect PartTextStruct::GetBoundaryBox(void) +EDA_Rect PartTextStruct::GetBoundaryBox() /********************************************/ /* return EDA_Rect contains the real (user coordinates) boundary box for a text field, diff --git a/eeschema/component_class.h b/eeschema/component_class.h index 8715cbde4b..a0a9dd7d2c 100644 --- a/eeschema/component_class.h +++ b/eeschema/component_class.h @@ -1,6 +1,6 @@ - /*****************************************************/ - /* Definitions for the Component classes for EESchema */ - /*****************************************************/ +/*****************************************************/ +/* Definitions for the Component classes for EESchema */ +/*****************************************************/ #ifndef COMPONENT_CLASS_H #define COMPONENT_CLASS_H @@ -14,110 +14,115 @@ /* Definition de la representation du composant */ -#define NUMBER_OF_FIELDS 12 /* Nombre de champs de texte affectes au composant */ -typedef enum -{ - REFERENCE = 0, /* Champ Reference of part, i.e. "IC21" */ - VALUE, /* Champ Value of part, i.e. "3.3K" */ - FOOTPRINT, /* Champ Name Module PCB, i.e. "16DIP300" */ - SHEET_FILENAME, /* Champ Name Schema component, i.e. "cnt16.sch" */ - FIELD1, - FIELD2, - FIELD3, - FIELD4, - FIELD5, - FIELD6, - FIELD7, - FIELD8 +#define NUMBER_OF_FIELDS 12 /* Nombre de champs de texte affectes au composant */ +typedef enum { + REFERENCE = 0, /* Champ Reference of part, i.e. "IC21" */ + VALUE, /* Champ Value of part, i.e. "3.3K" */ + FOOTPRINT, /* Champ Name Module PCB, i.e. "16DIP300" */ + SHEET_FILENAME, /* Champ Name Schema component, i.e. "cnt16.sch" */ + FIELD1, + FIELD2, + FIELD3, + FIELD4, + FIELD5, + FIELD6, + FIELD7, + FIELD8 } NumFieldType; /* Class to manage component fields. - component fields are texts attached to the component (not the graphic texts) - There are 2 major fields : Reference and Value -*/ -class PartTextStruct: public EDA_BaseStruct, public EDA_TextStruct + * component fields are texts attached to the component (not the graphic texts) + * There are 2 major fields : Reference and Value + */ +class PartTextStruct : public EDA_BaseStruct, public EDA_TextStruct { public: int m_Layer; - int m_FieldId; - wxString m_Name; /* Field name (ref, value,pcb, sheet, filed 1.. - and for fields 1 to 8 the name is editable */ + int m_FieldId; + wxString m_Name; /* Field name (ref, value,pcb, sheet, filed 1.. + * and for fields 1 to 8 the name is editable */ public: - PartTextStruct(const wxPoint & pos = wxPoint(0,0), const wxString & text = wxEmptyString); - ~PartTextStruct(void); + PartTextStruct( const wxPoint& pos = wxPoint( 0, 0 ), const wxString& text = wxEmptyString ); + ~PartTextStruct(); virtual wxString GetClass() const { - return wxT("PartTextStruct"); + return wxT( "PartTextStruct" ); } - - void PartTextCopy(PartTextStruct * target); - void Place(WinEDA_DrawFrame * frame, wxDC * DC); - EDA_Rect GetBoundaryBox(void); - bool IsVoid(); - void SwapData(PartTextStruct * copyitem); + + void PartTextCopy( PartTextStruct* target ); + void Place( WinEDA_DrawFrame* frame, wxDC* DC ); + + EDA_Rect GetBoundaryBox(); + bool IsVoid(); + void SwapData( PartTextStruct* copyitem ); }; /* the class DrawPartStruct describes a basic virtual component - Not used directly: - used classes are EDA_SchComponentStruct (the "classic" schematic component - and the Pseudo component DrawSheetStruct -*/ -class DrawPartStruct: public EDA_BaseStruct + * Not used directly: + * used classes are EDA_SchComponentStruct (the "classic" schematic component + * and the Pseudo component DrawSheetStruct + */ +class DrawPartStruct : public EDA_BaseStruct { public: - int m_Layer; - wxString m_ChipName; /* Key to look for in the library, i.e. "74LS00". */ - PartTextStruct m_Field[NUMBER_OF_FIELDS]; - wxPoint m_Pos; /* Exact position of part. */ + int m_Layer; + wxString m_ChipName; /* Key to look for in the library, i.e. "74LS00". */ + PartTextStruct m_Field[NUMBER_OF_FIELDS]; + wxPoint m_Pos; /* Exact position of part. */ public: - DrawPartStruct( KICAD_T struct_type, const wxPoint & pos); - ~DrawPartStruct(void); + DrawPartStruct( KICAD_T struct_type, const wxPoint &pos ); + ~DrawPartStruct(); virtual wxString GetClass() const { - return wxT("DrawPartStruct"); + return wxT( "DrawPartStruct" ); } - }; /* the class EDA_SchComponentStruct describes a real component */ -class EDA_SchComponentStruct: public DrawPartStruct +class EDA_SchComponentStruct : public DrawPartStruct { public: - int m_RefIdNumber; /* reference count: for U1, R2 .. it is the 1 or 2 value */ - int m_Multi; /* In multi unit chip - which unit to draw. */ - int m_FlagControlMulti; - int m_Convert; /* Gestion des mutiples representations (ex: conversion De Morgan) */ - int m_Transform[2][2]; /* The rotation/mirror transformation matrix. */ - bool * m_PinIsDangling; // liste des indicateurs de pin non connectee + int m_RefIdNumber; /* reference count: for U1, R2 .. it is the 1 or 2 value */ + int m_Multi; /* In multi unit chip - which unit to draw. */ + int m_FlagControlMulti; + int m_Convert; /* Gestion des mutiples representations (ex: conversion De Morgan) */ + int m_Transform[2][2]; /* The rotation/mirror transformation matrix. */ + bool* m_PinIsDangling; // liste des indicateurs de pin non connectee public: - EDA_SchComponentStruct(const wxPoint & pos = wxPoint(0,0)); - ~EDA_SchComponentStruct(void){} + EDA_SchComponentStruct( const wxPoint& pos = wxPoint( 0, 0 ) ); + ~EDA_SchComponentStruct( void ) { } + virtual wxString GetClass() const { - return wxT("EDA_SchComponentStruct"); + return wxT( "EDA_SchComponentStruct" ); } - - EDA_SchComponentStruct * GenCopy(void); - void SetRotationMiroir( int type ); - int GetRotationMiroir(void); - wxPoint GetScreenCoord(const wxPoint & coord); - void Display_Infos(WinEDA_DrawFrame * frame); - void ClearAnnotation(void); - EDA_Rect GetBoundaryBox(); - wxString ReturnFieldName(int FieldNumber); - virtual void Draw(WinEDA_DrawPanel * panel, wxDC * DC, const wxPoint & offset, int draw_mode, int Color = -1); - void SwapData(EDA_SchComponentStruct * copyitem); - virtual void Place(WinEDA_DrawFrame * frame, wxDC * DC); + + EDA_SchComponentStruct* GenCopy( void ); + void SetRotationMiroir( int type ); + int GetRotationMiroir(); + wxPoint GetScreenCoord( const wxPoint& coord ); + void Display_Infos( WinEDA_DrawFrame* frame ); + void ClearAnnotation(); + EDA_Rect GetBoundaryBox(); + wxString ReturnFieldName( int FieldNumber ); + + virtual void Draw( WinEDA_DrawPanel* panel, + wxDC* DC, + const wxPoint& offset, + int draw_mode, + int Color = -1 ); + void SwapData( EDA_SchComponentStruct* copyitem ); + + virtual void Place( WinEDA_DrawFrame* frame, wxDC* DC ); }; #endif /* COMPONENT_CLASS_H */ - diff --git a/eeschema/dialog_build_BOM.cpp b/eeschema/dialog_build_BOM.cpp index 2c1cc053ff..0d5cccd1c7 100644 --- a/eeschema/dialog_build_BOM.cpp +++ b/eeschema/dialog_build_BOM.cpp @@ -413,7 +413,7 @@ void WinEDA_Build_BOM_Frame::OnExitClick( wxCommandEvent& event ) } /**********************************************************/ -void WinEDA_Build_BOM_Frame::GenList(void) +void WinEDA_Build_BOM_Frame::GenList() /**********************************************************/ { #define EXT_LIST wxT(".lst") @@ -1142,7 +1142,7 @@ void WinEDA_Build_BOM_Frame::OnCloseWindow( wxCloseEvent& event ) } /**************************************************/ -void WinEDA_Build_BOM_Frame::SavePreferences(void) +void WinEDA_Build_BOM_Frame::SavePreferences() /**************************************************/ { s_Add_F1_state = m_AddField1->GetValue(); diff --git a/eeschema/dialog_build_BOM.h b/eeschema/dialog_build_BOM.h index d9510fec56..ee2c6b736a 100644 --- a/eeschema/dialog_build_BOM.h +++ b/eeschema/dialog_build_BOM.h @@ -114,7 +114,7 @@ public: ////@end WinEDA_Build_BOM_Frame event handler declarations - void GenList(void); + void GenList(); ////@begin WinEDA_Build_BOM_Frame member function declarations @@ -129,7 +129,7 @@ public: int PrintListeCmpByRef( FILE * f, EDA_BaseStruct ** List, int NbItems, bool CompactForm = FALSE ); int PrintListeCmpByVal( FILE *f, EDA_BaseStruct **List, int NbItems); void PrintFieldData(FILE * f, EDA_SchComponentStruct * DrawLibItem, bool CompactForm = FALSE); - void SavePreferences(void); + void SavePreferences(); /// Should we show tooltips? diff --git a/eeschema/dialog_create_component.h b/eeschema/dialog_create_component.h index 96cb8ee179..c6a189fba3 100644 --- a/eeschema/dialog_create_component.h +++ b/eeschema/dialog_create_component.h @@ -91,7 +91,7 @@ public: void CreateControls(); // others functions: - wxString ReturnCmpName(void) + wxString ReturnCmpName() { return m_CmpName->GetValue(); } diff --git a/eeschema/dialog_edit_component_in_lib.h b/eeschema/dialog_edit_component_in_lib.h index 43eb6b2972..531a5da0dd 100644 --- a/eeschema/dialog_edit_component_in_lib.h +++ b/eeschema/dialog_edit_component_in_lib.h @@ -119,10 +119,10 @@ public: /// Should we show tooltips? static bool ShowToolTips(); - void InitBuffers(void); - void BuildPanelBasic(void); - void BuildPanelDoc(void); - void BuildPanelAlias(void); + void InitBuffers(); + void BuildPanelBasic(); + void BuildPanelDoc(); + void BuildPanelAlias(); void BuildPanelEditField(); void PartPropertiesAccept(wxCommandEvent& event); void OnQuit(wxCommandEvent& event); @@ -130,16 +130,16 @@ public: void DeleteAliasOfPart(wxCommandEvent& event); void AddAliasOfPart(wxCommandEvent& event); bool ChangeNbUnitsPerPackage(int newUnit); - bool SetUnsetConvert(void); + bool SetUnsetConvert(); void CopyDocToAlias(wxCommandEvent& event); void BrowseAndSelectDocFile(wxCommandEvent& event); void SelectNewField(wxCommandEvent& event); void CopyFieldDataToBuffer(LibDrawField * Field); void CopyBufferToFieldData(LibDrawField * Field); - void CopyDataToPanelField(void); - void CopyPanelFieldToData(void); + void CopyDataToPanelField(); + void CopyPanelFieldToData(); - void BuildPanelFootprintFilter(void); + void BuildPanelFootprintFilter(); void DeleteAllFootprintFilter(wxCommandEvent& event); void DeleteOneFootprintFilter(wxCommandEvent& event); void AddFootprintFilter(wxCommandEvent& event); diff --git a/eeschema/dialog_edit_component_in_schematic.h b/eeschema/dialog_edit_component_in_schematic.h index 0ff44be77b..95c51f34e4 100644 --- a/eeschema/dialog_edit_component_in_schematic.h +++ b/eeschema/dialog_edit_component_in_schematic.h @@ -111,13 +111,13 @@ public: /// Should we show tooltips? static bool ShowToolTips(); - void InitBuffers(void); - void BuildPanelBasic(void); - void BuildPanelFields(void); + void InitBuffers(); + void BuildPanelBasic(); + void BuildPanelFields(); void ComponentPropertiesAccept(wxCommandEvent& event); void SetInitCmp( wxCommandEvent& event ); - void CopyDataToPanelField(void); - void CopyPanelFieldToData(void); + void CopyDataToPanelField(); + void CopyPanelFieldToData(); void SelectNewField(wxCommandEvent& event); ////@begin WinEDA_ComponentPropertiesFrame member variables diff --git a/eeschema/dialog_eeschema_config.cpp b/eeschema/dialog_eeschema_config.cpp index cac07e510a..d523740dff 100644 --- a/eeschema/dialog_eeschema_config.cpp +++ b/eeschema/dialog_eeschema_config.cpp @@ -303,7 +303,7 @@ void KiConfigEeschemaFrame::OnCloseWindow(wxCloseEvent & event) /*********************************************/ -void KiConfigEeschemaFrame::ChangeSetup(void) +void KiConfigEeschemaFrame::ChangeSetup() /*********************************************/ { g_UserLibDirBuffer = m_LibDirCtrl->GetValue(); @@ -377,7 +377,7 @@ wxString FullLibName,ShortLibName, Mask; /****************************************************/ -void KiConfigEeschemaFrame::SetFormatsNetListes(void) +void KiConfigEeschemaFrame::SetFormatsNetListes() /****************************************************/ /* Adjust the m_NetFormatBox current selection, according to the current netlist format*/ diff --git a/eeschema/dialog_eeschema_config.h b/eeschema/dialog_eeschema_config.h index 61119fe7d9..3e8b0cf675 100644 --- a/eeschema/dialog_eeschema_config.h +++ b/eeschema/dialog_eeschema_config.h @@ -119,10 +119,10 @@ public: /// Should we show tooltips? static bool ShowToolTips(); - void SetFormatsNetListes(void); + void SetFormatsNetListes(); void LibDelFct(wxCommandEvent& event); void AddOrInsertLibrary(wxCommandEvent& event); - void ChangeSetup(void); + void ChangeSetup(); ////@begin KiConfigEeschemaFrame member variables wxRadioBox* m_NetFormatBox; diff --git a/eeschema/dialog_erc.h b/eeschema/dialog_erc.h index c71071dfad..81b6299891 100644 --- a/eeschema/dialog_erc.h +++ b/eeschema/dialog_erc.h @@ -124,7 +124,7 @@ public: void SelNewCmp(wxCommandEvent& event); void ResetDefaultERCDiag(wxCommandEvent& event); void ChangeErrorLevel(wxCommandEvent& event); - void ReBuildMatrixPanel(void); + void ReBuildMatrixPanel(); ////@begin WinEDA_ErcFrame member variables wxNotebook* m_NoteBook; diff --git a/eeschema/edit_component_in_lib.cpp b/eeschema/edit_component_in_lib.cpp index 4305cf603e..957ea03b6a 100644 --- a/eeschema/edit_component_in_lib.cpp +++ b/eeschema/edit_component_in_lib.cpp @@ -126,7 +126,7 @@ int ii = Field->m_FieldId; } /*****************************************************/ -void WinEDA_PartPropertiesFrame::InitBuffers(void) +void WinEDA_PartPropertiesFrame::InitBuffers() /*****************************************************/ /* Init the buffers to a default value, or to values from CurrentLibEntry if CurrentLibEntry != NULL @@ -182,7 +182,7 @@ int ii; /*****************************************************/ -void WinEDA_PartPropertiesFrame::BuildPanelAlias(void) +void WinEDA_PartPropertiesFrame::BuildPanelAlias() /*****************************************************/ /* create the panel for component alias list editing */ @@ -241,7 +241,7 @@ wxButton * Button; /*****************************************************************/ -void WinEDA_PartPropertiesFrame::BuildPanelFootprintFilter(void) +void WinEDA_PartPropertiesFrame::BuildPanelFootprintFilter() /*****************************************************************/ /* create the panel for footprint filtering in cvpcb list */ @@ -303,7 +303,7 @@ wxBoxSizer * PanelFpFilterBoxSizer = new wxBoxSizer(wxHORIZONTAL); /*****************************************************/ -void WinEDA_PartPropertiesFrame::BuildPanelDoc(void) +void WinEDA_PartPropertiesFrame::BuildPanelDoc() /*****************************************************/ /* create the panel for component doc editing */ @@ -343,7 +343,7 @@ wxString msg_text; /*****************************************************/ -void WinEDA_PartPropertiesFrame::BuildPanelBasic(void) +void WinEDA_PartPropertiesFrame::BuildPanelBasic() /*****************************************************/ /* create the basic panel for component properties editing */ @@ -402,7 +402,7 @@ void WinEDA_PartPropertiesFrame::BuildPanelBasic(void) } /*********************************************************/ -void WinEDA_PartPropertiesFrame::BuildPanelEditField(void) +void WinEDA_PartPropertiesFrame::BuildPanelEditField() /**********************************************************/ /* Create and build the panel managing the fields (REF, VALUE ...) of the component @@ -483,7 +483,7 @@ wxString fieldnamelist[NUMBER_OF_FIELDS]; } /****************************************************************/ -void WinEDA_PartPropertiesFrame::CopyDataToPanelField(void) +void WinEDA_PartPropertiesFrame::CopyDataToPanelField() /****************************************************************/ /* Set the values displayed on the panel field according to the current field number @@ -520,7 +520,7 @@ int FieldId = m_CurrentFieldId; } /****************************************************************/ -void WinEDA_PartPropertiesFrame::CopyPanelFieldToData(void) +void WinEDA_PartPropertiesFrame::CopyPanelFieldToData() /****************************************************************/ /* Copy the values displayed on the panel field to the buffers according to the current field number @@ -944,7 +944,7 @@ LibEDA_BaseStruct* DrawItem, * NextDrawItem; /*****************************************************/ -bool WinEDA_PartPropertiesFrame::SetUnsetConvert(void) +bool WinEDA_PartPropertiesFrame::SetUnsetConvert() /*****************************************************/ /* crée ou efface (selon option AsConvert) les éléments de la représentation convertie d'un composant diff --git a/eeschema/eelayer.cpp b/eeschema/eelayer.cpp index c24f9749ce..610c0072bf 100644 --- a/eeschema/eelayer.cpp +++ b/eeschema/eelayer.cpp @@ -1,4 +1,4 @@ - /* Set up color Layers */ +/* Set up color Layers */ #include "fctsys.h" #include "gr_basic.h" @@ -18,462 +18,467 @@ /* Fonctions locales: */ /* Macro utile : */ -#define ADR(numlayer) &(g_LayerDescr.LayerColor[numlayer]) +#define ADR( numlayer ) & (g_LayerDescr.LayerColor[numlayer]) #define BUTT_SIZE_X 30 #define BUTT_SIZE_Y 20 enum col_sel_id { - ID_COLOR_SETUP = 1800 + ID_COLOR_SETUP = 1800 }; - /**********************************/ - /* Liste des menus de Menu_Layers */ - /**********************************/ +/**********************************/ +/* Liste des menus de Menu_Layers */ +/**********************************/ struct ColorButton - { - wxString m_Name; - int * m_Color; - int m_Id; - wxBitmapButton * m_Button; - int m_State; +{ + wxString m_Name; + int* m_Color; + int m_Id; + wxBitmapButton* m_Button; + int m_State; }; -static ColorButton Msg_General= +static ColorButton Msg_General = { - _("General"), /* Title */ - NULL + _( "General" ), /* Title */ + NULL }; -static ColorButton Msg_Sheets= +static ColorButton Msg_Sheets = { - _("Sheets"), /* Title */ - NULL + _( "Sheets" ), /* Title */ + NULL }; -static ColorButton Layer_Wire_Item= +static ColorButton Layer_Wire_Item = { - _("Wire"), /* Title */ - ADR(LAYER_WIRE) /* adr du parametre optionnel */ + _( "Wire" ), /* Title */ + ADR( LAYER_WIRE ) /* adr du parametre optionnel */ }; -static ColorButton Layer_Bus_Item= +static ColorButton Layer_Bus_Item = { - _("Bus"), /* Title */ - ADR(LAYER_BUS) /* adr du parametre optionnel */ + _( "Bus" ), /* Title */ + ADR( LAYER_BUS ) /* adr du parametre optionnel */ }; -static ColorButton Layer_Jonction_Item= +static ColorButton Layer_Jonction_Item = { - _("Junction"), /* Title */ - ADR(LAYER_JUNCTION) /* adr du parametre optionnel */ + _( "Junction" ), /* Title */ + ADR( LAYER_JUNCTION ) /* adr du parametre optionnel */ }; -static ColorButton Layer_LocalLabel_Item= +static ColorButton Layer_LocalLabel_Item = { - _("Label"), /* Title */ - ADR(LAYER_LOCLABEL) /* adr du parametre optionnel */ + _( "Label" ), /* Title */ + ADR( LAYER_LOCLABEL ) /* adr du parametre optionnel */ }; -static ColorButton Layer_GlobLabel_Item= +static ColorButton Layer_GlobLabel_Item = { - _("GlobLabel"), /* Title */ - ADR(LAYER_GLOBLABEL) /* adr du parametre optionnel */ + _( "GlobLabel" ), /* Title */ + ADR( LAYER_GLOBLABEL ) /* adr du parametre optionnel */ }; -static ColorButton Layer_PinNum_Item= +static ColorButton Layer_PinNum_Item = { - _("PinNum"), /* Title */ - ADR(LAYER_PINNUM) /* adr du parametre optionnel */ + _( "PinNum" ), /* Title */ + ADR( LAYER_PINNUM ) /* adr du parametre optionnel */ }; -static ColorButton Layer_PinNam_Item= +static ColorButton Layer_PinNam_Item = { - _("PinNam"), /* Title */ - ADR(LAYER_PINNAM) /* adr du parametre optionnel */ + _( "PinNam" ), /* Title */ + ADR( LAYER_PINNAM ) /* adr du parametre optionnel */ }; -static ColorButton Layer_Reference_Item= +static ColorButton Layer_Reference_Item = { - _("Reference"), /* Title */ - ADR(LAYER_REFERENCEPART) /* adr du parametre optionnel */ + _( "Reference" ), /* Title */ + ADR( LAYER_REFERENCEPART ) /* adr du parametre optionnel */ }; -static ColorButton Layer_Value_Item= +static ColorButton Layer_Value_Item = { - _("Value"), /* Title */ - ADR(LAYER_VALUEPART) /* adr du parametre optionnel */ + _( "Value" ), /* Title */ + ADR( LAYER_VALUEPART ) /* adr du parametre optionnel */ }; -static ColorButton Layer_Fields_Item= +static ColorButton Layer_Fields_Item = { - _("Fields"), /* Title */ - ADR(LAYER_FIELDS) /* adr du parametre optionnel */ + _( "Fields" ), /* Title */ + ADR( LAYER_FIELDS ) /* adr du parametre optionnel */ }; -static ColorButton Layer_BodyDevice_Item= +static ColorButton Layer_BodyDevice_Item = { - _("Body"), /* Title */ - ADR(LAYER_DEVICE) /* adr du parametre optionnel */ + _( "Body" ), /* Title */ + ADR( LAYER_DEVICE ) /* adr du parametre optionnel */ }; -static ColorButton Layer_BodyBackgroundDevice_Item= +static ColorButton Layer_BodyBackgroundDevice_Item = { - _("Body Bg"), /* Title */ - ADR(LAYER_DEVICE_BACKGROUND) /* adr du parametre optionnel */ + _( "Body Bg" ), /* Title */ + ADR( LAYER_DEVICE_BACKGROUND ) /* adr du parametre optionnel */ }; -static ColorButton MsgDevice_Item= +static ColorButton MsgDevice_Item = { - _("Device"), /* Title */ - NULL + _( "Device" ), /* Title */ + NULL }; -static ColorButton Layer_Notes_Item= +static ColorButton Layer_Notes_Item = { - _("Notes"), /* Title */ - ADR(LAYER_NOTES) /* adr du parametre optionnel */ + _( "Notes" ), /* Title */ + ADR( LAYER_NOTES ) /* adr du parametre optionnel */ }; -static ColorButton Layer_NetNam_Item= +static ColorButton Layer_NetNam_Item = { - _("Netname"), /* Title */ - ADR(LAYER_NETNAM) /* adr du parametre optionnel */ + _( "Netname" ), /* Title */ + ADR( LAYER_NETNAM ) /* adr du parametre optionnel */ }; -static ColorButton Layer_Pin_Item= +static ColorButton Layer_Pin_Item = { - _("Pin"), /* Title */ - ADR(LAYER_PIN) /* adr du parametre optionnel */ + _( "Pin" ), /* Title */ + ADR( LAYER_PIN ) /* adr du parametre optionnel */ }; -static ColorButton Layer_Sheet_Item= +static ColorButton Layer_Sheet_Item = { - _("Sheet"), /* Title */ - ADR(LAYER_SHEET) /* adr du parametre optionnel */ + _( "Sheet" ), /* Title */ + ADR( LAYER_SHEET ) /* adr du parametre optionnel */ }; -static ColorButton Layer_SheetName_Item= +static ColorButton Layer_SheetName_Item = { - _("SheetName"), /* Title */ - ADR(LAYER_SHEETNAME) /* adr du parametre optionnel */ + _( "SheetName" ), /* Title */ + ADR( LAYER_SHEETNAME ) /* adr du parametre optionnel */ }; -static ColorButton Layer_SheetFileName_Item= +static ColorButton Layer_SheetFileName_Item = { - _("Sheetfile"), /* Title */ - ADR(LAYER_SHEETFILENAME) /* adr du parametre optionnel */ + _( "Sheetfile" ), /* Title */ + ADR( LAYER_SHEETFILENAME ) /* adr du parametre optionnel */ }; -static ColorButton Layer_SheetLabel_Item= +static ColorButton Layer_SheetLabel_Item = { - _("SheetLabel"), /* Title */ - ADR(LAYER_SHEETLABEL) /* adr du parametre optionnel */ + _( "SheetLabel" ), /* Title */ + ADR( LAYER_SHEETLABEL ) /* adr du parametre optionnel */ }; -static ColorButton Layer_NoConnect_Item= +static ColorButton Layer_NoConnect_Item = { - _("NoConn"), /* Title */ - ADR(LAYER_NOCONNECT) /* adr du parametre optionnel */ + _( "NoConn" ), /* Title */ + ADR( LAYER_NOCONNECT ) /* adr du parametre optionnel */ }; -static ColorButton Msg_ErcMarck= +static ColorButton Msg_ErcMarck = { - _("Erc Mark"), /* Title */ - NULL + _( "Erc Mark" ), /* Title */ + NULL }; -static ColorButton Layer_Erc_Warning_Item= +static ColorButton Layer_Erc_Warning_Item = { - _("Erc Warning"), /* Title */ - ADR(LAYER_ERC_WARN) /* adr du parametre optionnel */ + _( "Erc Warning" ), /* Title */ + ADR( LAYER_ERC_WARN ) /* adr du parametre optionnel */ }; -static ColorButton Layer_Erc_Error_Item= +static ColorButton Layer_Erc_Error_Item = { - _("Erc Error"), /* Title */ - ADR(LAYER_ERC_ERR) /* adr du parametre optionnel */ + _( "Erc Error" ), /* Title */ + ADR( LAYER_ERC_ERR ) /* adr du parametre optionnel */ }; #define NB_BUTT 26 -static ColorButton * laytool_list[NB_BUTT+1] = { - &Msg_General, - &Layer_Wire_Item, - &Layer_Bus_Item, - &Layer_Jonction_Item, - &Layer_LocalLabel_Item, - &Layer_GlobLabel_Item, - &Layer_NetNam_Item, - &Layer_Notes_Item, - &Layer_NoConnect_Item, +static ColorButton* laytool_list[NB_BUTT + 1] = { + &Msg_General, + &Layer_Wire_Item, + &Layer_Bus_Item, + &Layer_Jonction_Item, + &Layer_LocalLabel_Item, + &Layer_GlobLabel_Item, + &Layer_NetNam_Item, + &Layer_Notes_Item, + &Layer_NoConnect_Item, - &MsgDevice_Item, - &Layer_BodyDevice_Item, - &Layer_BodyBackgroundDevice_Item, - &Layer_Pin_Item, - &Layer_PinNum_Item, - &Layer_PinNam_Item, - &Layer_Reference_Item, - &Layer_Value_Item, - &Layer_Fields_Item, + &MsgDevice_Item, + &Layer_BodyDevice_Item, + &Layer_BodyBackgroundDevice_Item, + &Layer_Pin_Item, + &Layer_PinNum_Item, + &Layer_PinNam_Item, + &Layer_Reference_Item, + &Layer_Value_Item, + &Layer_Fields_Item, - &Msg_Sheets, - &Layer_Sheet_Item, - &Layer_SheetFileName_Item, - &Layer_SheetName_Item, - &Layer_SheetLabel_Item, + &Msg_Sheets, + &Layer_Sheet_Item, + &Layer_SheetFileName_Item, + &Layer_SheetName_Item, + &Layer_SheetLabel_Item, - &Msg_ErcMarck, - &Layer_Erc_Warning_Item, - &Layer_Erc_Error_Item, + &Msg_ErcMarck, + &Layer_Erc_Warning_Item, + &Layer_Erc_Error_Item, - NULL + NULL }; /*************************************************************/ /* classe derivee pour la frame de Configuration des couleurs*/ /*************************************************************/ -class WinEDA_SetColorsFrame: public wxDialog +class WinEDA_SetColorsFrame : public wxDialog { private: - WinEDA_DrawFrame *m_Parent; - wxRadioBox * m_SelBgColor; + WinEDA_DrawFrame* m_Parent; + wxRadioBox* m_SelBgColor; public: - // Constructor and destructor - WinEDA_SetColorsFrame(WinEDA_DrawFrame *parent, const wxPoint& framepos); - ~WinEDA_SetColorsFrame(void) {}; + // Constructor and destructor + WinEDA_SetColorsFrame( WinEDA_DrawFrame * parent, const wxPoint &framepos ); + ~WinEDA_SetColorsFrame() { }; private: - void SetColor(wxCommandEvent& event); - void BgColorChoice(wxCommandEvent& event); - - DECLARE_EVENT_TABLE() + void SetColor( wxCommandEvent& event ); + void BgColorChoice( wxCommandEvent& event ); + DECLARE_EVENT_TABLE() }; /* Table des evenements pour WinEDA_SetColorsFrame */ -BEGIN_EVENT_TABLE(WinEDA_SetColorsFrame, wxDialog) - EVT_RADIOBOX(ID_SEL_BG_COLOR, WinEDA_SetColorsFrame::BgColorChoice) - EVT_COMMAND_RANGE(ID_COLOR_SETUP, ID_COLOR_SETUP+26, - wxEVT_COMMAND_BUTTON_CLICKED, - WinEDA_SetColorsFrame::SetColor) - +BEGIN_EVENT_TABLE( WinEDA_SetColorsFrame, wxDialog ) + EVT_RADIOBOX( ID_SEL_BG_COLOR, WinEDA_SetColorsFrame::BgColorChoice ) + EVT_COMMAND_RANGE( ID_COLOR_SETUP, ID_COLOR_SETUP + 26, + wxEVT_COMMAND_BUTTON_CLICKED, + WinEDA_SetColorsFrame::SetColor ) END_EVENT_TABLE() - /**************************************************************/ -void DisplayColorSetupFrame(WinEDA_DrawFrame * parent, - const wxPoint & framepos) +void DisplayColorSetupFrame( WinEDA_DrawFrame* parent, + const wxPoint& framepos ) /**************************************************************/ { - WinEDA_SetColorsFrame * frame = - new WinEDA_SetColorsFrame(parent, framepos); - frame->ShowModal(); - frame->Destroy(); + WinEDA_SetColorsFrame* frame = + new WinEDA_SetColorsFrame( parent, framepos ); + + frame->ShowModal(); + frame->Destroy(); } /**********************************************************************/ -WinEDA_SetColorsFrame::WinEDA_SetColorsFrame(WinEDA_DrawFrame *parent, - const wxPoint& framepos): - wxDialog(parent, -1, _("EESchema Preferences"), framepos, - wxSize(500, 270), DIALOG_STYLE) +WinEDA_SetColorsFrame::WinEDA_SetColorsFrame( WinEDA_DrawFrame* parent, + const wxPoint& framepos ) : + wxDialog( parent, -1, _( "EESchema Preferences" ), framepos, + wxSize( 500, 270 ), DIALOG_STYLE ) /**********************************************************************/ { #define START_Y 15 -wxBitmapButton * Button; -int ii, yy, butt_ID, buttcolor; -wxPoint pos; -int w = BUTT_SIZE_X, h = BUTT_SIZE_Y; -wxStaticText * text; -int right, bottom, line_height; -wxPoint bg_color_pos; - - m_Parent = parent; - SetFont(*g_DialogFont); + wxBitmapButton* Button; + int ii, yy, butt_ID, buttcolor; + wxPoint pos; + int w = BUTT_SIZE_X, h = BUTT_SIZE_Y; + wxStaticText* text; + int right, bottom, line_height; + wxPoint bg_color_pos; - pos.x = 10; pos.y = START_Y; - right = pos.x; bottom = 0; - line_height = h; - for ( ii = 0; laytool_list[ii] != NULL; ii++ ) - { - if( laytool_list[ii]->m_Color == NULL ) - { - if( pos.y != START_Y ) - { - pos.x = right + 10; - pos.y = START_Y; - bg_color_pos = pos; - } - wxString msg = wxGetTranslation(laytool_list[ii]->m_Name); - text = new wxStaticText( this, -1, - msg, - wxPoint( pos.x, pos.y ), - wxSize(-1, -1), 0 ); - line_height = MAX(line_height, text->GetRect().GetHeight()); - pos.y += line_height; - continue; - } - butt_ID = ID_COLOR_SETUP + ii; - laytool_list[ii]->m_Id = butt_ID; - wxMemoryDC iconDC; - wxBitmap ButtBitmap(w,h); - iconDC.SelectObject( ButtBitmap ); - buttcolor = *laytool_list[ii]->m_Color; - wxBrush Brush; - iconDC.SelectObject( ButtBitmap ); - iconDC.SetPen(*wxBLACK_PEN); - Brush.SetColour( - ColorRefs[buttcolor].m_Red, - ColorRefs[buttcolor].m_Green, - ColorRefs[buttcolor].m_Blue - ); - Brush.SetStyle(wxSOLID); + m_Parent = parent; + SetFont( *g_DialogFont ); - iconDC.SetBrush(Brush); - iconDC.DrawRectangle(0, 0, w, h); + pos.x = 10; pos.y = START_Y; + right = pos.x; bottom = 0; + line_height = h; + for( ii = 0; laytool_list[ii] != NULL; ii++ ) + { + if( laytool_list[ii]->m_Color == NULL ) + { + if( pos.y != START_Y ) + { + pos.x = right + 10; + pos.y = START_Y; + bg_color_pos = pos; + } + wxString msg = wxGetTranslation( laytool_list[ii]->m_Name ); + text = new wxStaticText( this, -1, + msg, + wxPoint ( pos.x, pos.y ), + wxSize( -1, -1 ), 0 ); - Button = new wxBitmapButton( this, butt_ID, - ButtBitmap, - wxPoint( pos.x, pos.y - (h - line_height) / 2 ), - wxSize(w, h) ); - laytool_list[ii]->m_Button = Button; + line_height = MAX( line_height, text->GetRect().GetHeight() ); + pos.y += line_height; + continue; + } + butt_ID = ID_COLOR_SETUP + ii; + laytool_list[ii]->m_Id = butt_ID; + wxMemoryDC iconDC; + wxBitmap ButtBitmap( w, h ); - wxString msg = wxGetTranslation(laytool_list[ii]->m_Name); - text = new wxStaticText( this, -1, - msg, - wxPoint(pos.x + 5 + w, pos.y ), - wxSize(-1, -1), 0 ); - wxPoint lowpos; - lowpos.x = text->GetRect().GetRight(); - lowpos.y = text->GetRect().GetBottom(); - right = MAX(right, lowpos.x); - bottom = MAX(bottom, lowpos.y); - bg_color_pos.y = lowpos.y; + iconDC.SelectObject( ButtBitmap ); + buttcolor = *laytool_list[ii]->m_Color; + wxBrush Brush; + iconDC.SelectObject( ButtBitmap ); + iconDC.SetPen( *wxBLACK_PEN ); + Brush.SetColour( + ColorRefs[buttcolor].m_Red, + ColorRefs[buttcolor].m_Green, + ColorRefs[buttcolor].m_Blue + ); + Brush.SetStyle( wxSOLID ); - yy = line_height + 5; - pos.y += yy; - } + iconDC.SetBrush( Brush ); + iconDC.DrawRectangle( 0, 0, w, h ); - bg_color_pos.x += 5; bg_color_pos.y += 25; -wxString bg_choice[2] = { _("White Background"), _("Black Background")}; - m_SelBgColor = new wxRadioBox(this, ID_SEL_BG_COLOR, - _("Background Colour"), bg_color_pos, - wxDefaultSize, 2, bg_choice, 1, wxRA_SPECIFY_COLS); - m_SelBgColor->SetSelection( (g_DrawBgColor == BLACK) ? 1 : 0); - bottom = MAX(bottom, m_SelBgColor->GetRect().GetBottom()); - right = MAX(right, m_SelBgColor->GetRect().GetRight()); + Button = new wxBitmapButton( this, butt_ID, + ButtBitmap, + wxPoint ( pos.x, pos.y - (h - line_height) / 2 ), + wxSize (w, h) ); - SetClientSize(wxSize(right+10, bottom+10)); + laytool_list[ii]->m_Button = Button; + + wxString msg = wxGetTranslation( laytool_list[ii]->m_Name ); + text = new wxStaticText( this, -1, + msg, + wxPoint (pos.x + 5 + w, pos.y ), + wxSize( -1, -1 ), 0 ); + + wxPoint lowpos; + lowpos.x = text->GetRect().GetRight(); + lowpos.y = text->GetRect().GetBottom(); + right = MAX( right, lowpos.x ); + bottom = MAX( bottom, lowpos.y ); + bg_color_pos.y = lowpos.y; + + yy = line_height + 5; + pos.y += yy; + } + + bg_color_pos.x += 5; bg_color_pos.y += 25; + + static const wxString bg_choice[2] = { _( "White Background" ), _( "Black Background" ) }; + + m_SelBgColor = new wxRadioBox( this, ID_SEL_BG_COLOR, + _( "Background Colour" ), bg_color_pos, + wxDefaultSize, 2, bg_choice, 1, wxRA_SPECIFY_COLS ); + + m_SelBgColor->SetSelection( (g_DrawBgColor == BLACK) ? 1 : 0 ); + bottom = MAX( bottom, m_SelBgColor->GetRect().GetBottom() ); + right = MAX( right, m_SelBgColor->GetRect().GetRight() ); + + SetClientSize( wxSize( right + 10, bottom + 10 ) ); } /***************************************************************/ -void WinEDA_SetColorsFrame::SetColor(wxCommandEvent& event) +void WinEDA_SetColorsFrame::SetColor( wxCommandEvent& event ) /***************************************************************/ { -int ii; -int id = event.GetId(); -int color; -int w = BUTT_SIZE_X, h = BUTT_SIZE_Y; + int ii; + int id = event.GetId(); + int color; + int w = BUTT_SIZE_X, h = BUTT_SIZE_Y; - color = DisplayColorFrame( this, - *laytool_list[id - ID_COLOR_SETUP]->m_Color ); - if ( color < 0 ) - return; + color = DisplayColorFrame( this, + *laytool_list[id - ID_COLOR_SETUP]->m_Color ); + if( color < 0 ) + return; - for ( ii = 0; laytool_list[ii] != NULL; ii++ ) - { - if( laytool_list[ii]->m_Id != id ) - continue; + for( ii = 0; laytool_list[ii] != NULL; ii++ ) + { + if( laytool_list[ii]->m_Id != id ) + continue; - if( *laytool_list[ii]->m_Color == color ) - break; + if( *laytool_list[ii]->m_Color == color ) + break; - *laytool_list[ii]->m_Color = color; - wxMemoryDC iconDC; + *laytool_list[ii]->m_Color = color; + wxMemoryDC iconDC; - wxBitmapButton * Button = laytool_list[ii]->m_Button; + wxBitmapButton* Button = laytool_list[ii]->m_Button; - wxBitmap ButtBitmap = Button->GetBitmapLabel(); - iconDC.SelectObject( ButtBitmap ); - int buttcolor = *laytool_list[ii]->m_Color; - wxBrush Brush; - iconDC.SelectObject( ButtBitmap ); - iconDC.SetPen(*wxBLACK_PEN); - Brush.SetColour( - ColorRefs[buttcolor].m_Red, - ColorRefs[buttcolor].m_Green, - ColorRefs[buttcolor].m_Blue - ); - Brush.SetStyle(wxSOLID); + wxBitmap ButtBitmap = Button->GetBitmapLabel(); + iconDC.SelectObject( ButtBitmap ); + int buttcolor = *laytool_list[ii]->m_Color; + wxBrush Brush; + iconDC.SelectObject( ButtBitmap ); + iconDC.SetPen( *wxBLACK_PEN ); + Brush.SetColour( + ColorRefs[buttcolor].m_Red, + ColorRefs[buttcolor].m_Green, + ColorRefs[buttcolor].m_Blue + ); + Brush.SetStyle( wxSOLID ); - iconDC.SetBrush(Brush); - iconDC.DrawRectangle(0,0, w, h); - Button->SetBitmapLabel(ButtBitmap); - if ( m_Parent->GetScreen() ) - m_Parent->GetScreen()->SetRefreshReq(); - } - Refresh(FALSE); + iconDC.SetBrush( Brush ); + iconDC.DrawRectangle( 0, 0, w, h ); + Button->SetBitmapLabel( ButtBitmap ); + if( m_Parent->GetScreen() ) + m_Parent->GetScreen()->SetRefreshReq(); + } + + Refresh( FALSE ); } /***************************************************************/ -void WinEDA_SetColorsFrame::BgColorChoice(wxCommandEvent& event) +void WinEDA_SetColorsFrame::BgColorChoice( wxCommandEvent& event ) /***************************************************************/ { -int color; + int color; - if ( m_SelBgColor->GetSelection() == 0 ) - color = WHITE; - else - color = BLACK; + if( m_SelBgColor->GetSelection() == 0 ) + color = WHITE; + else + color = BLACK; - if ( color != g_DrawBgColor ) - { - g_DrawBgColor = color; - m_Parent->SetDrawBgColor(g_DrawBgColor); - m_Parent->ReDrawPanel(); - } + if( color != g_DrawBgColor ) + { + g_DrawBgColor = color; + m_Parent->SetDrawBgColor( g_DrawBgColor ); + m_Parent->ReDrawPanel(); + } } /*************************/ -void SeedLayers(void) +void SeedLayers() /*************************/ { -LayerStruct * LayerPointer = &g_LayerDescr; -int pt; + LayerStruct* LayerPointer = &g_LayerDescr; + int pt; - LayerPointer->CommonColor = WHITE; - LayerPointer->Flags = 0; - pt = 0; - LayerPointer->CurrentWidth = 1; + LayerPointer->CommonColor = WHITE; + LayerPointer->Flags = 0; + pt = 0; + LayerPointer->CurrentWidth = 1; - /* seed Up the Layer colours, set all user layers off */ - for( pt = 0; pt < MAX_LAYERS; pt++ ) - { - LayerPointer->LayerStatus[pt] = 0; - LayerPointer->LayerColor[pt] = DARKGRAY; - } - - LayerPointer->NumberOfLayers = pt - 1; - /* Couleurs specifiques: Mise a jour par la lecture de la config */ + /* seed Up the Layer colours, set all user layers off */ + for( pt = 0; pt < MAX_LAYERS; pt++ ) + { + LayerPointer->LayerStatus[pt] = 0; + LayerPointer->LayerColor[pt] = DARKGRAY; + } + + LayerPointer->NumberOfLayers = pt - 1; + /* Couleurs specifiques: Mise a jour par la lecture de la config */ } /*******************************/ -int ReturnLayerColor(int Layer) +int ReturnLayerColor( int Layer ) /*******************************/ { - if( g_LayerDescr.Flags==0 ) - return( g_LayerDescr.LayerColor[Layer] ); - else - return( g_LayerDescr.CommonColor ); + if( g_LayerDescr.Flags==0 ) + return g_LayerDescr.LayerColor[Layer]; + else + return g_LayerDescr.CommonColor; } - diff --git a/eeschema/eestatus.cpp b/eeschema/eestatus.cpp index 5f520d7560..03fa39a959 100644 --- a/eeschema/eestatus.cpp +++ b/eeschema/eestatus.cpp @@ -52,7 +52,7 @@ public: // Constructor and destructor WinEDA_ConfigFrame(WinEDA_SchematicFrame *parent, const wxPoint& pos); - ~WinEDA_ConfigFrame(void) {}; + ~WinEDA_ConfigFrame() {}; void OnCloseWindow(wxCloseEvent & event); @@ -62,7 +62,7 @@ public: void LibDelFct(wxCommandEvent& event); void AddOrInsertLibrary(wxCommandEvent& event); void ReturnNetFormat(wxCommandEvent& event); - void ChangeSetup(void); + void ChangeSetup(); DECLARE_EVENT_TABLE() @@ -195,7 +195,7 @@ void WinEDA_ConfigFrame::OnCloseWindow(wxCloseEvent & event) /*******************************************/ -void WinEDA_ConfigFrame::ChangeSetup(void) +void WinEDA_ConfigFrame::ChangeSetup() /*******************************************/ { g_UserLibDirBuffer = LibDirCtrl->GetData(); diff --git a/eeschema/erc.cpp b/eeschema/erc.cpp index 1bd80eaff0..e1c995376c 100644 --- a/eeschema/erc.cpp +++ b/eeschema/erc.cpp @@ -159,7 +159,7 @@ void InstallErcFrame(WinEDA_SchematicFrame *parent, wxPoint & pos) /*********************************************/ -void WinEDA_ErcFrame::ReBuildMatrixPanel(void) +void WinEDA_ErcFrame::ReBuildMatrixPanel() /*********************************************/ /* Build or rebuild the panel showing the ERC matrix */ diff --git a/eeschema/fieldedi.cpp b/eeschema/fieldedi.cpp index 8ba3f3737f..50da1e266a 100644 --- a/eeschema/fieldedi.cpp +++ b/eeschema/fieldedi.cpp @@ -107,18 +107,18 @@ private: public: // Constructor and destructor WinEDA_PartPropertiesFrame(WinEDA_LibeditFrame *parent, wxPoint& pos); - ~WinEDA_PartPropertiesFrame(void) + ~WinEDA_PartPropertiesFrame() { if( AliasListCopy ) AliasListCopy->FreeList(); }; private: void PartPropertiesAccept(wxCommandEvent& event); - void DeleteAllAliasOfPart(void); - void DeleteAliasOfPart(void); - void AddAliasOfPart(void); + void DeleteAllAliasOfPart(); + void DeleteAliasOfPart(); + void AddAliasOfPart(); bool ChangeNbUnitsPerPackage(int newUnit); - bool SetUnsetConvert(void); + bool SetUnsetConvert(); DECLARE_EVENT_TABLE() }; @@ -566,10 +566,10 @@ bool recreateTB = FALSE; /***************************************************************/ - /* void WinEDA_PartPropertiesFrame::DeleteAllAliasOfPart(void) */ + /* void WinEDA_PartPropertiesFrame::DeleteAllAliasOfPart() */ /***************************************************************/ -void WinEDA_PartPropertiesFrame::DeleteAllAliasOfPart(void) +void WinEDA_PartPropertiesFrame::DeleteAllAliasOfPart() { if(CurrentLibEntry && AliasListCopy ) @@ -585,10 +585,10 @@ void WinEDA_PartPropertiesFrame::DeleteAllAliasOfPart(void) } /*********************************************************/ - /* void WinEDA_PartPropertiesFrame::AddAliasOfPart(void) */ + /* void WinEDA_PartPropertiesFrame::AddAliasOfPart() */ /*********************************************************/ -void WinEDA_PartPropertiesFrame::AddAliasOfPart(void) +void WinEDA_PartPropertiesFrame::AddAliasOfPart() { char Line[LINE_LEN]; int llen; @@ -623,10 +623,10 @@ ListOfAliasStruct * NewAlias; } /********************************/ - /* void DeleteAliasOfPart(void) */ + /* void DeleteAliasOfPart() */ /********************************/ -void WinEDA_PartPropertiesFrame::DeleteAliasOfPart(void) +void WinEDA_PartPropertiesFrame::DeleteAliasOfPart() { ListOfAliasStruct * Alias; wxString aliasname; @@ -745,7 +745,7 @@ LibDrawField *Field = (LibDrawField *)CurrentDrawItem; } /********************************/ - /* static void PlaceField(void) */ + /* static void PlaceField() */ /********************************/ void WinEDA_LibeditFrame::PlaceField(wxDC * DC, LibDrawField *Field) @@ -1046,12 +1046,12 @@ LibEDA_BaseStruct* DrawItem, * NextDrawItem; /**********************************************************/ - /* void WinEDA_PartPropertiesFrame::SetUnsetConvert(void) */ + /* void WinEDA_PartPropertiesFrame::SetUnsetConvert() */ /**********************************************************/ /* crée ou efface (selon option AsConvert) les éléments de la représentation convertie d'un composant */ -bool WinEDA_PartPropertiesFrame::SetUnsetConvert(void) +bool WinEDA_PartPropertiesFrame::SetUnsetConvert() { int FlagDel = 0; LibEDA_BaseStruct* DrawItem = NULL, * NextDrawItem; diff --git a/eeschema/files-io.cpp b/eeschema/files-io.cpp index 32db4ad781..dcda729f92 100644 --- a/eeschema/files-io.cpp +++ b/eeschema/files-io.cpp @@ -114,7 +114,7 @@ wxString LibArchiveFileName; } /************************/ -int CountCmpNumber(void) +int CountCmpNumber() /************************/ /* Routine retournant le nombre de composants dans le schema, powers non comprises */ diff --git a/eeschema/genliste.cpp b/eeschema/genliste.cpp index 0830ba8689..b35612df8e 100644 --- a/eeschema/genliste.cpp +++ b/eeschema/genliste.cpp @@ -71,10 +71,10 @@ public: // Constructor and destructor WinEDA_GenCmpListFrame(WinEDA_DrawFrame *parent, wxPoint& pos); - ~WinEDA_GenCmpListFrame(void) {}; + ~WinEDA_GenCmpListFrame() {}; void GenList(wxCommandEvent& event); - void GenListUpdateOpt(void); + void GenListUpdateOpt(); void ToolsExit(wxCommandEvent& event); DECLARE_EVENT_TABLE() @@ -151,7 +151,7 @@ wxPoint pos; } // Fonctions de positionnement des variables d'option -void WinEDA_GenCmpListFrame::GenListUpdateOpt(void) +void WinEDA_GenCmpListFrame::GenListUpdateOpt() { ItemsToList = 0; if ( m_ListCmpbyRefItems->GetValue() ) ItemsToList |= LISTCMP_BY_REF; diff --git a/eeschema/hierarch.cpp b/eeschema/hierarch.cpp index 71ed2b9e9e..41463e389d 100644 --- a/eeschema/hierarch.cpp +++ b/eeschema/hierarch.cpp @@ -51,7 +51,7 @@ private: wxImageList *imageList; public: - WinEDA_Tree(void) { } + WinEDA_Tree() { } WinEDA_Tree(WinEDA_HierFrame *parent); DECLARE_DYNAMIC_CLASS(WinEDA_Tree) @@ -93,7 +93,7 @@ public: WinEDA_HierFrame(WinEDA_SchematicFrame *parent, wxDC * DC, const wxPoint& pos); void BuildSheetList(EDA_BaseStruct * DrawStruct, wxTreeItemId * previousmenu); - ~WinEDA_HierFrame(void); + ~WinEDA_HierFrame(); void OnSelect(wxTreeEvent& event); @@ -165,7 +165,7 @@ wxRect itemrect; } } -WinEDA_HierFrame::~WinEDA_HierFrame(void) +WinEDA_HierFrame::~WinEDA_HierFrame() { } @@ -267,7 +267,7 @@ DrawSheetStruct * Sheet; /******************************************************/ -void WinEDA_SchematicFrame::InstallPreviousScreen(void) +void WinEDA_SchematicFrame::InstallPreviousScreen() /******************************************************/ /* Set the current screen to display the parent sheet of the current displayed sheet */ diff --git a/eeschema/lib_export.cpp b/eeschema/lib_export.cpp index 3e819a717c..acad1c66e0 100644 --- a/eeschema/lib_export.cpp +++ b/eeschema/lib_export.cpp @@ -22,7 +22,7 @@ /*************************************************/ -void WinEDA_LibeditFrame::ImportOnePart(void) +void WinEDA_LibeditFrame::ImportOnePart() /*************************************************/ /* Routine de lecture de 1 description. Le format est celui des librairies, mais on ne charge que 1 composant diff --git a/eeschema/libedit.cpp b/eeschema/libedit.cpp index 9a37dcb87a..4cca9f3a27 100644 --- a/eeschema/libedit.cpp +++ b/eeschema/libedit.cpp @@ -26,7 +26,7 @@ /**********************************************/ -void WinEDA_LibeditFrame::DisplayLibInfos(void) +void WinEDA_LibeditFrame::DisplayLibInfos() /**********************************************/ /* Affiche dans la zone messages la librairie , et le composant edite */ { @@ -60,7 +60,7 @@ wxChar UnitLetter[] = wxT("?ABCDEFGHIJKLMNOPQRSTUVWXYZ"); /**************************************************/ -void WinEDA_LibeditFrame::SelectActiveLibrary(void) +void WinEDA_LibeditFrame::SelectActiveLibrary() /**************************************************/ /* Routine to Select Current library */ @@ -78,7 +78,7 @@ LibraryStruct *Lib; /*************************************************/ /* Routine to Load one selected library content. */ /*************************************************/ -bool WinEDA_LibeditFrame::LoadOneLibraryPart(void) +bool WinEDA_LibeditFrame::LoadOneLibraryPart() { int i; wxString msg; @@ -216,7 +216,7 @@ void WinEDA_LibeditFrame::RedrawActiveWindow(wxDC * DC, bool EraseBg) /*************************************************/ -void WinEDA_LibeditFrame::SaveActiveLibrary(void) +void WinEDA_LibeditFrame::SaveActiveLibrary() /*************************************************/ /* Sauvegarde en fichier la librairie pointee par CurrentLib une sauvegarde en .bak de l'ancien fichier est egalement cree @@ -274,7 +274,7 @@ LibCmpEntry * CmpEntry; } /*********************************************/ -void WinEDA_LibeditFrame::DeleteOnePart(void) +void WinEDA_LibeditFrame::DeleteOnePart() /*********************************************/ /* Routine de suppression d'un composant dans la librairie courante (effacement en memoire uniquement, le fichier n'est pas modifie) @@ -359,7 +359,7 @@ wxString msg; /****************************************************/ -void WinEDA_LibeditFrame::CreateNewLibraryPart(void) +void WinEDA_LibeditFrame::CreateNewLibraryPart() /****************************************************/ /* Routine to create a new library component If an old component is currently in edit, it is deleted. @@ -540,7 +540,7 @@ EDA_LibCmpAliasStruct * AliasEntry; /***************************************************/ -void WinEDA_LibeditFrame::SaveOnePartInMemory(void) +void WinEDA_LibeditFrame::SaveOnePartInMemory() /***************************************************/ /* Routine de sauvegarde de la "partlib" courante dans la librairie courante Sauvegarde en memoire uniquement, et PAS sur fichier diff --git a/eeschema/libedit_undo_redo.cpp b/eeschema/libedit_undo_redo.cpp index 26853caf45..63f152068e 100644 --- a/eeschema/libedit_undo_redo.cpp +++ b/eeschema/libedit_undo_redo.cpp @@ -39,7 +39,7 @@ EDA_LibComponentStruct * CopyItem; } /******************************************************/ -void WinEDA_LibeditFrame::GetComponentFromRedoList(void) +void WinEDA_LibeditFrame::GetComponentFromRedoList() /******************************************************/ /* Redo the last edition: - Place the current edited library component in undo list @@ -59,7 +59,7 @@ void WinEDA_LibeditFrame::GetComponentFromRedoList(void) } /******************************************************/ -void WinEDA_LibeditFrame::GetComponentFromUndoList(void) +void WinEDA_LibeditFrame::GetComponentFromUndoList() /******************************************************/ /* Undo the last edition: - Place the current edited library component in Redo list diff --git a/eeschema/libedpart.cpp b/eeschema/libedpart.cpp index bf492efbfd..3186ac1171 100644 --- a/eeschema/libedpart.cpp +++ b/eeschema/libedpart.cpp @@ -99,14 +99,14 @@ private: public: // Constructor and destructor WinEDA_PartPropertiesFrame(WinEDA_LibeditFrame *parent, wxPoint& pos); - ~WinEDA_PartPropertiesFrame(void) + ~WinEDA_PartPropertiesFrame() { }; private: - void BuildPanelBasic(void); - void BuildPanelDoc(void); - void BuildPanelAlias(void); + void BuildPanelBasic(); + void BuildPanelDoc(); + void BuildPanelAlias(); void BuildPanelEditField(int fieldId); void PartPropertiesAccept(wxCommandEvent& event); void OnQuit(wxCommandEvent& event); @@ -114,7 +114,7 @@ private: void DeleteAliasOfPart(wxCommandEvent& event); void AddAliasOfPart(wxCommandEvent& event); bool ChangeNbUnitsPerPackage(int newUnit); - bool SetUnsetConvert(void); + bool SetUnsetConvert(); void CopyDocToAlias(wxCommandEvent& event); void BrowseAndSelectDocFile(wxCommandEvent& event); @@ -254,7 +254,7 @@ int ii; } /*****************************************************/ -void WinEDA_PartPropertiesFrame::BuildPanelAlias(void) +void WinEDA_PartPropertiesFrame::BuildPanelAlias() /*****************************************************/ /* create the panel for component alias list editing */ @@ -305,7 +305,7 @@ wxButton * Button; /*****************************************************/ -void WinEDA_PartPropertiesFrame::BuildPanelDoc(void) +void WinEDA_PartPropertiesFrame::BuildPanelDoc() /*****************************************************/ /* create the panel for component doc editing */ @@ -388,7 +388,7 @@ wxString msg_text; /*****************************************************/ -void WinEDA_PartPropertiesFrame::BuildPanelBasic(void) +void WinEDA_PartPropertiesFrame::BuildPanelBasic() /*****************************************************/ /* create the basic panel for component properties editing */ @@ -1033,7 +1033,7 @@ LibEDA_BaseStruct* DrawItem, * NextDrawItem; /*****************************************************/ -bool WinEDA_PartPropertiesFrame::SetUnsetConvert(void) +bool WinEDA_PartPropertiesFrame::SetUnsetConvert() /*****************************************************/ /* crée ou efface (selon option AsConvert) les éléments de la représentation convertie d'un composant diff --git a/eeschema/libframe.cpp b/eeschema/libframe.cpp index a07e5074c9..5b4e4dd5fe 100644 --- a/eeschema/libframe.cpp +++ b/eeschema/libframe.cpp @@ -82,7 +82,7 @@ WinEDA_LibeditFrame::WinEDA_LibeditFrame(wxWindow * father, WinEDA_App *parent, } /**********************************************/ -WinEDA_LibeditFrame::~WinEDA_LibeditFrame(void) +WinEDA_LibeditFrame::~WinEDA_LibeditFrame() /**********************************************/ { m_Parent->LibeditFrame = NULL; @@ -124,7 +124,7 @@ LibraryStruct *Lib; /******************************************/ -void WinEDA_LibeditFrame::SetToolbars(void) +void WinEDA_LibeditFrame::SetToolbars() /******************************************/ /* Enable or disable tools of the differents toolbars, according to the current conditions or options @@ -233,7 +233,7 @@ void WinEDA_LibeditFrame::SetToolbars(void) } /**************************************/ -int WinEDA_LibeditFrame::BestZoom(void) +int WinEDA_LibeditFrame::BestZoom() /**************************************/ { int dx, dy, ii,jj ; diff --git a/eeschema/menubar.cpp b/eeschema/menubar.cpp index e12e4d21f0..4b1d6cfd17 100644 --- a/eeschema/menubar.cpp +++ b/eeschema/menubar.cpp @@ -19,7 +19,7 @@ /************************************************/ -void WinEDA_SchematicFrame::ReCreateMenuBar(void) +void WinEDA_SchematicFrame::ReCreateMenuBar() /************************************************/ /* create or update the menubar for the schematic frame */ diff --git a/eeschema/netlist.cpp b/eeschema/netlist.cpp index cfd4ba867c..740e06b4d6 100644 --- a/eeschema/netlist.cpp +++ b/eeschema/netlist.cpp @@ -75,7 +75,7 @@ int i; } /*****************************************************/ -void * WinEDA_SchematicFrame::BuildNetListBase(void) +void * WinEDA_SchematicFrame::BuildNetListBase() /*****************************************************/ /* Routine qui construit le tableau des elements connectes du projet met a jour: diff --git a/eeschema/netlist_control.cpp b/eeschema/netlist_control.cpp index fde5f198a5..9c8597487c 100644 --- a/eeschema/netlist_control.cpp +++ b/eeschema/netlist_control.cpp @@ -55,7 +55,7 @@ public: EDA_NoteBookPage(wxNotebook* parent, const wxString & title, int id_NetType, int idCheckBox, int idCreateFile); - ~EDA_NoteBookPage(void) {}; + ~EDA_NoteBookPage() {}; }; @@ -141,14 +141,14 @@ public: public: // Constructor and destructor WinEDA_NetlistFrame(WinEDA_SchematicFrame *parent, wxPoint& pos); - ~WinEDA_NetlistFrame(void) {}; + ~WinEDA_NetlistFrame() {}; private: - void InstallCustomPages(void); - void InstallPageSpice(void); + void InstallCustomPages(); + void InstallPageSpice(); void GenNetlist(wxCommandEvent& event); void RunSimulator(wxCommandEvent& event); - void NetlistUpdateOpt(void); + void NetlistUpdateOpt(); void NetlistExit(wxCommandEvent& event); void SelectNetlistType(wxCommandEvent& event); void SetupPlugin(wxCommandEvent& event); @@ -238,7 +238,7 @@ int ii; /*************************************************/ -void WinEDA_NetlistFrame::InstallPageSpice(void) +void WinEDA_NetlistFrame::InstallPageSpice() /*************************************************/ /* Create the spice page */ @@ -278,7 +278,7 @@ wxString netlist_opt[2] = { _("Use Net Names"), _("Use Net Numbers") }; } /*************************************************/ -void WinEDA_NetlistFrame::InstallCustomPages(void) +void WinEDA_NetlistFrame::InstallCustomPages() /*************************************************/ /* create the pages for custom netlist format selection: */ @@ -376,7 +376,7 @@ EDA_NoteBookPage * CurrPage; } /***********************************************/ -void WinEDA_NetlistFrame::NetlistUpdateOpt(void) +void WinEDA_NetlistFrame::NetlistUpdateOpt() /***********************************************/ { int ii; diff --git a/eeschema/options.cpp b/eeschema/options.cpp index 62d09d0866..0b3dff07d5 100644 --- a/eeschema/options.cpp +++ b/eeschema/options.cpp @@ -64,7 +64,7 @@ public: // Constructor and destructor WinEDA_SetOptionsFrame(WinEDA_DrawFrame *parent, const wxPoint& framepos); - ~WinEDA_SetOptionsFrame(void) {}; + ~WinEDA_SetOptionsFrame() {}; private: void Accept(wxCommandEvent& event); diff --git a/eeschema/pinedit.cpp b/eeschema/pinedit.cpp index a8d4e35db1..364edc249d 100644 --- a/eeschema/pinedit.cpp +++ b/eeschema/pinedit.cpp @@ -107,7 +107,7 @@ wxString msg; /*********************************************/ -void WinEDA_LibeditFrame::InitEditOnePin(void) +void WinEDA_LibeditFrame::InitEditOnePin() /*********************************************/ /* Routine d'installation du menu d'edition d'une pin */ diff --git a/eeschema/plothpgl.cpp b/eeschema/plothpgl.cpp index a5a784d154..7db53a6c37 100644 --- a/eeschema/plothpgl.cpp +++ b/eeschema/plothpgl.cpp @@ -372,7 +372,7 @@ wxIcon WinEDA_PlotHPGLFrame::GetIconResource( const wxString& name ) /***************************************************/ -void WinEDA_PlotHPGLFrame::SetPageOffsetValue(void) +void WinEDA_PlotHPGLFrame::SetPageOffsetValue() /***************************************************/ { wxString msg; diff --git a/eeschema/plothpgl.h b/eeschema/plothpgl.h index 10c7369093..ccc076f0ae 100644 --- a/eeschema/plothpgl.h +++ b/eeschema/plothpgl.h @@ -134,7 +134,7 @@ public: void Plot_1_Page_HPGL(const wxString & FullFileName,BASE_SCREEN * screen); void Plot_Schematic_HPGL(int Select_PlotAll, int HPGL_SheetSize); void ReturnSheetDims( BASE_SCREEN * screen, wxSize & SheetSize, wxPoint & SheetOffset); - void SetPageOffsetValue(void); + void SetPageOffsetValue(); ////@begin WinEDA_PlotHPGLFrame member variables wxRadioBox* m_SizeOption; diff --git a/eeschema/plotps.cpp b/eeschema/plotps.cpp index 30de46f71a..5aa2a1982f 100644 --- a/eeschema/plotps.cpp +++ b/eeschema/plotps.cpp @@ -303,7 +303,7 @@ void WinEDA_PlotPSFrame::OnCloseClick( wxCommandEvent& event ) /*****************************************/ -void WinEDA_PlotPSFrame::InitOptVars(void) +void WinEDA_PlotPSFrame::InitOptVars() /*****************************************/ { Plot_Sheet_Ref = m_Plot_Sheet_Ref->GetValue(); diff --git a/eeschema/plotps.h b/eeschema/plotps.h index 4c843a907b..28acfc9f27 100644 --- a/eeschema/plotps.h +++ b/eeschema/plotps.h @@ -104,7 +104,7 @@ public: wxIcon GetIconResource( const wxString& name ); ////@end WinEDA_PlotPSFrame member function declarations - void InitOptVars(void); + void InitOptVars(); void CreatePSFile(int AllPages, int pagesize); void PlotOneSheetPS(const wxString & FileName, BASE_SCREEN * screen, Ki_PageDescr * sheet, int BBox[4], wxPoint plot_offset); diff --git a/eeschema/protos.h b/eeschema/protos.h index eb54dd3f68..8267b5a153 100644 --- a/eeschema/protos.h +++ b/eeschema/protos.h @@ -47,7 +47,7 @@ void InstallCmpeditFrame(WinEDA_SchematicFrame * parent, wxPoint & pos, /* Functions common to all EELibs?.c modules: */ int LibraryEntryCompare(EDA_LibComponentStruct *LE1, EDA_LibComponentStruct *LE2); -int NumOfLibraries(void); +int NumOfLibraries(); EDA_LibComponentStruct *FindLibPart(const wxChar *Name, const wxString & LibName, int Alias); void DrawingLibInGhost(WinEDA_DrawPanel * panel, wxDC * DC, EDA_LibComponentStruct *LibEntry, @@ -83,7 +83,7 @@ LibraryStruct * LoadLibraryName(WinEDA_DrawFrame * frame, const wxString & FullLibName, const wxString & LibName); void LoadLibraries(WinEDA_DrawFrame * frame); void FreeCmpLibrary(wxWindow * frame, const wxString & LibName); -const wxChar **GetLibNames(void); +const wxChar **GetLibNames(); void SnapLibItemPoint(int OrigX, int OrigY, int *ClosestX, int *ClosestY, EDA_SchComponentStruct *DrawLibItem); @@ -208,14 +208,14 @@ void RedrawOneStruct(WinEDA_DrawPanel * panel, wxDC * DC, EDA_BaseStruct *Struct /**************/ /* EELAYER.CPP */ /**************/ -void SeedLayers(void); +void SeedLayers(); int ReturnLayerColor(int Layer); void DisplayColorSetupFrame(WinEDA_DrawFrame * parent, const wxPoint & pos); /*************/ /* EELOAD.CPP */ /*************/ -int CountCmpNumber(void); +int CountCmpNumber(); /***************/ diff --git a/eeschema/schframe.cpp b/eeschema/schframe.cpp index 50ee66083d..d9fd6cad5c 100644 --- a/eeschema/schframe.cpp +++ b/eeschema/schframe.cpp @@ -156,7 +156,7 @@ WinEDA_SchematicFrame:: WinEDA_SchematicFrame(wxWindow * father, WinEDA_App *par /* Destructeur */ /***************/ -WinEDA_SchematicFrame::~WinEDA_SchematicFrame(void) +WinEDA_SchematicFrame::~WinEDA_SchematicFrame() { m_Parent->SchematicFrame = NULL; m_CurrentScreen = ScreenSch; @@ -228,7 +228,7 @@ SCH_SCREEN * screen; /********************************************/ -void WinEDA_SchematicFrame::SetToolbars(void) +void WinEDA_SchematicFrame::SetToolbars() /********************************************/ /* Active ou desactive les tools du toolbar horizontal, en fonction des commandes en cours @@ -283,7 +283,7 @@ en cours } /******************************************/ -int WinEDA_SchematicFrame::BestZoom(void) +int WinEDA_SchematicFrame::BestZoom() /******************************************/ { int dx, dy, ii,jj ; diff --git a/eeschema/tool_viewlib.cpp b/eeschema/tool_viewlib.cpp index 22809158dc..391dbe4565 100644 --- a/eeschema/tool_viewlib.cpp +++ b/eeschema/tool_viewlib.cpp @@ -24,7 +24,7 @@ #include "Lib_next.xpm" /****************************************************/ -void WinEDA_ViewlibFrame::ReCreateHToolbar(void) +void WinEDA_ViewlibFrame::ReCreateHToolbar() /****************************************************/ { int ii; @@ -145,7 +145,7 @@ bool asdeMorgan = FALSE, state; /****************************************************/ -void WinEDA_ViewlibFrame::ReCreateVToolbar(void) +void WinEDA_ViewlibFrame::ReCreateVToolbar() /****************************************************/ { } diff --git a/eeschema/viewlib_frame.cpp b/eeschema/viewlib_frame.cpp index 641485d825..393ecdc641 100644 --- a/eeschema/viewlib_frame.cpp +++ b/eeschema/viewlib_frame.cpp @@ -106,7 +106,7 @@ WinEDA_ViewlibFrame::WinEDA_ViewlibFrame(wxWindow * father, WinEDA_App *parent, /* Destructeur */ /***************/ -WinEDA_ViewlibFrame::~WinEDA_ViewlibFrame(void) +WinEDA_ViewlibFrame::~WinEDA_ViewlibFrame() { delete m_CurrentScreen; m_Parent->ViewlibFrame = NULL; @@ -172,7 +172,7 @@ wxSize Vtoolbar_size; /*******************************************/ -int WinEDA_ViewlibFrame::BestZoom(void) +int WinEDA_ViewlibFrame::BestZoom() /*******************************************/ { int bestzoom, ii, jj; @@ -212,7 +212,7 @@ EDA_LibComponentStruct * CurrentLibEntry = NULL; } /***************************************************/ -void WinEDA_ViewlibFrame::ReCreateListLib(void) +void WinEDA_ViewlibFrame::ReCreateListLib() /***************************************************/ { const wxChar ** ListNames, ** names; @@ -251,7 +251,7 @@ bool found = FALSE; } /***********************************************/ -void WinEDA_ViewlibFrame::ReCreateListCmp(void) +void WinEDA_ViewlibFrame::ReCreateListCmp() /***********************************************/ { int ii; diff --git a/eeschema/viewlibs.cpp b/eeschema/viewlibs.cpp index f1fd2af83c..de4a3fa3dd 100644 --- a/eeschema/viewlibs.cpp +++ b/eeschema/viewlibs.cpp @@ -106,7 +106,7 @@ void WinEDA_ViewlibFrame::OnRightClick(const wxPoint& MousePos, wxMenu * PopMenu /**********************************************/ -void WinEDA_ViewlibFrame::DisplayLibInfos(void) +void WinEDA_ViewlibFrame::DisplayLibInfos() /**********************************************/ /* Affiche en Ligne d'info la librairie en cours de visualisation */ { @@ -124,7 +124,7 @@ LibraryStruct * Lib; /*****************************************/ /* Routine to Select Current library */ /*****************************************/ -void WinEDA_ViewlibFrame::SelectCurrentLibrary(void) +void WinEDA_ViewlibFrame::SelectCurrentLibrary() { LibraryStruct * Lib; diff --git a/eeschema/wxprint.h b/eeschema/wxprint.h index 620554f6b5..4d6788aa0e 100644 --- a/eeschema/wxprint.h +++ b/eeschema/wxprint.h @@ -53,7 +53,7 @@ class MyCanvas: public wxScrolledWindow { public: MyCanvas(wxFrame *frame, const wxPoint& pos, const wxSize& size, long style = wxRETAINED); - ~MyCanvas(void) ; + ~MyCanvas() ; virtual void OnDraw(wxDC& dc); void OnEvent(wxMouseEvent& event); diff --git a/gerbview/controle.cpp b/gerbview/controle.cpp index d311129305..b95aeabe17 100644 --- a/gerbview/controle.cpp +++ b/gerbview/controle.cpp @@ -21,7 +21,7 @@ /**********************************************************************/ -EDA_BaseStruct * WinEDA_GerberFrame::GerberGeneralLocateAndDisplay(void) +EDA_BaseStruct * WinEDA_GerberFrame::GerberGeneralLocateAndDisplay() /**********************************************************************/ { return Locate(CURSEUR_OFF_GRILLE); diff --git a/gerbview/dcode.cpp b/gerbview/dcode.cpp index a48f20a146..83decd8ef7 100644 --- a/gerbview/dcode.cpp +++ b/gerbview/dcode.cpp @@ -80,7 +80,7 @@ int ii; -GERBER_Descr::~GERBER_Descr(void) +GERBER_Descr::~GERBER_Descr() { int ii; @@ -95,7 +95,7 @@ int ii; } /******************************************/ -void GERBER_Descr::ResetDefaultValues(void) +void GERBER_Descr::ResetDefaultValues() /******************************************/ { m_Parent = NULL; @@ -135,7 +135,7 @@ void GERBER_Descr::ResetDefaultValues(void) } /********************************************/ -int GERBER_Descr::ReturnUsedDcodeNumber(void) +int GERBER_Descr::ReturnUsedDcodeNumber() /********************************************/ { int ii, jj; @@ -155,7 +155,7 @@ int ii, jj; /******************************/ -void GERBER_Descr::InitToolTable(void) +void GERBER_Descr::InitToolTable() /******************************/ /* Creation du tableau des MAX_TOOLS DCodes utilisables, si il n'existe pas, et Init des DCodes à une valeur raisonnable @@ -188,11 +188,11 @@ D_CODE::D_CODE(int num_dcode) Clear_D_CODE_Data(); } -D_CODE::~D_CODE(void) +D_CODE::~D_CODE() { } -void D_CODE::Clear_D_CODE_Data(void) +void D_CODE::Clear_D_CODE_Data() { m_Size.x = DEFAULT_SIZE; m_Size.y = DEFAULT_SIZE; @@ -329,7 +329,7 @@ D_CODE ** ListeDCode; /***************************************************/ -void WinEDA_GerberFrame::CopyDCodesSizeToItems(void) +void WinEDA_GerberFrame::CopyDCodesSizeToItems() /***************************************************/ /* Set Size Items (Lines, Flashes) from DCodes List */ diff --git a/gerbview/gerberframe.cpp b/gerbview/gerberframe.cpp index 68bc371098..14971a343e 100644 --- a/gerbview/gerberframe.cpp +++ b/gerbview/gerberframe.cpp @@ -152,7 +152,7 @@ WinEDA_GerberFrame::WinEDA_GerberFrame(wxWindow * father, WinEDA_App *parent, } -WinEDA_GerberFrame::~WinEDA_GerberFrame(void) +WinEDA_GerberFrame::~WinEDA_GerberFrame() { m_Parent->m_GerberFrame = NULL; m_CurrentScreen = ScreenPcb; @@ -196,7 +196,7 @@ PCB_SCREEN * screen; } /*******************************************/ -void WinEDA_GerberFrame::SetToolbars(void) +void WinEDA_GerberFrame::SetToolbars() /*******************************************/ /* Active ou desactive les tools du toolbar horizontal, en fonction des commandes en cours @@ -285,7 +285,7 @@ GERBER_Descr * Gerber_layer_descr = g_GERBER_Descr_List[layer]; } /*************************************/ -int WinEDA_GerberFrame::BestZoom(void) +int WinEDA_GerberFrame::BestZoom() /*************************************/ { int ii,jj ; diff --git a/gerbview/gerbview.cpp b/gerbview/gerbview.cpp index 0a1eec8aa8..771563261d 100644 --- a/gerbview/gerbview.cpp +++ b/gerbview/gerbview.cpp @@ -22,7 +22,7 @@ wxString g_Main_Title = wxT("GerbView"); IMPLEMENT_APP(WinEDA_App) -bool WinEDA_App::OnInit(void) +bool WinEDA_App::OnInit() { wxString FFileName; diff --git a/gerbview/gerbview.h b/gerbview/gerbview.h index dc215019d6..af98e2a36a 100644 --- a/gerbview/gerbview.h +++ b/gerbview/gerbview.h @@ -143,11 +143,11 @@ public: public: GERBER_Descr(int layer); - ~GERBER_Descr(void); - void Clear_GERBER_Descr(void); - int ReturnUsedDcodeNumber(void); - void ResetDefaultValues(void); - void InitToolTable(void); + ~GERBER_Descr(); + void Clear_GERBER_Descr(); + int ReturnUsedDcodeNumber(); + void ResetDefaultValues(); + void InitToolTable(); // Routines utilisées en lecture de ficher gerber wxPoint ReadXYCoord(char * &Text); @@ -180,7 +180,7 @@ public: public: D_CODE(int num_dcode); ~D_CODE(); - void Clear_D_CODE_Data(void); + void Clear_D_CODE_Data(); }; eda_global wxChar *g_GERBER_Tool_Type[6] diff --git a/gerbview/gerbview_config.cpp b/gerbview/gerbview_config.cpp index 9764a2670c..8927ab0dd8 100644 --- a/gerbview/gerbview_config.cpp +++ b/gerbview/gerbview_config.cpp @@ -74,7 +74,7 @@ wxString FullFileName; /*****************************************************/ -bool Read_Config(void) +bool Read_Config() /*****************************************************/ /* lit la configuration, si elle n'a pas deja etee lue 1 - lit gerbview.cnf @@ -99,7 +99,7 @@ bool Read_Config(void) /******************************************/ -void WinEDA_GerberFrame::Update_config(void) +void WinEDA_GerberFrame::Update_config() /******************************************/ /* creation du fichier de config diff --git a/gerbview/options.cpp b/gerbview/options.cpp index e6ae4bb710..cd33d2f223 100644 --- a/gerbview/options.cpp +++ b/gerbview/options.cpp @@ -128,7 +128,7 @@ private: // Constructor and destructor public: WinEDA_GerberGeneralOptionsFrame(WinEDA_BasePcbFrame *parent,const wxPoint& pos); - ~WinEDA_GerberGeneralOptionsFrame(void) {}; + ~WinEDA_GerberGeneralOptionsFrame() {}; private: void AcceptPcbOptions(wxCommandEvent& event); @@ -263,7 +263,7 @@ public: // Constructor and destructor WinEDA_LookFrame(WinEDA_BasePcbFrame *parent,const wxPoint& pos); - ~WinEDA_LookFrame(void) {}; + ~WinEDA_LookFrame() {}; void AcceptPcbOptions(wxCommandEvent& event); void OnQuit(wxCommandEvent & event); diff --git a/gerbview/pcbtexte.cpp b/gerbview/pcbtexte.cpp index e3283ff674..fb80ca4c5c 100644 --- a/gerbview/pcbtexte.cpp +++ b/gerbview/pcbtexte.cpp @@ -94,7 +94,7 @@ void WinEDA_PcbFrame::StartMoveTextePcb(TEXTE_PCB * TextePcb, wxDC * DC) } /*****************************/ - /* void Move_Texte_Pcb(void) */ + /* void Move_Texte_Pcb() */ /*****************************/ /* Routine deplacant le texte PCB suivant le curseur de la souris */ diff --git a/gerbview/process_config.cpp b/gerbview/process_config.cpp index 368f96d65b..53023fa7ca 100644 --- a/gerbview/process_config.cpp +++ b/gerbview/process_config.cpp @@ -75,7 +75,7 @@ wxString FullFileName; /*****************************************************/ -bool Read_Config(void) +bool Read_Config() /*****************************************************/ /* lit la configuration, si elle n'a pas deja etee lue 1 - lit gerbview.cnf @@ -100,7 +100,7 @@ bool Read_Config(void) /******************************************/ -void WinEDA_GerberFrame::Update_config(void) +void WinEDA_GerberFrame::Update_config() /******************************************/ /* creation du fichier de config diff --git a/gerbview/protos.h b/gerbview/protos.h index 50b14a8cf0..9205bd15ef 100644 --- a/gerbview/protos.h +++ b/gerbview/protos.h @@ -14,7 +14,7 @@ BOARD_ITEM* SaveItemEfface( BOARD_ITEM* PtItem, int nbitems ); /***********************/ /* gerbview_config.cpp */ /***********************/ -bool Read_Config(void); +bool Read_Config(); bool Read_Hotkey_Config( WinEDA_DrawFrame * frame, bool verbose ); @@ -69,8 +69,8 @@ void trace_1_contour_GERBER(int cX,int cY, int dimX,int dimY, ses variations deltaX et deltaY et son orientation orient */ /* PLOTHPGL.CC */ -void Init_Trace_HPGL(void); -void Fin_Trace_HPGL(void); +void Init_Trace_HPGL(); +void Fin_Trace_HPGL(); void trace_1_segment_HPGL(int pos_X0,int pos_Y0,int pos_X1,int pos_Y1, int hauteur); diff --git a/gerbview/reglage.cpp b/gerbview/reglage.cpp index 8984b1bbb9..8577577a50 100644 --- a/gerbview/reglage.cpp +++ b/gerbview/reglage.cpp @@ -50,7 +50,7 @@ private: // Constructor and destructor public: WinEDA_ConfigFrame(WinEDA_GerberFrame *parent,const wxPoint& pos); - ~WinEDA_ConfigFrame(void) {}; + ~WinEDA_ConfigFrame() {}; private: void SaveCfg(wxCommandEvent & event); diff --git a/gerbview/select_layers_to_pcb.cpp b/gerbview/select_layers_to_pcb.cpp index 71b68f07eb..c81224d785 100644 --- a/gerbview/select_layers_to_pcb.cpp +++ b/gerbview/select_layers_to_pcb.cpp @@ -37,7 +37,7 @@ public: // Constructor and destructor WinEDA_SwapLayerFrame(WinEDA_GerberFrame *parent); - ~WinEDA_SwapLayerFrame(void) {}; + ~WinEDA_SwapLayerFrame() {}; private: void Sel_Layer(wxCommandEvent& event); diff --git a/gerbview/set_color.cpp b/gerbview/set_color.cpp index 31dbe4af54..1075405316 100644 --- a/gerbview/set_color.cpp +++ b/gerbview/set_color.cpp @@ -61,7 +61,7 @@ public: // Constructor and destructor WinEDA_SetColorsFrame(WinEDA_DrawFrame *parent, const wxPoint& framepos); - ~WinEDA_SetColorsFrame(void) {}; + ~WinEDA_SetColorsFrame() {}; private: void SetColor(wxCommandEvent& event); diff --git a/include/common.h b/include/common.h index 3644770fde..26d7c34e8c 100644 --- a/include/common.h +++ b/include/common.h @@ -1,6 +1,6 @@ - /****************************/ - /* common.h */ - /****************************/ +/****************************/ +/* common.h */ +/****************************/ #ifndef COMMON_H #define COMMON_H @@ -36,38 +36,37 @@ enum pseudokeys { #define ESC 27 #ifdef __WINDOWS__ -#define CVPCB_EXE wxT("cvpcb.exe") -#define PCBNEW_EXE wxT("pcbnew.exe") -#define EESCHEMA_EXE wxT("eeschema.exe") -#define GERBVIEW_EXE wxT("gerbview.exe") +#define CVPCB_EXE wxT( "cvpcb.exe" ) +#define PCBNEW_EXE wxT( "pcbnew.exe" ) +#define EESCHEMA_EXE wxT( "eeschema.exe" ) +#define GERBVIEW_EXE wxT( "gerbview.exe" ) #else #ifndef __WXMAC__ -#define CVPCB_EXE wxT("cvpcb") -#define PCBNEW_EXE wxT("pcbnew") -#define EESCHEMA_EXE wxT("eeschema") -#define GERBVIEW_EXE wxT("gerbview") +#define CVPCB_EXE wxT( "cvpcb" ) +#define PCBNEW_EXE wxT( "pcbnew" ) +#define EESCHEMA_EXE wxT( "eeschema" ) +#define GERBVIEW_EXE wxT( "gerbview" ) #endif #ifdef __WXMAC__ -#define CVPCB_EXE wxT("cvpcb.app") -#define PCBNEW_EXE wxT("pcbnew.app") -#define EESCHEMA_EXE wxT("eeschema.app") -#define GERBVIEW_EXE wxT("gerbview.app") +#define CVPCB_EXE wxT( "cvpcb.app" ) +#define PCBNEW_EXE wxT( "pcbnew.app" ) +#define EESCHEMA_EXE wxT( "eeschema.app" ) +#define GERBVIEW_EXE wxT( "gerbview.app" ) #endif #endif - /* Graphic Texts Orientation in 0.1 degree*/ #define TEXT_ORIENT_HORIZ 0 -#define TEXT_ORIENT_VERT 900 +#define TEXT_ORIENT_VERT 900 /* Affichage ou Effacement d'Item */ #define ON 1 /* Affichage */ #define OFF 0 /* Effacement */ /* unites d'affichage sur ecran et autres */ -#define INCHES 0 +#define INCHES 0 #define MILLIMETRE 1 #define CENTIMETRE 2 @@ -86,206 +85,214 @@ enum paramcfg_id /* type du parametre dans la structure ParamConfig */ PARAM_COMMAND_ERASE }; -#define MAX_COLOR 0x8001F +#define MAX_COLOR 0x8001F #define INT_MINVAL 0x80000000 #define INT_MAXVAL 0x7FFFFFFF class PARAM_CFG_BASE { public: - const wxChar * m_Ident; /* Abreviation de reperage des debuts de lignes */ - paramcfg_id m_Type; /* flag type des parametres */ - const wxChar * m_Group; /* Nom du groupe (rubrique) de classement */ - bool m_Setup; /* TRUE -> inscription en setup (registration base)*/ + const wxChar* m_Ident; /* Abreviation de reperage des debuts de lignes */ + paramcfg_id m_Type; /* flag type des parametres */ + const wxChar* m_Group; /* Nom du groupe (rubrique) de classement */ + bool m_Setup; /* TRUE -> inscription en setup (registration base)*/ public: - PARAM_CFG_BASE(const wxChar * ident, const paramcfg_id type, const wxChar * group = NULL); - ~PARAM_CFG_BASE() {}; + PARAM_CFG_BASE( const wxChar * ident, const paramcfg_id type, const wxChar * group = NULL ); + ~PARAM_CFG_BASE() { }; }; -class PARAM_CFG_INT : public PARAM_CFG_BASE +class PARAM_CFG_INT : public PARAM_CFG_BASE { public: - int * m_Pt_param; /* pointeur sur le parametre a configurer */ - int m_Min, m_Max; /* valeurs extremes du parametre */ - int m_Default; /* valeur par defaut */ + int* m_Pt_param; /* pointeur sur le parametre a configurer */ + int m_Min, m_Max; /* valeurs extremes du parametre */ + int m_Default; /* valeur par defaut */ public: - PARAM_CFG_INT(const wxChar * ident, int * ptparam, - int default_val = 0, int min = INT_MINVAL, int max = INT_MAXVAL, - const wxChar * group = NULL); - PARAM_CFG_INT(bool Insetup, const wxChar * ident, int * ptparam, - int default_val = 0, int min = INT_MINVAL, int max = INT_MAXVAL, - const wxChar * group = NULL); + PARAM_CFG_INT( const wxChar * ident, int* ptparam, + int default_val = 0, int min = INT_MINVAL, int max = INT_MAXVAL, + const wxChar * group = NULL ); + PARAM_CFG_INT( bool Insetup, const wxChar * ident, int* ptparam, + int default_val = 0, int min = INT_MINVAL, int max = INT_MAXVAL, + const wxChar * group = NULL ); }; class PARAM_CFG_SETCOLOR : public PARAM_CFG_BASE { public: - int * m_Pt_param; /* pointeur sur le parametre a configurer */ - int m_Default; /* valeur par defaut */ + int* m_Pt_param; /* pointeur sur le parametre a configurer */ + int m_Default; /* valeur par defaut */ public: - PARAM_CFG_SETCOLOR(const wxChar * ident, int * ptparam, - int default_val, const wxChar * group = NULL); - PARAM_CFG_SETCOLOR(bool Insetup, const wxChar * ident, int * ptparam, - int default_val, const wxChar * group = NULL); + PARAM_CFG_SETCOLOR( const wxChar * ident, int* ptparam, + int default_val, const wxChar * group = NULL ); + PARAM_CFG_SETCOLOR( bool Insetup, const wxChar * ident, int* ptparam, + int default_val, const wxChar * group = NULL ); }; -class PARAM_CFG_DOUBLE : public PARAM_CFG_BASE +class PARAM_CFG_DOUBLE : public PARAM_CFG_BASE { public: - double * m_Pt_param; /* pointeur sur le parametre a configurer */ - double m_Default; /* valeur par defaut */ - double m_Min, m_Max; /* valeurs extremes du parametre */ + double* m_Pt_param; /* pointeur sur le parametre a configurer */ + double m_Default; /* valeur par defaut */ + double m_Min, m_Max; /* valeurs extremes du parametre */ public: - PARAM_CFG_DOUBLE(const wxChar * ident, double * ptparam, - double default_val = 0.0, double min = 0.0, double max = 10000.0, - const wxChar * group = NULL); - PARAM_CFG_DOUBLE(bool Insetup, const wxChar * ident, double * ptparam, - double default_val = 0.0, double min = 0.0, double max = 10000.0, - const wxChar * group = NULL); + PARAM_CFG_DOUBLE( const wxChar * ident, double* ptparam, + double default_val = 0.0, double min = 0.0, double max = 10000.0, + const wxChar * group = NULL ); + PARAM_CFG_DOUBLE( bool Insetup, const wxChar * ident, double* ptparam, + double default_val = 0.0, double min = 0.0, double max = 10000.0, + const wxChar * group = NULL ); }; -class PARAM_CFG_BOOL : public PARAM_CFG_BASE +class PARAM_CFG_BOOL : public PARAM_CFG_BASE { public: - bool * m_Pt_param; /* pointeur sur le parametre a configurer */ - int m_Default; /* valeur par defaut */ + bool* m_Pt_param; /* pointeur sur le parametre a configurer */ + int m_Default; /* valeur par defaut */ public: - PARAM_CFG_BOOL(const wxChar * ident, bool * ptparam, - int default_val = FALSE,const wxChar * group = NULL); - PARAM_CFG_BOOL(bool Insetup, const wxChar * ident, bool * ptparam, - int default_val = FALSE,const wxChar * group = NULL); + PARAM_CFG_BOOL( const wxChar * ident, bool * ptparam, + int default_val = FALSE, const wxChar * group = NULL ); + PARAM_CFG_BOOL( bool Insetup, const wxChar * ident, bool * ptparam, + int default_val = FALSE, const wxChar * group = NULL ); }; -class PARAM_CFG_WXSTRING : public PARAM_CFG_BASE +class PARAM_CFG_WXSTRING : public PARAM_CFG_BASE { public: - wxString * m_Pt_param; /* pointeur sur le parametre a configurer */ + wxString* m_Pt_param; /* pointeur sur le parametre a configurer */ public: - PARAM_CFG_WXSTRING(const wxChar * ident, wxString * ptparam, const wxChar * group = NULL); - PARAM_CFG_WXSTRING(bool Insetup, const wxChar * ident, wxString * ptparam, const wxChar * group = NULL); + PARAM_CFG_WXSTRING( const wxChar * ident, wxString * ptparam, const wxChar * group = NULL ); + PARAM_CFG_WXSTRING( bool Insetup, + const wxChar * ident, + wxString * ptparam, + const wxChar * group = NULL ); }; class PARAM_CFG_LIBNAME_LIST : public PARAM_CFG_BASE { public: - wxArrayString * m_Pt_param; /* pointeur sur le parametre a configurer */ + wxArrayString* m_Pt_param; /* pointeur sur le parametre a configurer */ public: - PARAM_CFG_LIBNAME_LIST(const wxChar * ident, wxArrayString * ptparam, const wxChar * group = NULL); + PARAM_CFG_LIBNAME_LIST( const wxChar * ident, + wxArrayString * ptparam, + const wxChar * group = NULL ); }; - /***********************************/ - /* Classe pour affichage de textes */ - /***********************************/ -class WinEDA_TextFrame: public wxDialog +/***********************************/ +/* Classe pour affichage de textes */ +/***********************************/ +class WinEDA_TextFrame : public wxDialog { private: - wxWindow * m_Parent; - wxListBox * m_List; + wxWindow* m_Parent; + wxListBox* m_List; public: - WinEDA_TextFrame(wxWindow * parent, const wxString & title); - void Append( const wxString & text); + WinEDA_TextFrame( wxWindow * parent, const wxString &title ); + void Append( const wxString& text ); + private: - void D_ClickOnList(wxCommandEvent& event); - void OnClose(wxCloseEvent& event); + void D_ClickOnList( wxCommandEvent& event ); + void OnClose( wxCloseEvent& event ); DECLARE_EVENT_TABLE() }; /* Gestion des feuilles de trac�: -*/ + */ class Ki_PageDescr { // All sizes are in 1/1000 inch public: - wxSize m_Size ; /* page size in 1/1000 inch */ - wxPoint m_Offset; /* plot offset in 1/1000 inch */ + wxSize m_Size; /* page size in 1/1000 inch */ + wxPoint m_Offset; /* plot offset in 1/1000 inch */ wxString m_Name; - int m_LeftMargin; - int m_RightMargin; - int m_TopMargin; - int m_BottomMargin; + int m_LeftMargin; + int m_RightMargin; + int m_TopMargin; + int m_BottomMargin; public: - Ki_PageDescr(const wxSize & size, const wxPoint & offset, const wxString & name); + Ki_PageDescr( const wxSize &size, const wxPoint &offset, const wxString &name ); }; /* Standard page sizes in 1/1000 inch */ #if defined EDA_BASE -Ki_PageDescr g_Sheet_A4(wxSize(11700,8267), wxPoint(0,0), wxT("A4") ); -Ki_PageDescr g_Sheet_A3(wxSize(16535,11700),wxPoint(0,0),wxT("A3") ); -Ki_PageDescr g_Sheet_A2(wxSize(23400,16535),wxPoint(0,0),wxT("A2") ); -Ki_PageDescr g_Sheet_A1(wxSize(33070,23400),wxPoint(0,0),wxT("A1") ); -Ki_PageDescr g_Sheet_A0(wxSize(46800,33070),wxPoint(0,0),wxT("A0") ); -Ki_PageDescr g_Sheet_A(wxSize(11000,8500),wxPoint(0,0),wxT("A") ); -Ki_PageDescr g_Sheet_B(wxSize(17000,11000),wxPoint(0,0),wxT("B") ); -Ki_PageDescr g_Sheet_C(wxSize(22000,17000),wxPoint(0,0),wxT("C") ); -Ki_PageDescr g_Sheet_D(wxSize(34000,22000),wxPoint(0,0),wxT("D") ); -Ki_PageDescr g_Sheet_E(wxSize(44000,34000),wxPoint(0,0),wxT("E") ); -Ki_PageDescr g_Sheet_GERBER(wxSize(32000,32000),wxPoint(0,0),wxT("GERBER") ); -Ki_PageDescr g_Sheet_user(wxSize(17000,11000),wxPoint(0,0),wxT("User") ); +Ki_PageDescr g_Sheet_A4( wxSize( 11700, 8267 ), wxPoint( 0, 0 ), wxT( "A4" ) ); +Ki_PageDescr g_Sheet_A3( wxSize( 16535, 11700 ), wxPoint( 0, 0 ), wxT( "A3" ) ); +Ki_PageDescr g_Sheet_A2( wxSize( 23400, 16535 ), wxPoint( 0, 0 ), wxT( "A2" ) ); +Ki_PageDescr g_Sheet_A1( wxSize( 33070, 23400 ), wxPoint( 0, 0 ), wxT( "A1" ) ); +Ki_PageDescr g_Sheet_A0( wxSize( 46800, 33070 ), wxPoint( 0, 0 ), wxT( "A0" ) ); +Ki_PageDescr g_Sheet_A( wxSize( 11000, 8500 ), wxPoint( 0, 0 ), wxT( "A" ) ); +Ki_PageDescr g_Sheet_B( wxSize( 17000, 11000 ), wxPoint( 0, 0 ), wxT( "B" ) ); +Ki_PageDescr g_Sheet_C( wxSize( 22000, 17000 ), wxPoint( 0, 0 ), wxT( "C" ) ); +Ki_PageDescr g_Sheet_D( wxSize( 34000, 22000 ), wxPoint( 0, 0 ), wxT( "D" ) ); +Ki_PageDescr g_Sheet_E( wxSize( 44000, 34000 ), wxPoint( 0, 0 ), wxT( "E" ) ); +Ki_PageDescr g_Sheet_GERBER( wxSize( 32000, 32000 ), wxPoint( 0, 0 ), wxT( "GERBER" ) ); +Ki_PageDescr g_Sheet_user( wxSize( 17000, 11000 ), wxPoint( 0, 0 ), wxT( "User" ) ); + #else -extern Ki_PageDescr g_Sheet_A4 ; -extern Ki_PageDescr g_Sheet_A3 ; -extern Ki_PageDescr g_Sheet_A2 ; -extern Ki_PageDescr g_Sheet_A1 ; -extern Ki_PageDescr g_Sheet_A0 ; -extern Ki_PageDescr g_Sheet_A ; -extern Ki_PageDescr g_Sheet_B ; -extern Ki_PageDescr g_Sheet_C ; -extern Ki_PageDescr g_Sheet_D ; -extern Ki_PageDescr g_Sheet_E ; -extern Ki_PageDescr g_Sheet_GERBER ; -extern Ki_PageDescr g_Sheet_user ; +extern Ki_PageDescr g_Sheet_A4; +extern Ki_PageDescr g_Sheet_A3; +extern Ki_PageDescr g_Sheet_A2; +extern Ki_PageDescr g_Sheet_A1; +extern Ki_PageDescr g_Sheet_A0; +extern Ki_PageDescr g_Sheet_A; +extern Ki_PageDescr g_Sheet_B; +extern Ki_PageDescr g_Sheet_C; +extern Ki_PageDescr g_Sheet_D; +extern Ki_PageDescr g_Sheet_E; +extern Ki_PageDescr g_Sheet_GERBER; +extern Ki_PageDescr g_Sheet_user; #endif -COMMON_GLOBL int g_LastKey; /* code de la derniere touche actionn�� */ +COMMON_GLOBL int g_LastKey; /* code de la derniere touche actionn�� */ COMMON_GLOBL wxString g_ProductName #ifdef EDA_BASE -= wxT("KiCad E.D.A. ") += wxT( "KiCad E.D.A. " ) #endif ; /* Gestion des librairies */ COMMON_GLOBL wxString g_RealLibDirBuffer; // Chemin reel des librairies de module - // = UserLibDirBuffer si non vide - // = chemin par defaut sinon +// = UserLibDirBuffer si non vide +// = chemin par defaut sinon COMMON_GLOBL wxString g_UserLibDirBuffer; // Chemin des librairies de module donne par - // le file de config +// le file de config /* variables globales generales */ COMMON_GLOBL int g_DebugLevel; // 0= Pas de debug */ COMMON_GLOBL int g_MouseOldButtons; COMMON_GLOBL int g_KeyPressed; + // Font used by kicad. // these font have a size which do not depend on default size system font -COMMON_GLOBL wxFont * g_StdFont; /* Standard font used for status display ,in message panel */ -COMMON_GLOBL wxFont * g_DialogFont; /* Normal font used in dialog box */ -COMMON_GLOBL wxFont * g_ItalicFont; /* Italic font used in dialog box */ -COMMON_GLOBL wxFont * g_MsgFont; /* Italic font used in msg panel (lower window) */ -COMMON_GLOBL wxFont * g_FixedFont; /* Affichage de Texte en fenetres de dialogue, - fonte a pas fixe)*/ -COMMON_GLOBL int g_StdFontPointSize; /* taille de la fonte */ -COMMON_GLOBL int g_DialogFontPointSize; /* taille de la fonte */ -COMMON_GLOBL int g_FixedFontPointSize; /* taille de la fonte */ -COMMON_GLOBL int g_MsgFontPointSize; /* taille de la fonte */ -COMMON_GLOBL int g_FontMinPointSize; /* taille minimum des fontes */ +COMMON_GLOBL wxFont* g_StdFont; /* Standard font used for status display ,in message panel */ +COMMON_GLOBL wxFont* g_DialogFont; /* Normal font used in dialog box */ +COMMON_GLOBL wxFont* g_ItalicFont; /* Italic font used in dialog box */ +COMMON_GLOBL wxFont* g_MsgFont; /* Italic font used in msg panel (lower window) */ +COMMON_GLOBL wxFont* g_FixedFont; /* Affichage de Texte en fenetres de dialogue, + * fonte a pas fixe)*/ +COMMON_GLOBL int g_StdFontPointSize; /* taille de la fonte */ +COMMON_GLOBL int g_DialogFontPointSize; /* taille de la fonte */ +COMMON_GLOBL int g_FixedFontPointSize; /* taille de la fonte */ +COMMON_GLOBL int g_MsgFontPointSize; /* taille de la fonte */ +COMMON_GLOBL int g_FontMinPointSize; /* taille minimum des fontes */ -COMMON_GLOBL bool g_IsPrinting; // TRUE si impression au lieu de trace a l'ecran -COMMON_GLOBL bool g_ShowPageLimits // TRUE to display the page limits +COMMON_GLOBL bool g_IsPrinting; // TRUE si impression au lieu de trace a l'ecran +COMMON_GLOBL bool g_ShowPageLimits // TRUE to display the page limits #ifdef EDA_BASE = TRUE #endif @@ -294,27 +301,28 @@ COMMON_GLOBL bool g_ShowPageLimits // TRUE to display the page limits /* Gloabl variables for project handling */ COMMON_GLOBL wxString g_Prj_Config_Filename_ext #ifdef EDA_BASE -= wxT(".pro" ) += wxT( ".pro" ) #endif ; -COMMON_GLOBL wxFileConfig * g_Prj_Config; // Configuration locale, propre au projet -COMMON_GLOBL wxString g_Prj_Default_Config_FullFilename; // Nom (full file name) du file Configuration par defaut (kicad.pro) -COMMON_GLOBL wxString g_Prj_Config_LocalFilename; // Nom du file Configuration local (.pro) +COMMON_GLOBL wxFileConfig* g_Prj_Config; // Configuration locale, propre au projet +COMMON_GLOBL wxString g_Prj_Default_Config_FullFilename; // Nom (full file name) du file Configuration par defaut (kicad.pro) +COMMON_GLOBL wxString g_Prj_Config_LocalFilename; // Nom du file Configuration local (.pro) // Handle the preferd editor for browsing report files: -COMMON_GLOBL wxString g_EditorName; +COMMON_GLOBL wxString g_EditorName; // Gestion de la grille "utilisateur" (User Grid) #ifdef EDA_BASE -wxRealPoint g_UserGrid(0.01, 0.01); -int g_UserGrid_Unit = INCHES; +wxRealPoint g_UserGrid( 0.01, 0.01 ); + +int g_UserGrid_Unit = INCHES; #else extern wxRealPoint g_UserGrid; -extern int g_UserGrid_Unit; +extern int g_UserGrid_Unit; #endif -COMMON_GLOBL int g_UnitMetric; // display units mm = 1, inches = 0, cm = 2 +COMMON_GLOBL int g_UnitMetric; // display units mm = 1, inches = 0, cm = 2 // shape selector for cursor screen @@ -326,13 +334,12 @@ COMMON_GLOBL int g_GhostColor; /* Draw color for grid: */ COMMON_GLOBL int g_GridColor #ifdef EDA_BASE - = DARKGRAY += DARKGRAY #endif ; /* Current used screen: */ -COMMON_GLOBL BASE_SCREEN * ActiveScreen; - +COMMON_GLOBL BASE_SCREEN* ActiveScreen; /**************************************/ @@ -345,10 +352,11 @@ class WinEDA_DrawPanel; /* COMMON.CPP */ -wxString ReturnPcbLayerName(int layer_number, bool is_filename = FALSE); +wxString ReturnPcbLayerName( int layer_number, bool is_filename = FALSE ); + /* Return the name of the layer number "layer_number". - if "is_filename" == TRUE, the name can be used for a file name - (not internatinalized, no space)*/ + * if "is_filename" == TRUE, the name can be used for a file name + * (not internatinalized, no space)*/ /*********************/ @@ -358,272 +366,304 @@ wxString ReturnPcbLayerName(int layer_number, bool is_filename = FALSE); /**************/ /* DRAWTXT.CPP */ /**************/ -void DrawGraphicText(WinEDA_DrawPanel * panel, wxDC * DC, const wxPoint & pos, - int mode_color, const wxString & Text, - int orient , const wxSize & char_size, - int h_justify, int v_justify, int width = 0); +void DrawGraphicText( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& pos, + int mode_color, const wxString& Text, + int orient, const wxSize& char_size, + int h_justify, int v_justify, int width = 0 ); -void PlotGraphicText(int format_plot, const wxPoint & Pos, int gcolor, - const wxString & Text, - int orient, const wxSize & Size, int h_justify, int v_justify); +void PlotGraphicText( int format_plot, const wxPoint& Pos, int gcolor, + const wxString& Text, + int orient, const wxSize& Size, int h_justify, int v_justify ); /***************/ /* CONFIRM.CPP */ /***************/ -void DisplayError(wxWindow * parent, const wxString & msg, int displaytime = 0); -void DisplayInfo(wxWindow * parent, const wxString & msg, int displaytime = 0); - /* Routines d'affichage messages ( disparait au bout de displaytime 0.1 secondes) */ +void DisplayError( wxWindow* parent, const wxString& msg, int displaytime = 0 ); +void DisplayInfo( wxWindow* parent, const wxString& msg, int displaytime = 0 ); -bool IsOK(wxWindow * parent, const wxString & msg) ; - /* Routine affichant la fenetre "CONFIRMATION" - Retourne 1 ou 0 selon reponse Yes / No */ +/* Routines d'affichage messages ( disparait au bout de displaytime 0.1 secondes) */ -int Get_Message(const wxString & titre, wxString & buffer, wxWindow * frame) ; - /* Fonction d'installation du menu de Dialogue - entree: titre = titre a afficher - entree/sortie :buffer : contient la reponse - si a l'appel buffer n'est pas vide, son contenu est aussi - affiche, mais disparait a la 1ere correction */ +bool IsOK( wxWindow* parent, const wxString& msg ); + +/* Routine affichant la fenetre "CONFIRMATION" + * Retourne 1 ou 0 selon reponse Yes / No */ + +int Get_Message( const wxString& titre, wxString& buffer, wxWindow* frame ); + +/* Fonction d'installation du menu de Dialogue + * entree: titre = titre a afficher + * entree/sortie :buffer : contient la reponse + * si a l'appel buffer n'est pas vide, son contenu est aussi + * affiche, mais disparait a la 1ere correction */ /************************/ /* file GESTFICH.CPP */ /************************/ -wxString GetEditorName(void); // Return the prefered editor name -void OpenPDF( const wxString & file ); -void OpenFile( const wxString & file ); +wxString GetEditorName(); // Return the prefered editor name +void OpenPDF( const wxString& file ); +void OpenFile( const wxString& file ); -bool EDA_DirectorySelector(const wxString & Title, /* Titre de la fenetre */ - wxString & Path, /* Chemin par defaut */ - int flag, /* reserve */ - wxWindow * Frame, /* parent frame */ - const wxPoint & Pos); +bool EDA_DirectorySelector( const wxString& Title, /* Titre de la fenetre */ + wxString& Path, /* Chemin par defaut */ + int flag, /* reserve */ + wxWindow* Frame, /* parent frame */ + const wxPoint& Pos ); -wxString EDA_FileSelector(const wxString & Title, /* Window title */ - const wxString & Path, /* default path */ - const wxString & FileName, /* default filename */ - const wxString & Ext, /* default extension */ - const wxString & Mask, /* Display filename mask */ - wxWindow * Frame, /* parent frame */ - int flag, /* wxSAVE, wxOPEN ..*/ - const bool keep_working_directory, /* true = do not change the C.W.D. */ - const wxPoint & Pos = wxPoint(-1, -1) - ); +wxString EDA_FileSelector( const wxString& Title, /* Window title */ + const wxString& Path, /* default path */ + const wxString& FileName, /* default filename */ + const wxString& Ext, /* default extension */ + const wxString& Mask, /* Display filename mask */ + wxWindow* Frame, /* parent frame */ + int flag, /* wxSAVE, wxOPEN ..*/ + const bool keep_working_directory, /* true = do not change the C.W.D. */ + const wxPoint& Pos = wxPoint( -1, -1 ) + ); + +wxString MakeFileName( const wxString& dir, + const wxString& shortname, const wxString& ext ); -wxString MakeFileName( const wxString & dir, - const wxString & shortname, const wxString & ext); /* Calcule le nom complet d'un file d'apres les chaines - dir = prefixe (chemin) - shortname = nom avec ou sans chemin ou extension - ext = extension + * dir = prefixe (chemin) + * shortname = nom avec ou sans chemin ou extension + * ext = extension + * + * si la chaine name possede deja un chemin ou une extension, elles + * ne seront pas modifiees + * + * retourne la chaine calculee */ - si la chaine name possede deja un chemin ou une extension, elles - ne seront pas modifiees +wxString MakeReducedFileName( const wxString& fullfilename, + const wxString& default_path, + const wxString& default_ext ); - retourne la chaine calculee */ - -wxString MakeReducedFileName( const wxString & fullfilename, - const wxString & default_path, - const wxString & default_ext); /* Calcule le nom "reduit" d'un file d'apres les chaines - fullfilename = nom complet - default_path = prefixe (chemin) par defaut - default_ext = extension par defaut + * fullfilename = nom complet + * default_path = prefixe (chemin) par defaut + * default_ext = extension par defaut + * + * retourne le nom reduit, c'est a dire: + * sans le chemin si le chemin est default_path + * avec ./ si si le chemin est le chemin courant + * sans l'extension si l'extension est default_ext + * + * Renvoie un chemin en notation unix ('/' en separateur de repertoire) + */ - retourne le nom reduit, c'est a dire: - sans le chemin si le chemin est default_path - avec ./ si si le chemin est le chemin courant - sans l'extension si l'extension est default_ext +WinEDAListBox* GetFileNames( char* Directory, char* Mask ); - Renvoie un chemin en notation unix ('/' en separateur de repertoire) -*/ +void ChangeFileNameExt( wxString& FullFileName, const wxString& NewExt ); -WinEDAListBox * GetFileNames(char *Directory, char *Mask); +/* Change l'extension du "filename FullFileName" en NewExt. + * Retourne FullFileName */ -void ChangeFileNameExt( wxString & FullFileName, const wxString & NewExt ); - /* Change l'extension du "filename FullFileName" en NewExt. - Retourne FullFileName */ +int ExecuteFile( wxWindow* frame, const wxString& ExecFile, + const wxString& param = wxEmptyString ); +void AddDelimiterString( wxString& string ); -int ExecuteFile(wxWindow * frame, const wxString & ExecFile, - const wxString & param = wxEmptyString); -void AddDelimiterString( wxString & string ); +void SetRealLibraryPath( const wxString& shortlibname );/* met a jour + * le chemin des librairies RealLibDirBuffer (global) + * a partir de UserLibDirBuffer (global): + * Si UserLibDirBuffer non vide RealLibDirBuffer = UserLibDirBuffer. + * Sinon si variable d'environnement KICAD definie (KICAD = chemin pour kicad), + * UserLibDirBuffer = /shortlibname; + * Sinon UserLibDirBuffer = ../shortlibname/ + */ +wxString FindKicadHelpPath(); -void SetRealLibraryPath(const wxString & shortlibname); /* met a jour - le chemin des librairies RealLibDirBuffer (global) -a partir de UserLibDirBuffer (global): - Si UserLibDirBuffer non vide RealLibDirBuffer = UserLibDirBuffer. - Sinon si variable d'environnement KICAD definie (KICAD = chemin pour kicad), - UserLibDirBuffer = /shortlibname; - Sinon UserLibDirBuffer = ../shortlibname/ -*/ -wxString FindKicadHelpPath(void); /* Find absolute path for kicad/help (or kicad/help/) */ -wxString ReturnKicadDatasPath(void); - /* Retourne le chemin des donnees communes de kicad. */ +wxString ReturnKicadDatasPath(); + +/* Retourne le chemin des donnees communes de kicad. */ + +wxString FindKicadFile( const wxString& shortname ); -wxString FindKicadFile(const wxString & shortname); /* Search the executable file shortname in kicad binary path and return -full file name if found or shortname */ + * full file name if found or shortname */ /*************/ /* STRING.CPP */ /*************/ -char * strupper(char * Text); +char* strupper( char* Text ); -int ReadDelimitedText(char * dest, char * source, int NbMaxChar ); - /* lit et place dans dest la chaine de caractere trouvee dans source, - delimitee par " . - transfere NbMaxChar max - retourne le nombre de codes lus dans source - dest est termine par NULL */ +int ReadDelimitedText( char* dest, char* source, int NbMaxChar ); -char * GetLine(FILE *File, char *Line, int *LineNum = NULL, int SizeLine = 255); - /* Routine de lecture de 1 ligne utile - retourne la 1ere ligne utile lue. - elimine lignes vides et commentaires */ -char * StrPurge(char * text); - /* Supprime les caracteres Space en debut de la ligne text - retourne un pointeur sur le 1er caractere non Space de text */ +/* lit et place dans dest la chaine de caractere trouvee dans source, + * delimitee par " . + * transfere NbMaxChar max + * retourne le nombre de codes lus dans source + * dest est termine par NULL */ -char * DateAndTime(char * line); -wxString DateAndTime(void); - /* Retourne la chaine de caractere donnant date+heure */ +char* GetLine( FILE* File, char* Line, int* LineNum = NULL, int SizeLine = 255 ); -int StrLenNumCmp(const wxChar *str1,const wxChar *str2, int NbMax); - /* - routine (compatible qsort() ) de comparaision pour classement alphab�tique - Analogue a strncmp() mais les nombres sont compar�s selon leur valeur num�rique - et non pas par leur code ascii */ +/* Routine de lecture de 1 ligne utile + * retourne la 1ere ligne utile lue. + * elimine lignes vides et commentaires */ +char* StrPurge( char* text ); -int StrNumICmp(const wxChar *str1,const wxChar *str2); - /* routine (compatible qsort() ) de comparaison pour classement alphab�tique, - avec lower case == upper case. - Analogue a stricmp() mais les nombres sont compar�s selon leur valeur num�rique - et non pas par leur code ascii */ +/* Supprime les caracteres Space en debut de la ligne text + * retourne un pointeur sur le 1er caractere non Space de text */ -int StrLenNumICmp(const wxChar *str1,const wxChar *str2, int NbMax); - /* routine (compatible qsort() ) de comparaison pour classement alphab�tique, - avec lower case == upper case. - Analogue a stricmp() mais les nombres sont compar�s selon leur valeur num�rique - et non pas par leur code ascii */ +char* DateAndTime( char* line ); +wxString DateAndTime(); -bool WildCompareString(const wxString & pattern, const wxString & string_to_tst, - bool case_sensitive = TRUE); - /* compare 2 noms de composants, selon regles usuelles - ( Jokers * , ? , autoris�s). - la chaine de reference est "pattern" - si case_sensitive == TRUE (default), comparaison exacte - retourne TRUE si match FALSE si differences */ +/* Retourne la chaine de caractere donnant date+heure */ -char * to_point(char * Text); - /* convertit les , en . dans une chaine. utilis� pour compenser la fct printf - qui genere les flottants avec une virgule au lieu du point en mode international */ +int StrLenNumCmp( const wxChar* str1, const wxChar* str2, int NbMax ); + +/* + * routine (compatible qsort() ) de comparaision pour classement alphab�tique + * Analogue a strncmp() mais les nombres sont compar�s selon leur valeur num�rique + * et non pas par leur code ascii */ + +int StrNumICmp( const wxChar* str1, const wxChar* str2 ); + +/* routine (compatible qsort() ) de comparaison pour classement alphab�tique, + * avec lower case == upper case. + * Analogue a stricmp() mais les nombres sont compar�s selon leur valeur num�rique + * et non pas par leur code ascii */ + +int StrLenNumICmp( const wxChar* str1, const wxChar* str2, int NbMax ); + +/* routine (compatible qsort() ) de comparaison pour classement alphab�tique, + * avec lower case == upper case. + * Analogue a stricmp() mais les nombres sont compar�s selon leur valeur num�rique + * et non pas par leur code ascii */ + +bool WildCompareString( const wxString& pattern, const wxString& string_to_tst, + bool case_sensitive = TRUE ); + +/* compare 2 noms de composants, selon regles usuelles + * ( Jokers * , ? , autoris�s). + * la chaine de reference est "pattern" + * si case_sensitive == TRUE (default), comparaison exacte + * retourne TRUE si match FALSE si differences */ + +char* to_point( char* Text ); + +/* convertit les , en . dans une chaine. utilis� pour compenser la fct printf + * qui genere les flottants avec une virgule au lieu du point en mode international */ /****************/ /* infospgm.cpp */ /****************/ -void Print_Kicad_Infos(wxWindow * frame); +void Print_Kicad_Infos( wxWindow* frame ); /**************/ /* common.cpp */ /**************/ -wxString GetBuildVersion(void); /* Return the build date */ +wxString GetBuildVersion(); /* Return the build date */ + +void Affiche_1_Parametre( WinEDA_DrawFrame* frame, + int pos_X, + const wxString& texte_H, + const wxString& texte_L, + int color ); -void Affiche_1_Parametre(WinEDA_DrawFrame * frame , - int pos_X,const wxString& texte_H,const wxString& texte_L,int color); /* - Routine d'affichage d'un parametre. - pos_X = cadrage horizontal - si pos_X < 0 : la position horizontale est la derniere - valeur demandee >= 0 - texte_H = texte a afficher en ligne superieure. - si "", par d'affichage sur cette ligne - texte_L = texte a afficher en ligne inferieure. - si "", par d'affichage sur cette ligne - color = couleur d'affichage -*/ + * Routine d'affichage d'un parametre. + * pos_X = cadrage horizontal + * si pos_X < 0 : la position horizontale est la derniere + * valeur demandee >= 0 + * texte_H = texte a afficher en ligne superieure. + * si "", par d'affichage sur cette ligne + * texte_L = texte a afficher en ligne inferieure. + * si "", par d'affichage sur cette ligne + * color = couleur d'affichage + */ -void AfficheDoc(WinEDA_DrawFrame * frame, const wxString & Doc, const wxString & KeyW); - /* Routine d'affichage de la documentation associee a un composant */ +void AfficheDoc( WinEDA_DrawFrame* frame, const wxString& Doc, const wxString& KeyW ); -int GetTimeStamp(void); - /* Retoure une identification temporelle (Time stamp) differente a chaque appel */ -int DisplayColorFrame(wxWindow * parent, int OldColor); -int GetCommandOptions(const int argc, const char **argv, const char * stringtst, - const char ** optarg, int * optind); +/* Routine d'affichage de la documentation associee a un composant */ + +int GetTimeStamp(); + +/* Retoure une identification temporelle (Time stamp) differente a chaque appel */ +int DisplayColorFrame( wxWindow* parent, int OldColor ); +int GetCommandOptions( const int argc, const char** argv, const char* stringtst, + const char** optarg, int* optind ); -void valeur_param(int valeur,wxString & buf_texte); +void valeur_param( int valeur, wxString& buf_texte ); + /* Retourne pour affichage la valeur d'un parametre, selon type d'unites choisies - entree : valeur en mils , buffer de texte - retourne en buffer : texte : valeur exprimee en pouces ou millimetres - suivie de " ou mm -*/ + * entree : valeur en mils , buffer de texte + * retourne en buffer : texte : valeur exprimee en pouces ou millimetres + * suivie de " ou mm + */ -wxString ReturnUnitSymbol(int Units = g_UnitMetric); -int ReturnValueFromString(int Units, const wxString & TextValue, int Internal_Unit); -wxString ReturnStringFromValue(int Units, int Value, int Internal_Unit); -void AddUnitSymbol(wxStaticText & Stext, int Units = g_UnitMetric); - /* Add string " (mm):" or " ("):" to the static text Stext. - Used in dialog boxes for entering values depending on selected units */ -void PutValueInLocalUnits(wxTextCtrl & TextCtr, int Value, int Internal_Unit); - /* Convert the number Value in a string according to the internal units - and the selected unit (g_UnitMetric) and put it in the wxTextCtrl TextCtrl */ -int ReturnValueFromTextCtrl(const wxTextCtrl & TextCtr, int Internal_Unit); - /* Convert the Value in the wxTextCtrl TextCtrl in an integer, - according to the internal units and the selected unit (g_UnitMetric) */ +wxString ReturnUnitSymbol( int Units = g_UnitMetric ); +int ReturnValueFromString( int Units, const wxString& TextValue, int Internal_Unit ); +wxString ReturnStringFromValue( int Units, int Value, int Internal_Unit ); +void AddUnitSymbol( wxStaticText& Stext, int Units = g_UnitMetric ); -double To_User_Unit(bool is_metric, int val,int internal_unit_value); -int From_User_Unit(bool is_metric, double val,int internal_unit_value); -wxString GenDate(void); -void MyFree (void * pt_mem); -void * MyZMalloc (size_t nb_octets); -void * MyMalloc (size_t nb_octets); +/* Add string " (mm):" or " ("):" to the static text Stext. + * Used in dialog boxes for entering values depending on selected units */ +void PutValueInLocalUnits( wxTextCtrl& TextCtr, int Value, int Internal_Unit ); + +/* Convert the number Value in a string according to the internal units + * and the selected unit (g_UnitMetric) and put it in the wxTextCtrl TextCtrl */ +int ReturnValueFromTextCtrl( const wxTextCtrl& TextCtr, int Internal_Unit ); + +/* Convert the Value in the wxTextCtrl TextCtrl in an integer, + * according to the internal units and the selected unit (g_UnitMetric) */ + +double To_User_Unit( bool is_metric, int val, int internal_unit_value ); +int From_User_Unit( bool is_metric, double val, int internal_unit_value ); +wxString GenDate(); +void MyFree( void* pt_mem ); +void* MyZMalloc( size_t nb_octets ); +void* MyMalloc( size_t nb_octets ); /****************/ /* eda_doc.cpp */ /****************/ -int KeyWordOk(const wxString & KeyList, const wxString & Database ); +int KeyWordOk( const wxString& KeyList, const wxString& Database ); + /* Recherche si dans le texte Database on retrouve tous les mots - cles donnes dans KeyList ( KeyList = suite de mots cles - separes par des espaces - Retourne: - 0 si aucun mot cle trouv� - 1 si mot cle trouv� -*/ -bool GetAssociatedDocument(wxFrame * frame, const wxString & LibPath, - const wxString & DocName); + * cles donnes dans KeyList ( KeyList = suite de mots cles + * separes par des espaces + * Retourne: + * 0 si aucun mot cle trouv� + * 1 si mot cle trouv� + */ +bool GetAssociatedDocument( wxFrame* frame, const wxString& LibPath, + const wxString& DocName ); /****************************/ /* get_component_dialog.cpp */ /****************************/ -wxString GetComponentName(WinEDA_DrawFrame * frame, - wxArrayString & HistoryList, const wxString & Title, - wxString(*AuxTool)(WinEDA_DrawFrame *parent) ); - /* Dialog frame to choose a component name */ -void AddHistoryComponentName(wxArrayString & HistoryList, const wxString & Name); - /* Add the string "Name" to the history list */ +wxString GetComponentName( WinEDA_DrawFrame* frame, + wxArrayString& HistoryList, const wxString& Title, + wxString (* AuxTool)(WinEDA_DrawFrame* parent) ); + +/* Dialog frame to choose a component name */ +void AddHistoryComponentName( wxArrayString& HistoryList, const wxString& Name ); + +/* Add the string "Name" to the history list */ /**********************/ /* block_commande.cpp */ /**********************/ -void AbortBlockCurrentCommand(WinEDA_DrawPanel * Panel, wxDC * DC); - /* Cancel Current block operation. */ -void InitBlockLocateDatas( WinEDA_DrawPanel * Panel,const wxPoint & startpos ); - /* Init the initial values of a BlockLocate, before starting a block command */ -void DrawAndSizingBlockOutlines(WinEDA_DrawPanel * panel, wxDC * DC, bool erase ); - /* Redraw the outlines of the block which shows the search area for block commands - The first point of the rectangle showing the area is initialised - by InitBlockLocateDatas(). - The other point of the rectangle is the mouse cursor */ +void AbortBlockCurrentCommand( WinEDA_DrawPanel* Panel, wxDC* DC ); +/* Cancel Current block operation. */ +void InitBlockLocateDatas( WinEDA_DrawPanel* Panel, const wxPoint& startpos ); + +/* Init the initial values of a BlockLocate, before starting a block command */ +void DrawAndSizingBlockOutlines( WinEDA_DrawPanel* panel, wxDC* DC, bool erase ); + +/* Redraw the outlines of the block which shows the search area for block commands + * The first point of the rectangle showing the area is initialised + * by InitBlockLocateDatas(). + * The other point of the rectangle is the mouse cursor */ #endif // COMMON_H - diff --git a/include/fctsys.h b/include/fctsys.h index 2489cf5135..da72d2b168 100644 --- a/include/fctsys.h +++ b/include/fctsys.h @@ -1,6 +1,6 @@ - /********************/ - /* includes systeme */ - /********************/ +/********************/ +/* includes systeme */ +/********************/ #ifndef FCTSYS_H #define FCTSYS_H @@ -21,8 +21,8 @@ #ifdef __FreeBSD__ #include #else -# ifndef __DARWIN__ -# include // MacOSX (DARWIN): malloc() and free() are in stdlib.h +#ifndef __DARWIN__ +#include // MacOSX (DARWIN): malloc() and free() are in stdlib.h #endif #endif #include @@ -38,43 +38,41 @@ #define M_PI 3.141592653 #endif -#define PCB_INTERNAL_UNIT 10000 // PCBNEW internal unit = 1/10000 inch -#define EESCHEMA_INTERNAL_UNIT 1000 // EESCHEMA internal unit = 1/1000 inch +#define PCB_INTERNAL_UNIT 10000 // PCBNEW internal unit = 1/10000 inch +#define EESCHEMA_INTERNAL_UNIT 1000 // EESCHEMA internal unit = 1/1000 inch #include "wxstruct.h" #include "gr_basic.h" // Old wxWidget compatibility (prior to wxWidget 2.7): -#if ( (wxMAJOR_VERSION < 2) || ((wxMAJOR_VERSION == 2)&& (wxMINOR_VERSION < 7)) ) -#define wxFD_OPEN wxOPEN -#define wxFD_SAVE wxSAVE +#if ( ( wxMAJOR_VERSION < 2) || ( ( wxMAJOR_VERSION == 2)&& (wxMINOR_VERSION < 7 ) ) ) +#define wxFD_OPEN wxOPEN +#define wxFD_SAVE wxSAVE #define wxFD_OVERWRITE_PROMPT wxOVERWRITE_PROMPT -#define WXK_PAGEUP WXK_PRIOR -#define WXK_PAGEDOWN WXK_NEXT +#define WXK_PAGEUP WXK_PRIOR +#define WXK_PAGEDOWN WXK_NEXT #endif #ifdef __UNIX__ -#define stricmp strcasecmp +#define stricmp strcasecmp #define strnicmp strncasecmp #endif #ifdef __WINDOWS__ -#define DIR_SEP '\\' -#define STRING_DIR_SEP wxT("\\") +#define DIR_SEP '\\' +#define STRING_DIR_SEP wxT( "\\" ) #else -#define DIR_SEP '/' -#define STRING_DIR_SEP wxT("/") +#define DIR_SEP '/' +#define STRING_DIR_SEP wxT( "/" ) #endif -#define UNIX_STRING_DIR_SEP wxT("/") -#define WIN_STRING_DIR_SEP wxT("\\") +#define UNIX_STRING_DIR_SEP wxT( "/" ) +#define WIN_STRING_DIR_SEP wxT( "\\" ) #ifndef TRUE -#define TRUE ((bool)1) -#define FALSE ((bool)0) +#define TRUE ((bool)1) +#define FALSE ((bool)0) #endif #endif /* FCTSYS_H */ - - diff --git a/include/gr_basic.h b/include/gr_basic.h index 705e425e81..d6ba314884 100644 --- a/include/gr_basic.h +++ b/include/gr_basic.h @@ -125,8 +125,8 @@ void GRSFillCSegm(EDA_Rect * ClipBox, wxDC * DC, int x1, int y1, int x2, int y2, int width, int Color); void GRSetColor(int Color); -void GRSetDefaultPalette(void); -int GRGetColor(void); +void GRSetDefaultPalette(); +int GRGetColor(); void GRPutPixel(EDA_Rect * ClipBox, wxDC * DC, int x, int y, int color); void GRSPutPixel(EDA_Rect * ClipBox, wxDC * DC, int x, int y, int color); int GRGetPixel(wxDC * DC, int x, int y); diff --git a/include/plot_common.h b/include/plot_common.h index eb01c5edac..d2c78b490e 100644 --- a/include/plot_common.h +++ b/include/plot_common.h @@ -33,7 +33,7 @@ void UserToDeviceCoordinate(wxPoint & pos ); // modifie les coord pos.x et pos.y pour le trace selon l'orientation, l'echelle, les offsets de trace void UserToDeviceSize(wxSize & size ); // modifie les dimension size.x et size.y pour le trace selon l'echelle -void ForcePenReinit(void); +void ForcePenReinit(); // set the flag g_CurrentPenWidth to -1 in order // to force a pen width redefinition for the next draw command diff --git a/kicad/buildmnu.cpp b/kicad/buildmnu.cpp index eecf7b9769..f4ce72e203 100644 --- a/kicad/buildmnu.cpp +++ b/kicad/buildmnu.cpp @@ -1,6 +1,6 @@ - /***********************************************/ - /* buildmnu.h: construction du menu principal */ - /***********************************************/ + /***********************************************/ + /* buildmnu.h: construction du menu principal */ + /***********************************************/ #include "fctsys.h" #include "gr_basic.h" @@ -18,7 +18,7 @@ // ---------------------------------------------------------------------------- // USE_XPM_BITMAPS -#include "bitmaps.h" // Common bitmaps +#include "bitmaps.h" // Common bitmaps #include "zip.xpm" #include "unzip.xpm" @@ -37,287 +37,287 @@ BEGIN_EVENT_TABLE(WinEDA_MainFrame, WinEDA_BasicFrame) - EVT_SIZE(WinEDA_MainFrame::OnSize) - EVT_CLOSE(WinEDA_MainFrame::OnCloseWindow) - EVT_SASH_DRAGGED(ID_LEFT_FRAME, WinEDA_MainFrame::OnSashDrag) - EVT_SASH_DRAGGED(ID_BOTTOM_FRAME, WinEDA_MainFrame::OnSashDrag) - EVT_SASH_DRAGGED(ID_MAIN_COMMAND, WinEDA_MainFrame::OnSashDrag) + EVT_SIZE(WinEDA_MainFrame::OnSize) + EVT_CLOSE(WinEDA_MainFrame::OnCloseWindow) + EVT_SASH_DRAGGED(ID_LEFT_FRAME, WinEDA_MainFrame::OnSashDrag) + EVT_SASH_DRAGGED(ID_BOTTOM_FRAME, WinEDA_MainFrame::OnSashDrag) + EVT_SASH_DRAGGED(ID_MAIN_COMMAND, WinEDA_MainFrame::OnSashDrag) - EVT_MENU_RANGE(ID_LOAD_PROJECT,ID_LOAD_FILE_10, - WinEDA_MainFrame::Process_Files) - EVT_MENU(ID_SAVE_PROJECT, WinEDA_MainFrame::Process_Files) + EVT_MENU_RANGE(ID_LOAD_PROJECT,ID_LOAD_FILE_10, + WinEDA_MainFrame::Process_Files) + EVT_MENU(ID_SAVE_PROJECT, WinEDA_MainFrame::Process_Files) - EVT_TOOL(ID_NEW_PROJECT, WinEDA_MainFrame::Process_Files) - EVT_TOOL(ID_LOAD_PROJECT, WinEDA_MainFrame::Process_Files) - EVT_TOOL(ID_SAVE_PROJECT, WinEDA_MainFrame::Process_Files) - EVT_TOOL(ID_SAVE_AND_ZIP_FILES, WinEDA_MainFrame::Process_Files) + EVT_TOOL(ID_NEW_PROJECT, WinEDA_MainFrame::Process_Files) + EVT_TOOL(ID_LOAD_PROJECT, WinEDA_MainFrame::Process_Files) + EVT_TOOL(ID_SAVE_PROJECT, WinEDA_MainFrame::Process_Files) + EVT_TOOL(ID_SAVE_AND_ZIP_FILES, WinEDA_MainFrame::Process_Files) - EVT_MENU(ID_EXIT, WinEDA_MainFrame::Process_Special_Functions) + EVT_MENU(ID_EXIT, WinEDA_MainFrame::Process_Special_Functions) - EVT_MENU(ID_TO_EDITOR, WinEDA_MainFrame::Process_Fct) - EVT_MENU(ID_BROWSE_AN_SELECT_FILE, WinEDA_MainFrame::Process_Fct) - EVT_MENU(ID_SELECT_PREFERED_EDITOR, WinEDA_MainFrame::Process_Preferences) - EVT_MENU(ID_SELECT_DEFAULT_PDF_BROWSER, WinEDA_MainFrame::Process_Preferences) - EVT_MENU(ID_SELECT_PREFERED_PDF_BROWSER, WinEDA_MainFrame::Process_Preferences) - EVT_MENU(ID_SELECT_PREFERED_PDF_BROWSER_NAME, WinEDA_MainFrame::Process_Preferences) - EVT_MENU(ID_SAVE_AND_ZIP_FILES, WinEDA_MainFrame::Process_Files) - EVT_MENU(ID_READ_ZIP_ARCHIVE, WinEDA_MainFrame::Process_Files) - EVT_MENU(ID_PROJECT_TREE_REFRESH, WinEDA_MainFrame::OnRefresh) + EVT_MENU(ID_TO_EDITOR, WinEDA_MainFrame::Process_Fct) + EVT_MENU(ID_BROWSE_AN_SELECT_FILE, WinEDA_MainFrame::Process_Fct) + EVT_MENU(ID_SELECT_PREFERED_EDITOR, WinEDA_MainFrame::Process_Preferences) + EVT_MENU(ID_SELECT_DEFAULT_PDF_BROWSER, WinEDA_MainFrame::Process_Preferences) + EVT_MENU(ID_SELECT_PREFERED_PDF_BROWSER, WinEDA_MainFrame::Process_Preferences) + EVT_MENU(ID_SELECT_PREFERED_PDF_BROWSER_NAME, WinEDA_MainFrame::Process_Preferences) + EVT_MENU(ID_SAVE_AND_ZIP_FILES, WinEDA_MainFrame::Process_Files) + EVT_MENU(ID_READ_ZIP_ARCHIVE, WinEDA_MainFrame::Process_Files) + EVT_MENU(ID_PROJECT_TREE_REFRESH, WinEDA_MainFrame::OnRefresh) - EVT_MENU(ID_PREFERENCES_FONT_INFOSCREEN, WinEDA_MainFrame::Process_Preferences) + EVT_MENU(ID_PREFERENCES_FONT_INFOSCREEN, WinEDA_MainFrame::Process_Preferences) - EVT_MENU_RANGE(ID_LANGUAGE_CHOICE, ID_LANGUAGE_CHOICE_END, - WinEDA_MainFrame::SetLanguage) + EVT_MENU_RANGE(ID_LANGUAGE_CHOICE, ID_LANGUAGE_CHOICE_END, + WinEDA_MainFrame::SetLanguage) - EVT_MENU(ID_GENERAL_HELP, WinEDA_MainFrame::GetKicadHelp) - EVT_MENU(ID_KICAD_ABOUT, WinEDA_MainFrame::GetKicadAbout) + EVT_MENU(ID_GENERAL_HELP, WinEDA_MainFrame::GetKicadHelp) + EVT_MENU(ID_KICAD_ABOUT, WinEDA_MainFrame::GetKicadAbout) - EVT_BUTTON(ID_TO_PCB, WinEDA_MainFrame::Process_Fct) - EVT_BUTTON(ID_TO_CVPCB, WinEDA_MainFrame::Process_Fct) - EVT_BUTTON(ID_TO_EESCHEMA, WinEDA_MainFrame::Process_Fct) - EVT_BUTTON(ID_TO_GERBVIEW, WinEDA_MainFrame::Process_Fct) + EVT_BUTTON(ID_TO_PCB, WinEDA_MainFrame::Process_Fct) + EVT_BUTTON(ID_TO_CVPCB, WinEDA_MainFrame::Process_Fct) + EVT_BUTTON(ID_TO_EESCHEMA, WinEDA_MainFrame::Process_Fct) + EVT_BUTTON(ID_TO_GERBVIEW, WinEDA_MainFrame::Process_Fct) #ifdef KICAD_PYTHON - EVT_BUTTON(ID_RUN_PYTHON, WinEDA_MainFrame::Process_Fct) + EVT_BUTTON(ID_RUN_PYTHON, WinEDA_MainFrame::Process_Fct) #endif END_EVENT_TABLE() /*******************************************/ -void WinEDA_MainFrame::ReCreateMenuBar(void) +void WinEDA_MainFrame::ReCreateMenuBar() /*******************************************/ { -int ii, jj; -wxMenuBar * menuBar = GetMenuBar() ; + int ii, jj; + wxMenuBar * menuBar = GetMenuBar() ; - if( menuBar == NULL ) - { - m_MenuBar = menuBar = new wxMenuBar(); + if( menuBar == NULL ) + { + m_MenuBar = menuBar = new wxMenuBar(); - m_FilesMenu = new wxMenu; - wxMenuItem *item = new wxMenuItem(m_FilesMenu, ID_LOAD_PROJECT, - _("&Open Project Descr"), - _("Select an existing project descriptor") ); - item->SetBitmap(open_project_xpm); - m_FilesMenu->Append(item); + m_FilesMenu = new wxMenu; + wxMenuItem *item = new wxMenuItem(m_FilesMenu, ID_LOAD_PROJECT, + _("&Open Project Descr"), + _("Select an existing project descriptor") ); + item->SetBitmap(open_project_xpm); + m_FilesMenu->Append(item); - item = new wxMenuItem(m_FilesMenu, ID_NEW_PROJECT, - _("&New Project Descr"), - _("Create new project descriptor") ); - item->SetBitmap(new_project_xpm); - m_FilesMenu->Append(item); + item = new wxMenuItem(m_FilesMenu, ID_NEW_PROJECT, + _("&New Project Descr"), + _("Create new project descriptor") ); + item->SetBitmap(new_project_xpm); + m_FilesMenu->Append(item); - item = new wxMenuItem(m_FilesMenu, ID_SAVE_PROJECT, - _("&Save Project Descr"), - _("Save current project descriptor") ); - item->SetBitmap(save_project_xpm); - m_FilesMenu->Append(item); + item = new wxMenuItem(m_FilesMenu, ID_SAVE_PROJECT, + _("&Save Project Descr"), + _("Save current project descriptor") ); + item->SetBitmap(save_project_xpm); + m_FilesMenu->Append(item); - m_FilesMenu->AppendSeparator(); - item = new wxMenuItem(m_FilesMenu, ID_SAVE_AND_ZIP_FILES, - _("Save &Project Files"), - _("Save and Zip all project files") ); - item->SetBitmap(zip_xpm); - m_FilesMenu->Append(item); - item = new wxMenuItem(m_FilesMenu, ID_READ_ZIP_ARCHIVE, - _("&Unzip Archive"), - _("UnZip archive file") ); - item->SetBitmap(unzip_xpm); - m_FilesMenu->Append(item); + m_FilesMenu->AppendSeparator(); + item = new wxMenuItem(m_FilesMenu, ID_SAVE_AND_ZIP_FILES, + _("Save &Project Files"), + _("Save and Zip all project files") ); + item->SetBitmap(zip_xpm); + m_FilesMenu->Append(item); + item = new wxMenuItem(m_FilesMenu, ID_READ_ZIP_ARCHIVE, + _("&Unzip Archive"), + _("UnZip archive file") ); + item->SetBitmap(unzip_xpm); + m_FilesMenu->Append(item); - m_FilesMenu->AppendSeparator(); - item = new wxMenuItem(m_FilesMenu, ID_EXIT, _("E&xit"), _("Quit Kicad") ); - item->SetBitmap(exit_xpm); - m_FilesMenu->Append(item); + m_FilesMenu->AppendSeparator(); + item = new wxMenuItem(m_FilesMenu, ID_EXIT, _("E&xit"), _("Quit Kicad") ); + item->SetBitmap(exit_xpm); + m_FilesMenu->Append(item); - // Creation des selections des anciens fichiers - m_FilesMenu->AppendSeparator(); - for ( ii = 0; ii < 10; ii++ ) - { - if ( GetLastProject(ii).IsEmpty() ) break; - m_FilesMenu->Append(ID_LOAD_FILE_1 + ii, GetLastProject(ii) ); - } + // Creation des selections des anciens fichiers + m_FilesMenu->AppendSeparator(); + for ( ii = 0; ii < 10; ii++ ) + { + if ( GetLastProject(ii).IsEmpty() ) break; + m_FilesMenu->Append(ID_LOAD_FILE_1 + ii, GetLastProject(ii) ); + } - // Menu Browse - wxMenu *browseMenu = new wxMenu(); - item = new wxMenuItem(browseMenu, ID_TO_EDITOR, - _("&Editor"), _("Text editor") ); - item->SetBitmap(editor_xpm); - browseMenu->Append(item); - item = new wxMenuItem(browseMenu, ID_BROWSE_AN_SELECT_FILE, - _("&Browse Files"), _("Read or edit files") ); - item->SetBitmap(browse_files_xpm); - browseMenu->Append(item); - browseMenu->AppendSeparator(); - item = new wxMenuItem(browseMenu, ID_SELECT_PREFERED_EDITOR, - _("&Select Editor"), _("Select your prefered editor for file browsing") ); - item->SetBitmap(editor_xpm); - browseMenu->Append(item); + // Menu Browse + wxMenu *browseMenu = new wxMenu(); + item = new wxMenuItem(browseMenu, ID_TO_EDITOR, + _("&Editor"), _("Text editor") ); + item->SetBitmap(editor_xpm); + browseMenu->Append(item); + item = new wxMenuItem(browseMenu, ID_BROWSE_AN_SELECT_FILE, + _("&Browse Files"), _("Read or edit files") ); + item->SetBitmap(browse_files_xpm); + browseMenu->Append(item); + browseMenu->AppendSeparator(); + item = new wxMenuItem(browseMenu, ID_SELECT_PREFERED_EDITOR, + _("&Select Editor"), _("Select your prefered editor for file browsing") ); + item->SetBitmap(editor_xpm); + browseMenu->Append(item); - // Preferences menu: - wxMenu *PreferencesMenu = new wxMenu; - item = new wxMenuItem(PreferencesMenu , ID_PREFERENCES_FONT_INFOSCREEN, - _("Select Fonts"), _("Select Fonts and Font sizes")); - item->SetBitmap(fonts_xpm); - PreferencesMenu->Append(item); + // Preferences menu: + wxMenu *PreferencesMenu = new wxMenu; + item = new wxMenuItem(PreferencesMenu , ID_PREFERENCES_FONT_INFOSCREEN, + _("Select Fonts"), _("Select Fonts and Font sizes")); + item->SetBitmap(fonts_xpm); + PreferencesMenu->Append(item); - // Submenu Pdf Browser selection: system browser or user selected browser (and its name) - wxMenu *SubMenuPdfBrowserChoice = new wxMenu; - item = new wxMenuItem(SubMenuPdfBrowserChoice , ID_SELECT_DEFAULT_PDF_BROWSER, - _("Default Pdf Viewer"), _("Use the default (system) PDF viewer used to browse datasheets"), - wxITEM_CHECK); - SETBITMAPS(datasheet_xpm); - SubMenuPdfBrowserChoice->Append(item); - SubMenuPdfBrowserChoice->Check(ID_SELECT_DEFAULT_PDF_BROWSER, - EDA_Appl->m_PdfBrowserIsDefault); - item = new wxMenuItem(SubMenuPdfBrowserChoice , ID_SELECT_PREFERED_PDF_BROWSER, - _("Favourite Pdf Viewer"), _("Use your favourite PDF viewer used to browse datasheets"), - wxITEM_CHECK); - SETBITMAPS(preference_xpm); - SubMenuPdfBrowserChoice->Append(item); - SubMenuPdfBrowserChoice->AppendSeparator(); - SubMenuPdfBrowserChoice->Check(ID_SELECT_PREFERED_PDF_BROWSER, - !EDA_Appl->m_PdfBrowserIsDefault); - item = new wxMenuItem(SubMenuPdfBrowserChoice , ID_SELECT_PREFERED_PDF_BROWSER_NAME, - _("Select Pdf Viewer"), _("Select your favourite PDF viewer used to browse datasheets")); - item->SetBitmap(datasheet_xpm); - SubMenuPdfBrowserChoice->Append(item); - ADD_MENUITEM_WITH_HELP_AND_SUBMENU(PreferencesMenu, SubMenuPdfBrowserChoice, - -1, _("Pdf Browser"), - wxT("Pdf Browser choice: default or user selection"), - datasheet_xpm); + // Submenu Pdf Browser selection: system browser or user selected browser (and its name) + wxMenu *SubMenuPdfBrowserChoice = new wxMenu; + item = new wxMenuItem(SubMenuPdfBrowserChoice , ID_SELECT_DEFAULT_PDF_BROWSER, + _("Default Pdf Viewer"), _("Use the default (system) PDF viewer used to browse datasheets"), + wxITEM_CHECK); + SETBITMAPS(datasheet_xpm); + SubMenuPdfBrowserChoice->Append(item); + SubMenuPdfBrowserChoice->Check(ID_SELECT_DEFAULT_PDF_BROWSER, + EDA_Appl->m_PdfBrowserIsDefault); + item = new wxMenuItem(SubMenuPdfBrowserChoice , ID_SELECT_PREFERED_PDF_BROWSER, + _("Favourite Pdf Viewer"), _("Use your favourite PDF viewer used to browse datasheets"), + wxITEM_CHECK); + SETBITMAPS(preference_xpm); + SubMenuPdfBrowserChoice->Append(item); + SubMenuPdfBrowserChoice->AppendSeparator(); + SubMenuPdfBrowserChoice->Check(ID_SELECT_PREFERED_PDF_BROWSER, + !EDA_Appl->m_PdfBrowserIsDefault); + item = new wxMenuItem(SubMenuPdfBrowserChoice , ID_SELECT_PREFERED_PDF_BROWSER_NAME, + _("Select Pdf Viewer"), _("Select your favourite PDF viewer used to browse datasheets")); + item->SetBitmap(datasheet_xpm); + SubMenuPdfBrowserChoice->Append(item); + ADD_MENUITEM_WITH_HELP_AND_SUBMENU(PreferencesMenu, SubMenuPdfBrowserChoice, + -1, _("Pdf Browser"), + wxT("Pdf Browser choice: default or user selection"), + datasheet_xpm); - PreferencesMenu->AppendSeparator(); - m_Parent->SetLanguageList(PreferencesMenu); + PreferencesMenu->AppendSeparator(); + m_Parent->SetLanguageList(PreferencesMenu); - // Menu Help: - wxMenu *helpMenu = new wxMenu; - item = new wxMenuItem(helpMenu , ID_GENERAL_HELP, - _("&Contents"), _("Open the kicad manual")); - item->SetBitmap(help_xpm); - helpMenu->Append(item); + // Menu Help: + wxMenu *helpMenu = new wxMenu; + item = new wxMenuItem(helpMenu , ID_GENERAL_HELP, + _("&Contents"), _("Open the kicad manual")); + item->SetBitmap(help_xpm); + helpMenu->Append(item); - item = new wxMenuItem(helpMenu , ID_KICAD_ABOUT, - _("&About"), _("About this application")); - item->SetBitmap(info_xpm); - helpMenu->Append(item); + item = new wxMenuItem(helpMenu , ID_KICAD_ABOUT, + _("&About"), _("About this application")); + item->SetBitmap(info_xpm); + helpMenu->Append(item); - menuBar->Append(m_FilesMenu, _("&Projects")); - menuBar->Append(browseMenu, _("&Browse")); - menuBar->Append(PreferencesMenu, _("&Preferences")); - menuBar->Append(helpMenu, _("&Help")); + menuBar->Append(m_FilesMenu, _("&Projects")); + menuBar->Append(browseMenu, _("&Browse")); + menuBar->Append(PreferencesMenu, _("&Preferences")); + menuBar->Append(helpMenu, _("&Help")); - // Associate the menu bar with the frame - SetMenuBar(menuBar); - } - else // simple mise a jour de la liste des fichiers anciens - { - wxMenuItem * item; - int max_file = m_Parent->m_LastProjectMaxCount; - for ( ii = max_file-1; ii >=0 ; ii-- ) - { - if( m_FilesMenu->FindItem(ID_LOAD_FILE_1 + ii) ) - { - item = m_FilesMenu->Remove(ID_LOAD_FILE_1 + ii); - if ( item ) delete item; - } - } - for ( jj = 0, ii = 0; ii < max_file; ii++ ) - { - if (GetLastProject(ii).IsEmpty() ) break; - m_FilesMenu->Append(ID_LOAD_FILE_1 + jj, GetLastProject(ii) ); - jj++; - } - } + // Associate the menu bar with the frame + SetMenuBar(menuBar); + } + else // simple mise a jour de la liste des fichiers anciens + { + wxMenuItem * item; + int max_file = m_Parent->m_LastProjectMaxCount; + for ( ii = max_file-1; ii >=0 ; ii-- ) + { + if( m_FilesMenu->FindItem(ID_LOAD_FILE_1 + ii) ) + { + item = m_FilesMenu->Remove(ID_LOAD_FILE_1 + ii); + if ( item ) delete item; + } + } + for ( jj = 0, ii = 0; ii < max_file; ii++ ) + { + if (GetLastProject(ii).IsEmpty() ) break; + m_FilesMenu->Append(ID_LOAD_FILE_1 + jj, GetLastProject(ii) ); + jj++; + } + } } /***************************************************/ -void WinEDA_MainFrame::RecreateBaseHToolbar(void) +void WinEDA_MainFrame::RecreateBaseHToolbar() /***************************************************/ { - if ( m_HToolBar != NULL ) return; + if ( m_HToolBar != NULL ) return; - m_HToolBar = new WinEDA_Toolbar(TOOLBAR_MAIN, this, ID_H_TOOLBAR, TRUE); - SetToolBar(m_HToolBar); + m_HToolBar = new WinEDA_Toolbar(TOOLBAR_MAIN, this, ID_H_TOOLBAR, TRUE); + SetToolBar(m_HToolBar); - // Set up toolbar - m_HToolBar->AddTool(ID_NEW_PROJECT, BITMAP(new_project_xpm), - wxNullBitmap, FALSE, - -1, -1, (wxObject *) NULL, - _("Create new project descriptor")); + // Set up toolbar + m_HToolBar->AddTool(ID_NEW_PROJECT, BITMAP(new_project_xpm), + wxNullBitmap, FALSE, + -1, -1, (wxObject *) NULL, + _("Create new project descriptor")); - m_HToolBar->AddTool(ID_LOAD_PROJECT, BITMAP(open_project_xpm), - wxNullBitmap, FALSE, - -1, -1, (wxObject *) NULL, - _("Select an existing project descriptor")); + m_HToolBar->AddTool(ID_LOAD_PROJECT, BITMAP(open_project_xpm), + wxNullBitmap, FALSE, + -1, -1, (wxObject *) NULL, + _("Select an existing project descriptor")); - m_HToolBar->AddTool(ID_SAVE_PROJECT, BITMAP(save_project_xpm), - wxNullBitmap, FALSE, - -1, -1, (wxObject *) NULL, - _("Save current project descriptor")); + m_HToolBar->AddTool(ID_SAVE_PROJECT, BITMAP(save_project_xpm), + wxNullBitmap, FALSE, + -1, -1, (wxObject *) NULL, + _("Save current project descriptor")); - m_HToolBar->AddSeparator(); - m_HToolBar->AddTool(ID_SAVE_AND_ZIP_FILES, BITMAP(zip_xpm), - wxNullBitmap, FALSE, - -1, -1, (wxObject *) NULL, - _("Archive all project files")); + m_HToolBar->AddSeparator(); + m_HToolBar->AddTool(ID_SAVE_AND_ZIP_FILES, BITMAP(zip_xpm), + wxNullBitmap, FALSE, + -1, -1, (wxObject *) NULL, + _("Archive all project files")); - m_HToolBar->AddSeparator(); - m_HToolBar->AddTool(ID_PROJECT_TREE_REFRESH, BITMAP(reload_xpm), - wxNullBitmap, FALSE, - -1, -1, (wxObject *) NULL, - _("Refresh project tree")); + m_HToolBar->AddSeparator(); + m_HToolBar->AddTool(ID_PROJECT_TREE_REFRESH, BITMAP(reload_xpm), + wxNullBitmap, FALSE, + -1, -1, (wxObject *) NULL, + _("Refresh project tree")); - // after adding the buttons to the toolbar, must call Realize() to reflect - // the changes - m_HToolBar->Realize(); + // after adding the buttons to the toolbar, must call Realize() to reflect + // the changes + m_HToolBar->Realize(); } /*************************************************/ -void WinEDA_MainFrame::CreateCommandToolbar(void) +void WinEDA_MainFrame::CreateCommandToolbar() /*************************************************/ { -wxBitmapButton * btn; + wxBitmapButton * btn; - // delete and recreate the toolbar - if( m_VToolBar ) return; - btn = new wxBitmapButton( this, ID_TO_EESCHEMA, BITMAP(icon_eeschema_xpm) ); - btn->SetToolTip(_("eeschema (Schematic editor)")); - AddFastLaunch( btn ); + // delete and recreate the toolbar + if( m_VToolBar ) return; + btn = new wxBitmapButton( this, ID_TO_EESCHEMA, BITMAP(icon_eeschema_xpm) ); + btn->SetToolTip(_("eeschema (Schematic editor)")); + AddFastLaunch( btn ); - btn = new wxBitmapButton( this,ID_TO_CVPCB, BITMAP(icon_cvpcb_xpm) ); - btn->SetToolTip(_("cvpcb (Components to modules)")); - AddFastLaunch( btn ); + btn = new wxBitmapButton( this,ID_TO_CVPCB, BITMAP(icon_cvpcb_xpm) ); + btn->SetToolTip(_("cvpcb (Components to modules)")); + AddFastLaunch( btn ); - btn = new wxBitmapButton( this, ID_TO_PCB, BITMAP(a_icon_pcbnew_xpm) ); - btn->SetToolTip(_("pcbnew (PCB editor)")); - AddFastLaunch( btn ); + btn = new wxBitmapButton( this, ID_TO_PCB, BITMAP(a_icon_pcbnew_xpm) ); + btn->SetToolTip(_("pcbnew (PCB editor)")); + AddFastLaunch( btn ); - btn = new wxBitmapButton( this, ID_TO_GERBVIEW, BITMAP(icon_gerbview_xpm) ); - btn->SetToolTip(_("gerbview (Gerber viewer)")); - AddFastLaunch( btn ); + btn = new wxBitmapButton( this, ID_TO_GERBVIEW, BITMAP(icon_gerbview_xpm) ); + btn->SetToolTip(_("gerbview (Gerber viewer)")); + AddFastLaunch( btn ); - // Set up toolbar + // Set up toolbar - #ifdef KICAD_PYTHON - btn = new wxBitmapButton( this, ID_RUN_PYTHON, BITMAP(icon_python_xpm) ); - btn->SetToolTip(_("Run Python Script")); - AddFastLaunch( btn ); - #endif + #ifdef KICAD_PYTHON + btn = new wxBitmapButton( this, ID_RUN_PYTHON, BITMAP(icon_python_xpm) ); + btn->SetToolTip(_("Run Python Script")); + AddFastLaunch( btn ); + #endif } void WinEDA_MainFrame::AddFastLaunch( wxButton * button, int sep ) { - static wxPoint pos (20, 20); - button->Reparent( m_CommandWin ); - button->Move( pos ); - pos.x += button->GetSize().GetWidth() + sep; + static wxPoint pos (20, 20); + button->Reparent( m_CommandWin ); + button->Move( pos ); + pos.x += button->GetSize().GetWidth() + sep; } diff --git a/kicad/files-io.cpp b/kicad/files-io.cpp index 38b4b24cca..c470b6219c 100644 --- a/kicad/files-io.cpp +++ b/kicad/files-io.cpp @@ -1,6 +1,6 @@ - /****************/ - /* files-io.cpp */ - /****************/ +/****************/ +/* files-io.cpp */ +/****************/ #ifdef __GNUG__ #pragma implementation @@ -22,262 +22,294 @@ #include "kicad.h" #include "prjconfig.h" -#define ZIP_EXT wxT(".zip") -#define ZIP_MASK wxT("*.zip") +#define ZIP_EXT wxT( ".zip" ) +#define ZIP_MASK wxT( "*.zip" ) -static void Create_NewPrj_Config( const wxString PrjFullFileName); +static void Create_NewPrj_Config( const wxString PrjFullFileName ); /***********************************************************/ -void WinEDA_MainFrame::Process_Files(wxCommandEvent& event) +void WinEDA_MainFrame::Process_Files( wxCommandEvent& event ) /***********************************************************/ + /* Gestion generale des commandes de sauvegarde -*/ + */ { -int id = event.GetId(); -wxString path = wxGetCwd(); -wxString fullfilename; -bool IsNew = FALSE; - - switch (id) - { - case ID_SAVE_PROJECT: /* Update project File */ - Save_Prj_Config(); - break; + int id = event.GetId(); + wxString path = wxGetCwd(); + + wxString fullfilename; + bool IsNew = FALSE; - case ID_LOAD_FILE_1: - case ID_LOAD_FILE_2: - case ID_LOAD_FILE_3: - case ID_LOAD_FILE_4: - case ID_LOAD_FILE_5: - case ID_LOAD_FILE_6: - case ID_LOAD_FILE_7: - case ID_LOAD_FILE_8: - case ID_LOAD_FILE_9: - case ID_LOAD_FILE_10: - m_PrjFileName = GetLastProject( id - ID_LOAD_FILE_1); - SetLastProject(m_PrjFileName); - ReCreateMenuBar(); - Load_Prj_Config(); - break; + switch( id ) + { + case ID_SAVE_PROJECT: /* Update project File */ + Save_Prj_Config(); + break; - case ID_NEW_PROJECT: - IsNew = TRUE; - case ID_LOAD_PROJECT: - SetLastProject(m_PrjFileName); - fullfilename = EDA_FileSelector( IsNew ? _("Create Project files:") : _("Load Project files:"), - path, /* Chemin par defaut */ - wxEmptyString, /* nom fichier par defaut */ - g_Prj_Config_Filename_ext, /* extension par defaut */ - wxT("*") + g_Prj_Config_Filename_ext, /* Masque d'affichage */ - this, - IsNew ? wxFD_SAVE : wxFD_OPEN, - FALSE - ); - if ( fullfilename.IsEmpty() ) break; - - ChangeFileNameExt(fullfilename, g_Prj_Config_Filename_ext); - m_PrjFileName = fullfilename; - if ( IsNew ) Create_NewPrj_Config( m_PrjFileName); - SetLastProject(m_PrjFileName); - Load_Prj_Config(); - break; + case ID_LOAD_FILE_1: + case ID_LOAD_FILE_2: + case ID_LOAD_FILE_3: + case ID_LOAD_FILE_4: + case ID_LOAD_FILE_5: + case ID_LOAD_FILE_6: + case ID_LOAD_FILE_7: + case ID_LOAD_FILE_8: + case ID_LOAD_FILE_9: + case ID_LOAD_FILE_10: + m_PrjFileName = GetLastProject( id - ID_LOAD_FILE_1 ); + SetLastProject( m_PrjFileName ); + ReCreateMenuBar(); + Load_Prj_Config(); + break; + + case ID_NEW_PROJECT: + IsNew = TRUE; + + case ID_LOAD_PROJECT: + SetLastProject( m_PrjFileName ); + fullfilename = EDA_FileSelector( IsNew ? _( "Create Project files:" ) : + _( "Load Project files:" ), + path, /* Chemin par defaut */ + wxEmptyString, /* nom fichier par defaut */ + g_Prj_Config_Filename_ext, /* extension par defaut */ + wxT( "*" ) + g_Prj_Config_Filename_ext, /* Masque d'affichage */ + this, + IsNew ? wxFD_SAVE : wxFD_OPEN, + FALSE + ); + if( fullfilename.IsEmpty() ) + break; + + ChangeFileNameExt( fullfilename, g_Prj_Config_Filename_ext ); + m_PrjFileName = fullfilename; + if( IsNew ) + Create_NewPrj_Config( m_PrjFileName ); + SetLastProject( m_PrjFileName ); + Load_Prj_Config(); + break; - case ID_SAVE_AND_ZIP_FILES: - CreateZipArchive(wxEmptyString); - break; - - case ID_READ_ZIP_ARCHIVE: - UnZipArchive(wxEmptyString); - break; - - default: DisplayError(this, wxT("WinEDA_MainFrame::Process_Files error")); - break; - } + case ID_SAVE_AND_ZIP_FILES: + CreateZipArchive( wxEmptyString ); + break; + + case ID_READ_ZIP_ARCHIVE: + UnZipArchive( wxEmptyString ); + break; + + default: + DisplayError( this, wxT( "WinEDA_MainFrame::Process_Files error" ) ); + break; + } } /**************************************************************/ -static void Create_NewPrj_Config(const wxString PrjFullFileName) +static void Create_NewPrj_Config( const wxString PrjFullFileName ) /**************************************************************/ + /* Cree un nouveau fichier projet a partir du modele -*/ + */ { -wxString msg; - // Init default config filename - g_Prj_Config_LocalFilename.Empty(); - g_Prj_Default_Config_FullFilename = - ReturnKicadDatasPath() + - wxT("template/kicad") + - g_Prj_Config_Filename_ext; + wxString msg; - if ( ! wxFileExists(g_Prj_Default_Config_FullFilename) ) - { - msg = _("Template file non found ") + g_Prj_Default_Config_FullFilename; - DisplayInfo(NULL, msg); - } - - else - { - if ( wxFileExists(PrjFullFileName) ) - { - msg = _("File ") + PrjFullFileName - + _(" exists! OK to continue?"); - if ( IsOK(NULL, msg) ) - { - wxCopyFile(g_Prj_Default_Config_FullFilename, - PrjFullFileName); - } - } - } + // Init default config filename + g_Prj_Config_LocalFilename.Empty(); + + g_Prj_Default_Config_FullFilename = ReturnKicadDatasPath() + + wxT( "template/kicad" ) + g_Prj_Config_Filename_ext; - g_SchematicRootFileName = wxFileNameFromPath(PrjFullFileName); - ChangeFileNameExt(g_SchematicRootFileName, g_SchExtBuffer); - g_BoardFileName = wxFileNameFromPath(PrjFullFileName); - ChangeFileNameExt(g_BoardFileName, g_BoardExtBuffer); - - EDA_Appl->WriteProjectConfig(PrjFullFileName, wxT("/general"), CfgParamList); + if( !wxFileExists( g_Prj_Default_Config_FullFilename ) ) + { + msg = _( "Template file non found " ) + g_Prj_Default_Config_FullFilename; + DisplayInfo( NULL, msg ); + } + else + { + if( wxFileExists( PrjFullFileName ) ) + { + msg = _( "File " ) + PrjFullFileName + + _( " exists! OK to continue?" ); + if( IsOK( NULL, msg ) ) + { + wxCopyFile( g_Prj_Default_Config_FullFilename, + PrjFullFileName ); + } + } + } + + g_SchematicRootFileName = wxFileNameFromPath( PrjFullFileName ); + ChangeFileNameExt( g_SchematicRootFileName, g_SchExtBuffer ); + + g_BoardFileName = wxFileNameFromPath( PrjFullFileName ); + ChangeFileNameExt( g_BoardFileName, g_BoardExtBuffer ); + + EDA_Appl->WriteProjectConfig( PrjFullFileName, wxT( "/general" ), CfgParamList ); } /**********************************************************************/ -void WinEDA_MainFrame::UnZipArchive(const wxString FullFileName) +void WinEDA_MainFrame::UnZipArchive( const wxString FullFileName ) /**********************************************************************/ + /* Lit un fichier archive .zip et le decompresse dans le repertoire courant -*/ + */ { -wxString filename = FullFileName; -wxString msg; -wxString old_cwd = wxGetCwd(); - - if ( filename.IsEmpty() ) - filename = EDA_FileSelector( _("Unzip Project:"), - wxEmptyString, /* Chemin par defaut */ - wxEmptyString, /* nom fichier par defaut */ - ZIP_EXT, /* extension par defaut */ - ZIP_MASK, /* Masque d'affichage */ - this, - wxFD_OPEN, - TRUE - ); - if ( filename.IsEmpty() ) return; + wxString filename = FullFileName; + wxString msg; + wxString old_cwd = wxGetCwd(); - msg = _("\nOpen ") + filename + wxT("\n"); - PrintMsg( msg ); + if( filename.IsEmpty() ) + filename = EDA_FileSelector( _( "Unzip Project:" ), + wxEmptyString, /* Chemin par defaut */ + wxEmptyString, /* nom fichier par defaut */ + ZIP_EXT, /* extension par defaut */ + ZIP_MASK, /* Masque d'affichage */ + this, + wxFD_OPEN, + TRUE + ); + if( filename.IsEmpty() ) + return; -wxString target_dirname = wxDirSelector ( _("Target Directory"), - wxEmptyString, 0, wxDefaultPosition, this); - if ( target_dirname.IsEmpty() ) return; - - wxSetWorkingDirectory(target_dirname); - msg = _("Unzip in ") + target_dirname + wxT("\n"); - PrintMsg( msg ); - -wxFileSystem zipfilesys; - zipfilesys.AddHandler(new wxZipFSHandler); - filename += wxT("#zip:"); - zipfilesys.ChangePathTo(filename); - -wxFSFile * zipfile = NULL; -wxString localfilename = zipfilesys.FindFirst( wxT("*.*") ); - - while ( !localfilename.IsEmpty() ) - { - zipfile = zipfilesys.OpenFile(localfilename); - if (zipfile == NULL) - { - DisplayError(this, wxT("Zip file read error")); - break; - } - wxString unzipfilename = localfilename.AfterLast(':'); - msg = _("Extract file ") + unzipfilename; - PrintMsg(msg); - wxInputStream * stream = zipfile->GetStream(); - wxFFileOutputStream * ofile = new wxFFileOutputStream(unzipfilename); - if ( ofile->Ok() ) - { - ofile->Write(*stream); - PrintMsg( _(" OK\n") ); - } - else PrintMsg( _(" *ERROR*\n") ); + msg = _( "\nOpen " ) + filename + wxT( "\n" ); + PrintMsg( msg ); - delete ofile; - delete zipfile; - localfilename = zipfilesys.FindNext(); - } - PrintMsg( wxT("** end **\n") ); - - wxSetWorkingDirectory(old_cwd); + wxString target_dirname = wxDirSelector( _( "Target Directory" ), + wxEmptyString, 0, wxDefaultPosition, this ); + if( target_dirname.IsEmpty() ) + return; + + wxSetWorkingDirectory( target_dirname ); + msg = _( "Unzip in " ) + target_dirname + wxT( "\n" ); + PrintMsg( msg ); + + wxFileSystem zipfilesys; + zipfilesys.AddHandler( new wxZipFSHandler ); + + filename += wxT( "#zip:" ); + zipfilesys.ChangePathTo( filename ); + + wxFSFile* zipfile = NULL; + wxString localfilename = zipfilesys.FindFirst( wxT( "*.*" ) ); + + while( !localfilename.IsEmpty() ) + { + zipfile = zipfilesys.OpenFile( localfilename ); + if( zipfile == NULL ) + { + DisplayError( this, wxT( "Zip file read error" ) ); + break; + } + + wxString unzipfilename = localfilename.AfterLast( ':' ); + + msg = _( "Extract file " ) + unzipfilename; + PrintMsg( msg ); + + wxInputStream* stream = zipfile->GetStream(); + + wxFFileOutputStream* ofile = new wxFFileOutputStream( unzipfilename ); + + if( ofile->Ok() ) + { + ofile->Write( *stream ); + PrintMsg( _( " OK\n" ) ); + } + else + PrintMsg( _( " *ERROR*\n" ) ); + + delete ofile; + delete zipfile; + localfilename = zipfilesys.FindNext(); + } + + PrintMsg( wxT( "** end **\n" ) ); + + wxSetWorkingDirectory( old_cwd ); } + /********************************************************************/ -void WinEDA_MainFrame::CreateZipArchive(const wxString FullFileName) +void WinEDA_MainFrame::CreateZipArchive( const wxString FullFileName ) /********************************************************************/ { -wxString filename = FullFileName; -wxString zip_file_fullname; -wxString msg; -wxString curr_path = wxGetCwd(); - - if ( filename.IsEmpty() ) - { - filename = m_PrjFileName; - ChangeFileNameExt(filename, wxT(".zip")); - filename = EDA_FileSelector( _("Archive Project files:"), - wxEmptyString, /* Chemin par defaut */ - filename, /* nom fichier par defaut */ - ZIP_EXT, /* extension par defaut */ - ZIP_MASK, /* Masque d'affichage */ - this, - wxFD_SAVE, - FALSE - ); - } - if ( filename.IsEmpty() ) return; + wxString filename = FullFileName; + wxString zip_file_fullname; + wxString msg; + wxString curr_path = wxGetCwd(); + + if( filename.IsEmpty() ) + { + filename = m_PrjFileName; + ChangeFileNameExt( filename, wxT( ".zip" ) ); + filename = EDA_FileSelector( _( "Archive Project files:" ), + wxEmptyString, /* Chemin par defaut */ + filename, /* nom fichier par defaut */ + ZIP_EXT, /* extension par defaut */ + ZIP_MASK, /* Masque d'affichage */ + this, + wxFD_SAVE, + FALSE + ); + } + if( filename.IsEmpty() ) + return; -wxFileName zip_name(filename); - zip_file_fullname = zip_name.GetFullName(); - AddDelimiterString( zip_file_fullname ); + wxFileName zip_name( filename ); -wxChar * Ext_to_arch[] = { /* Liste des extensions des fichiers à sauver */ - wxT("*.sch"), wxT("*.lib"), wxT("*.cmp"), wxT("*.brd"), - wxT("*.net"), wxT("*.pro"), wxT("*.pho"), wxT("*.py"), - wxT("*.pdf"), wxT("*.txt"), - NULL}; -int ii = 0; -wxString zip_cmd = wxT("-O ") + zip_file_fullname; - filename = wxFindFirstFile(Ext_to_arch[ii]); - while ( !filename.IsEmpty() ) - { - wxFileName name(filename); - wxString fullname = name.GetFullName(); - AddDelimiterString( fullname ); - zip_cmd += wxT(" ") + fullname; - msg = _("Compress file ") + fullname + wxT("\n"); - PrintMsg(msg); + zip_file_fullname = zip_name.GetFullName(); + AddDelimiterString( zip_file_fullname ); - filename = wxFindNextFile(); - while (filename.IsEmpty() ) - { - ii++; - if (Ext_to_arch[ii]) filename = wxFindFirstFile(Ext_to_arch[ii]); - else break; - } - } + /* Liste des extensions des fichiers à sauver */ + static const wxChar* Ext_to_arch[] = { + wxT( "*.sch" ), wxT( "*.lib" ), wxT( "*.cmp" ), wxT( "*.brd" ), + wxT( "*.net" ), wxT( "*.pro" ), wxT( "*.pho" ), wxT( "*.py" ), + wxT( "*.pdf" ), wxT( "*.txt" ), + NULL + }; + + int ii = 0; + + wxString zip_cmd = wxT( "-O " ) + zip_file_fullname; + filename = wxFindFirstFile( Ext_to_arch[ii] ); + + while( !filename.IsEmpty() ) + { + wxFileName name( filename ); + + wxString fullname = name.GetFullName(); + AddDelimiterString( fullname ); + zip_cmd += wxT( " " ) + fullname; + + msg = _( "Compress file " ) + fullname + wxT( "\n" ); + PrintMsg( msg ); + + filename = wxFindNextFile(); + while( filename.IsEmpty() ) + { + ii++; + if( Ext_to_arch[ii] ) + filename = wxFindFirstFile( Ext_to_arch[ii] ); + else + break; + } + } #ifdef __WINDOWS__ -#define ZIPPER wxT("minizip.exe") +#define ZIPPER wxT( "minizip.exe" ) #else -#define ZIPPER wxT("minizip") -#endif - if ( ExecuteFile(this, ZIPPER, zip_cmd) >= 0 ) - { - msg = _("\nCreate Zip Archive ") + zip_file_fullname; - PrintMsg( msg ); - PrintMsg( wxT("\n** end **\n") ); - } - else PrintMsg( wxT("Minizip command error, abort\n") ); - - wxSetWorkingDirectory(curr_path); +#define ZIPPER wxT( "minizip" ) +#endif + if( ExecuteFile( this, ZIPPER, zip_cmd ) >= 0 ) + { + msg = _( "\nCreate Zip Archive " ) + zip_file_fullname; + PrintMsg( msg ); + PrintMsg( wxT( "\n** end **\n" ) ); + } + else + PrintMsg( wxT( "Minizip command error, abort\n" ) ); + + wxSetWorkingDirectory( curr_path ); } diff --git a/kicad/kicad.cpp b/kicad/kicad.cpp index cd4db79653..70d06b5569 100644 --- a/kicad/kicad.cpp +++ b/kicad/kicad.cpp @@ -1,6 +1,6 @@ - /********************************/ - /* kicad.cpp - module principal */ - /********************************/ + /********************************/ + /* kicad.cpp - module principal */ + /********************************/ #ifdef __GNUG__ #pragma implementation @@ -38,9 +38,9 @@ void ShowLogo(char * FonteFileName); /* Routines locales */ - /************************************/ - /* Called to initialize the program */ - /************************************/ + /************************************/ + /* Called to initialize the program */ + /************************************/ // Create a new application object IMPLEMENT_APP(WinEDA_App) @@ -49,17 +49,17 @@ IMPLEMENT_APP(WinEDA_App) using namespace boost::python; // Global functions: -static WinEDA_MainFrame& GetMainFrame(void) { return *( wxGetApp().m_MainFrame ); } +static WinEDA_MainFrame& GetMainFrame() { return *( wxGetApp().m_MainFrame ); } static void WinEDAPrint( str msg ) { GetMainFrame().PrintMsg( PyHandler::MakeStr( msg ) + wxT("\n") ); } -static void WinEDAClear() { GetMainFrame().ClearMsg(); } +static void WinEDAClear() { GetMainFrame().ClearMsg(); } static object GetTypeExt( enum TreeFileType type ) { return PyHandler::Convert( WinEDA_PrjFrame::GetFileExt( type ) ); } // WinEDA_MainFrame Special binding functions: // (one line functions are simple wrappers) -object WinEDA_MainFrame::GetPrjName() const { return PyHandler::Convert( m_PrjFileName ); } -object WinEDA_MainFrame::ToWx() { return object( handle<>( borrowed( wxPyMake_wxObject( this, false ) ) ) ); } -WinEDA_PrjFrame* WinEDA_MainFrame::GetTree() const { return m_LeftWin; } +object WinEDA_MainFrame::GetPrjName() const { return PyHandler::Convert( m_PrjFileName ); } +object WinEDA_MainFrame::ToWx() { return object( handle<>( borrowed( wxPyMake_wxObject( this, false ) ) ) ); } +WinEDA_PrjFrame* WinEDA_MainFrame::GetTree() const { return m_LeftWin; } void WinEDA_MainFrame::AddFastLaunchPy( object & button ) { @@ -74,117 +74,117 @@ void WinEDA_MainFrame::AddFastLaunchPy( object & button ) // WinEDA_PrjFrame Special binding functions: // (one line functions are simple wrappers) -object WinEDA_PrjFrame::ToWx() { return object( handle<>( borrowed( wxPyMake_wxObject( this, false ) ) ) ); } -object WinEDA_PrjFrame::GetFtExPy( enum TreeFileType type ) const { return PyHandler::Convert( GetFileExt( type ) ); } -object WinEDA_PrjFrame::GetMenuPy( enum TreeFileType type ) { return object( handle<>( borrowed( wxPyMake_wxObject( GetContextMenu( (int) type ), false ) ) ) ); } -object WinEDA_PrjFrame::GetTreeCtrl() { return object( handle<>( borrowed( wxPyMake_wxObject( m_TreeProject, false ) ) ) ); } -object WinEDA_PrjFrame::GetCurrentMenu() { return object( handle<>( borrowed( wxPyMake_wxObject( m_PopupMenu, false ) ) ) ); } +object WinEDA_PrjFrame::ToWx() { return object( handle<>( borrowed( wxPyMake_wxObject( this, false ) ) ) ); } +object WinEDA_PrjFrame::GetFtExPy( enum TreeFileType type ) const { return PyHandler::Convert( GetFileExt( type ) ); } +object WinEDA_PrjFrame::GetMenuPy( enum TreeFileType type ) { return object( handle<>( borrowed( wxPyMake_wxObject( GetContextMenu( (int) type ), false ) ) ) ); } +object WinEDA_PrjFrame::GetTreeCtrl() { return object( handle<>( borrowed( wxPyMake_wxObject( m_TreeProject, false ) ) ) ); } +object WinEDA_PrjFrame::GetCurrentMenu() { return object( handle<>( borrowed( wxPyMake_wxObject( m_PopupMenu, false ) ) ) ); } void WinEDA_PrjFrame::NewFilePy( const str & name, enum TreeFileType type, object & id ) { - wxTreeItemId root; - if (! wxPyConvertSwigPtr( id.ptr(), (void**)&root, _T("wxTreeItemId") ) ) return; - NewFile( PyHandler::MakeStr( name ), type, root ); + wxTreeItemId root; + if (! wxPyConvertSwigPtr( id.ptr(), (void**)&root, _T("wxTreeItemId") ) ) return; + NewFile( PyHandler::MakeStr( name ), type, root ); } void WinEDA_PrjFrame::AddFilePy( const str & file, object & root ) /* Add a file to the tree under root, or m_root if conversion is wrong */ { - wxTreeItemId * theroot = &m_root; - if ( !wxPyConvertSwigPtr( root.ptr(), (void**)&root, _T("wxTreeItemId") ) ) - { - theroot = &m_root; - } - AddFile( PyHandler::MakeStr( file ), *theroot ); + wxTreeItemId * theroot = &m_root; + if ( !wxPyConvertSwigPtr( root.ptr(), (void**)&root, _T("wxTreeItemId") ) ) + { + theroot = &m_root; + } + AddFile( PyHandler::MakeStr( file ), *theroot ); } TreePrjItemData * WinEDA_PrjFrame::GetItemData( const object & item ) /* convert wxTreeItem into TreePrjItemData */ { - wxTreeItemId *id = NULL; - if ( !wxPyConvertSwigPtr( item.ptr(), (void**)&id, _T("wxTreeItemId") ) ) return NULL; - return dynamic_cast( m_TreeProject->GetItemData( *id ) ); + wxTreeItemId *id = NULL; + if ( !wxPyConvertSwigPtr( item.ptr(), (void**)&id, _T("wxTreeItemId") ) ) return NULL; + return dynamic_cast( m_TreeProject->GetItemData( *id ) ); } // TreePrjItemData Special binding functions // (one line functions are simple wrappers) -bool TreePrjItemData::RenamePy( const str & newname, bool check ) { return Rename( PyHandler::MakeStr(newname), check ); } -object TreePrjItemData::GetDirPy() const { return PyHandler::Convert( GetDir() ); } -object TreePrjItemData::GetFileNamePy() const { return PyHandler::Convert( GetFileName() ); } -object TreePrjItemData::GetMenuPy() { return object( handle<>( borrowed( wxPyMake_wxObject( &m_fileMenu, false ) ) ) ); } +bool TreePrjItemData::RenamePy( const str & newname, bool check ) { return Rename( PyHandler::MakeStr(newname), check ); } +object TreePrjItemData::GetDirPy() const { return PyHandler::Convert( GetDir() ); } +object TreePrjItemData::GetFileNamePy() const { return PyHandler::Convert( GetFileName() ); } +object TreePrjItemData::GetMenuPy() { return object( handle<>( borrowed( wxPyMake_wxObject( &m_fileMenu, false ) ) ) ); } // kicad module init function // ( this function is called from PyHandler to init the kicad module ) -static void py_kicad_init(void) +static void py_kicad_init() { def( "GetMainFrame", &GetMainFrame, return_value_policy< reference_existing_object >() ); def( "GetTypeExtension", &GetTypeExt ); - class_( "PrjItem" ) - // Internal data: - .def( "GetFileName", &TreePrjItemData::GetFileNamePy ) - .def( "GetDir", &TreePrjItemData::GetDirPy ) - .def( "GetType", &TreePrjItemData::GetType ) - .def( "GetId", &TreePrjItemData::GetIdPy ) - .def( "GetMenu", &TreePrjItemData::GetMenuPy ) - // Item control - .def( "SetState", &TreePrjItemData::SetState ) - .def( "Rename", &TreePrjItemData::RenamePy ) - .def( "Move", &TreePrjItemData::Move ) - .def( "Delete", &TreePrjItemData::Delete ) - .def( "Activate", &TreePrjItemData::Activate ) - ; + class_( "PrjItem" ) + // Internal data: + .def( "GetFileName", &TreePrjItemData::GetFileNamePy ) + .def( "GetDir", &TreePrjItemData::GetDirPy ) + .def( "GetType", &TreePrjItemData::GetType ) + .def( "GetId", &TreePrjItemData::GetIdPy ) + .def( "GetMenu", &TreePrjItemData::GetMenuPy ) + // Item control + .def( "SetState", &TreePrjItemData::SetState ) + .def( "Rename", &TreePrjItemData::RenamePy ) + .def( "Move", &TreePrjItemData::Move ) + .def( "Delete", &TreePrjItemData::Delete ) + .def( "Activate", &TreePrjItemData::Activate ) + ; enum_( "FileType" ) - .value( "PROJECT", TREE_PROJECT ) - .value( "SCHEMA", TREE_SCHEMA ) - .value( "BOARD", TREE_PCB ) - .value( "PYSCRIPT", TREE_PY ) - .value( "GERBER", TREE_GERBER ) - .value( "PDF", TREE_PDF ) - .value( "TXT", TREE_TXT ) - .value( "NETLIST", TREE_NET ) - .value( "UNKNOWN", TREE_UNKNOWN ) - .value( "DIRECTORY", TREE_DIRECTORY ) - .value( "MAX", TREE_MAX ); + .value( "PROJECT", TREE_PROJECT ) + .value( "SCHEMA", TREE_SCHEMA ) + .value( "BOARD", TREE_PCB ) + .value( "PYSCRIPT", TREE_PY ) + .value( "GERBER", TREE_GERBER ) + .value( "PDF", TREE_PDF ) + .value( "TXT", TREE_TXT ) + .value( "NETLIST", TREE_NET ) + .value( "UNKNOWN", TREE_UNKNOWN ) + .value( "DIRECTORY", TREE_DIRECTORY ) + .value( "MAX", TREE_MAX ); class_( "TreeWindow" ) - // wx Interface - .def( "ToWx", &WinEDA_PrjFrame::ToWx ) - // common features - .def( "GetContextMenu", &WinEDA_PrjFrame::GetMenuPy ) - .def( "GetFileExtension", &WinEDA_PrjFrame::GetFtExPy ) - // file filters control + // wx Interface + .def( "ToWx", &WinEDA_PrjFrame::ToWx ) + // common features + .def( "GetContextMenu", &WinEDA_PrjFrame::GetMenuPy ) + .def( "GetFileExtension", &WinEDA_PrjFrame::GetFtExPy ) + // file filters control .def( "AddFilter", &WinEDA_PrjFrame::AddFilter ) .def( "ClearFilters", &WinEDA_PrjFrame::ClearFilters ) .def( "RemoveFilter", &WinEDA_PrjFrame::RemoveFilterPy ) .def( "GetFilters", &WinEDA_PrjFrame::GetFilters, return_value_policy < copy_const_reference >() ) - .def( "GetCurrentMenu", &WinEDA_PrjFrame::GetCurrentMenu ) - // Project tree control - .def( "AddState", &WinEDA_PrjFrame::AddStatePy ) - .def( "GetTreeCtrl", &WinEDA_PrjFrame::GetTreeCtrl ) + .def( "GetCurrentMenu", &WinEDA_PrjFrame::GetCurrentMenu ) + // Project tree control + .def( "AddState", &WinEDA_PrjFrame::AddStatePy ) + .def( "GetTreeCtrl", &WinEDA_PrjFrame::GetTreeCtrl ) .def( "GetItemData", &WinEDA_PrjFrame::GetItemData, return_value_policy < reference_existing_object >() ) .def( "FindItemData", &WinEDA_PrjFrame::FindItemData, return_value_policy < reference_existing_object >() ) - .def( "NewFile", &WinEDA_PrjFrame::NewFilePy ) - .def( "AddFile", &WinEDA_PrjFrame::AddFilePy ) + .def( "NewFile", &WinEDA_PrjFrame::NewFilePy ) + .def( "AddFile", &WinEDA_PrjFrame::AddFilePy ) ; class_( "MainFrame" ) - // Wx interface - .def( "ToWx", &WinEDA_MainFrame::ToWx ) - // Common controls - .def( "AddFastLaunch", &WinEDA_MainFrame::AddFastLaunchPy ) + // Wx interface + .def( "ToWx", &WinEDA_MainFrame::ToWx ) + // Common controls + .def( "AddFastLaunch", &WinEDA_MainFrame::AddFastLaunchPy ) .def( "Refresh", &WinEDA_MainFrame::OnRefreshPy ) - .def( "GetProjectName", &WinEDA_MainFrame::GetPrjName ) - .def( "GetProjectWindow", &WinEDA_MainFrame::GetTree, return_value_policy< reference_existing_object >() ); + .def( "GetProjectName", &WinEDA_MainFrame::GetPrjName ) + .def( "GetProjectWindow", &WinEDA_MainFrame::GetTree, return_value_policy< reference_existing_object >() ); } // common module init function -static void py_common_init(void) +static void py_common_init() { def( "Print", &WinEDAPrint ); def( "Clear", &WinEDAClear ); @@ -193,60 +193,62 @@ static void py_common_init(void) #endif -bool WinEDA_App::OnInit(void) +bool WinEDA_App::OnInit() { - EDA_Appl = this; - InitEDA_Appl( wxT("kicad")); - - /* init kicad */ - GetSettings(); // read current setup + EDA_Appl = this; + InitEDA_Appl( wxT("kicad")); + + /* init kicad */ + GetSettings(); // read current setup - m_MainFrame = new WinEDA_MainFrame(this, NULL, wxT("KiCad"), - wxPoint(0,0), wxSize(600,400) ); - if(argc > 1 ) m_MainFrame->m_PrjFileName = argv[1]; - else if ( m_EDA_Config ) - { - m_MainFrame->m_PrjFileName = m_EDA_Config->Read(wxT("LastProject"), - wxT("noname.pro") ); - } - else m_MainFrame->m_PrjFileName = wxT("noname.pro"); + m_MainFrame = new WinEDA_MainFrame(this, NULL, wxT("KiCad"), + wxPoint(0,0), wxSize(600,400) ); + + if(argc > 1 ) + m_MainFrame->m_PrjFileName = argv[1]; + else if ( m_EDA_Config ) + { + m_MainFrame->m_PrjFileName = m_EDA_Config->Read(wxT("LastProject"), + wxT("noname.pro") ); + } + else + m_MainFrame->m_PrjFileName = wxT("noname.pro"); - wxString Title = g_Main_Title + wxT(" ") + GetBuildVersion(); - Title += wxT(" ") + m_MainFrame->m_PrjFileName; - m_MainFrame->SetTitle(Title); - m_MainFrame->ReCreateMenuBar(); - m_MainFrame->RecreateBaseHToolbar(); + wxString Title = g_Main_Title + wxT(" ") + GetBuildVersion(); + Title += wxT(" ") + m_MainFrame->m_PrjFileName; + m_MainFrame->SetTitle(Title); + m_MainFrame->ReCreateMenuBar(); + m_MainFrame->RecreateBaseHToolbar(); - m_MainFrame->m_LeftWin->ReCreateTreePrj(); - SetTopWindow(m_MainFrame); - m_MainFrame->Show(TRUE); + m_MainFrame->m_LeftWin->ReCreateTreePrj(); + SetTopWindow(m_MainFrame); + m_MainFrame->Show(TRUE); - /* Preparation Affichage du logo */ + /* Preparation Affichage du logo */ #ifdef SPLASH_OK -wxString logoname( wxString(m_BinDir) + wxT("logokicad.png") ); -wxBitmap image; - if ( image.LoadFile( logoname, wxBITMAP_TYPE_PNG ) ) - { - wxSplashScreen * logoscreen = new wxSplashScreen( image, - wxSPLASH_CENTRE_ON_PARENT | wxSPLASH_TIMEOUT, - 500, m_MainFrame, -1, - wxDefaultPosition, wxDefaultSize, - wxSIMPLE_BORDER | wxSTAY_ON_TOP); - } + wxString logoname( wxString(m_BinDir) + wxT("logokicad.png") ); + wxBitmap image; + if ( image.LoadFile( logoname, wxBITMAP_TYPE_PNG ) ) + { + wxSplashScreen * logoscreen = new wxSplashScreen( image, + wxSPLASH_CENTRE_ON_PARENT | wxSPLASH_TIMEOUT, + 500, m_MainFrame, -1, + wxDefaultPosition, wxDefaultSize, + wxSIMPLE_BORDER | wxSTAY_ON_TOP); + } #endif - if ( wxFileExists(m_MainFrame->m_PrjFileName) ) - { - m_MainFrame->Load_Prj_Config(); - } + if( wxFileExists(m_MainFrame->m_PrjFileName) ) + { + m_MainFrame->Load_Prj_Config(); + } - #ifdef KICAD_PYTHON - PyHandler::GetInstance()->AddToModule( wxT("kicad"), &py_kicad_init ); - PyHandler::GetInstance()->AddToModule( wxT("common"), &py_common_init ); - #endif +#ifdef KICAD_PYTHON + PyHandler::GetInstance()->AddToModule( wxT("kicad"), &py_kicad_init ); + PyHandler::GetInstance()->AddToModule( wxT("common"), &py_common_init ); +#endif - - return TRUE; + return TRUE; } // vim: tabstop=4 : noexpandtab : diff --git a/kicad/kicad.h b/kicad/kicad.h index 4677bbccb2..616c085023 100644 --- a/kicad/kicad.h +++ b/kicad/kicad.h @@ -1,6 +1,6 @@ - /***********/ - /* kicad.h */ - /***********/ +/***********/ +/* kicad.h */ +/***********/ #ifndef KICAD_H #define KICAD_H @@ -16,7 +16,7 @@ /* Message de presentation */ eda_global wxString g_Main_Title #ifdef MAIN - = wxT("KiCad") += wxT( "KiCad" ) #endif ; @@ -25,137 +25,162 @@ eda_global wxString g_Main_Title class WinEDA_TreePrj; class WinEDA_PrjFrame; - /*******************************************/ - /* classe pour la Fenetre generale de kicad*/ - /*******************************************/ +/*******************************************/ +/* classe pour la Fenetre generale de kicad*/ +/*******************************************/ -class WinEDA_MainFrame: public WinEDA_BasicFrame +class WinEDA_MainFrame : public WinEDA_BasicFrame { - /* This class is the main entry point of the py API */ + /* This class is the main entry point of the py API */ public: - WinEDA_CommandFrame * m_CommandWin; - WinEDA_PrjFrame * m_LeftWin; - wxSashLayoutWindow * m_BottomWin; - wxTextCtrl * m_DialogWin; - WinEDA_Toolbar * m_VToolBar; // Toolbar Vertical bord d'ecran - wxString m_PrjFileName; - int m_LeftWin_Width; - int m_CommandWin_Height; + WinEDA_CommandFrame* m_CommandWin; + WinEDA_PrjFrame* m_LeftWin; + wxSashLayoutWindow* m_BottomWin; + wxTextCtrl* m_DialogWin; + WinEDA_Toolbar* m_VToolBar; // Toolbar Vertical bord d'ecran + wxString m_PrjFileName; + + int m_LeftWin_Width; + int m_CommandWin_Height; private: - wxMenu * m_FilesMenu; + wxMenu* m_FilesMenu; public: - // Constructor and destructor - WinEDA_MainFrame(WinEDA_App * eda_app, wxWindow *parent, const wxString & title, - const wxPoint& pos, const wxSize& size); - ~WinEDA_MainFrame(void); + // Constructor and destructor + WinEDA_MainFrame( WinEDA_App * eda_app, wxWindow * parent, const wxString &title, + const wxPoint &pos, const wxSize &size ); - void OnCloseWindow(wxCloseEvent & Event); - void OnSize(wxSizeEvent& event); - void OnPaint(wxPaintEvent & event); - void ReDraw(wxDC * DC); - void OnSashDrag(wxSashEvent& event); - void Load_Prj_Config(void); - void Save_Prj_Config(void); - void Process_Fct(wxCommandEvent& event); - void Process_Files(wxCommandEvent& event); - void Process_Config(wxCommandEvent& event); - void Process_Special_Functions(wxCommandEvent& event); - void Process_Preferences(wxCommandEvent& event); - void ReCreateMenuBar(void); - void RecreateBaseHToolbar(void); - void CreateCommandToolbar(void); - void PrintMsg(const wxString & text); - void ClearMsg(); - void SetLanguage(wxCommandEvent& event); - void OnRefresh(wxCommandEvent& event); + ~WinEDA_MainFrame(); - void CreateZipArchive(const wxString FullFileName); - void UnZipArchive(const wxString FullFileName); + void OnCloseWindow( wxCloseEvent& Event ); + void OnSize( wxSizeEvent& event ); + void OnPaint( wxPaintEvent& event ); + void ReDraw( wxDC* DC ); + void OnSashDrag( wxSashEvent& event ); + void Load_Prj_Config(); + void Save_Prj_Config(); + void Process_Fct( wxCommandEvent& event ); + void Process_Files( wxCommandEvent& event ); + void Process_Config( wxCommandEvent& event ); + void Process_Special_Functions( wxCommandEvent& event ); + void Process_Preferences( wxCommandEvent& event ); + void ReCreateMenuBar(); + void RecreateBaseHToolbar(); + void CreateCommandToolbar(); + void PrintMsg( const wxString& text ); + void ClearMsg(); + void SetLanguage( wxCommandEvent& event ); + void OnRefresh( wxCommandEvent& event ); - #ifdef KICAD_PYTHON - void OnRefreshPy(); - boost::python::object GetPrjName() const; - WinEDA_MainFrame( const WinEDA_MainFrame& ) {} - WinEDA_MainFrame() {} - boost::python::object ToWx(); - void AddFastLaunchPy( boost::python::object & button ); - WinEDA_PrjFrame* GetTree() const; - #endif + void CreateZipArchive( const wxString FullFileName ); + void UnZipArchive( const wxString FullFileName ); - void AddFastLaunch( wxButton * button, int sep = 20 ); +#ifdef KICAD_PYTHON + void OnRefreshPy(); - DECLARE_EVENT_TABLE() + boost::python::object GetPrjName() const; + + WinEDA_MainFrame( const WinEDA_MainFrame & ) {} + + WinEDA_MainFrame() {} + + boost::python::object ToWx(); + void AddFastLaunchPy( boost::python::object& button ); + WinEDA_PrjFrame* GetTree() const; + +#endif + + void AddFastLaunch( wxButton* button, int sep = 20 ); + + DECLARE_EVENT_TABLE() }; // Order of this enum changes AddFile() internal working // please update both enum TreeFileType { - TREE_PROJECT = 1, - TREE_SCHEMA, - TREE_PCB, - TREE_PY, - TREE_GERBER, - TREE_PDF, - TREE_TXT, - TREE_NET, - TREE_UNKNOWN, - TREE_DIRECTORY, - TREE_MAX, + TREE_PROJECT = 1, + TREE_SCHEMA, + TREE_PCB, + TREE_PY, + TREE_GERBER, + TREE_PDF, + TREE_TXT, + TREE_NET, + TREE_UNKNOWN, + TREE_DIRECTORY, + TREE_MAX, }; /***********************************************************/ /* Classes pour l'arbre de hierarchie de gestion du projet */ /***********************************************************/ -class TreePrjItemData: public wxTreeItemData +class TreePrjItemData : public wxTreeItemData { public: - enum TreeFileType m_Type; - bool m_IsRootFile; // True if m_Filename is a root schematic (same name as project) - wxString m_FileName; + TreeFileType m_Type; + bool m_IsRootFile; // True if m_Filename is a root schematic (same name as project) + wxString m_FileName; private: - wxTreeCtrl * m_Parent; - wxMenu m_fileMenu; - int m_State; + wxTreeCtrl* m_Parent; + wxMenu m_fileMenu; + int m_State; public: - TreePrjItemData(enum TreeFileType type, const wxString & data, wxTreeCtrl * parent); - TreePrjItemData() : m_Parent(NULL) {} - TreePrjItemData( const TreePrjItemData & src ) - : m_Type( src.m_Type ) - , m_FileName( src.m_FileName ) - , m_Parent( src.m_Parent ) - { - SetState( src.m_State ); - } + TreePrjItemData( TreeFileType type, const wxString& data, wxTreeCtrl* parent ); + TreePrjItemData() : m_Parent( NULL ) {} + + TreePrjItemData( const TreePrjItemData &src ) : + m_Type( src.m_Type ), + m_FileName( src.m_FileName ), + m_Parent( src.m_Parent ) + { + SetState( src.m_State ); + } - enum TreeFileType GetType() const { return m_Type; } - wxString GetFileName() const { return m_FileName; } - void SetFileName( const wxString & name ) { m_FileName = name; } + TreeFileType GetType() const + { + return m_Type; + } + wxString GetFileName() const + { + return m_FileName; + } + void SetFileName( const wxString& name ) + { + m_FileName = name; + } - wxString GetDir() const; + wxString GetDir() const; - void OnRename( wxTreeEvent & event, bool check = true ); - bool Rename( const wxString & name, bool check = true ); - bool Delete( bool check = true ); - void Move( TreePrjItemData * dest ); - void Activate(); + void OnRename( wxTreeEvent& event, bool check = true ); + bool Rename( const wxString& name, bool check = true ); + bool Delete( bool check = true ); + void Move( TreePrjItemData* dest ); + void Activate(); - const wxMenu * GetMenu() { return &m_fileMenu; } - void SetState( int state ); + const wxMenu* GetMenu() + { + return &m_fileMenu; + } + + void SetState( int state ); - #ifdef KICAD_PYTHON - boost::python::object GetFileNamePy() const; - bool RenamePy( const boost::python::str & newname, bool check = true ); - boost::python::object GetDirPy() const; - boost::python::object GetIdPy() const; - boost::python::object GetMenuPy(); - #endif +#ifdef KICAD_PYTHON + boost::python::object GetFileNamePy() const; + bool RenamePy( const boost::python::str& newname, bool check = true ); + + boost::python::object GetDirPy() const; + + boost::python::object GetIdPy() const; + + boost::python::object GetMenuPy(); + +#endif }; /* Fenetre d'affichage des fichiers du projet */ @@ -163,112 +188,126 @@ class WinEDA_PrjFrame : public wxSashLayoutWindow { private: - std::vector< wxMenu* > m_ContextMenus; - wxMenu * m_PopupMenu; - std::vector< wxString > m_Filters; - + std::vector m_ContextMenus; + std::vector m_Filters; + + wxMenu* m_PopupMenu; wxCursor m_DragCursor; wxCursor m_Default; protected: - wxMenu * GetContextMenu( int type ); - void NewFile( enum TreeFileType type ); - void NewFile( const wxString & name, enum TreeFileType type, wxTreeItemId & root ); - TreePrjItemData * GetSelectedData(); + wxMenu* GetContextMenu( int type ); + void NewFile( TreeFileType type ); + void NewFile( const wxString& name, TreeFileType type, wxTreeItemId& root ); + TreePrjItemData* GetSelectedData(); public: - WinEDA_MainFrame * m_Parent; - WinEDA_TreePrj * m_TreeProject; + WinEDA_MainFrame* m_Parent; + WinEDA_TreePrj* m_TreeProject; - wxTreeItemId m_root; + wxTreeItemId m_root; public: - static wxString GetFileExt( enum TreeFileType type ); + static wxString GetFileExt( TreeFileType type ); - WinEDA_PrjFrame(WinEDA_MainFrame * parent, - const wxPoint & pos, const wxSize & size ); - ~WinEDA_PrjFrame(void) {} - void OnSelect(wxTreeEvent & Event); - void OnRenameAsk(wxTreeEvent & Event); - void OnRename(wxTreeEvent & Event); - void OnDragStart( wxTreeEvent & event ); - void OnDragEnd( wxTreeEvent & event ); - void OnRight(wxTreeEvent & Event); - void ReCreateTreePrj(void); + WinEDA_PrjFrame( WinEDA_MainFrame * parent, + const wxPoint &pos, const wxSize &size ); + ~WinEDA_PrjFrame() { } + void OnSelect( wxTreeEvent& Event ); + void OnRenameAsk( wxTreeEvent& Event ); + void OnRename( wxTreeEvent& Event ); + void OnDragStart( wxTreeEvent& event ); + void OnDragEnd( wxTreeEvent& event ); + void OnRight( wxTreeEvent& Event ); + void ReCreateTreePrj(); - void OnTxtEdit(wxCommandEvent & event); + void OnTxtEdit( wxCommandEvent& event ); - void OnDeleteFile(wxCommandEvent &event ); - void OnRenameFile(wxCommandEvent &event ); + void OnDeleteFile( wxCommandEvent& event ); + void OnRenameFile( wxCommandEvent& event ); - void OnNewFile(wxCommandEvent & event); - void OnNewDirectory(wxCommandEvent & event); - void OnNewSchFile(wxCommandEvent & event); - void OnNewBrdFile(wxCommandEvent & event); - void OnNewPyFile(wxCommandEvent & event); - void OnNewGerberFile(wxCommandEvent & event); - void OnNewTxtFile(wxCommandEvent & event); - void OnNewNetFile(wxCommandEvent & event); + void OnNewFile( wxCommandEvent& event ); + void OnNewDirectory( wxCommandEvent& event ); + void OnNewSchFile( wxCommandEvent& event ); + void OnNewBrdFile( wxCommandEvent& event ); + void OnNewPyFile( wxCommandEvent& event ); + void OnNewGerberFile( wxCommandEvent& event ); + void OnNewTxtFile( wxCommandEvent& event ); + void OnNewNetFile( wxCommandEvent& event ); - void ClearFilters(); - const std::vector & GetFilters(); - void RemoveFilter( const wxString & filter ); + void ClearFilters(); + + const std::vector& GetFilters(); + void RemoveFilter( const wxString& filter ); #ifdef KICAD_PYTHON - boost::python::object ToWx(); + boost::python::object ToWx(); - WinEDA_PrjFrame() {} - WinEDA_PrjFrame( const WinEDA_PrjFrame & ) {} + WinEDA_PrjFrame() { + } + WinEDA_PrjFrame( const WinEDA_PrjFrame & ) { + } - void OnRunPy(wxCommandEvent & event); - boost::python::object GetMenuPy( enum TreeFileType ); - boost::python::object GetFtExPy ( enum TreeFileType ) const; + void OnRunPy( wxCommandEvent& event ); - void RemoveFilterPy( const boost::python::str & filter ); - void AddFilter( const boost::python::str & filter ); + boost::python::object GetMenuPy( TreeFileType ); - boost::python::object GetTreeCtrl(); - TreePrjItemData * GetItemData( const boost::python::object & item ); - void AddFilePy( const boost::python::str & name, boost::python::object & root ); - void NewFilePy( const boost::python::str & name, enum TreeFileType type, boost::python::object & root ); + boost::python::object GetFtExPy( TreeFileType ) const; - TreePrjItemData * FindItemData( const boost::python::str & name ); - boost::python::object GetCurrentMenu(); - int AddStatePy( boost::python::object & bitmap ); + void RemoveFilterPy( const boost::python::str& filter ); + void AddFilter( const boost::python::str& filter ); + + boost::python::object GetTreeCtrl(); + TreePrjItemData* GetItemData( const boost::python::object& item ); + void AddFilePy( const boost::python::str& name, boost::python::object& root ); + void NewFilePy( const boost::python::str& name, + TreeFileType type, + boost::python::object& root ); + + TreePrjItemData* FindItemData( const boost::python::str& name ); + + boost::python::object GetCurrentMenu(); + int AddStatePy( boost::python::object& bitmap ); #endif - void AddFile( const wxString & name, wxTreeItemId & root ); - DECLARE_EVENT_TABLE() + void AddFile( const wxString& name, wxTreeItemId& root ); + + DECLARE_EVENT_TABLE() }; /** Classe TreeCtrl des fichiers projets **/ class WinEDA_TreePrj : public wxTreeCtrl { - DECLARE_DYNAMIC_CLASS(WinEDA_TreePrj) + DECLARE_DYNAMIC_CLASS( WinEDA_TreePrj ) private: - WinEDA_PrjFrame * m_Parent; - wxImageList * m_ImageList; + WinEDA_PrjFrame* m_Parent; + wxImageList* m_ImageList; public: - WinEDA_PrjFrame * GetParent() { return m_Parent; } - WinEDA_TreePrj(WinEDA_PrjFrame *parent); - ~WinEDA_TreePrj(); + WinEDA_PrjFrame* GetParent() + { + return m_Parent; + } + WinEDA_TreePrj( WinEDA_PrjFrame * parent ); + ~WinEDA_TreePrj(); private: - /* overlayed sort function */ - int OnCompareItems(const wxTreeItemId& item1, const wxTreeItemId& item2); + /* overlayed sort function */ + int OnCompareItems( const wxTreeItemId& item1, const wxTreeItemId& item2 ); }; + eda_global wxString g_SchematicRootFileName; eda_global wxString g_BoardFileName; #ifdef MAIN -wxString g_SchExtBuffer(wxT(".sch")); -wxString g_BoardExtBuffer(wxT(".brd")); -wxString g_NetlistExtBuffer(wxT(".net")); -wxString g_GerberExtBuffer(wxT(".pho")); +wxString g_SchExtBuffer( wxT( ".sch" ) ); +wxString g_BoardExtBuffer( wxT( ".brd" ) ); +wxString g_NetlistExtBuffer( wxT( ".net" ) ); +wxString g_GerberExtBuffer( wxT( ".pho" ) ); + #else eda_global wxString g_SchExtBuffer; eda_global wxString g_BoardExtBuffer; @@ -277,4 +316,5 @@ eda_global wxString g_GerberExtBuffer; #endif #endif + // vim: tabstop=4 : noexpandtab : diff --git a/kicad/mdiframe.cpp b/kicad/mdiframe.cpp index b35e365df6..b9282a31a5 100644 --- a/kicad/mdiframe.cpp +++ b/kicad/mdiframe.cpp @@ -118,7 +118,7 @@ wxString line; /* Destructeur */ /***************/ -WinEDA_MainFrame::~WinEDA_MainFrame(void) +WinEDA_MainFrame::~WinEDA_MainFrame() { if( m_Parent->m_EDA_Config ) { diff --git a/kicad/prjconfig.cpp b/kicad/prjconfig.cpp index f36a1925f7..8357756a09 100644 --- a/kicad/prjconfig.cpp +++ b/kicad/prjconfig.cpp @@ -17,7 +17,7 @@ /*******************************************/ -void WinEDA_MainFrame::Load_Prj_Config(void) +void WinEDA_MainFrame::Load_Prj_Config() /*******************************************/ { @@ -43,7 +43,7 @@ void WinEDA_MainFrame::Load_Prj_Config(void) /*********************************************/ -void WinEDA_MainFrame::Save_Prj_Config(void) +void WinEDA_MainFrame::Save_Prj_Config() /*********************************************/ { wxString FullFileName; diff --git a/kicad/treeprj_datas.cpp b/kicad/treeprj_datas.cpp index 7a8fc84623..affc34e3da 100644 --- a/kicad/treeprj_datas.cpp +++ b/kicad/treeprj_datas.cpp @@ -31,334 +31,379 @@ /* Methodes pour l'arbre gestion du projet */ /********************************************/ -IMPLEMENT_ABSTRACT_CLASS(WinEDA_TreePrj, wxTreeCtrl) -WinEDA_TreePrj::WinEDA_TreePrj(WinEDA_PrjFrame * parent) : - wxTreeCtrl(parent, ID_PROJECT_TREE, - wxDefaultPosition, wxDefaultSize, - wxTR_HAS_BUTTONS | wxTR_EDIT_LABELS, wxDefaultValidator, wxT("EDATreeCtrl")) +IMPLEMENT_ABSTRACT_CLASS( WinEDA_TreePrj, wxTreeCtrl ) + +WinEDA_TreePrj::WinEDA_TreePrj( WinEDA_PrjFrame* parent ) : + wxTreeCtrl( parent, ID_PROJECT_TREE, + wxDefaultPosition, wxDefaultSize, + wxTR_HAS_BUTTONS | wxTR_EDIT_LABELS, wxDefaultValidator, wxT( "EDATreeCtrl" ) ) { - m_Parent = parent; - // Make an image list containing small icons - m_ImageList = new wxImageList(16, 16, TRUE, TREE_MAX); + m_Parent = parent; - m_ImageList->Add(wxBitmap(kicad_icon_small_xpm)); // TREE_PROJECT - m_ImageList->Add(wxBitmap(eeschema_xpm)); // TREE_SCHEMA - m_ImageList->Add(wxBitmap(pcbnew_xpm)); // TREE_PCB - m_ImageList->Add(wxBitmap(icon_python_small_xpm)); // TREE_PY - m_ImageList->Add(wxBitmap(icon_gerbview_small_xpm)); // TREE_GERBER - m_ImageList->Add(wxBitmap(datasheet_xpm)); // TREE_PDF - m_ImageList->Add(wxBitmap(icon_txt_xpm)); // TREE_TXT - m_ImageList->Add(wxBitmap(icon_cvpcb_small_xpm)); // TREE_NET - m_ImageList->Add(wxBitmap(unknown_xpm)); // TREE_UNKNOWN - m_ImageList->Add(wxBitmap(directory_xpm)); // TREE_DIRECTORY + // Make an image list containing small icons + m_ImageList = new wxImageList( 16, 16, TRUE, TREE_MAX ); - SetImageList(m_ImageList); + m_ImageList->Add( wxBitmap( kicad_icon_small_xpm ) ); // TREE_PROJECT + m_ImageList->Add( wxBitmap( eeschema_xpm ) ); // TREE_SCHEMA + m_ImageList->Add( wxBitmap( pcbnew_xpm ) ); // TREE_PCB + m_ImageList->Add( wxBitmap( icon_python_small_xpm ) ); // TREE_PY + m_ImageList->Add( wxBitmap( icon_gerbview_small_xpm ) ); // TREE_GERBER + m_ImageList->Add( wxBitmap( datasheet_xpm ) ); // TREE_PDF + m_ImageList->Add( wxBitmap( icon_txt_xpm ) ); // TREE_TXT + m_ImageList->Add( wxBitmap( icon_cvpcb_small_xpm ) ); // TREE_NET + m_ImageList->Add( wxBitmap( unknown_xpm ) ); // TREE_UNKNOWN + m_ImageList->Add( wxBitmap( directory_xpm ) ); // TREE_DIRECTORY + + SetImageList( m_ImageList ); } /***************************************************************************************/ -int WinEDA_TreePrj::OnCompareItems(const wxTreeItemId& item1, const wxTreeItemId& item2) +int WinEDA_TreePrj::OnCompareItems( const wxTreeItemId& item1, const wxTreeItemId& item2 ) /***************************************************************************************/ + /* sort function for tree items. -items are sorted : - directory names first by alphabetic order - root file names after - file names last by alphabetic order -*/ + * items are sorted : + * directory names first by alphabetic order + * root file names after + * file names last by alphabetic order + */ { -TreePrjItemData* myitem1 = (TreePrjItemData*)GetItemData(item1); -TreePrjItemData* myitem2 = (TreePrjItemData*)GetItemData(item2); + TreePrjItemData* myitem1 = (TreePrjItemData*) GetItemData( item1 ); + TreePrjItemData* myitem2 = (TreePrjItemData*) GetItemData( item2 ); - if ( (myitem1->m_Type == TREE_DIRECTORY) && ( myitem2->m_Type != TREE_DIRECTORY ) ) - return -1; - if ( (myitem2->m_Type == TREE_DIRECTORY) && ( myitem1->m_Type != TREE_DIRECTORY ) ) - return 1; - - if ( myitem1->m_IsRootFile && ! myitem2->m_IsRootFile ) - return -1; - if ( myitem2->m_IsRootFile && ! myitem1->m_IsRootFile ) - return 1; + if( (myitem1->m_Type == TREE_DIRECTORY) && ( myitem2->m_Type != TREE_DIRECTORY ) ) + return -1; + if( (myitem2->m_Type == TREE_DIRECTORY) && ( myitem1->m_Type != TREE_DIRECTORY ) ) + return 1; - return myitem1->m_FileName.CmpNoCase(myitem2->m_FileName) ; + if( myitem1->m_IsRootFile && !myitem2->m_IsRootFile ) + return -1; + if( myitem2->m_IsRootFile && !myitem1->m_IsRootFile ) + return 1; + + return myitem1->m_FileName.CmpNoCase( myitem2->m_FileName ); } /****************************************************************************************************/ -TreePrjItemData::TreePrjItemData(enum TreeFileType type, const wxString & data, wxTreeCtrl * parent) - : wxTreeItemData() +TreePrjItemData::TreePrjItemData( enum TreeFileType type, const wxString& data, + wxTreeCtrl* parent ) : + wxTreeItemData() /****************************************************************************************************/ { - m_Type = type; - m_Parent = parent; - m_FileName = data; - m_IsRootFile = false; + m_Type = type; + m_Parent = parent; + m_FileName = data; + m_IsRootFile = false; } + #ifdef KICAD_PYTHON using namespace boost::python; /**************************************/ object TreePrjItemData::GetIdPy() const /**************************************/ + // Convert the data to an id { - wxTreeItemId * id = new wxTreeItemId(); - *id = GetId(); - return object( handle<>( borrowed( wxPyConstructObject( id, wxT("wxTreeItemId"), true ) ) ) ); + wxTreeItemId* id = new wxTreeItemId(); + + *id = GetId(); + return object( handle<>( borrowed( wxPyConstructObject( id, wxT( "wxTreeItemId" ), true ) ) ) ); } + + #endif /*******************************************/ void TreePrjItemData::SetState( int state ) /*******************************************/ + // Set the state used in the icon list { - wxImageList* imglist = m_Parent->GetImageList(); - if ( !imglist || state < 0 || state >= imglist->GetImageCount() / ( TREE_MAX - 2 ) ) return; - m_State = state; - int imgid = m_Type - 1 + state * ( TREE_MAX - 1 ); - m_Parent->SetItemImage( GetId(), imgid ); - m_Parent->SetItemImage( GetId(), imgid, wxTreeItemIcon_Selected ); + wxImageList* imglist = m_Parent->GetImageList(); + + if( !imglist || state < 0 || state >= imglist->GetImageCount() / ( TREE_MAX - 2 ) ) + return; + m_State = state; + int imgid = m_Type - 1 + state * ( TREE_MAX - 1 ); + m_Parent->SetItemImage( GetId(), imgid ); + m_Parent->SetItemImage( GetId(), imgid, wxTreeItemIcon_Selected ); } + /*******************************************/ wxString TreePrjItemData::GetDir() const /*******************************************/ /* Get the directory containing the file */ { - if (TREE_DIRECTORY == m_Type ) return m_FileName; + if( TREE_DIRECTORY == m_Type ) + return m_FileName; - wxFileName filename = wxFileName( m_FileName ); - filename.MakeRelativeTo( wxGetCwd() ); - wxArrayString dirs = filename.GetDirs(); + wxFileName filename = wxFileName( m_FileName ); + + filename.MakeRelativeTo( wxGetCwd() ); + + wxArrayString dirs = filename.GetDirs(); - wxString dir; - for ( unsigned int i = 0; i < dirs.Count(); i ++ ) - { - dir += dirs[i] + filename.GetPathSeparator(); - } - return dir; + wxString dir; + for( unsigned int i = 0; i < dirs.Count(); i++ ) + { + dir += dirs[i] + filename.GetPathSeparator(); + } + + return dir; } + /****************************************************************/ -void TreePrjItemData::OnRename( wxTreeEvent & event, bool check ) +void TreePrjItemData::OnRename( wxTreeEvent& event, bool check ) /****************************************************************/ /* Called upon tree item rename */ { - if ( !Rename( event.GetLabel(), check ) ) event.Veto(); + if( !Rename( event.GetLabel(), check ) ) + event.Veto(); } + /****************************************************/ -void TreePrjItemData::Move( TreePrjItemData * dest ) +void TreePrjItemData::Move( TreePrjItemData* dest ) /****************************************************/ + // Move the object to dest { const wxString sep = wxFileName().GetPathSeparator(); - if (!dest) return; - if ( m_Parent != dest->m_Parent ) return;// Can not cross move! - if ( dest == this ) return; // Can not move to ourself... - wxTreeItemId parent = m_Parent->GetItemParent( GetId() ); - if ( dest == dynamic_cast( m_Parent->GetItemData( parent ) ) ) return; // same parent ? + if( !dest ) + return; + if( m_Parent != dest->m_Parent ) + return; // Can not cross move! + if( dest == this ) + return; // Can not move to ourself... - // We need to create a new item from us, and move - // data to there ... + wxTreeItemId parent = m_Parent->GetItemParent( GetId() ); + if( dest == dynamic_cast( m_Parent->GetItemData( parent ) ) ) + return; // same parent ? - // First move file on the disk - wxFileName fname( m_FileName ); - wxString destName; - if ( !dest->GetDir().IsEmpty() ) destName = dest->GetDir() + sep; - destName += fname.GetFullName(); + // We need to create a new item from us, and move + // data to there ... - if ( destName == GetFileName() ) return; // Same place ?? + // First move file on the disk + wxFileName fname( m_FileName ); - // Move the file on the disk: -#if ( (wxMAJOR_VERSION < 2) || ((wxMAJOR_VERSION == 2)&& (wxMINOR_VERSION < 7)) ) - if ( !wxRenameFile( GetFileName(), destName ) ) + wxString destName; + if( !dest->GetDir().IsEmpty() ) + destName = dest->GetDir() + sep; + destName += fname.GetFullName(); + + if( destName == GetFileName() ) + return; // Same place ?? + + // Move the file on the disk: +#if ( ( wxMAJOR_VERSION < 2) || ( ( wxMAJOR_VERSION == 2)&& (wxMINOR_VERSION < 7 ) ) ) + if( !wxRenameFile( GetFileName(), destName ) ) #else - if ( !wxRenameFile( GetFileName(), destName, false ) ) + if( !wxRenameFile( GetFileName(), destName, false ) ) #endif - { - wxMessageDialog( m_Parent, _( "Unable to move file ... "), _( "Permission error ?" ), wxICON_ERROR | wxOK ); - return; - } + { + wxMessageDialog( m_Parent, _( "Unable to move file ... " ), _( + "Permission error ?" ), wxICON_ERROR | wxOK ); + return; + } - #ifdef KICAD_PYTHON - object param = make_tuple( PyHandler::Convert( m_FileName ) - , PyHandler::Convert( destName ) ); - PyHandler::GetInstance()->TriggerEvent( wxT("kicad::MoveFile"), param ); - #endif +#ifdef KICAD_PYTHON + object param = make_tuple( PyHandler::Convert( m_FileName ), + PyHandler::Convert( destName ) ); + PyHandler::GetInstance()->TriggerEvent( wxT( "kicad::MoveFile" ), param ); +#endif - SetFileName( destName ); - - if ( TREE_DIRECTORY != GetType() ) - { - // Move the tree item itself now: - wxTreeItemId oldId = GetId(); - int i = m_Parent->GetItemImage( oldId ); - wxString text = m_Parent->GetItemText( oldId ); - - // Bye bye old Id :'( - wxTreeItemId newId = m_Parent->AppendItem( dest->GetId(), text, i ); - m_Parent->SetItemData( newId, this ); - m_Parent->SetItemData( oldId, NULL ); - m_Parent->Delete( oldId ); - } - else - { - // We should move recursively all files, but that's quite boring - // let's just refresh that's all ... TODO (change this to a better code ...) - wxCommandEvent dummy; - dynamic_cast(m_Parent)->GetParent()->m_Parent->OnRefresh(dummy); - } + SetFileName( destName ); + if( TREE_DIRECTORY != GetType() ) + { + // Move the tree item itself now: + wxTreeItemId oldId = GetId(); + int i = m_Parent->GetItemImage( oldId ); + wxString text = m_Parent->GetItemText( oldId ); + // Bye bye old Id :'( + wxTreeItemId newId = m_Parent->AppendItem( dest->GetId(), text, i ); + m_Parent->SetItemData( newId, this ); + m_Parent->SetItemData( oldId, NULL ); + m_Parent->Delete( oldId ); + } + else + { + // We should move recursively all files, but that's quite boring + // let's just refresh that's all ... TODO (change this to a better code ...) + wxCommandEvent dummy; + dynamic_cast( m_Parent )->GetParent()->m_Parent->OnRefresh( dummy ); + } } + /****************************************************************/ -bool TreePrjItemData::Rename( const wxString & name, bool check ) +bool TreePrjItemData::Rename( const wxString& name, bool check ) /****************************************************************/ /* rename the file checking if extension change occurs */ { - if ( name.IsEmpty() ) return false; + if( name.IsEmpty() ) + return false; const wxString sep = wxFileName().GetPathSeparator(); - wxString newFile; - wxString dirs = GetDir(); + wxString newFile; + wxString dirs = GetDir(); - if ( !dirs.IsEmpty() && GetType() != TREE_DIRECTORY ) newFile = dirs + sep + name; - else newFile = name; + if( !dirs.IsEmpty() && GetType() != TREE_DIRECTORY ) + newFile = dirs + sep + name; + else + newFile = name; - if ( newFile == m_FileName ) return false; + if( newFile == m_FileName ) + return false; - wxString ext = WinEDA_PrjFrame::GetFileExt( GetType() ); + wxString ext = WinEDA_PrjFrame::GetFileExt( GetType() ); - wxRegEx reg( wxT( "^.*\\" ) + ext + wxT( "$" ), wxRE_ICASE ); - if ( check && !ext.IsEmpty() && !reg.Matches( newFile ) ) - { - wxMessageDialog dialog( m_Parent - , _("Changing file extension will change file type.\n Do you want to continue ?") - , _("Rename File") - , wxYES_NO | wxICON_QUESTION ); + wxRegEx reg( wxT ( "^.*\\" ) + ext + wxT( "$" ), wxRE_ICASE ); - if ( wxID_YES != dialog.ShowModal() ) return false; - } + if( check && !ext.IsEmpty() && !reg.Matches( newFile ) ) + { + wxMessageDialog dialog( m_Parent, + _( + "Changing file extension will change file type.\n Do you want to continue ?" ), + _( "Rename File" ), + wxYES_NO | wxICON_QUESTION ); -#if ( (wxMAJOR_VERSION < 2) || ((wxMAJOR_VERSION == 2)&& (wxMINOR_VERSION < 7)) ) - if (! wxRenameFile( m_FileName, newFile ) ) + if( wxID_YES != dialog.ShowModal() ) + return false; + } + +#if ( (wxMAJOR_VERSION < 2) || ( (wxMAJOR_VERSION == 2) && (wxMINOR_VERSION < 7) ) ) + if( !wxRenameFile( m_FileName, newFile ) ) #else - if (! wxRenameFile( m_FileName, newFile, false ) ) + if( !wxRenameFile( m_FileName, newFile, false ) ) #endif - { - wxMessageDialog( m_Parent, _( "Unable to rename file ... "), _( "Permission error ?" ), wxICON_ERROR | wxOK ); - return false; - } - SetFileName( newFile ); + { + wxMessageDialog( m_Parent, _( "Unable to rename file ... " ), + _("Permission error ?" ), wxICON_ERROR | wxOK ); + return false; + } + SetFileName( newFile ); - #ifdef KICAD_PYTHON - object param = make_tuple( PyHandler::Convert( m_FileName ) - , PyHandler::Convert( newFile ) ); - PyHandler::GetInstance()->TriggerEvent( wxT("kicad::RenameFile"), param ); - #endif - return true; + #ifdef KICAD_PYTHON + object param = make_tuple( PyHandler::Convert( m_FileName ), + PyHandler::Convert( newFile ) ); + PyHandler::GetInstance()->TriggerEvent( wxT( "kicad::RenameFile" ), param ); + #endif + return true; } + /*******************************************/ bool TreePrjItemData::Delete( bool check ) /*******************************************/ /* delete a file */ { - wxMessageDialog dialog( m_Parent, _("Do you really want to delete ") + GetFileName(), _("Delete File") - , wxYES_NO | wxICON_QUESTION ); + wxMessageDialog dialog( m_Parent, _ ("Do you really want to delete ") + GetFileName(), + _("Delete File" ), wxYES_NO | wxICON_QUESTION ); - if ( !check || wxID_YES == dialog.ShowModal() ) - { - if ( !wxDirExists( m_FileName ) ) - { - wxRemoveFile( m_FileName ); - } - else - { - wxArrayString filelist; - wxDir::GetAllFiles( m_FileName, &filelist ); - for ( unsigned int i = 0; i < filelist.Count(); i++ ) wxRemoveFile( filelist[i] ); - wxRmdir( m_FileName ); - } - m_Parent->Delete( GetId() ); - #ifdef KICAD_PYTHON - PyHandler::GetInstance()->TriggerEvent( wxT("kicad::DeleteFile"), PyHandler::Convert( m_FileName ) ); - #endif - return true; - } - return false; + if( !check || wxID_YES == dialog.ShowModal() ) + { + if( !wxDirExists( m_FileName ) ) + { + wxRemoveFile( m_FileName ); + } + else + { + wxArrayString filelist; + + wxDir::GetAllFiles( m_FileName, &filelist ); + + for( unsigned int i = 0; i < filelist.Count(); i++ ) + wxRemoveFile( filelist[i] ); + + wxRmdir( m_FileName ); + } + m_Parent->Delete( GetId() ); + +#ifdef KICAD_PYTHON + PyHandler::GetInstance()->TriggerEvent( wxT( "kicad::DeleteFile" ), + PyHandler::Convert( m_FileName ) ); +#endif + return true; + } + return false; } + /**********************************/ void TreePrjItemData::Activate() /**********************************/ /* Called under item activation */ { - wxString FullFileName = wxGetCwd() + wxFileName().GetPathSeparator() + GetFileName(); + wxString FullFileName = wxGetCwd() + wxFileName().GetPathSeparator() + GetFileName(); - switch ( GetType() ) - { - case TREE_PROJECT: - break; + switch( GetType() ) + { + case TREE_PROJECT: + break; - case TREE_DIRECTORY: - m_Parent->Toggle( GetId() ); - break; + case TREE_DIRECTORY: + m_Parent->Toggle( GetId() ); + break; - case TREE_SCHEMA: - { - AddDelimiterString( FullFileName ); - ExecuteFile(m_Parent, EESCHEMA_EXE, FullFileName); - break; - } + case TREE_SCHEMA: + { + AddDelimiterString( FullFileName ); + ExecuteFile( m_Parent, EESCHEMA_EXE, FullFileName ); + break; + } - case TREE_PCB: - AddDelimiterString( FullFileName ); - ExecuteFile(m_Parent, PCBNEW_EXE, FullFileName); - break; + case TREE_PCB: + AddDelimiterString( FullFileName ); + ExecuteFile( m_Parent, PCBNEW_EXE, FullFileName ); + break; #ifdef KICAD_PYTHON - case TREE_PY: - PyHandler::GetInstance()->RunScript( FullFileName ); - break; - #endif + case TREE_PY: + PyHandler::GetInstance()->RunScript( FullFileName ); + break; + #endif - case TREE_GERBER: - AddDelimiterString(FullFileName); - ExecuteFile(m_Parent, GERBVIEW_EXE, FullFileName); - break; + case TREE_GERBER: + AddDelimiterString( FullFileName ); + ExecuteFile( m_Parent, GERBVIEW_EXE, FullFileName ); + break; - case TREE_PDF: - OpenPDF( FullFileName ); - break; + case TREE_PDF: + OpenPDF( FullFileName ); + break; - case TREE_NET: - AddDelimiterString(FullFileName); - ExecuteFile(m_Parent, CVPCB_EXE, FullFileName); - break; + case TREE_NET: + AddDelimiterString( FullFileName ); + ExecuteFile( m_Parent, CVPCB_EXE, FullFileName ); + break; - case TREE_TXT: - { - wxString editorname = GetEditorName(); - if ( !editorname.IsEmpty() ) ExecuteFile(m_Parent, editorname, FullFileName); - break; - } + case TREE_TXT: + { + wxString editorname = GetEditorName(); + if( !editorname.IsEmpty() ) + ExecuteFile( m_Parent, editorname, FullFileName ); + break; + } - default: - OpenFile( FullFileName ); - break; - - } + default: + OpenFile( FullFileName ); + break; + } } + /***************************************************/ -TreePrjItemData * WinEDA_PrjFrame::GetSelectedData() +TreePrjItemData* WinEDA_PrjFrame::GetSelectedData() /***************************************************/ { - return dynamic_cast( m_TreeProject->GetItemData(m_TreeProject->GetSelection()) ); + return dynamic_cast( m_TreeProject->GetItemData( m_TreeProject->GetSelection() ) ); } - diff --git a/kicad/treeprj_frame.cpp b/kicad/treeprj_frame.cpp index bca8a901a2..5977d7c645 100644 --- a/kicad/treeprj_frame.cpp +++ b/kicad/treeprj_frame.cpp @@ -27,128 +27,151 @@ #include "id.h" /******************************************************************/ -WinEDA_PrjFrame::WinEDA_PrjFrame(WinEDA_MainFrame * parent, - const wxPoint & pos, - const wxSize & size ) : - wxSashLayoutWindow(parent, ID_LEFT_FRAME, pos, size, - wxNO_BORDER|wxSW_3D) +WinEDA_PrjFrame::WinEDA_PrjFrame( WinEDA_MainFrame* parent, + const wxPoint& pos, + const wxSize& size ) : + wxSashLayoutWindow( parent, ID_LEFT_FRAME, pos, size, + wxNO_BORDER | wxSW_3D ) /******************************************************************/ { - m_Parent = parent; - m_TreeProject = NULL; - wxMenuItem *item; - m_PopupMenu = NULL; - /* Filtering some file extensions (.bak, .bck, .000) (backup files)*/ - m_Filters.push_back(wxT("^.*\\.(bak|bck|000)$") ); - + m_Parent = parent; + m_TreeProject = NULL; + wxMenuItem* item; + m_PopupMenu = NULL; + /* Filtering is now inverted: the filters are actually used to _enable_ support + * for a given file type. + */ + m_Filters.push_back( wxT( "^.*\\.sch$" ) ); // note: sch filter must be first because of a test in AddFile() below + m_Filters.push_back( wxT( "^.*\\.pro$" ) ); + m_Filters.push_back( wxT( "^.*\\.pdf$" ) ); + m_Filters.push_back( wxT( "^[^$].*\\.brd$" ) ); + m_Filters.push_back( wxT( "^.*\\.net$" ) ); + m_Filters.push_back( wxT( "^.*\\.txt$" ) ); + m_Filters.push_back( wxT( "^.*\\.pho$" ) ); + #ifdef KICAD_PYTHON - PyHandler::GetInstance()->DeclareEvent( wxT( "kicad::RunScript" ) ); - PyHandler::GetInstance()->DeclareEvent( wxT( "kicad::EditScript" ) ); - PyHandler::GetInstance()->DeclareEvent( wxT( "kicad::TreeContextMenu" ) ); - PyHandler::GetInstance()->DeclareEvent( wxT( "kicad::TreeAddFile" ) ); - PyHandler::GetInstance()->DeclareEvent( wxT( "kicad::NewFile" ) ); - PyHandler::GetInstance()->DeclareEvent( wxT( "kicad::NewDirectory" ) ); - PyHandler::GetInstance()->DeclareEvent( wxT( "kicad::DeleteFile" ) ); - PyHandler::GetInstance()->DeclareEvent( wxT( "kicad::RenameFile" ) ); - PyHandler::GetInstance()->DeclareEvent( wxT( "kicad::MoveFile" ) ); + m_Filters.push_back( wxT( "^.*\\.py$" ) ); + + PyHandler::GetInstance()->DeclareEvent( wxT( "kicad::RunScript" ) ); + PyHandler::GetInstance()->DeclareEvent( wxT( "kicad::EditScript" ) ); + PyHandler::GetInstance()->DeclareEvent( wxT( "kicad::TreeContextMenu" ) ); + PyHandler::GetInstance()->DeclareEvent( wxT( "kicad::TreeAddFile" ) ); + PyHandler::GetInstance()->DeclareEvent( wxT( "kicad::NewFile" ) ); + PyHandler::GetInstance()->DeclareEvent( wxT( "kicad::NewDirectory" ) ); + PyHandler::GetInstance()->DeclareEvent( wxT( "kicad::DeleteFile" ) ); + PyHandler::GetInstance()->DeclareEvent( wxT( "kicad::RenameFile" ) ); + PyHandler::GetInstance()->DeclareEvent( wxT( "kicad::MoveFile" ) ); #endif - for ( int i = 0; i < TREE_MAX; i++ ) m_ContextMenus.push_back( new wxMenu() ); + for( int i = 0; i < TREE_MAX; i++ ) + m_ContextMenus.push_back( new wxMenu() ); - // Python script context menu: + // Python script context menu: - wxMenu * menu = m_ContextMenus[TREE_PY]; + wxMenu* menu = m_ContextMenus[TREE_PY]; #ifdef KICAD_PYTHON - item = new wxMenuItem(menu, ID_PROJECT_RUNPY, - _("&Run"), - _("Run the Python Script") ); - item->SetBitmap( icon_python_small_xpm ); - menu->Append( item ); + item = new wxMenuItem( menu, ID_PROJECT_RUNPY, + _( "&Run" ), + _( "Run the Python Script" ) ); + + item->SetBitmap( icon_python_small_xpm ); + menu->Append( item ); #endif - item = new wxMenuItem(menu, ID_PROJECT_TXTEDIT, - _("&Edit in a text editor"), - _("&Open the file in a Text Editor") ); - item->SetBitmap( icon_txt_xpm ); - menu->Append( item ); + item = new wxMenuItem( menu, ID_PROJECT_TXTEDIT, + _( "&Edit in a text editor" ), + _( "&Open the file in a Text Editor" ) ); - // New files context menu: - wxMenu * menus[2]; + item->SetBitmap( icon_txt_xpm ); + menu->Append( item ); + + // New files context menu: + wxMenu* menus[2]; menus[0] = m_ContextMenus[TREE_DIRECTORY]; menus[1] = m_ContextMenus[TREE_PROJECT]; - for ( int i = 0; i < 2; i ++ ) + for( int i = 0; i < 2; i++ ) { menu = menus[i]; - item = new wxMenuItem(menu, ID_PROJECT_NEWDIR, _("New D&irectory"), _("Create a New Directory") ); + item = new wxMenuItem( menu, ID_PROJECT_NEWDIR, _( "New D&irectory" ), _( + "Create a New Directory" ) ); + item->SetBitmap( directory_xpm ); menu->Append( item ); #ifdef KICAD_PYTHON - item = new wxMenuItem(menu, ID_PROJECT_NEWPY, _("New P&ython Script"), _("Create a New Python Script") ); + item = new wxMenuItem( menu, ID_PROJECT_NEWPY, _( "New P&ython Script" ), _( + "Create a New Python Script" ) ); + item->SetBitmap( new_python_xpm ); menu->Append( item ); #endif - item = new wxMenuItem(menu, ID_PROJECT_NEWTXT, _("New &Text File"), _("Create a New Txt File") ); + item = new wxMenuItem( menu, ID_PROJECT_NEWTXT, _( "New &Text File" ), _( + "Create a New Txt File" ) ); + item->SetBitmap( new_txt_xpm ); menu->Append( item ); - item = new wxMenuItem(menu, ID_PROJECT_NEWFILE, _("New &File"), _("Create a New File") ); + item = new wxMenuItem( menu, ID_PROJECT_NEWFILE, _( "New &File" ), _( "Create a New File" ) ); + item->SetBitmap( new_xpm ); menu->Append( item ); } - - // Put the Rename and Delete file menu commands: - for ( int i = TREE_PROJECT + 1; i < TREE_MAX ; i++ ) - { - menu = m_ContextMenus[i]; - item = new wxMenuItem(menu, ID_PROJECT_RENAME - , TREE_DIRECTORY != i ? _("&Rename File") : _("&Rename Directory") - , TREE_DIRECTORY != i ? _("Rename the File") : _("&Rename the Directory") ); - item->SetBitmap( right_xpm ); - menu->Append( item ); - if ( TREE_DIRECTORY != i ) - { - item = new wxMenuItem(menu, ID_PROJECT_TXTEDIT - , _("&Edit in a text editor") - , _("Open the file in a Text Editor")); - item->SetBitmap( icon_txt_xpm ); - menu->Append( item ); - } - item = new wxMenuItem(menu, ID_PROJECT_DELETE - , TREE_DIRECTORY != i ? _("&Delete File") : _("&Delete Directory") - , TREE_DIRECTORY != i ? _("Delete the File") : _("&Delete the Directory and its content") ); - item->SetBitmap( delete_xpm ); - menu->Append( item ); - } + // Put the Rename and Delete file menu commands: + for( int i = TREE_PROJECT + 1; i < TREE_MAX; i++ ) + { + menu = m_ContextMenus[i]; + item = new wxMenuItem( menu, ID_PROJECT_RENAME, + TREE_DIRECTORY != i ? _ ("&Rename File") : _( "&Rename Directory" ), + TREE_DIRECTORY != i ? _ ("Rename the File") : _( "&Rename the Directory" ) ); - ReCreateTreePrj(); + item->SetBitmap( right_xpm ); + menu->Append( item ); + if( TREE_DIRECTORY != i ) + { + item = new wxMenuItem( menu, ID_PROJECT_TXTEDIT, + _( "&Edit in a text editor" ), + _( "Open the file in a Text Editor" ) ); + + item->SetBitmap( icon_txt_xpm ); + menu->Append( item ); + } + item = new wxMenuItem( menu, ID_PROJECT_DELETE, + TREE_DIRECTORY != i ? _ ("&Delete File") : _( "&Delete Directory" ), + TREE_DIRECTORY != i ? _ ("Delete the File") : _( + "&Delete the Directory and its content" ) ); + + item->SetBitmap( delete_xpm ); + menu->Append( item ); + } + + ReCreateTreePrj(); } -BEGIN_EVENT_TABLE(WinEDA_PrjFrame, wxSashLayoutWindow) +BEGIN_EVENT_TABLE( WinEDA_PrjFrame, wxSashLayoutWindow ) - EVT_TREE_BEGIN_LABEL_EDIT(ID_PROJECT_TREE, WinEDA_PrjFrame::OnRenameAsk ) - EVT_TREE_END_LABEL_EDIT(ID_PROJECT_TREE, WinEDA_PrjFrame::OnRename ) - EVT_TREE_ITEM_ACTIVATED(ID_PROJECT_TREE, WinEDA_PrjFrame::OnSelect) - EVT_TREE_ITEM_RIGHT_CLICK(ID_PROJECT_TREE, WinEDA_PrjFrame::OnRight) - EVT_TREE_BEGIN_DRAG( ID_PROJECT_TREE, WinEDA_PrjFrame::OnDragStart) - EVT_TREE_END_DRAG( ID_PROJECT_TREE, WinEDA_PrjFrame::OnDragEnd) - EVT_MENU(ID_PROJECT_TXTEDIT, WinEDA_PrjFrame::OnTxtEdit) - EVT_MENU(ID_PROJECT_NEWFILE, WinEDA_PrjFrame::OnNewFile) - EVT_MENU(ID_PROJECT_NEWDIR, WinEDA_PrjFrame::OnNewDirectory) - EVT_MENU(ID_PROJECT_NEWPY, WinEDA_PrjFrame::OnNewPyFile) - EVT_MENU(ID_PROJECT_NEWTXT, WinEDA_PrjFrame::OnNewTxtFile) - EVT_MENU(ID_PROJECT_DELETE, WinEDA_PrjFrame::OnDeleteFile) - EVT_MENU(ID_PROJECT_RENAME, WinEDA_PrjFrame::OnRenameFile) +EVT_TREE_BEGIN_LABEL_EDIT( ID_PROJECT_TREE, WinEDA_PrjFrame::OnRenameAsk ) +EVT_TREE_END_LABEL_EDIT( ID_PROJECT_TREE, WinEDA_PrjFrame::OnRename ) +EVT_TREE_ITEM_ACTIVATED( ID_PROJECT_TREE, WinEDA_PrjFrame::OnSelect ) +EVT_TREE_ITEM_RIGHT_CLICK( ID_PROJECT_TREE, WinEDA_PrjFrame::OnRight ) +EVT_TREE_BEGIN_DRAG( ID_PROJECT_TREE, WinEDA_PrjFrame::OnDragStart ) +EVT_TREE_END_DRAG( ID_PROJECT_TREE, WinEDA_PrjFrame::OnDragEnd ) +EVT_MENU( ID_PROJECT_TXTEDIT, WinEDA_PrjFrame::OnTxtEdit ) +EVT_MENU( ID_PROJECT_NEWFILE, WinEDA_PrjFrame::OnNewFile ) +EVT_MENU( ID_PROJECT_NEWDIR, WinEDA_PrjFrame::OnNewDirectory ) +EVT_MENU( ID_PROJECT_NEWPY, WinEDA_PrjFrame::OnNewPyFile ) +EVT_MENU( ID_PROJECT_NEWTXT, WinEDA_PrjFrame::OnNewTxtFile ) +EVT_MENU( ID_PROJECT_DELETE, WinEDA_PrjFrame::OnDeleteFile ) +EVT_MENU( ID_PROJECT_RENAME, WinEDA_PrjFrame::OnRenameFile ) #ifdef KICAD_PYTHON - EVT_MENU(ID_PROJECT_RUNPY, WinEDA_PrjFrame::OnRunPy) +EVT_MENU( ID_PROJECT_RUNPY, WinEDA_PrjFrame::OnRunPy ) #endif END_EVENT_TABLE() @@ -158,57 +181,68 @@ WinEDA_TreePrj::~WinEDA_TreePrj() { } + /*******************************************************/ -void WinEDA_PrjFrame::OnDragStart( wxTreeEvent & event ) +void WinEDA_PrjFrame::OnDragStart( wxTreeEvent& event ) /*******************************************************/ + // Allowing drag&drop of file other than the currently opened project { - /* Ensure item is selected (Under Windows start drag does not activate the item) */ -wxTreeItemId curr_item = event.GetItem(); - m_TreeProject->SelectItem(curr_item); - TreePrjItemData * data = GetSelectedData(); - if ( data->GetFileName() == m_Parent->m_PrjFileName ) return; + /* Ensure item is selected (Under Windows start drag does not activate the item) */ + wxTreeItemId curr_item = event.GetItem(); - wxTreeItemId id = m_TreeProject->GetSelection(); + m_TreeProject->SelectItem( curr_item ); + TreePrjItemData* data = GetSelectedData(); + if( data->GetFileName() == m_Parent->m_PrjFileName ) + return; - wxImage img = m_TreeProject->GetImageList()->GetBitmap( data->GetType() - 1 ).ConvertToImage(); - m_DragCursor = wxCursor(img ); - m_Parent->wxWindow::SetCursor( (wxCursor &) m_DragCursor ); - event.Allow(); + wxTreeItemId id = m_TreeProject->GetSelection(); + + wxImage img = m_TreeProject->GetImageList()->GetBitmap( data->GetType() - + 1 ).ConvertToImage(); + m_DragCursor = wxCursor( img ); + m_Parent->wxWindow::SetCursor( (wxCursor &)m_DragCursor ); + event.Allow(); } + /*******************************************************/ -void WinEDA_PrjFrame::OnDragEnd( wxTreeEvent & event ) +void WinEDA_PrjFrame::OnDragEnd( wxTreeEvent& event ) /*******************************************************/ { - m_Parent->SetCursor( wxNullCursor ); + m_Parent->SetCursor( wxNullCursor ); - wxTreeItemId moved = m_TreeProject->GetSelection(); - TreePrjItemData * source_data = GetSelectedData(); - wxTreeItemId dest = event.GetItem(); - if (!dest.IsOk() ) return; // Cancelled ... - TreePrjItemData * destData = dynamic_cast(m_TreeProject->GetItemData( dest ) ); - if (!destData ) return; + wxTreeItemId moved = m_TreeProject->GetSelection(); + TreePrjItemData* source_data = GetSelectedData(); + wxTreeItemId dest = event.GetItem(); + if( !dest.IsOk() ) + return; // Cancelled ... + TreePrjItemData* destData = dynamic_cast( m_TreeProject->GetItemData( dest ) ); + if( !destData ) + return; - // the item can be a member of the selected directory; get the directory itself - if ( TREE_DIRECTORY != destData->GetType() && !m_TreeProject->ItemHasChildren( dest ) ) - { // the item is a member of the selected directory; get the directory itself - dest = m_TreeProject->GetItemParent( dest ); - if (!dest.IsOk() ) return; // no parent ? + // the item can be a member of the selected directory; get the directory itself + if( TREE_DIRECTORY != destData->GetType() && !m_TreeProject->ItemHasChildren( dest ) ) + { // the item is a member of the selected directory; get the directory itself + dest = m_TreeProject->GetItemParent( dest ); + if( !dest.IsOk() ) + return; // no parent ? - // Select the right destData: - destData = dynamic_cast(m_TreeProject->GetItemData( dest ) ); - if (!destData ) return; - } + // Select the right destData: + destData = dynamic_cast( m_TreeProject->GetItemData( dest ) ); + if( !destData ) + return; + } - source_data->Move( destData ); + source_data->Move( destData ); #if 0 - /* Sort filenames by alphabetic order */ - m_TreeProject->SortChildren(dest); + /* Sort filenames by alphabetic order */ + m_TreeProject->SortChildren( dest ); #endif } + /************************************/ void WinEDA_PrjFrame::ClearFilters() /************************************/ @@ -216,258 +250,361 @@ void WinEDA_PrjFrame::ClearFilters() m_Filters.clear(); } + /*************************************************************/ -void WinEDA_PrjFrame::RemoveFilter( const wxString & filter ) +void WinEDA_PrjFrame::RemoveFilter( const wxString& filter ) /*************************************************************/ { - for ( unsigned int i = 0; i < m_Filters.size(); i++ ) + for( unsigned int i = 0; i < m_Filters.size(); i++ ) { - if ( filter == m_Filters[i] ) + if( filter == m_Filters[i] ) { - m_Filters.erase( m_Filters.begin() + i ); + m_Filters.erase( m_Filters.begin() + i ); return; } } } + #ifdef KICAD_PYTHON /********************************************************************************/ -TreePrjItemData * WinEDA_PrjFrame::FindItemData( const boost::python::str & name ) +TreePrjItemData* WinEDA_PrjFrame::FindItemData( const boost::python::str& name ) /********************************************************************************/ + // Return the data corresponding to the file, or NULL { - // (Interative tree parsing) - std::vector< wxTreeItemId > roots1, roots2; - std::vector< wxTreeItemId > *root, *reserve; - wxString filename = PyHandler::MakeStr( name ); + // (Interative tree parsing) + std::vector< wxTreeItemId > roots1, roots2; + std::vector< wxTreeItemId > * root, * reserve; + wxString filename = PyHandler::MakeStr( name ); - root = &roots1; - reserve = &roots2; - root->push_back( m_TreeProject->GetRootItem() ); + root = &roots1; + reserve = &roots2; + + root->push_back( m_TreeProject->GetRootItem() ); + // if we look for the root, return it ... + TreePrjItemData* data = dynamic_cast< TreePrjItemData*>( + m_TreeProject->GetItemData( root->at( 0 ) ) ); + + if( data->GetFileName() == filename ) + return data; - // if we look for the root, return it ... - TreePrjItemData * data = dynamic_cast< TreePrjItemData *>( m_TreeProject->GetItemData( root->at(0) ) ); - if ( data->GetFileName() == filename ) return data; + // Then find in its child + while( root->size() ) + { + // look in all roots + for( unsigned int i = 0; i < root->size(); i++ ) + { + wxTreeItemId id = root->at( i ); - // Then find in its child - while ( root->size() ) - { - // look in all roots - for ( unsigned int i = 0; i < root->size() ; i++ ) - { - wxTreeItemId id = root->at( i ); + // for each root check any child: + void* cookie = NULL; + wxTreeItemId child = m_TreeProject->GetFirstChild( id, cookie ); + + while( child.IsOk() ) + { + TreePrjItemData* data = dynamic_cast< TreePrjItemData*>( + m_TreeProject->GetItemData( child ) ); + + if( data ) + { + if( data->GetFileName() == filename ) + return data; + if( m_TreeProject->ItemHasChildren( child ) ) + reserve->push_back( child ); + } + child = m_TreeProject->GetNextSibling( child ); + } + } - // for each root check any child: - void * cookie = NULL; - wxTreeItemId child = m_TreeProject->GetFirstChild( id, cookie ); - while ( child.IsOk() ) - { - TreePrjItemData * data = dynamic_cast< TreePrjItemData *>( m_TreeProject->GetItemData( child ) ); - if ( data ) - { - if ( data->GetFileName() == filename ) return data; - if ( m_TreeProject->ItemHasChildren( child ) ) reserve->push_back( child ); - } - child = m_TreeProject->GetNextSibling( child ); - } + // Swap the roots + root->clear(); + std::vector< wxTreeItemId > * tmp; + tmp = root; + root = reserve; + reserve = tmp; + } - } - // Swap the roots - root->clear(); - std::vector< wxTreeItemId > *tmp; - tmp = root; - root = reserve; - reserve = tmp; - } - return NULL; + return NULL; } + /******************************************************************/ -void WinEDA_PrjFrame::RemoveFilterPy( const boost::python::str & filter ) +void WinEDA_PrjFrame::RemoveFilterPy( const boost::python::str& filter ) /******************************************************************/ { RemoveFilter( PyHandler::MakeStr( filter ) ); } + /******************************************************************/ -void WinEDA_PrjFrame::AddFilter( const boost::python::str & filter ) +void WinEDA_PrjFrame::AddFilter( const boost::python::str& filter ) /******************************************************************/ { - wxRegEx reg; - wxString text = PyHandler::MakeStr( filter ); - if ( !reg.Compile( text ) ) return; + wxRegEx reg; + wxString text = PyHandler::MakeStr( filter ); + + if( !reg.Compile( text ) ) + return; m_Filters.push_back( text ); } + #endif /******************************************************************/ -const std::vector< wxString > & WinEDA_PrjFrame::GetFilters() +const std::vector& WinEDA_PrjFrame::GetFilters() /******************************************************************/ { return m_Filters; } + /******************************************************************/ -wxMenu * WinEDA_PrjFrame::GetContextMenu( int type ) +wxMenu* WinEDA_PrjFrame::GetContextMenu( int type ) /******************************************************************/ { - return m_ContextMenus[type]; + return m_ContextMenus[type]; } -void WinEDA_PrjFrame::OnNewDirectory(wxCommandEvent & event) { NewFile( TREE_DIRECTORY ); } -void WinEDA_PrjFrame::OnNewFile(wxCommandEvent & event) { NewFile( TREE_UNKNOWN ); } -void WinEDA_PrjFrame::OnNewPyFile(wxCommandEvent & event) { NewFile( TREE_PY ); } -void WinEDA_PrjFrame::OnNewTxtFile(wxCommandEvent & event) { NewFile( TREE_TXT ); } + +void WinEDA_PrjFrame::OnNewDirectory( wxCommandEvent& event ) +{ + NewFile( TREE_DIRECTORY ); +} +void WinEDA_PrjFrame::OnNewFile( wxCommandEvent& event ) +{ + NewFile( TREE_UNKNOWN ); +} +void WinEDA_PrjFrame::OnNewPyFile( wxCommandEvent& event ) +{ + NewFile( TREE_PY ); +} +void WinEDA_PrjFrame::OnNewTxtFile( wxCommandEvent& event ) +{ + NewFile( TREE_TXT ); +} /******************************************************************/ -void WinEDA_PrjFrame::NewFile( enum TreeFileType type ) +void WinEDA_PrjFrame::NewFile( TreeFileType type ) /******************************************************************/ { - wxString filename; - wxString mask = GetFileExt( type ); - const wxString sep = wxFileName().GetPathSeparator(); + wxString filename; + wxString mask = GetFileExt( type ); + const wxString sep = wxFileName().GetPathSeparator(); // Get the directory: - wxString dir; + wxString dir; + + TreePrjItemData* treeData; + wxString FullFileName; - TreePrjItemData * treeData; - wxString FullFileName; treeData = GetSelectedData(); - if (!treeData) return; + if( !treeData ) + return; dir = treeData->GetDir(); // Ask for the new file name - filename = EDA_FileSelector( TREE_DIRECTORY != type ? _("Create New File:") : _("Create New Directory"), - wxGetCwd() + sep + dir, /* Chemin par defaut */ - _("noname") + mask, /* nom fichier par defaut */ - mask, /* extension par defaut */ - mask, /* Masque d'affichage */ - this, - wxFD_SAVE | wxFD_OVERWRITE_PROMPT, - TRUE - ); - if ( filename.IsEmpty() ) return; + filename = EDA_FileSelector( TREE_DIRECTORY != + type ? _( "Create New File:" ) : _( "Create New Directory" ), + wxGetCwd() + sep + dir, /* Chemin par defaut */ + _( "noname" ) + mask, /* nom fichier par defaut */ + mask, /* extension par defaut */ + mask, /* Masque d'affichage */ + this, + wxFD_SAVE | wxFD_OVERWRITE_PROMPT, + TRUE + ); + if( filename.IsEmpty() ) + return; - enum TreeFileType rootType = treeData->GetType(); - wxTreeItemId root; + TreeFileType rootType = treeData->GetType(); + wxTreeItemId root; - if ( TREE_DIRECTORY == rootType ) + if( TREE_DIRECTORY == rootType ) { root = m_TreeProject->GetSelection(); } else { root = m_TreeProject->GetItemParent( m_TreeProject->GetSelection() ); - if ( !root.IsOk() ) root = m_TreeProject->GetSelection(); + if( !root.IsOk() ) + root = m_TreeProject->GetSelection(); } - NewFile( filename, type, root ); + NewFile( filename, type, root ); } + /******************************************************************/ -void WinEDA_PrjFrame::NewFile( const wxString & name, - enum TreeFileType type, wxTreeItemId & root ) +void WinEDA_PrjFrame::NewFile( const wxString& name, + TreeFileType type, wxTreeItemId& root ) /******************************************************************/ { - if ( TREE_DIRECTORY != type ) + if( TREE_DIRECTORY != type ) { wxFile( name, wxFile::write ); - #ifdef KICAD_PYTHON - PyHandler::GetInstance()->TriggerEvent( wxT("kicad::NewFile"), PyHandler::Convert(name) ); - #endif +#ifdef KICAD_PYTHON + PyHandler::GetInstance()->TriggerEvent( + wxT( "kicad::NewFile" ), PyHandler::Convert( name ) ); +#endif } else { wxMkdir( name ); - #ifdef KICAD_PYTHON - PyHandler::GetInstance()->TriggerEvent( wxT("kicad::NewDirectory"), PyHandler::Convert(name) ); - #endif +#ifdef KICAD_PYTHON + PyHandler::GetInstance()->TriggerEvent( + wxT( "kicad::NewDirectory" ), PyHandler::Convert( name ) ); +#endif } AddFile( name, root ); } + /******************************************************************/ -wxString WinEDA_PrjFrame::GetFileExt( enum TreeFileType type ) +wxString WinEDA_PrjFrame::GetFileExt( TreeFileType type ) /******************************************************************/ { -wxString ext; - - switch ( type ) - { - case 0 : - break; // 0 is not used - case TREE_PROJECT: - ext = wxT( ".pro" ); - break; - case TREE_SCHEMA: - ext = g_SchExtBuffer; - break; - case TREE_PCB: - ext = g_BoardExtBuffer; - break; - case TREE_PY: - ext = wxT( ".py" ); - break; - case TREE_GERBER: - ext = g_GerberExtBuffer; - break; - case TREE_PDF: - ext = wxT( ".pdf" ); - break; - case TREE_TXT: - ext = wxT( ".txt" ); - break; - case TREE_NET: - ext = wxT( ".net" ); - break; - default: - break; - }; + wxString ext; - return ext; -} - -/**************************************************************************/ -void WinEDA_PrjFrame::AddFile( const wxString & name, wxTreeItemId & root ) -/**************************************************************************/ -/* add filename "name" to the tree - if name is a directory, add the sub directory file names -*/ -{ -wxTreeItemId cellule; -// Filter -wxRegEx reg; - - for ( unsigned int i = 0; i < m_Filters.size(); i++ ) + switch( type ) { - reg.Compile( m_Filters[i], wxRE_ICASE ); - if ( reg.Matches( name ) ) return; + case 0: + break; // 0 is not used + + case TREE_PROJECT: + ext = wxT( ".pro" ); + break; + + case TREE_SCHEMA: + ext = g_SchExtBuffer; + break; + + case TREE_PCB: + ext = g_BoardExtBuffer; + break; + + case TREE_PY: + ext = wxT( ".py" ); + break; + + case TREE_GERBER: + ext = g_GerberExtBuffer; + break; + + case TREE_PDF: + ext = wxT( ".pdf" ); + break; + + case TREE_TXT: + ext = wxT( ".txt" ); + break; + + case TREE_NET: + ext = wxT( ".net" ); + break; + + default: + break; } - // Check the file type - int type = TREE_UNKNOWN; + return ext; +} - if ( wxDirExists( name ) ) + +/**************************************************************************/ +void WinEDA_PrjFrame::AddFile( const wxString& name, wxTreeItemId& root ) +/**************************************************************************/ + +/* add filename "name" to the tree + * if name is a directory, add the sub directory file names + */ +{ + wxTreeItemId cellule; + + // Check the file type + TreeFileType type = TREE_UNKNOWN; + + if( wxDirExists( name ) ) { type = TREE_DIRECTORY; } else { - for ( int i = TREE_PROJECT; i < TREE_MAX; i++ ) + // Filter + wxRegEx reg; + + bool isSchematic=false; + bool addFile=false; + for( unsigned i=0; i < m_Filters.size(); i++ ) { - wxString ext = GetFileExt( (enum TreeFileType) i ); - - if ( ext == wxT( "" ) ) continue; - - reg.Compile( wxString::FromAscii( "^.*\\" ) + ext + wxString::FromAscii( "$" ), wxRE_ICASE ); - if ( reg.Matches( name ) ) + reg.Compile( m_Filters[i], wxRE_ICASE ); + if( reg.Matches( name ) ) { - type = i; + addFile=true; + if( i==0 ) + isSchematic = true; + } + } + + if( !addFile ) + return; + + // only show the schematic if it is a top level schematic. eeschema + // cannot open a schematic and display it properly unless it starts + // at the top of the hierarchy. The schematic is top level only if + // there is a line in the header saying: + // "Sheet 1 " + if( isSchematic ) + { + char line[128]; // small because we just need a few bytes from the start of a line + FILE* fp; + + wxString FullFileName = wxGetCwd() + STRING_DIR_SEP + name; + + fp = wxFopen( FullFileName, wxT( "rt" ) ); + if( fp == NULL ) + { + //printf("Unable to open \"%s\"\n", (const char*) FullFileName.mb_str() ); + return; // why show a file we cannot open? + } + + addFile = false; + for( int i=0; i<20; ++i ) + { + if( !fgets( line, sizeof(line), fp ) ) + break; + + if( !strncmp( line, "Sheet 1 ", 8 ) ) + { + addFile = true; + break; + } + } + + fclose(fp); + + if( !addFile ) + return; // it is a non-top-level schematic + } + + for( int i = TREE_PROJECT; i < TREE_MAX; i++ ) + { + wxString ext = GetFileExt( (TreeFileType) i ); + + if( ext == wxT( "" ) ) + continue; + + reg.Compile( wxString::FromAscii( "^.*\\" ) + ext + + wxString::FromAscii("$" ), wxRE_ICASE ); + + if( reg.Matches( name ) ) + { + type = (TreeFileType) i; break; } } @@ -475,271 +612,329 @@ wxRegEx reg; // Append the item (only appending the filename not the full path): - wxString file = wxFileNameFromPath( name ); - cellule = m_TreeProject->AppendItem( root, file ); - TreePrjItemData * data = new TreePrjItemData( (enum TreeFileType) type, name, m_TreeProject ); - m_TreeProject->SetItemFont( cellule, *g_StdFont ); - m_TreeProject->SetItemData( cellule, data ); - data->SetState(0); + wxString file = wxFileNameFromPath( name ); + cellule = m_TreeProject->AppendItem( root, file ); + TreePrjItemData* data = new TreePrjItemData( type, name, m_TreeProject ); - /* Mark root files (files which have the same name as the project) */ - wxFileName project (m_Parent->m_PrjFileName); - wxFileName currfile (file); - if ( currfile.GetName().CmpNoCase(project.GetName()) == 0 ) data->m_IsRootFile = true; - else data->m_IsRootFile = false; - - #ifdef KICAD_PYTHON - PyHandler::GetInstance()->TriggerEvent( wxT("kicad::TreeAddFile"), PyHandler::Convert( name ) ); - #endif + m_TreeProject->SetItemFont( cellule, *g_StdFont ); + m_TreeProject->SetItemData( cellule, data ); + data->SetState( 0 ); - if ( TREE_DIRECTORY == type ) + /* Mark root files (files which have the same name as the project) */ + wxFileName project( m_Parent->m_PrjFileName ); + wxFileName currfile( file ); + + if( currfile.GetName().CmpNoCase( project.GetName() ) == 0 ) + data->m_IsRootFile = true; + else + data->m_IsRootFile = false; + +#ifdef KICAD_PYTHON + PyHandler::GetInstance()->TriggerEvent( wxT( "kicad::TreeAddFile" ), PyHandler::Convert( name ) ); +#endif + + if( TREE_DIRECTORY == type ) { const wxString sep = wxFileName().GetPathSeparator(); wxDir dir( name ); - wxString dir_filename; - if ( dir.GetFirst( &dir_filename ) ) + + wxString dir_filename; + if( dir.GetFirst( &dir_filename ) ) { do { AddFile( name + sep + dir_filename, cellule ); - } while ( dir.GetNext( &dir_filename ) ); + } while( dir.GetNext( &dir_filename ) ); } - /* Sort filenames by alphabetic order */ - m_TreeProject->SortChildren(cellule); + + /* Sort filenames by alphabetic order */ + m_TreeProject->SortChildren( cellule ); } } + /******************************************/ -void WinEDA_PrjFrame::ReCreateTreePrj(void) +void WinEDA_PrjFrame::ReCreateTreePrj() /******************************************/ + /* Create or modify the tree showing project file names -*/ + */ { -wxTreeItemId rootcellule; -wxString Text; -bool prjOpened = false; + wxTreeItemId rootcellule; + wxString Text; + bool prjOpened = false; - if ( ! m_TreeProject ) m_TreeProject = new WinEDA_TreePrj(this); - else m_TreeProject->DeleteAllItems(); + if( !m_TreeProject ) + m_TreeProject = new WinEDA_TreePrj( this ); + else + m_TreeProject->DeleteAllItems(); - m_TreeProject->SetFont(* g_StdFont); - if (m_Parent->m_PrjFileName.IsEmpty() ) Text = wxT("noname"); - else Text = wxFileNameFromPath(m_Parent->m_PrjFileName); + m_TreeProject->SetFont( *g_StdFont ); + + if( m_Parent->m_PrjFileName.IsEmpty() ) + Text = wxT( "noname" ); + else + Text = wxFileNameFromPath( m_Parent->m_PrjFileName ); - prjOpened = wxFileExists( Text ); + prjOpened = wxFileExists( Text ); - // root tree: - m_root = rootcellule = m_TreeProject->AddRoot(Text, TREE_PROJECT - 1, TREE_PROJECT - 1); - m_TreeProject->SetItemBold(rootcellule, TRUE); - m_TreeProject->SetItemData( rootcellule, new TreePrjItemData(TREE_PROJECT, wxEmptyString, m_TreeProject) ); - m_TreeProject->SetItemFont(rootcellule, *g_StdFont); + // root tree: + m_root = rootcellule = m_TreeProject->AddRoot( Text, TREE_PROJECT - 1, TREE_PROJECT - 1 ); + + m_TreeProject->SetItemBold( rootcellule, TRUE ); + + m_TreeProject->SetItemData( rootcellule, + new TreePrjItemData( TREE_PROJECT, wxEmptyString, m_TreeProject ) ); + + m_TreeProject->SetItemFont( rootcellule, *g_StdFont ); - ChangeFileNameExt(Text, wxEmptyString); + ChangeFileNameExt( Text, wxEmptyString ); - // Add at least a .scn / .brd if not existing: - if ( !wxFileExists(Text+g_SchExtBuffer) ) AddFile( Text + g_SchExtBuffer, m_root ); - if ( !wxFileExists(Text+g_BoardExtBuffer) ) AddFile( Text + g_BoardExtBuffer, m_root ); + // Add at least a .scn / .brd if not existing: + if( !wxFileExists( Text + g_SchExtBuffer ) ) + AddFile( Text + g_SchExtBuffer, m_root ); + + if( !wxFileExists( Text + g_BoardExtBuffer ) ) + AddFile( Text + g_BoardExtBuffer, m_root ); - // Now adding all current files if available - if ( prjOpened ) - { + // Now adding all current files if available + if( prjOpened ) + { wxDir dir( wxGetCwd() ); + wxString filename; - if ( dir.GetFirst( &filename ) ) + + if( dir.GetFirst( &filename ) ) { do { - if ( filename == Text + wxT( ".pro" ) ) continue; - AddFile( filename, m_root ); - } while ( dir.GetNext( &filename ) ); + if( filename == Text + wxT( ".pro" ) ) + continue; + + AddFile( filename, m_root ); + + } while( dir.GetNext( &filename ) ); } - } + } - m_TreeProject->Expand(rootcellule); - - /* Sort filenames by alphabetic order */ - m_TreeProject->SortChildren(m_root); + m_TreeProject->Expand( rootcellule ); + + /* Sort filenames by alphabetic order */ + m_TreeProject->SortChildren( m_root ); } + /**************************************************/ -void WinEDA_PrjFrame::OnRight(wxTreeEvent & Event) +void WinEDA_PrjFrame::OnRight( wxTreeEvent& Event ) /**************************************************/ + // Opens (popup) the context menu { -int tree_id; -TreePrjItemData * tree_data; -wxString FullFileName; -wxTreeItemId curr_item = Event.GetItem(); - - /* Ensure item is selected (Under Windows right click does not select the item) */ - m_TreeProject->SelectItem(curr_item); - - // Delete and recreate the context menu - delete( m_PopupMenu ); - m_PopupMenu = new wxMenu(); + int tree_id; + TreePrjItemData* tree_data; + wxString FullFileName; + wxTreeItemId curr_item = Event.GetItem(); - // Get the current filename: - tree_data = GetSelectedData(); - if (!tree_data) return; + /* Ensure item is selected (Under Windows right click does not select the item) */ + m_TreeProject->SelectItem( curr_item ); - tree_id = tree_data->GetType(); - FullFileName = tree_data->GetFileName(); + // Delete and recreate the context menu + delete( m_PopupMenu ); + m_PopupMenu = new wxMenu(); - // copy menu contents in order of the next array: - wxMenu * menus[] = - { - GetContextMenu( tree_id ) - , const_cast( tree_data->GetMenu() ) - }; + // Get the current filename: + tree_data = GetSelectedData(); + if( !tree_data ) + return; - for ( unsigned int j = 0; j < sizeof(menus)/sizeof(wxMenu*); j++ ) - { - wxMenu * menu = menus[j]; - if ( ! menu ) continue; - wxMenuItemList list = menu->GetMenuItems(); + tree_id = tree_data->GetType(); + FullFileName = tree_data->GetFileName(); - for ( unsigned int i = 0; i < list.GetCount() ; i ++ ) - { - // Grrrr! wxMenu does not have any copy constructor !! (do it by hand) - wxMenuItem * src = list[i]; - wxString label = src->GetText(); - // for obscure reasons, the & is translated into _ ... so replace it - label.Replace( wxT("_"), wxT("&"), true ); - wxMenuItem * item = new wxMenuItem( m_PopupMenu, src->GetId() - , label, src->GetHelp() - , src->GetKind() ); - item->SetBitmap( src->GetBitmap() ); - m_PopupMenu->Append( item ); - } - } + // copy menu contents in order of the next array: + wxMenu* menus[] = + { + GetContextMenu( tree_id ), + const_cast( tree_data->GetMenu() ) + }; - // At last, call python to let python add menu items "on the fly" + for( unsigned int j=0; j < sizeof(menus)/sizeof(wxMenu*); j++ ) + { + wxMenu* menu = menus[j]; + if( !menu ) + continue; + + wxMenuItemList list = menu->GetMenuItems(); - #ifdef KICAD_PYTHON - PyHandler::GetInstance()->TriggerEvent( wxT("kicad::TreeContextMenu"), PyHandler::Convert( FullFileName ) ); - #endif + for( unsigned int i = 0; i < list.GetCount(); i++ ) + { + // Grrrr! wxMenu does not have any copy constructor !! (do it by hand) + wxMenuItem* src = list[i]; + wxString label = src->GetText(); - if ( m_PopupMenu ) PopupMenu( m_PopupMenu ); -} + // for obscure reasons, the & is translated into _ ... so replace it + label.Replace( wxT( "_" ), wxT( "&" ), true ); + wxMenuItem* item = new wxMenuItem( m_PopupMenu, src->GetId(), + label, src->GetHelp(), src->GetKind() ); + item->SetBitmap( src->GetBitmap() ); + m_PopupMenu->Append( item ); + } + } -/*******************************************************/ -void WinEDA_PrjFrame::OnTxtEdit(wxCommandEvent & event ) -/*******************************************************/ -{ - TreePrjItemData * tree_data = GetSelectedData(); - if (!tree_data) return; + // At last, call python to let python add menu items "on the fly" - wxString FullFileName = tree_data->GetFileName(); - AddDelimiterString( FullFileName ); - wxString editorname = GetEditorName(); - if ( !editorname.IsEmpty() ) - { #ifdef KICAD_PYTHON - PyHandler::GetInstance()->TriggerEvent( wxT("kicad::EditScript"), PyHandler::Convert( FullFileName ) ); + PyHandler::GetInstance()->TriggerEvent( wxT( "kicad::TreeContextMenu" ), + PyHandler::Convert( FullFileName ) ); #endif - ExecuteFile(this, editorname, FullFileName); - } + + if( m_PopupMenu ) + PopupMenu( m_PopupMenu ); } -/***************************************************/ -void WinEDA_PrjFrame::OnDeleteFile(wxCommandEvent &) -/***************************************************/ + +/*******************************************************/ +void WinEDA_PrjFrame::OnTxtEdit( wxCommandEvent& event ) +/*******************************************************/ { - TreePrjItemData * tree_data = GetSelectedData(); - if (!tree_data) return; - tree_data->Delete(); + TreePrjItemData* tree_data = GetSelectedData(); + + if( !tree_data ) + return; + + wxString FullFileName = tree_data->GetFileName(); + AddDelimiterString( FullFileName ); + wxString editorname = GetEditorName(); + if( !editorname.IsEmpty() ) + { +#ifdef KICAD_PYTHON + PyHandler::GetInstance()->TriggerEvent( wxT( "kicad::EditScript" ), + PyHandler::Convert( FullFileName ) ); +#endif + ExecuteFile( this, editorname, FullFileName ); + } } + /***************************************************/ -void WinEDA_PrjFrame::OnRenameFile(wxCommandEvent &) +void WinEDA_PrjFrame::OnDeleteFile( wxCommandEvent& ) /***************************************************/ { -wxTreeItemId curr_item = m_TreeProject->GetSelection(); -TreePrjItemData * tree_data = GetSelectedData(); - if (!tree_data) return; + TreePrjItemData* tree_data = GetSelectedData(); -wxString buffer = m_TreeProject->GetItemText(curr_item); -wxString msg = _("Change File Name: ") + tree_data->m_FileName; - if ( Get_Message(msg, buffer, this) != 0 ) - return; //Abort command + if( !tree_data ) + return; + tree_data->Delete(); +} - if ( tree_data->Rename( buffer, true ) ) - { - m_TreeProject->SetItemText(curr_item, buffer); - } - + +/***************************************************/ +void WinEDA_PrjFrame::OnRenameFile( wxCommandEvent& ) +/***************************************************/ +{ + wxTreeItemId curr_item = m_TreeProject->GetSelection(); + TreePrjItemData* tree_data = GetSelectedData(); + + if( !tree_data ) + return; + + wxString buffer = m_TreeProject->GetItemText( curr_item ); + wxString msg = _( "Change File Name: " ) + tree_data->m_FileName; + if( Get_Message( msg, buffer, this ) != 0 ) + return; //Abort command + + if( tree_data->Rename( buffer, true ) ) + { + m_TreeProject->SetItemText( curr_item, buffer ); + } } #ifdef KICAD_PYTHON /***************************************************/ -void WinEDA_PrjFrame::OnRunPy(wxCommandEvent & event ) +void WinEDA_PrjFrame::OnRunPy( wxCommandEvent& event ) /***************************************************/ { - TreePrjItemData * tree_data = GetSelectedData(); - if (!tree_data) return; + TreePrjItemData* tree_data = GetSelectedData(); - wxString FullFileName = tree_data->GetFileName(); - PyHandler::GetInstance()->TriggerEvent( wxT("kicad::RunScript"), PyHandler::Convert( FullFileName ) ); - PyHandler::GetInstance()->RunScript( FullFileName ); + if( !tree_data ) + return; + + wxString FullFileName = tree_data->GetFileName(); + PyHandler::GetInstance()->TriggerEvent( wxT( "kicad::RunScript" ), + PyHandler::Convert( FullFileName ) ); + PyHandler::GetInstance()->RunScript( FullFileName ); } + /****************************************************************/ -int WinEDA_PrjFrame::AddStatePy( boost::python::object & bitmap ) +int WinEDA_PrjFrame::AddStatePy( boost::python::object& bitmap ) /****************************************************************/ + // Add a state to the image list ... { - wxBitmap * image; - bool success = wxPyConvertSwigPtr( bitmap.ptr(), (void**)&image, _T("wxBitmap")); - if ( !success ) return -1; + wxBitmap* image; + bool success = wxPyConvertSwigPtr( bitmap.ptr(), (void**) &image, _T( "wxBitmap" ) ); - wxImageList * list = m_TreeProject->GetImageList(); - int ret = list->GetImageCount() / ( TREE_MAX - 2 ); + if( !success ) + return -1; - for ( int i = 0; i < TREE_MAX - 1; i ++ ) - { - wxBitmap composed ( list->GetBitmap( i ) ); - wxMemoryDC dc; - dc.SelectObject( composed ); - dc.DrawBitmap( *image, 0, 0, true ); - list->Add( composed ); - } - return ret; + wxImageList* list = m_TreeProject->GetImageList(); + int ret = list->GetImageCount() / ( TREE_MAX - 2 ); + + for( int i = 0; i < TREE_MAX - 1; i++ ) + { + wxBitmap composed( list->GetBitmap ( i ) ); + + wxMemoryDC dc; + dc.SelectObject( composed ); + dc.DrawBitmap( *image, 0, 0, true ); + list->Add( composed ); + } + + return ret; } + #endif /***************************************************/ -void WinEDA_PrjFrame::OnRenameAsk(wxTreeEvent & event) +void WinEDA_PrjFrame::OnRenameAsk( wxTreeEvent& event ) /***************************************************/ /* Prevent the main project to be renamed */ { - TreePrjItemData * tree_data = GetSelectedData(); - if (!tree_data) return; - if ( m_Parent->m_PrjFileName == tree_data->GetFileName() ) event.Veto(); + TreePrjItemData* tree_data = GetSelectedData(); + + if( !tree_data ) + return; + if( m_Parent->m_PrjFileName == tree_data->GetFileName() ) + event.Veto(); } + /***************************************************/ -void WinEDA_PrjFrame::OnRename(wxTreeEvent & event) +void WinEDA_PrjFrame::OnRename( wxTreeEvent& event ) /***************************************************/ /* rename a tree item on demand of the context menu */ { - TreePrjItemData * tree_data = GetSelectedData(); - if (!tree_data) return; + TreePrjItemData* tree_data = GetSelectedData(); - tree_data->OnRename( event ); + if( !tree_data ) + return; + + tree_data->OnRename( event ); } /**************************************************/ -void WinEDA_PrjFrame::OnSelect(wxTreeEvent & Event) +void WinEDA_PrjFrame::OnSelect( wxTreeEvent& Event ) /**************************************************/ { -wxString FullFileName; + wxString FullFileName; - TreePrjItemData * tree_data = GetSelectedData(); - if (!tree_data) return; - tree_data->Activate(); + TreePrjItemData* tree_data = GetSelectedData(); + + if( !tree_data ) + return; + tree_data->Activate(); } - diff --git a/pcbnew/ar_protos.h b/pcbnew/ar_protos.h index 271ea815d3..11378c93a5 100644 --- a/pcbnew/ar_protos.h +++ b/pcbnew/ar_protos.h @@ -49,7 +49,7 @@ void TraceArc(int ux0,int uy0,int ux1,int uy1, int ArcAngle, int lg,int layer, /* SOLVE.CPP */ /* QUEUE.CPP */ -void FreeQueue(void); /* Libere la memoire de la queue de recherche */ +void FreeQueue(); /* Libere la memoire de la queue de recherche */ void InitQueue(); void GetQueue( int *, int *, int *, int *, int * ); int SetQueue( int, int, int, int, int, int, int ); diff --git a/pcbnew/autorout.h b/pcbnew/autorout.h index 3dddb36925..23c831ca28 100644 --- a/pcbnew/autorout.h +++ b/pcbnew/autorout.h @@ -138,10 +138,10 @@ public: int m_MemSize; public: - BOARDHEAD(void); - ~BOARDHEAD(void); - int InitBoard(void); - void UnInitBoard(void); + BOARDHEAD(); + ~BOARDHEAD(); + int InitBoard(); + void UnInitBoard(); }; diff --git a/pcbnew/dialog_edit_mod_text.cpp b/pcbnew/dialog_edit_mod_text.cpp index c600c61cb4..1205573d7b 100644 --- a/pcbnew/dialog_edit_mod_text.cpp +++ b/pcbnew/dialog_edit_mod_text.cpp @@ -295,7 +295,7 @@ wxIcon WinEDA_TextModPropertiesFrame::GetIconResource( const wxString& name ) } /********************************************************/ -void WinEDA_TextModPropertiesFrame::SetDisplayValue(void) +void WinEDA_TextModPropertiesFrame::SetDisplayValue() /********************************************************/ { wxString msg; diff --git a/pcbnew/dialog_edit_mod_text.h b/pcbnew/dialog_edit_mod_text.h index ccaab8a6ea..674539a49c 100644 --- a/pcbnew/dialog_edit_mod_text.h +++ b/pcbnew/dialog_edit_mod_text.h @@ -107,7 +107,7 @@ public: /// Should we show tooltips? static bool ShowToolTips(); void TextModPropertiesAccept(wxCommandEvent& event); - void SetDisplayValue(void); + void SetDisplayValue(); ////@begin WinEDA_TextModPropertiesFrame member variables wxStaticText* m_ModuleInfoText; diff --git a/pcbnew/dialog_edit_module.h b/pcbnew/dialog_edit_module.h index ae4084276a..660182fda7 100644 --- a/pcbnew/dialog_edit_module.h +++ b/pcbnew/dialog_edit_module.h @@ -53,7 +53,7 @@ public: // Constructor and destructor WinEDA_ModulePropertiesFrame(WinEDA_BasePcbFrame *parent, MODULE * Module, wxDC * DC, const wxPoint & pos); - ~WinEDA_ModulePropertiesFrame(void) + ~WinEDA_ModulePropertiesFrame() { } @@ -64,8 +64,8 @@ private: void CreateTextModule(wxCommandEvent& event); void EditOrDelTextModule(wxCommandEvent& event); void SelectTextListBox(wxCommandEvent& event); - void ReCreateFieldListBox(void); - void SetTextListButtons(void); + void ReCreateFieldListBox(); + void SetTextListButtons(); void BuildPanelModuleProperties(bool FullOptions); void ModuleOrientEvent(wxCommandEvent& event); void ExchangeModule(wxCommandEvent& event); @@ -89,7 +89,7 @@ public: public: Panel3D_Ctrl(WinEDA_ModulePropertiesFrame * parentframe, wxNotebook * parent, int id, Struct3D_Master * struct3D); - ~Panel3D_Ctrl(void); + ~Panel3D_Ctrl(); void Browse3DLib(wxCommandEvent& event); void AddOrRemove3DShape(wxCommandEvent& event); DECLARE_EVENT_TABLE() diff --git a/pcbnew/dialog_pad_edit.h b/pcbnew/dialog_pad_edit.h index fa205366e7..b719f1f07b 100644 --- a/pcbnew/dialog_pad_edit.h +++ b/pcbnew/dialog_pad_edit.h @@ -130,11 +130,11 @@ public: static bool ShowToolTips(); void PadPropertiesAccept(wxCommandEvent& event); - void PadTypeSelected(void); + void PadTypeSelected(); void PadTypeSelectedEvent(wxCommandEvent& event); void PadOrientEvent(wxCommandEvent& event); void SetPadLayersList(long layer_mask); - void SetOthersControls(void); + void SetOthersControls(); ////@begin WinEDA_PadPropertiesFrame member variables wxBoxSizer* m_LeftBoxSizer; diff --git a/pcbnew/dialog_setup_libs.cpp b/pcbnew/dialog_setup_libs.cpp index 997a42083f..8344624285 100644 --- a/pcbnew/dialog_setup_libs.cpp +++ b/pcbnew/dialog_setup_libs.cpp @@ -314,7 +314,7 @@ wxIcon KiConfigPcbnewFrame::GetIconResource( const wxString& name ) } /********************************************/ -void KiConfigPcbnewFrame::SetNewOptions(void) +void KiConfigPcbnewFrame::SetNewOptions() /********************************************/ { g_UserLibDirBuffer = m_TextLibDir->GetValue(); diff --git a/pcbnew/dialog_setup_libs.h b/pcbnew/dialog_setup_libs.h index 5b1ab7c278..c82b7c0659 100644 --- a/pcbnew/dialog_setup_libs.h +++ b/pcbnew/dialog_setup_libs.h @@ -116,7 +116,7 @@ public: void SaveCfg(wxCommandEvent& event); void LibDelFct(wxCommandEvent& event); void LibInsertFct(wxCommandEvent& event); - void SetNewOptions(void); + void SetNewOptions(); ////@begin KiConfigPcbnewFrame member variables wxStaticBoxSizer* m_FileExtList; diff --git a/pcbnew/dialog_track_options.cpp b/pcbnew/dialog_track_options.cpp index 122bc0e23b..6d86a9c984 100644 --- a/pcbnew/dialog_track_options.cpp +++ b/pcbnew/dialog_track_options.cpp @@ -226,7 +226,7 @@ wxIcon WinEDA_PcbTracksDialog::GetIconResource( const wxString& name ) } /*************************************************/ -void WinEDA_PcbTracksDialog::SetDisplayValue(void) +void WinEDA_PcbTracksDialog::SetDisplayValue() /*************************************************/ { AddUnitSymbol(*m_ViaSizeTitle); diff --git a/pcbnew/dialog_track_options.h b/pcbnew/dialog_track_options.h index d0da01c556..34b178b8cf 100644 --- a/pcbnew/dialog_track_options.h +++ b/pcbnew/dialog_track_options.h @@ -103,7 +103,7 @@ public: /// Should we show tooltips? static bool ShowToolTips(); void AcceptPcbOptions(wxCommandEvent& event); - void SetDisplayValue(void); + void SetDisplayValue(); ////@begin WinEDA_PcbTracksDialog member variables wxStaticText* m_ViaSizeTitle; diff --git a/pcbnew/drag.h b/pcbnew/drag.h index 6ef9f488d1..eb98f71132 100644 --- a/pcbnew/drag.h +++ b/pcbnew/drag.h @@ -24,7 +24,7 @@ public: DRAG_SEGM(TRACK * segm); ~DRAG_SEGM(); - void SetInitialValues(void); + void SetInitialValues(); }; @@ -39,7 +39,7 @@ void Build_Drag_Liste(WinEDA_DrawPanel * panel, wxDC * DC, MODULE * Module); void Build_1_Pad_SegmentsToDrag(WinEDA_DrawPanel * panel, wxDC * DC, D_PAD * PtPad ); void Collect_TrackSegmentsToDrag(WinEDA_DrawPanel * panel, wxDC * DC, wxPoint & point, int MasqueLayer, int net_code); -void EraseDragListe(void); +void EraseDragListe(); void AddSegmentToDragList(WinEDA_DrawPanel * panel, wxDC * DC, int flag, TRACK * Track); /* Add the segment"Track" to the drag list, and erase it from screen flag = STARTPOINT (if the point to drag is the start point of Track) or ENDPOINT */ diff --git a/pcbnew/dragsegm.cpp b/pcbnew/dragsegm.cpp index c8aa7e465e..13839e0459 100644 --- a/pcbnew/dragsegm.cpp +++ b/pcbnew/dragsegm.cpp @@ -34,7 +34,7 @@ DRAG_SEGM::~DRAG_SEGM() } -void DRAG_SEGM::SetInitialValues(void) +void DRAG_SEGM::SetInitialValues() { m_Segm->m_Start = m_StartInitialValue; m_Segm->m_End = m_EndInitialValue; @@ -188,7 +188,7 @@ BOARD * pcb = ((WinEDA_BasePcbFrame*)(panel->m_Parent))->m_Pcb; /*****************************/ -void EraseDragListe(void) +void EraseDragListe() /*****************************/ /* Routine de liberation memoire de la liste des structures DRAG_SEGM remet a zero le pointeur global g_DragSegmentList diff --git a/pcbnew/editpads.cpp b/pcbnew/editpads.cpp index 69c5c22c14..a7c8d845d1 100644 --- a/pcbnew/editpads.cpp +++ b/pcbnew/editpads.cpp @@ -63,7 +63,7 @@ void WinEDA_BasePcbFrame::InstallPadOptionsFrame(D_PAD * Pad, } /********************************************************/ -void WinEDA_PadPropertiesFrame::SetOthersControls(void) +void WinEDA_PadPropertiesFrame::SetOthersControls() /********************************************************/ { int tmp; @@ -234,7 +234,7 @@ void WinEDA_PadPropertiesFrame::PadTypeSelectedEvent(wxCommandEvent& event) PadTypeSelected(); } -void WinEDA_PadPropertiesFrame::PadTypeSelected(void) +void WinEDA_PadPropertiesFrame::PadTypeSelected() { long layer_mask; int ii; diff --git a/pcbnew/gendrill.cpp b/pcbnew/gendrill.cpp index ce3e02beab..319c2096b9 100644 --- a/pcbnew/gendrill.cpp +++ b/pcbnew/gendrill.cpp @@ -57,7 +57,7 @@ enum zeros_fmt { }; /* Routines Locales */ -static void Fin_Drill(void); +static void Fin_Drill(); static void PlotDrillSymbol(const wxPoint & position,int diametre,int num_forme,int format); static void PlotOvalDrillSymbol(const wxPoint & position,const wxSize & size,int orient,int format); @@ -114,21 +114,21 @@ class WinEDA_DrillFrame: public wxDialog // Constructor and destructor public: WinEDA_DrillFrame(WinEDA_PcbFrame *parent); - ~WinEDA_DrillFrame(void) {}; + ~WinEDA_DrillFrame() {}; private: void OnQuit(wxCommandEvent& event); - void SetParams(void); + void SetParams(); void GenDrillFiles(wxCommandEvent& event); void GenDrillMap(int format); void UpdatePrecisionOptions(wxCommandEvent& event); - void UpdateConfig(void); + void UpdateConfig(); int Plot_Drill_PcbMap( FORET * buffer, int format); - void GenDrillReport(void); + void GenDrillReport(); int Gen_Liste_Forets( FORET * buffer,bool print_header); int Gen_Drill_File_EXCELLON( FORET * buffer); void Gen_Line_EXCELLON(char *line, float x, float y); - void Init_Drill(void); + void Init_Drill(); DECLARE_EVENT_TABLE() }; @@ -264,7 +264,7 @@ wxString choice_drill_report_msg[] = /**************************************/ -void WinEDA_DrillFrame::SetParams(void) +void WinEDA_DrillFrame::SetParams() /**************************************/ { Unit_Drill_is_Inch = (m_Choice_Unit->GetSelection() == 0) ? FALSE : TRUE; @@ -316,7 +316,7 @@ WinEDA_DrillFrame * frame = new WinEDA_DrillFrame(this); /******************************************/ -void WinEDA_DrillFrame::UpdateConfig(void) +void WinEDA_DrillFrame::UpdateConfig() /******************************************/ /* Save drill options: */ { @@ -771,7 +771,7 @@ char line[1024]; /***************************************/ -void WinEDA_DrillFrame::Init_Drill(void) +void WinEDA_DrillFrame::Init_Drill() /***************************************/ /* Print the DRILL file header */ { @@ -818,7 +818,7 @@ char Line[256]; } /************************/ -void Fin_Drill(void) +void Fin_Drill() /************************/ { //add if minimal here @@ -1426,7 +1426,7 @@ void PlotOvalDrillSymbol(const wxPoint & position,const wxSize & size,int orient } /*******************************************/ -void WinEDA_DrillFrame::GenDrillReport(void) +void WinEDA_DrillFrame::GenDrillReport() /*******************************************/ /* Create a list of drill values and drill count diff --git a/pcbnew/globaleditpad.cpp b/pcbnew/globaleditpad.cpp index 6e90fac056..0e1160800d 100644 --- a/pcbnew/globaleditpad.cpp +++ b/pcbnew/globaleditpad.cpp @@ -54,7 +54,7 @@ public: // Constructor and destructor WinEDA_PadGlobalEditFrame(WinEDA_BasePcbFrame *parent, D_PAD * Pad, wxDC * DC, const wxPoint & pos); - ~WinEDA_PadGlobalEditFrame(void) + ~WinEDA_PadGlobalEditFrame() { } diff --git a/pcbnew/librairi.cpp b/pcbnew/librairi.cpp index 3169fb5f47..240f9265f8 100644 --- a/pcbnew/librairi.cpp +++ b/pcbnew/librairi.cpp @@ -671,7 +671,7 @@ wxPoint newpos; /*******************************************************/ -void WinEDA_ModuleEditFrame::Select_Active_Library(void) +void WinEDA_ModuleEditFrame::Select_Active_Library() /*******************************************************/ { if ( g_LibName_List.GetCount() == 0 ) return; diff --git a/pcbnew/menubarmodedit.cpp b/pcbnew/menubarmodedit.cpp index 4f69d53c85..0a2925d322 100644 --- a/pcbnew/menubarmodedit.cpp +++ b/pcbnew/menubarmodedit.cpp @@ -18,7 +18,7 @@ /***********************************************/ -void WinEDA_ModuleEditFrame::ReCreateMenuBar(void) +void WinEDA_ModuleEditFrame::ReCreateMenuBar() /***********************************************/ /* Cree ou reinitialise le menu du haut d'ecran diff --git a/pcbnew/menubarpcb.cpp b/pcbnew/menubarpcb.cpp index 75863007a0..cbe9107681 100644 --- a/pcbnew/menubarpcb.cpp +++ b/pcbnew/menubarpcb.cpp @@ -20,7 +20,7 @@ #include "Post_Compo.xpm" /***********************************************/ -void WinEDA_PcbFrame::ReCreateMenuBar(void) +void WinEDA_PcbFrame::ReCreateMenuBar() /***********************************************/ /* Cree ou reinitialise le menu du haut d'ecran diff --git a/pcbnew/pcbpiste.cpp b/pcbnew/pcbpiste.cpp index 999df09726..af995e980e 100644 --- a/pcbnew/pcbpiste.cpp +++ b/pcbnew/pcbpiste.cpp @@ -39,7 +39,7 @@ public: // Constructor and destructor WinEDA_SwapLayerFrame(WinEDA_BasePcbFrame *parent); - ~WinEDA_SwapLayerFrame(void) {}; + ~WinEDA_SwapLayerFrame() {}; private: void Sel_Layer(wxCommandEvent& event); diff --git a/pcbnew/plotgerb.cpp b/pcbnew/plotgerb.cpp index d0842de4cc..007bad0f55 100644 --- a/pcbnew/plotgerb.cpp +++ b/pcbnew/plotgerb.cpp @@ -27,7 +27,7 @@ static bool ShowDcodeError = TRUE; /* Routines Locales */ static void Init_Trace_GERBER(WinEDA_BasePcbFrame * frame, FILE * gerbfile); -static void Init_ApertureList(void); +static void Init_ApertureList(); static void Fin_Trace_GERBER(WinEDA_BasePcbFrame * frame, FILE * gerbfile); static void Plot_1_CIRCLE_pad_GERBER(wxPoint pos,int diametre) ; static void trace_1_pastille_OVALE_GERBER(wxPoint pos, wxSize size,int orient); @@ -726,7 +726,7 @@ char Line[1024]; /***********************************/ -static void Init_ApertureList(void) +static void Init_ApertureList() /***********************************/ /* Init the memory to handle the aperture list: the member .m_Type is used by get_D_code() to handle the end of list: diff --git a/pcbnew/protos.h b/pcbnew/protos.h index 6824f5e311..4b993a68a6 100644 --- a/pcbnew/protos.h +++ b/pcbnew/protos.h @@ -382,7 +382,7 @@ void DeleteStructList( BOARD_ITEM* Struct ); /***************/ /* AUTOPLACE.CPP */ /***************/ -int Calcule_Encadrement_EdgeBoard(void); +int Calcule_Encadrement_EdgeBoard(); /***************/ /* AUTOROUT.CPP */ diff --git a/pcbnew/queue.cpp b/pcbnew/queue.cpp index 479f2637f6..26635a3757 100644 --- a/pcbnew/queue.cpp +++ b/pcbnew/queue.cpp @@ -36,7 +36,7 @@ void ReSetQueue( int, int, int, int, int, int, int ); /************************/ -void FreeQueue(void) +void FreeQueue() /************************/ /* Free the memory used for storing all the queue */ { @@ -49,11 +49,11 @@ struct PcbQueue *p; } } /************************/ - /* void InitQueue(void) */ + /* void InitQueue() */ /************************/ /* initialize the search queue */ -void InitQueue(void) +void InitQueue() { struct PcbQueue *p; diff --git a/pcbnew/reglage.cpp b/pcbnew/reglage.cpp index 8885cb3905..121ec8b158 100644 --- a/pcbnew/reglage.cpp +++ b/pcbnew/reglage.cpp @@ -47,14 +47,14 @@ public: public: // Constructor and destructor WinEDA_ConfigFrame(WinEDA_PcbFrame *parent,const wxPoint& pos); - ~WinEDA_ConfigFrame(void) {}; + ~WinEDA_ConfigFrame() {}; private: void OnCloseWindow(wxCloseEvent & event); void SaveCfg(wxCommandEvent& event); void LibDelFct(wxCommandEvent& event); void LibInsertFct(wxCommandEvent& event); - void SetNewOptions(void); + void SetNewOptions(); DECLARE_EVENT_TABLE() @@ -194,7 +194,7 @@ void WinEDA_ConfigFrame::OnCloseWindow(wxCloseEvent & event) } /********************************************/ -void WinEDA_ConfigFrame::SetNewOptions(void) +void WinEDA_ConfigFrame::SetNewOptions() /********************************************/ { g_UserLibDirBuffer = m_TextLibDir->GetData(); diff --git a/pcbnew/solve.cpp b/pcbnew/solve.cpp index b870be490e..ffb4fd34aa 100644 --- a/pcbnew/solve.cpp +++ b/pcbnew/solve.cpp @@ -1030,7 +1030,7 @@ static void OrCell_Trace( BOARD* pcb, int col, int row, /*******************************************/ -/* static void Place_Piste_en_Buffer(void) */ +/* static void Place_Piste_en_Buffer() */ /*******************************************/ /* Insere la nouvelle piste creee dans la liste standard des pistes. diff --git a/pcbnew/work.cpp b/pcbnew/work.cpp index d46efed673..b3650726f1 100644 --- a/pcbnew/work.cpp +++ b/pcbnew/work.cpp @@ -36,19 +36,19 @@ static CWORK *Current = NULL; /* Routines definies ici : */ -void InitWork(void); -void ReInitWork(void); +void InitWork(); +void ReInitWork(); int SetWork( int, int, int, int, int, CHEVELU *, int ); void GetWork( int *, int *, int *, int *, int *, CHEVELU ** ); void SortWork(); /************************/ - /* void InitWork (void) */ + /* void InitWork () */ /************************/ /* initialize the work list */ -void InitWork(void) +void InitWork() { CWORK *ptr; @@ -61,11 +61,11 @@ CWORK *ptr; /*************************/ - /* void ReInitWork(void) */ + /* void ReInitWork() */ /*************************/ /* initialize the work list */ -void ReInitWork(void) +void ReInitWork() { Current = Head; } @@ -136,11 +136,11 @@ void GetWork (int *r1,int *c1,int *n_c,int *r2,int *c2,CHEVELU** pt_ch ) /***********************/ - /* void SortWork(void) */ + /* void SortWork() */ /***********************/ /* order the work items; shortest (low cost) first */ -void SortWork(void) +void SortWork() { CWORK *p; CWORK *q0; /* put PRIORITY CONNECTs in q0 */ diff --git a/share/dialog_print.h b/share/dialog_print.h index 720f15ea12..75bb65685e 100644 --- a/share/dialog_print.h +++ b/share/dialog_print.h @@ -117,16 +117,16 @@ public: /// Should we show tooltips? static bool ShowToolTips(); - void OnClosePrintDialog(void); + void OnClosePrintDialog(); void OnPrintSetup(wxCommandEvent& event); void OnPrintPreview(wxCommandEvent& event); void EDA_PrintPage(wxCommandEvent& event); void SetColorOrBlack(wxCommandEvent& event); void SetScale(wxCommandEvent& event); - int SetLayerMaskFromListSelection(void); - wxString BuildPrintTitle(void); - void SetOthersDatas(void); - void SetPenWidth(void); + int SetLayerMaskFromListSelection(); + wxString BuildPrintTitle(); + void SetOthersDatas(); + void SetPenWidth(); ////@begin WinEDA_PrintFrame member variables diff --git a/share/gr_basic.cpp b/share/gr_basic.cpp index 6e09b306c1..6e97336b0f 100644 --- a/share/gr_basic.cpp +++ b/share/gr_basic.cpp @@ -1365,7 +1365,7 @@ long w = 0, h = 0; } /********************************/ - /* void GRReseTextFgColor(void) */ + /* void GRReseTextFgColor() */ /********************************/ /* Mise a la couleur par defaut des textes a afficher */ diff --git a/share/setpage.cpp b/share/setpage.cpp index 8b8e6cec1e..696e42be23 100644 --- a/share/setpage.cpp +++ b/share/setpage.cpp @@ -468,7 +468,7 @@ wxString msg; /*******************************************************/ -void WinEDA_SetPageFrame::SearchPageSizeSelection(void) +void WinEDA_SetPageFrame::SearchPageSizeSelection() /*******************************************************/ /* Search the correct index to activate the radiobox list size selection according to the current page size diff --git a/share/setpage.h b/share/setpage.h index a800a328ef..438a5e725c 100644 --- a/share/setpage.h +++ b/share/setpage.h @@ -115,7 +115,7 @@ public: /// Should we show tooltips? static bool ShowToolTips(); - void SearchPageSizeSelection(void); + void SearchPageSizeSelection(); void SavePageSettings(wxCommandEvent& event); void ReturnSizeSelected(wxCommandEvent& event); diff --git a/share/svg_print.cpp b/share/svg_print.cpp index f55b0be1dd..3c313da161 100644 --- a/share/svg_print.cpp +++ b/share/svg_print.cpp @@ -282,7 +282,7 @@ wxIcon WinEDA_PrintSVGFrame::GetIconResource( const wxString& name ) /******************************************************/ -wxString WinEDA_PrintSVGFrame::ReturnFullFileName(void) +wxString WinEDA_PrintSVGFrame::ReturnFullFileName() /******************************************************/ { wxString name, ext; @@ -294,7 +294,7 @@ wxString name, ext; /********************************************/ -void WinEDA_PrintSVGFrame::SetPenWidth(void) +void WinEDA_PrintSVGFrame::SetPenWidth() /********************************************/ { s_SVGPenMinWidth = m_DialogPenWidth->GetValue(); diff --git a/share/svg_print.h b/share/svg_print.h index c79dc969b0..01a18533b4 100644 --- a/share/svg_print.h +++ b/share/svg_print.h @@ -117,7 +117,7 @@ public: void PrintSVGDoc(wxCommandEvent& event); bool DrawPage(const wxString & FullFileName); - wxString ReturnFullFileName(void); + wxString ReturnFullFileName(); ////@begin WinEDA_PrintSVGFrame member variables wxBoxSizer* m_DialogPenWidthSizer; diff --git a/share/wxprint.cpp b/share/wxprint.cpp index e31e2f3963..c38332245b 100644 --- a/share/wxprint.cpp +++ b/share/wxprint.cpp @@ -115,7 +115,7 @@ public: bool OnBeginDocument(int startPage, int endPage); void GetPageInfo(int *minPage, int *maxPage, int *selPageFrom, int *selPageTo); - void DrawPage(void); + void DrawPage(); }; /*******************************************************/ @@ -160,7 +160,7 @@ bool PrinterError = FALSE; /*******************************************/ -void WinEDA_PrintFrame::SetOthersDatas(void) +void WinEDA_PrintFrame::SetOthersDatas() /*******************************************/ { #ifndef PCBNEW @@ -216,7 +216,7 @@ void WinEDA_PrintFrame::SetOthersDatas(void) } /**********************************************************/ -int WinEDA_PrintFrame::SetLayerMaskFromListSelection(void) +int WinEDA_PrintFrame::SetLayerMaskFromListSelection() /**********************************************************/ { int page_count; @@ -246,7 +246,7 @@ void WinEDA_PrintFrame::SetColorOrBlack(wxCommandEvent& event) } /****************************************************/ -void WinEDA_PrintFrame::OnClosePrintDialog(void) +void WinEDA_PrintFrame::OnClosePrintDialog() /****************************************************/ /* called when WinEDA_PrintFrame is closed */ @@ -276,7 +276,7 @@ void WinEDA_PrintFrame::OnClosePrintDialog(void) /************************************************/ -wxString WinEDA_PrintFrame::BuildPrintTitle(void) +wxString WinEDA_PrintFrame::BuildPrintTitle() /************************************************/ /* return a valid filename to create a print file */ @@ -306,7 +306,7 @@ void WinEDA_PrintFrame::SetScale(wxCommandEvent& event) } /****************************************/ -void WinEDA_PrintFrame::SetPenWidth(void) +void WinEDA_PrintFrame::SetPenWidth() /****************************************/ /* Get the new pen width value, and verify min et max value NOTE: s_PrintPenMinWidth is in internal units @@ -559,7 +559,7 @@ bool EDA_Printout::OnBeginDocument(int startPage, int endPage) } /********************************/ -void EDA_Printout::DrawPage(void) +void EDA_Printout::DrawPage() /********************************/ /* This is the real print function: print the active screen diff --git a/todo.txt b/todo.txt index 9a20a455d7..6a2885abad 100644 --- a/todo.txt +++ b/todo.txt @@ -2,7 +2,21 @@ Here are some source code maintenance tasks that need to be done, and maybe some folks will see these items and volunteer to do them. -*** @todo: grep for @todo and finish off those tasks. + +*** improved xpm handling +We should: +1) make a library out of ALL the xpm files, and +2) develop a simple header file which declares ALL of them using conventional C/C++: + extern char * somename2_xpm[]; + extern char * somename3_xpm[]; + : + : +This way the linker can bundle in the xpms that it has seen referenced. I don't +think seeing the extern declaration is cause to do this, it must actually be +referenced. I think this would be an easier way to manage xpms. + + +*** @todo: grep for @todo and finish off those tasks, scattered throughout the source. *** make the ADD_MENUITEM macros in include/macros.h be static inline functions instead @@ -30,5 +44,7 @@ compiler can help with this too. *** Translate comments that are in French to English so there can be a broader understanding by new developers. + *** Implement the graying in/out of "Edit/Undo", "Edit/Redo" menu items, when Undo/Redo stack is empty/filled. +