Loading AUTHORS.txt +1 −1 Original line number Original line Diff line number Diff line Loading @@ -41,4 +41,4 @@ Remy Halvick, David Briscoe, Dominique Laigle, Paul Burke == Programm credits for icons and others == Programm credits for icons and others Icons by Iigo Zuluagaz <inigo_zuluaga@yahoo.es> Icons by Iigo Zuluagaz <inigo_zuluaga@yahoo.es> 3D modules by Renie Marquet <reniemarquet@uol.com.br> 3D modules by Renie Marquet <reniemarquet@uol.com.br> 3D modules by Cyril Frausti <cyril.frausti@gmail.com> 3D modules by Christophe Boschat <nox454@hotmail.fr> common/about_kicad.cpp +1 −1 Original line number Original line Diff line number Diff line Loading @@ -140,5 +140,5 @@ void InitKiCadAbout( wxAboutDialogInfo& info ) /* Add programm credits for icons */ /* Add programm credits for icons */ info.AddArtist( wxT( "Icons by Iñigo Zuluagaz <inigo_zuluaga@yahoo.es>" ) ); info.AddArtist( wxT( "Icons by Iñigo Zuluagaz <inigo_zuluaga@yahoo.es>" ) ); info.AddArtist( SetMsg( wxT( "3D modules by Renie Marquet <reniemarquet@uol.com.br>" ) ) ); info.AddArtist( SetMsg( wxT( "3D modules by Renie Marquet <reniemarquet@uol.com.br>" ) ) ); info.AddArtist( SetMsg( wxT( "3D modules by Cyril Frausti <cyril.frausti@gmail.com>" ) ) ); info.AddArtist( SetMsg( wxT( "3D modules by Christophe Boschat <nox454@hotmail.fr>" ) ) ); } } common/base_screen.cpp +16 −8 Original line number Original line Diff line number Diff line Loading @@ -53,7 +53,8 @@ BASE_SCREEN::~BASE_SCREEN() /*******************************/ /*******************************/ void BASE_SCREEN::InitDatas() void BASE_SCREEN::InitDatas() /*******************************/ /*******************************/ { { if( m_Center ) if( m_Center ) Loading @@ -79,19 +80,23 @@ void BASE_SCREEN::InitDatas() m_FlagSave = 1; // Used in auto save: set when an auto save is made m_FlagSave = 1; // Used in auto save: set when an auto save is made } } /* /** * Get screen units scalar. * Get screen units scalar. * * * Default implimentation returns scalar used for schematic screen. The * Default implimentation returns scalar used for schematic screen. The * internal units used by the schematic screen is 1 mil (0.001"). Override * internal units used by the schematic screen is 1 mil (0.001"). Override * this in derived classes that require internal units other than 1 mil. * this in derived classes that require internal units other than 1 mil. */ */ int BASE_SCREEN::GetInternalUnits( void ) int BASE_SCREEN::GetInternalUnits( void ) { { return EESCHEMA_INTERNAL_UNIT; return EESCHEMA_INTERNAL_UNIT; } } wxSize BASE_SCREEN::ReturnPageSize( void ) /************************************/ wxSize BASE_SCREEN::ReturnPageSize( void ) /************************************/ { { int internal_units = GetInternalUnits(); int internal_units = GetInternalUnits(); Loading @@ -99,13 +104,16 @@ wxSize BASE_SCREEN::ReturnPageSize( void ) ( m_CurrentSheetDesc->m_Size.y * internal_units ) / 1000 ); ( m_CurrentSheetDesc->m_Size.y * internal_units ) / 1000 ); } } /******************************************************************/ wxPoint BASE_SCREEN::CursorRealPosition( const wxPoint& ScreenPos ) /** /******************************************************************/ * Function CursorRealPosition /** Function CursorRealPosition * @return the position in user units of location ScreenPos * @return the position in user units of location ScreenPos * @param ScreenPos = the screen (in pixel) position co convert * @param ScreenPos = the screen (in pixel) position co convert */ */ /******************************************************************/ wxPoint BASE_SCREEN::CursorRealPosition( const wxPoint& ScreenPos ) /******************************************************************/ { { wxPoint curpos = ScreenPos; wxPoint curpos = ScreenPos; Unscale( curpos ); Unscale( curpos ); Loading common/basicframe.cpp +72 −37 Original line number Original line Diff line number Diff line /******************************************************************/ /** /* basicframe.cpp - fonctions des classes du type WinEDA_BasicFrame */ * WinEDA_BasicFrame Class Functions /******************************************************************/ * @file basicframe.cpp */ #ifdef __GNUG__ #ifdef __GNUG__ # pragma implementation # pragma implementation #endif #endif /* wxWidgets about dialog */ #include <wx/aboutdlg.h> #include <wx/aboutdlg.h> #include <wx/fontdlg.h> #include "wx/statline.h" #include "wx/statline.h" #include "wx/generic/aboutdlgg.h" #include "wx/generic/aboutdlgg.h" #include <wx/fontdlg.h> #include "fctsys.h" #include "fctsys.h" #include "appl_wxstruct.h" #include "appl_wxstruct.h" Loading @@ -22,15 +23,18 @@ #include "wxstruct.h" #include "wxstruct.h" /*******************************************************/ /* /* Constructeur de WinEDA_BasicFrame: la fenetre generale */ * Class constructor for WinEDA_BasicFrame general options /*******************************************************/ */ /**********************************************************/ WinEDA_BasicFrame::WinEDA_BasicFrame( wxWindow* father, int idtype, WinEDA_BasicFrame::WinEDA_BasicFrame( wxWindow* father, int idtype, const wxString& title, const wxString& title, const wxPoint& pos, const wxSize& size, const wxPoint& pos, const wxSize& size, long style ) : long style ) : wxFrame( father, -1, title, pos, size, style ) wxFrame( father, -1, title, pos, size, style ) /**********************************************************/ { { wxSize minsize; wxSize minsize; Loading @@ -56,6 +60,9 @@ WinEDA_BasicFrame::WinEDA_BasicFrame( wxWindow* father, int idtype, } } /* * */ /******************************************/ /******************************************/ WinEDA_BasicFrame::~WinEDA_BasicFrame() WinEDA_BasicFrame::~WinEDA_BasicFrame() /******************************************/ /******************************************/ Loading @@ -66,18 +73,22 @@ WinEDA_BasicFrame::~WinEDA_BasicFrame() } } /********************************************/ /* void WinEDA_BasicFrame::ReCreateMenuBar() * Virtual function /********************************************/ */ /***********************************/ // Virtual function void WinEDA_BasicFrame::ReCreateMenuBar() /***********************************/ { { } } /*********************************************/ /*******************************/ void WinEDA_BasicFrame::GetSettings() void /*********************************************/ WinEDA_BasicFrame::GetSettings() /*******************************/ { { wxString text; wxString text; int Ypos_min; int Ypos_min; Loading Loading @@ -110,9 +121,10 @@ void WinEDA_BasicFrame::GetSettings() } } /*****************************************/ /********************************/ void WinEDA_BasicFrame::SaveSettings() void /*****************************************/ WinEDA_BasicFrame::SaveSettings() /********************************/ { { wxString text; wxString text; wxConfig* config; wxConfig* config; Loading @@ -137,19 +149,22 @@ void WinEDA_BasicFrame::SaveSettings() /******************************************************/ /******************************************************/ void WinEDA_BasicFrame::PrintMsg( const wxString& text ) void WinEDA_BasicFrame::PrintMsg( const wxString& text ) /******************************************************/ /******************************************************/ { { SetStatusText( text ); SetStatusText( text ); } } /* * Display a bargraph (0 to 50 point length) for a PerCent value from 0 to 100 */ /*************************************************************************/ /*************************************************************************/ void WinEDA_BasicFrame::DisplayActivity( int PerCent, const wxString& Text ) void WinEDA_BasicFrame::DisplayActivity( int PerCent, const wxString& Text ) /*************************************************************************/ /*************************************************************************/ /* Display a bargraph (0 to 50 point length) for a PerCent value from 0 to 100 */ { { wxString Line; wxString Line; Loading @@ -165,23 +180,26 @@ void WinEDA_BasicFrame::DisplayActivity( int PerCent, const wxString& Text ) } } /* * Met a jour la liste des anciens projets */ /*******************************************************************/ /*******************************************************************/ void WinEDA_BasicFrame::SetLastProject( const wxString& FullFileName ) void WinEDA_BasicFrame::SetLastProject( const wxString& FullFileName ) /*******************************************************************/ /*******************************************************************/ /* Met a jour la liste des anciens projets */ { { wxGetApp().m_fileHistory.AddFileToHistory( FullFileName ); wxGetApp().m_fileHistory.AddFileToHistory( FullFileName ); ReCreateMenuBar(); ReCreateMenuBar(); } } /** /* * Fetch the file name from the file history list. * Fetch the file name from the file history list. */ */ /*********************************************************************/ wxString WinEDA_BasicFrame::GetFileFromHistory( int cmdId, wxString WinEDA_BasicFrame::GetFileFromHistory( int cmdId, const wxString& type ) const wxString& type ) /*********************************************************************/ { { wxString fn, msg; wxString fn, msg; size_t i; size_t i; Loading Loading @@ -209,12 +227,18 @@ wxString WinEDA_BasicFrame::GetFileFromHistory( int cmdId, } } /* * */ /**************************************************************/ /**************************************************************/ void WinEDA_BasicFrame::GetKicadHelp( wxCommandEvent& event ) void WinEDA_BasicFrame::GetKicadHelp( wxCommandEvent& event ) /**************************************************************/ /**************************************************************/ { { wxString msg; wxString msg; #if defined ONLINE_HELP_FILES_FORMAT_IS_HTML #if defined ONLINE_HELP_FILES_FORMAT_IS_HTML if( wxGetApp().m_HtmlCtrl == NULL ) if( wxGetApp().m_HtmlCtrl == NULL ) { { wxGetApp().InitOnLineHelp(); wxGetApp().InitOnLineHelp(); Loading @@ -231,6 +255,7 @@ void WinEDA_BasicFrame::GetKicadHelp( wxCommandEvent& event ) msg.Printf( _( "Help file %s not found" ), wxGetApp().m_HelpFileName.GetData() ); msg.Printf( _( "Help file %s not found" ), wxGetApp().m_HelpFileName.GetData() ); DisplayError( this, msg ); DisplayError( this, msg ); } } #elif defined ONLINE_HELP_FILES_FORMAT_IS_PDF #elif defined ONLINE_HELP_FILES_FORMAT_IS_PDF // wxString fullfilename = FindKicadHelpPath() + wxGetApp().m_HelpFileName; // wxString fullfilename = FindKicadHelpPath() + wxGetApp().m_HelpFileName; // if ( wxFileExists(fullfilename) ) // if ( wxFileExists(fullfilename) ) Loading @@ -256,8 +281,13 @@ void WinEDA_BasicFrame::GetKicadHelp( wxCommandEvent& event ) #endif #endif } } /* * */ /***********************************************************************/ /***********************************************************************/ void WinEDA_BasicFrame::GetKicadAbout( wxCommandEvent& WXUNUSED(event) ) void WinEDA_BasicFrame::GetKicadAbout( wxCommandEvent& WXUNUSED(event) ) /***********************************************************************/ /***********************************************************************/ { { wxAboutDialogInfo info; wxAboutDialogInfo info; Loading @@ -266,8 +296,12 @@ void WinEDA_BasicFrame::GetKicadAbout( wxCommandEvent& WXUNUSED(event) ) } } /* * */ /********************************************************************/ /********************************************************************/ void WinEDA_BasicFrame::ProcessFontPreferences( int id ) void WinEDA_BasicFrame::ProcessFontPreferences( int id ) /********************************************************************/ /********************************************************************/ { { wxFont font; wxFont font; Loading Loading @@ -308,3 +342,4 @@ void WinEDA_BasicFrame::ProcessFontPreferences( int id ) break; break; } } } } common/common.cpp +188 −116 Original line number Original line Diff line number Diff line /**********************************************************/ /**********************************************************/ /* Routines d'affichage de parametres et caracteristiques */ /* Routines d'affichage de parametres et caracteristiques */ /**********************************************************/ /**********************************************************/ /* Fichier common.cpp */ #include "fctsys.h" #include "fctsys.h" #include "gr_basic.h" #include "gr_basic.h" #include "trigo.h" #include "trigo.h" Loading @@ -15,31 +12,30 @@ #include "confirm.h" #include "confirm.h" #include <wx/process.h> #include <wx/process.h> /*****************************/ wxString GetBuildVersion() /*****************************/ /* Return the build date /* * Return the build date */ */ /****************/ wxString GetBuildVersion() /****************/ { { return g_BuildVersion; return g_BuildVersion; } } /*********************************************/ /* /* Return custom build date for about dialog */ * Return custom build date for about dialog /*********************************************/ */ wxString GetAboutBuildVersion() wxString GetAboutBuildVersion() /*********************************************/ /*********************************************/ { { return g_BuildAboutVersion; return g_BuildAboutVersion; } } /********************************/ void SetLocaleTo_C_standard( void ) /********************************/ /** function SetLocaleTo_C_standard /** function SetLocaleTo_C_standard * because kicad is internationalized, switch internatization to "C" standard * because kicad is internationalized, switch internatization to "C" standard * i.e. uses the . (dot) as separator in print/read float numbers * i.e. uses the . (dot) as separator in print/read float numbers Loading @@ -50,15 +46,15 @@ void SetLocaleTo_C_standard( void ) * This is wrapper to the C setlocale( LC_NUMERIC, "C" ) function, * This is wrapper to the C setlocale( LC_NUMERIC, "C" ) function, * but could make more easier an optional use of locale in kicad * but could make more easier an optional use of locale in kicad */ */ /********************************/ void SetLocaleTo_C_standard( void ) /********************************/ { { setlocale( LC_NUMERIC, "C" ); // Switch the locale to standard C setlocale( LC_NUMERIC, "C" ); // Switch the locale to standard C } } /********************************/ void SetLocaleTo_Default( void ) /********************************/ /** function SetLocaleTo_Default /** function SetLocaleTo_Default * because kicad is internationalized, switch internatization to default * because kicad is internationalized, switch internatization to default * to use the default separator in print/read float numbers * to use the default separator in print/read float numbers Loading @@ -68,13 +64,18 @@ void SetLocaleTo_Default( void ) * This is wrapper to the C setlocale( LC_NUMERIC, "" ) function, * This is wrapper to the C setlocale( LC_NUMERIC, "" ) function, * but could make more easier an optional use of locale in kicad * but could make more easier an optional use of locale in kicad */ */ /********************************/ void SetLocaleTo_Default( void ) /********************************/ { { setlocale( LC_NUMERIC, "" ); // revert to the current locale setlocale( LC_NUMERIC, "" ); // revert to the current locale } } /********************************************************************/ /********************************************************************/ bool EnsureTextCtrlWidth( wxTextCtrl* aCtrl, const wxString* aString ) bool EnsureTextCtrlWidth(wxTextCtrl* aCtrl, const wxString* aString ) /********************************************************************/ /********************************************************************/ { { wxWindow* window = aCtrl->GetParent(); wxWindow* window = aCtrl->GetParent(); Loading Loading @@ -110,7 +111,9 @@ bool EnsureTextCtrlWidth( wxTextCtrl* aCtrl, const wxString* aString ) /*********************************************************************************************/ /*********************************************************************************************/ Ki_PageDescr::Ki_PageDescr( const wxSize& size, const wxPoint& offset, const wxString& name ) Ki_PageDescr::Ki_PageDescr(const wxSize& size, const wxPoint& offset, const wxString& name ) /*********************************************************************************************/ /*********************************************************************************************/ { { // All sizes are in 1/1000 inch // All sizes are in 1/1000 inch Loading @@ -131,7 +134,8 @@ Ki_PageDescr::Ki_PageDescr( const wxSize& size, const wxPoint& offset, const wxS /************************************/ /************************************/ wxString ReturnUnitSymbol( int Units ) wxString ReturnUnitSymbol( int Units ) /************************************/ /************************************/ { { wxString label; wxString label; Loading @@ -154,13 +158,15 @@ wxString ReturnUnitSymbol( int Units ) } } /**************************************************/ /* void AddUnitSymbol( wxStaticText& Stext, int Units ) * Add string " (mm):" or " ("):" to the static text Stext. /**************************************************/ /* Add string " (mm):" or " ("):" to the static text Stext. * Used in dialog boxes for entering values depending on selected units * Used in dialog boxes for entering values depending on selected units */ */ /**************************************************/ void AddUnitSymbol(wxStaticText& Stext, int Units ) /**************************************************/ { { wxString msg = Stext.GetLabel() + ReturnUnitSymbol( Units ); wxString msg = Stext.GetLabel() + ReturnUnitSymbol( Units ); Loading @@ -168,13 +174,16 @@ void AddUnitSymbol( wxStaticText& Stext, int Units ) } } /****************************************************************************/ /* void PutValueInLocalUnits( wxTextCtrl& TextCtr, int Value, int Internal_Unit ) * Convert the number Value in a string according to the internal units /****************************************************************************/ /* 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 * and the selected unit (g_UnitMetric) and put it in the wxTextCtrl TextCtrl */ */ /******************************************/ void PutValueInLocalUnits( wxTextCtrl& TextCtr, int Value, int Internal_Unit ) /*****************************************/ { { wxString msg = ReturnStringFromValue( g_UnitMetric, Value, Internal_Unit ); wxString msg = ReturnStringFromValue( g_UnitMetric, Value, Internal_Unit ); Loading @@ -182,13 +191,15 @@ void PutValueInLocalUnits( wxTextCtrl& TextCtr, int Value, int Internal_Unit ) } } /*******************************************************************/ /* int ReturnValueFromTextCtrl( const wxTextCtrl& TextCtr, int Internal_Unit ) * Convert the Value in the wxTextCtrl TextCtrl in an integer, /********************************************************************/ /* Convert the Value in the wxTextCtrl TextCtrl in an integer, * according to the internal units and the selected unit (g_UnitMetric) * according to the internal units and the selected unit (g_UnitMetric) */ */ /***************************************************/ int ReturnValueFromTextCtrl( const wxTextCtrl& TextCtr, int Internal_Unit ) /***************************************************/ { { int value; int value; wxString msg = TextCtr.GetValue(); wxString msg = TextCtr.GetValue(); Loading @@ -199,10 +210,6 @@ int ReturnValueFromTextCtrl( const wxTextCtrl& TextCtr, int Internal_Unit ) } } /**************************************************************************************************/ wxString ReturnStringFromValue( int aUnits, int aValue, int aInternal_Unit, bool aAdd_unit_symbol ) /**************************************************************************************************/ /** Function ReturnStringFromValue /** Function ReturnStringFromValue * Return the string from Value, according to units (inch, mm ...) for display, * Return the string from Value, according to units (inch, mm ...) for display, * and the initial unit for value * and the initial unit for value Loading @@ -212,6 +219,13 @@ wxString ReturnStringFromValue( int aUnits, int aValue, int aInternal_Unit, boo * @param aAdd_unit_symbol = true to add symbol unit to the string value * @param aAdd_unit_symbol = true to add symbol unit to the string value * @return a wxString what contains value and optionnaly the sumbol unit (like 2.000 mm) * @return a wxString what contains value and optionnaly the sumbol unit (like 2.000 mm) */ */ /*******************************************/ wxString ReturnStringFromValue(int aUnits, int aValue, int aInternal_Unit, bool aAdd_unit_symbol) /*******************************************/ { { wxString StringValue; wxString StringValue; double value_to_print; double value_to_print; Loading Loading @@ -244,16 +258,19 @@ wxString ReturnStringFromValue( int aUnits, int aValue, int aInternal_Unit, boo } } /****************************************************************************/ /* int ReturnValueFromString( int Units, const wxString& TextValue, int Internal_Unit ) * Return the string from Value, according to units (inch, mm ...) for display, /****************************************************************************/ /* Return the string from Value, according to units (inch, mm ...) for display, * and the initial unit for value * and the initial unit for value * Unit = display units (INCH, MM ..) * Unit = display units (INCH, MM ..) * Value = text * Value = text * Internal_Unit = units per inch for computed value * Internal_Unit = units per inch for computed value */ */ /****************************************************************************/ int ReturnValueFromString( int Units, const wxString& TextValue, int Internal_Unit ) /****************************************************************************/ { { int Value; int Value; double dtmp = 0; double dtmp = 0; Loading @@ -268,12 +285,15 @@ int ReturnValueFromString( int Units, const wxString& TextValue, int Internal_Un } } /* * Convert in inch or mm the variable "val" given in internal units */ /******************************************************************/ /******************************************************************/ double To_User_Unit( bool is_metric, int val, int internal_unit_value ) double To_User_Unit( bool is_metric, int val, int internal_unit_value ) /******************************************************************/ /******************************************************************/ /* Convert in inch or mm the variable "val" given in internal units */ { { double value; double value; Loading @@ -286,12 +306,15 @@ 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 ) * Return in internal units the value "val" given in inch or mm /**********************************************************************/ /* Return in internal units the value "val" given in inch or mm */ */ /*****************************************/ int From_User_Unit( bool is_metric, double val, int internal_unit_value ) /*****************************************/ { { double value; double value; Loading @@ -304,12 +327,13 @@ int From_User_Unit( bool is_metric, double val, int internal_unit_value ) } } /**********************/ /* wxString GenDate() * Return the string date "day month year" like "23 jun 2005" /**********************/ /* Return the string date "day month year" like "23 jun 2005" */ */ /********/ wxString GenDate() /********/ { { static const wxString mois[12] = static const wxString mois[12] = { { Loading @@ -330,10 +354,13 @@ wxString GenDate() } } /* * My memory allocation */ /***********************************/ /***********************************/ void* MyMalloc( size_t nb_octets ) void* MyMalloc( size_t nb_octets ) /***********************************/ /***********************************/ /* My memory allocation */ { { void* pt_mem; void* pt_mem; Loading @@ -353,10 +380,6 @@ void* MyMalloc( size_t nb_octets ) } } /**************************************************************/ bool ProcessExecute( const wxString& aCommandLine, int aFlags ) /**************************************************************/ /** /** * Function ProcessExecute * Function ProcessExecute * runs a child process. * runs a child process. Loading @@ -364,6 +387,11 @@ bool ProcessExecute( const wxString& aCommandLine, int aFlags ) * @param aFlags The same args as allowed for wxExecute() * @param aFlags The same args as allowed for wxExecute() * @return bool - true if success, else false * @return bool - true if success, else false */ */ /********************************************/ bool ProcessExecute( const wxString& aCommandLine, int aFlags ) /********************************************/ { { #ifdef __WINDOWS__ #ifdef __WINDOWS__ int pid = wxExecute( aCommandLine ); int pid = wxExecute( aCommandLine ); Loading @@ -375,12 +403,13 @@ bool ProcessExecute( const wxString& aCommandLine, int aFlags ) } } /************************************/ /* void* MyZMalloc( size_t nb_octets ) * My memory allocation, memory space is cleared /************************************/ /* My memory allocation, memory space is cleared */ */ /*****************************/ void* MyZMalloc( size_t nb_octets ) /*****************************/ { { void* pt_mem = MyMalloc( nb_octets ); void* pt_mem = MyMalloc( nb_octets ); Loading @@ -391,7 +420,8 @@ void* MyZMalloc( size_t nb_octets ) /*******************************/ /*******************************/ void MyFree( void* pt_mem ) void MyFree( void* pt_mem ) /*******************************/ /*******************************/ { { if( pt_mem ) if( pt_mem ) Loading @@ -399,14 +429,16 @@ void MyFree( void* pt_mem ) } } /**************************************************************/ /* wxString ReturnPcbLayerName( int layer_number, bool omitSpacePadding ) * Return the name of the layer number "layer_number". /**************************************************************/ /* Return the name of the layer number "layer_number". * if omitSpacePadding == TRUE, the name can be used for a file name * if omitSpacePadding == TRUE, the name can be used for a file name * (no spaces, replaced by _) * (no spaces, replaced by _) */ */ /**************************************************************/ wxString ReturnPcbLayerName( int layer_number, bool omitSpacePadding ) /**************************************************************/ { { const unsigned LAYER_LIMIT = 29; const unsigned LAYER_LIMIT = 29; Loading Loading @@ -455,11 +487,23 @@ EVT_CLOSE( WinEDA_TextFrame::OnClose ) END_EVENT_TABLE() END_EVENT_TABLE() /***************************************************************************/ /***************************************************************************/ WinEDA_TextFrame::WinEDA_TextFrame( wxWindow* parent, const wxString& title ) : WinEDA_TextFrame::WinEDA_TextFrame( wxWindow* parent, wxDialog( parent, -1, title, wxPoint( -1, -1 ), wxSize( 250, 350 ), const wxString& title ) : wxDEFAULT_DIALOG_STYLE | wxFRAME_FLOAT_ON_PARENT | MAYBE_RESIZE_BORDER ) wxDialog( parent, -1, title, wxPoint( -1, -1 ), wxSize( 250, 350 ), wxDEFAULT_DIALOG_STYLE | wxFRAME_FLOAT_ON_PARENT | MAYBE_RESIZE_BORDER ) /***************************************************************************/ /***************************************************************************/ { { /* * TODO background and foreground colors of WinEDA_TextFrame should be * controllable / settable with project settings or config file and not * hardcoded in binairy ! */ wxSize size; wxSize size; m_Parent = parent; m_Parent = parent; Loading @@ -467,18 +511,26 @@ WinEDA_TextFrame::WinEDA_TextFrame( wxWindow* parent, const wxString& title ) : CentreOnParent(); CentreOnParent(); size = GetClientSize(); size = GetClientSize(); m_List = new wxListBox( this, ID_TEXTBOX_LIST, m_List = new wxListBox( this, wxPoint( 0, 0 ), size, ID_TEXTBOX_LIST, wxPoint( 0, 0 ), size, 0, NULL, 0, NULL, wxLB_ALWAYS_SB | wxLB_SINGLE ); wxLB_ALWAYS_SB | wxLB_SINGLE ); m_List->SetBackgroundColour( wxColour( 200, 255, 255 ) ); /* The color of the text in the wxListBox (black) */ m_List->SetBackgroundColour( wxColour( 255, 255, 255 ) ); /* The foreground color of the wxListBox (white) */ m_List->SetForegroundColour( wxColour( 0, 0, 0 ) ); SetReturnCode( -1 ); SetReturnCode( -1 ); } } /***************************************************/ /***************************************************/ void WinEDA_TextFrame::Append( const wxString& text ) void WinEDA_TextFrame::Append( const wxString& text ) /***************************************************/ /***************************************************/ { { m_List->Append( text ); m_List->Append( text ); Loading @@ -486,7 +538,8 @@ void WinEDA_TextFrame::Append( const wxString& text ) /**********************************************************/ /**********************************************************/ void WinEDA_TextFrame::D_ClickOnList( wxCommandEvent& event ) void WinEDA_TextFrame::D_ClickOnList( wxCommandEvent& event ) /**********************************************************/ /**********************************************************/ { { int ii = m_List->GetSelection(); int ii = m_List->GetSelection(); Loading @@ -496,19 +549,15 @@ void WinEDA_TextFrame::D_ClickOnList( wxCommandEvent& event ) /*************************************************/ /*************************************************/ void WinEDA_TextFrame::OnClose( wxCloseEvent& event ) void WinEDA_TextFrame::OnClose( wxCloseEvent& event ) /*************************************************/ /*************************************************/ { { EndModal( -1 ); EndModal( -1 ); } } /*****************************************************************************/ /** 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. * Routine d'affichage d'un parametre. * pos_X = cadrage horizontal * pos_X = cadrage horizontal * si pos_X < 0 : la position horizontale est la derniere * si pos_X < 0 : la position horizontale est la derniere Loading @@ -519,18 +568,28 @@ void Affiche_1_Parametre( WinEDA_DrawFrame* frame, int pos_X, * si "", par d'affichage sur cette ligne * si "", par d'affichage sur cette ligne * color = couleur d'affichage * color = couleur d'affichage */ */ /*****************************************************************************/ void Affiche_1_Parametre( WinEDA_DrawFrame* frame, int pos_X, const wxString& texte_H, const wxString& texte_L, int color ) /*****************************************************************************/ { { frame->MsgPanel->Affiche_1_Parametre( pos_X, texte_H, texte_L, color ); frame->MsgPanel->Affiche_1_Parametre( pos_X, texte_H, texte_L, color ); } } /****************************************************************************/ void AfficheDoc( WinEDA_DrawFrame* frame, const wxString& Doc, const wxString& KeyW ) /****************************************************************************/ /* /* * Routine d'affichage de la documentation associee a un composant * Routine d'affichage de la documentation associee a un composant */ */ /****************************************************************************/ void AfficheDoc( WinEDA_DrawFrame* frame, const wxString& Doc, const wxString& KeyW ) /****************************************************************************/ { { wxString Line1( wxT( "Doc: " ) ), Line2( wxT( "KeyW: " ) ); wxString Line1( wxT( "Doc: " ) ), Line2( wxT( "KeyW: " ) ); Loading Loading @@ -564,17 +623,18 @@ int GetTimeStamp() } } /**************************************************************/ const wxString& valeur_param( int valeur, wxString& buf_texte ) /**************************************************************/ /** /** * @todo replace this obsolete funtion by ReturnStringFromValue * TODO replace this obsolete funtion by ReturnStringFromValue * Retourne pour affichage la valeur d'un parametre, selon type d'unites choisies * Retourne pour affichage la valeur d'un parametre, selon type d'unites choisies * entree : valeur en mils , buffer de texte * entree : valeur en mils , buffer de texte * retourne en buffer : texte : valeur exprimee en pouces ou millimetres * retourne en buffer : texte : valeur exprimee en pouces ou millimetres * suivie de " ou mm * suivie de " ou mm */ */ /*********************************************/ const wxString& valeur_param( int valeur, wxString& buf_texte ) /*********************************************/ { { if( g_UnitMetric ) if( g_UnitMetric ) { { Loading @@ -589,7 +649,14 @@ const wxString& valeur_param( int valeur, wxString& buf_texte ) } } wxString& operator <<( wxString& aString, const wxPoint& aPos ) /* * */ /**********************************/ wxString& operator <<( wxString& aString, const wxPoint& aPos ) /*********************************/ { { wxString temp; wxString temp; Loading @@ -601,11 +668,16 @@ wxString& operator <<( wxString& aString, const wxPoint& aPos ) } } #ifdef __MSVC__ // compilers that does not have the round function (posix) /* compilers that does not have the round function (posix) */ /* return the nearest rounded ( equivalent to the nearest integer value) #ifdef __MSVC__ /* * return the nearest rounded ( equivalent to the nearest integer value) * from aNumber * from aNumber */ */ double round( double aNumber ) /**********************/ double round( double aNumber ) /**********************/ { { return floor( aNumber + 0.5 ); return floor( aNumber + 0.5 ); } } Loading Loading
AUTHORS.txt +1 −1 Original line number Original line Diff line number Diff line Loading @@ -41,4 +41,4 @@ Remy Halvick, David Briscoe, Dominique Laigle, Paul Burke == Programm credits for icons and others == Programm credits for icons and others Icons by Iigo Zuluagaz <inigo_zuluaga@yahoo.es> Icons by Iigo Zuluagaz <inigo_zuluaga@yahoo.es> 3D modules by Renie Marquet <reniemarquet@uol.com.br> 3D modules by Renie Marquet <reniemarquet@uol.com.br> 3D modules by Cyril Frausti <cyril.frausti@gmail.com> 3D modules by Christophe Boschat <nox454@hotmail.fr>
common/about_kicad.cpp +1 −1 Original line number Original line Diff line number Diff line Loading @@ -140,5 +140,5 @@ void InitKiCadAbout( wxAboutDialogInfo& info ) /* Add programm credits for icons */ /* Add programm credits for icons */ info.AddArtist( wxT( "Icons by Iñigo Zuluagaz <inigo_zuluaga@yahoo.es>" ) ); info.AddArtist( wxT( "Icons by Iñigo Zuluagaz <inigo_zuluaga@yahoo.es>" ) ); info.AddArtist( SetMsg( wxT( "3D modules by Renie Marquet <reniemarquet@uol.com.br>" ) ) ); info.AddArtist( SetMsg( wxT( "3D modules by Renie Marquet <reniemarquet@uol.com.br>" ) ) ); info.AddArtist( SetMsg( wxT( "3D modules by Cyril Frausti <cyril.frausti@gmail.com>" ) ) ); info.AddArtist( SetMsg( wxT( "3D modules by Christophe Boschat <nox454@hotmail.fr>" ) ) ); } }
common/base_screen.cpp +16 −8 Original line number Original line Diff line number Diff line Loading @@ -53,7 +53,8 @@ BASE_SCREEN::~BASE_SCREEN() /*******************************/ /*******************************/ void BASE_SCREEN::InitDatas() void BASE_SCREEN::InitDatas() /*******************************/ /*******************************/ { { if( m_Center ) if( m_Center ) Loading @@ -79,19 +80,23 @@ void BASE_SCREEN::InitDatas() m_FlagSave = 1; // Used in auto save: set when an auto save is made m_FlagSave = 1; // Used in auto save: set when an auto save is made } } /* /** * Get screen units scalar. * Get screen units scalar. * * * Default implimentation returns scalar used for schematic screen. The * Default implimentation returns scalar used for schematic screen. The * internal units used by the schematic screen is 1 mil (0.001"). Override * internal units used by the schematic screen is 1 mil (0.001"). Override * this in derived classes that require internal units other than 1 mil. * this in derived classes that require internal units other than 1 mil. */ */ int BASE_SCREEN::GetInternalUnits( void ) int BASE_SCREEN::GetInternalUnits( void ) { { return EESCHEMA_INTERNAL_UNIT; return EESCHEMA_INTERNAL_UNIT; } } wxSize BASE_SCREEN::ReturnPageSize( void ) /************************************/ wxSize BASE_SCREEN::ReturnPageSize( void ) /************************************/ { { int internal_units = GetInternalUnits(); int internal_units = GetInternalUnits(); Loading @@ -99,13 +104,16 @@ wxSize BASE_SCREEN::ReturnPageSize( void ) ( m_CurrentSheetDesc->m_Size.y * internal_units ) / 1000 ); ( m_CurrentSheetDesc->m_Size.y * internal_units ) / 1000 ); } } /******************************************************************/ wxPoint BASE_SCREEN::CursorRealPosition( const wxPoint& ScreenPos ) /** /******************************************************************/ * Function CursorRealPosition /** Function CursorRealPosition * @return the position in user units of location ScreenPos * @return the position in user units of location ScreenPos * @param ScreenPos = the screen (in pixel) position co convert * @param ScreenPos = the screen (in pixel) position co convert */ */ /******************************************************************/ wxPoint BASE_SCREEN::CursorRealPosition( const wxPoint& ScreenPos ) /******************************************************************/ { { wxPoint curpos = ScreenPos; wxPoint curpos = ScreenPos; Unscale( curpos ); Unscale( curpos ); Loading
common/basicframe.cpp +72 −37 Original line number Original line Diff line number Diff line /******************************************************************/ /** /* basicframe.cpp - fonctions des classes du type WinEDA_BasicFrame */ * WinEDA_BasicFrame Class Functions /******************************************************************/ * @file basicframe.cpp */ #ifdef __GNUG__ #ifdef __GNUG__ # pragma implementation # pragma implementation #endif #endif /* wxWidgets about dialog */ #include <wx/aboutdlg.h> #include <wx/aboutdlg.h> #include <wx/fontdlg.h> #include "wx/statline.h" #include "wx/statline.h" #include "wx/generic/aboutdlgg.h" #include "wx/generic/aboutdlgg.h" #include <wx/fontdlg.h> #include "fctsys.h" #include "fctsys.h" #include "appl_wxstruct.h" #include "appl_wxstruct.h" Loading @@ -22,15 +23,18 @@ #include "wxstruct.h" #include "wxstruct.h" /*******************************************************/ /* /* Constructeur de WinEDA_BasicFrame: la fenetre generale */ * Class constructor for WinEDA_BasicFrame general options /*******************************************************/ */ /**********************************************************/ WinEDA_BasicFrame::WinEDA_BasicFrame( wxWindow* father, int idtype, WinEDA_BasicFrame::WinEDA_BasicFrame( wxWindow* father, int idtype, const wxString& title, const wxString& title, const wxPoint& pos, const wxSize& size, const wxPoint& pos, const wxSize& size, long style ) : long style ) : wxFrame( father, -1, title, pos, size, style ) wxFrame( father, -1, title, pos, size, style ) /**********************************************************/ { { wxSize minsize; wxSize minsize; Loading @@ -56,6 +60,9 @@ WinEDA_BasicFrame::WinEDA_BasicFrame( wxWindow* father, int idtype, } } /* * */ /******************************************/ /******************************************/ WinEDA_BasicFrame::~WinEDA_BasicFrame() WinEDA_BasicFrame::~WinEDA_BasicFrame() /******************************************/ /******************************************/ Loading @@ -66,18 +73,22 @@ WinEDA_BasicFrame::~WinEDA_BasicFrame() } } /********************************************/ /* void WinEDA_BasicFrame::ReCreateMenuBar() * Virtual function /********************************************/ */ /***********************************/ // Virtual function void WinEDA_BasicFrame::ReCreateMenuBar() /***********************************/ { { } } /*********************************************/ /*******************************/ void WinEDA_BasicFrame::GetSettings() void /*********************************************/ WinEDA_BasicFrame::GetSettings() /*******************************/ { { wxString text; wxString text; int Ypos_min; int Ypos_min; Loading Loading @@ -110,9 +121,10 @@ void WinEDA_BasicFrame::GetSettings() } } /*****************************************/ /********************************/ void WinEDA_BasicFrame::SaveSettings() void /*****************************************/ WinEDA_BasicFrame::SaveSettings() /********************************/ { { wxString text; wxString text; wxConfig* config; wxConfig* config; Loading @@ -137,19 +149,22 @@ void WinEDA_BasicFrame::SaveSettings() /******************************************************/ /******************************************************/ void WinEDA_BasicFrame::PrintMsg( const wxString& text ) void WinEDA_BasicFrame::PrintMsg( const wxString& text ) /******************************************************/ /******************************************************/ { { SetStatusText( text ); SetStatusText( text ); } } /* * Display a bargraph (0 to 50 point length) for a PerCent value from 0 to 100 */ /*************************************************************************/ /*************************************************************************/ void WinEDA_BasicFrame::DisplayActivity( int PerCent, const wxString& Text ) void WinEDA_BasicFrame::DisplayActivity( int PerCent, const wxString& Text ) /*************************************************************************/ /*************************************************************************/ /* Display a bargraph (0 to 50 point length) for a PerCent value from 0 to 100 */ { { wxString Line; wxString Line; Loading @@ -165,23 +180,26 @@ void WinEDA_BasicFrame::DisplayActivity( int PerCent, const wxString& Text ) } } /* * Met a jour la liste des anciens projets */ /*******************************************************************/ /*******************************************************************/ void WinEDA_BasicFrame::SetLastProject( const wxString& FullFileName ) void WinEDA_BasicFrame::SetLastProject( const wxString& FullFileName ) /*******************************************************************/ /*******************************************************************/ /* Met a jour la liste des anciens projets */ { { wxGetApp().m_fileHistory.AddFileToHistory( FullFileName ); wxGetApp().m_fileHistory.AddFileToHistory( FullFileName ); ReCreateMenuBar(); ReCreateMenuBar(); } } /** /* * Fetch the file name from the file history list. * Fetch the file name from the file history list. */ */ /*********************************************************************/ wxString WinEDA_BasicFrame::GetFileFromHistory( int cmdId, wxString WinEDA_BasicFrame::GetFileFromHistory( int cmdId, const wxString& type ) const wxString& type ) /*********************************************************************/ { { wxString fn, msg; wxString fn, msg; size_t i; size_t i; Loading Loading @@ -209,12 +227,18 @@ wxString WinEDA_BasicFrame::GetFileFromHistory( int cmdId, } } /* * */ /**************************************************************/ /**************************************************************/ void WinEDA_BasicFrame::GetKicadHelp( wxCommandEvent& event ) void WinEDA_BasicFrame::GetKicadHelp( wxCommandEvent& event ) /**************************************************************/ /**************************************************************/ { { wxString msg; wxString msg; #if defined ONLINE_HELP_FILES_FORMAT_IS_HTML #if defined ONLINE_HELP_FILES_FORMAT_IS_HTML if( wxGetApp().m_HtmlCtrl == NULL ) if( wxGetApp().m_HtmlCtrl == NULL ) { { wxGetApp().InitOnLineHelp(); wxGetApp().InitOnLineHelp(); Loading @@ -231,6 +255,7 @@ void WinEDA_BasicFrame::GetKicadHelp( wxCommandEvent& event ) msg.Printf( _( "Help file %s not found" ), wxGetApp().m_HelpFileName.GetData() ); msg.Printf( _( "Help file %s not found" ), wxGetApp().m_HelpFileName.GetData() ); DisplayError( this, msg ); DisplayError( this, msg ); } } #elif defined ONLINE_HELP_FILES_FORMAT_IS_PDF #elif defined ONLINE_HELP_FILES_FORMAT_IS_PDF // wxString fullfilename = FindKicadHelpPath() + wxGetApp().m_HelpFileName; // wxString fullfilename = FindKicadHelpPath() + wxGetApp().m_HelpFileName; // if ( wxFileExists(fullfilename) ) // if ( wxFileExists(fullfilename) ) Loading @@ -256,8 +281,13 @@ void WinEDA_BasicFrame::GetKicadHelp( wxCommandEvent& event ) #endif #endif } } /* * */ /***********************************************************************/ /***********************************************************************/ void WinEDA_BasicFrame::GetKicadAbout( wxCommandEvent& WXUNUSED(event) ) void WinEDA_BasicFrame::GetKicadAbout( wxCommandEvent& WXUNUSED(event) ) /***********************************************************************/ /***********************************************************************/ { { wxAboutDialogInfo info; wxAboutDialogInfo info; Loading @@ -266,8 +296,12 @@ void WinEDA_BasicFrame::GetKicadAbout( wxCommandEvent& WXUNUSED(event) ) } } /* * */ /********************************************************************/ /********************************************************************/ void WinEDA_BasicFrame::ProcessFontPreferences( int id ) void WinEDA_BasicFrame::ProcessFontPreferences( int id ) /********************************************************************/ /********************************************************************/ { { wxFont font; wxFont font; Loading Loading @@ -308,3 +342,4 @@ void WinEDA_BasicFrame::ProcessFontPreferences( int id ) break; break; } } } }
common/common.cpp +188 −116 Original line number Original line Diff line number Diff line /**********************************************************/ /**********************************************************/ /* Routines d'affichage de parametres et caracteristiques */ /* Routines d'affichage de parametres et caracteristiques */ /**********************************************************/ /**********************************************************/ /* Fichier common.cpp */ #include "fctsys.h" #include "fctsys.h" #include "gr_basic.h" #include "gr_basic.h" #include "trigo.h" #include "trigo.h" Loading @@ -15,31 +12,30 @@ #include "confirm.h" #include "confirm.h" #include <wx/process.h> #include <wx/process.h> /*****************************/ wxString GetBuildVersion() /*****************************/ /* Return the build date /* * Return the build date */ */ /****************/ wxString GetBuildVersion() /****************/ { { return g_BuildVersion; return g_BuildVersion; } } /*********************************************/ /* /* Return custom build date for about dialog */ * Return custom build date for about dialog /*********************************************/ */ wxString GetAboutBuildVersion() wxString GetAboutBuildVersion() /*********************************************/ /*********************************************/ { { return g_BuildAboutVersion; return g_BuildAboutVersion; } } /********************************/ void SetLocaleTo_C_standard( void ) /********************************/ /** function SetLocaleTo_C_standard /** function SetLocaleTo_C_standard * because kicad is internationalized, switch internatization to "C" standard * because kicad is internationalized, switch internatization to "C" standard * i.e. uses the . (dot) as separator in print/read float numbers * i.e. uses the . (dot) as separator in print/read float numbers Loading @@ -50,15 +46,15 @@ void SetLocaleTo_C_standard( void ) * This is wrapper to the C setlocale( LC_NUMERIC, "C" ) function, * This is wrapper to the C setlocale( LC_NUMERIC, "C" ) function, * but could make more easier an optional use of locale in kicad * but could make more easier an optional use of locale in kicad */ */ /********************************/ void SetLocaleTo_C_standard( void ) /********************************/ { { setlocale( LC_NUMERIC, "C" ); // Switch the locale to standard C setlocale( LC_NUMERIC, "C" ); // Switch the locale to standard C } } /********************************/ void SetLocaleTo_Default( void ) /********************************/ /** function SetLocaleTo_Default /** function SetLocaleTo_Default * because kicad is internationalized, switch internatization to default * because kicad is internationalized, switch internatization to default * to use the default separator in print/read float numbers * to use the default separator in print/read float numbers Loading @@ -68,13 +64,18 @@ void SetLocaleTo_Default( void ) * This is wrapper to the C setlocale( LC_NUMERIC, "" ) function, * This is wrapper to the C setlocale( LC_NUMERIC, "" ) function, * but could make more easier an optional use of locale in kicad * but could make more easier an optional use of locale in kicad */ */ /********************************/ void SetLocaleTo_Default( void ) /********************************/ { { setlocale( LC_NUMERIC, "" ); // revert to the current locale setlocale( LC_NUMERIC, "" ); // revert to the current locale } } /********************************************************************/ /********************************************************************/ bool EnsureTextCtrlWidth( wxTextCtrl* aCtrl, const wxString* aString ) bool EnsureTextCtrlWidth(wxTextCtrl* aCtrl, const wxString* aString ) /********************************************************************/ /********************************************************************/ { { wxWindow* window = aCtrl->GetParent(); wxWindow* window = aCtrl->GetParent(); Loading Loading @@ -110,7 +111,9 @@ bool EnsureTextCtrlWidth( wxTextCtrl* aCtrl, const wxString* aString ) /*********************************************************************************************/ /*********************************************************************************************/ Ki_PageDescr::Ki_PageDescr( const wxSize& size, const wxPoint& offset, const wxString& name ) Ki_PageDescr::Ki_PageDescr(const wxSize& size, const wxPoint& offset, const wxString& name ) /*********************************************************************************************/ /*********************************************************************************************/ { { // All sizes are in 1/1000 inch // All sizes are in 1/1000 inch Loading @@ -131,7 +134,8 @@ Ki_PageDescr::Ki_PageDescr( const wxSize& size, const wxPoint& offset, const wxS /************************************/ /************************************/ wxString ReturnUnitSymbol( int Units ) wxString ReturnUnitSymbol( int Units ) /************************************/ /************************************/ { { wxString label; wxString label; Loading @@ -154,13 +158,15 @@ wxString ReturnUnitSymbol( int Units ) } } /**************************************************/ /* void AddUnitSymbol( wxStaticText& Stext, int Units ) * Add string " (mm):" or " ("):" to the static text Stext. /**************************************************/ /* Add string " (mm):" or " ("):" to the static text Stext. * Used in dialog boxes for entering values depending on selected units * Used in dialog boxes for entering values depending on selected units */ */ /**************************************************/ void AddUnitSymbol(wxStaticText& Stext, int Units ) /**************************************************/ { { wxString msg = Stext.GetLabel() + ReturnUnitSymbol( Units ); wxString msg = Stext.GetLabel() + ReturnUnitSymbol( Units ); Loading @@ -168,13 +174,16 @@ void AddUnitSymbol( wxStaticText& Stext, int Units ) } } /****************************************************************************/ /* void PutValueInLocalUnits( wxTextCtrl& TextCtr, int Value, int Internal_Unit ) * Convert the number Value in a string according to the internal units /****************************************************************************/ /* 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 * and the selected unit (g_UnitMetric) and put it in the wxTextCtrl TextCtrl */ */ /******************************************/ void PutValueInLocalUnits( wxTextCtrl& TextCtr, int Value, int Internal_Unit ) /*****************************************/ { { wxString msg = ReturnStringFromValue( g_UnitMetric, Value, Internal_Unit ); wxString msg = ReturnStringFromValue( g_UnitMetric, Value, Internal_Unit ); Loading @@ -182,13 +191,15 @@ void PutValueInLocalUnits( wxTextCtrl& TextCtr, int Value, int Internal_Unit ) } } /*******************************************************************/ /* int ReturnValueFromTextCtrl( const wxTextCtrl& TextCtr, int Internal_Unit ) * Convert the Value in the wxTextCtrl TextCtrl in an integer, /********************************************************************/ /* Convert the Value in the wxTextCtrl TextCtrl in an integer, * according to the internal units and the selected unit (g_UnitMetric) * according to the internal units and the selected unit (g_UnitMetric) */ */ /***************************************************/ int ReturnValueFromTextCtrl( const wxTextCtrl& TextCtr, int Internal_Unit ) /***************************************************/ { { int value; int value; wxString msg = TextCtr.GetValue(); wxString msg = TextCtr.GetValue(); Loading @@ -199,10 +210,6 @@ int ReturnValueFromTextCtrl( const wxTextCtrl& TextCtr, int Internal_Unit ) } } /**************************************************************************************************/ wxString ReturnStringFromValue( int aUnits, int aValue, int aInternal_Unit, bool aAdd_unit_symbol ) /**************************************************************************************************/ /** Function ReturnStringFromValue /** Function ReturnStringFromValue * Return the string from Value, according to units (inch, mm ...) for display, * Return the string from Value, according to units (inch, mm ...) for display, * and the initial unit for value * and the initial unit for value Loading @@ -212,6 +219,13 @@ wxString ReturnStringFromValue( int aUnits, int aValue, int aInternal_Unit, boo * @param aAdd_unit_symbol = true to add symbol unit to the string value * @param aAdd_unit_symbol = true to add symbol unit to the string value * @return a wxString what contains value and optionnaly the sumbol unit (like 2.000 mm) * @return a wxString what contains value and optionnaly the sumbol unit (like 2.000 mm) */ */ /*******************************************/ wxString ReturnStringFromValue(int aUnits, int aValue, int aInternal_Unit, bool aAdd_unit_symbol) /*******************************************/ { { wxString StringValue; wxString StringValue; double value_to_print; double value_to_print; Loading Loading @@ -244,16 +258,19 @@ wxString ReturnStringFromValue( int aUnits, int aValue, int aInternal_Unit, boo } } /****************************************************************************/ /* int ReturnValueFromString( int Units, const wxString& TextValue, int Internal_Unit ) * Return the string from Value, according to units (inch, mm ...) for display, /****************************************************************************/ /* Return the string from Value, according to units (inch, mm ...) for display, * and the initial unit for value * and the initial unit for value * Unit = display units (INCH, MM ..) * Unit = display units (INCH, MM ..) * Value = text * Value = text * Internal_Unit = units per inch for computed value * Internal_Unit = units per inch for computed value */ */ /****************************************************************************/ int ReturnValueFromString( int Units, const wxString& TextValue, int Internal_Unit ) /****************************************************************************/ { { int Value; int Value; double dtmp = 0; double dtmp = 0; Loading @@ -268,12 +285,15 @@ int ReturnValueFromString( int Units, const wxString& TextValue, int Internal_Un } } /* * Convert in inch or mm the variable "val" given in internal units */ /******************************************************************/ /******************************************************************/ double To_User_Unit( bool is_metric, int val, int internal_unit_value ) double To_User_Unit( bool is_metric, int val, int internal_unit_value ) /******************************************************************/ /******************************************************************/ /* Convert in inch or mm the variable "val" given in internal units */ { { double value; double value; Loading @@ -286,12 +306,15 @@ 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 ) * Return in internal units the value "val" given in inch or mm /**********************************************************************/ /* Return in internal units the value "val" given in inch or mm */ */ /*****************************************/ int From_User_Unit( bool is_metric, double val, int internal_unit_value ) /*****************************************/ { { double value; double value; Loading @@ -304,12 +327,13 @@ int From_User_Unit( bool is_metric, double val, int internal_unit_value ) } } /**********************/ /* wxString GenDate() * Return the string date "day month year" like "23 jun 2005" /**********************/ /* Return the string date "day month year" like "23 jun 2005" */ */ /********/ wxString GenDate() /********/ { { static const wxString mois[12] = static const wxString mois[12] = { { Loading @@ -330,10 +354,13 @@ wxString GenDate() } } /* * My memory allocation */ /***********************************/ /***********************************/ void* MyMalloc( size_t nb_octets ) void* MyMalloc( size_t nb_octets ) /***********************************/ /***********************************/ /* My memory allocation */ { { void* pt_mem; void* pt_mem; Loading @@ -353,10 +380,6 @@ void* MyMalloc( size_t nb_octets ) } } /**************************************************************/ bool ProcessExecute( const wxString& aCommandLine, int aFlags ) /**************************************************************/ /** /** * Function ProcessExecute * Function ProcessExecute * runs a child process. * runs a child process. Loading @@ -364,6 +387,11 @@ bool ProcessExecute( const wxString& aCommandLine, int aFlags ) * @param aFlags The same args as allowed for wxExecute() * @param aFlags The same args as allowed for wxExecute() * @return bool - true if success, else false * @return bool - true if success, else false */ */ /********************************************/ bool ProcessExecute( const wxString& aCommandLine, int aFlags ) /********************************************/ { { #ifdef __WINDOWS__ #ifdef __WINDOWS__ int pid = wxExecute( aCommandLine ); int pid = wxExecute( aCommandLine ); Loading @@ -375,12 +403,13 @@ bool ProcessExecute( const wxString& aCommandLine, int aFlags ) } } /************************************/ /* void* MyZMalloc( size_t nb_octets ) * My memory allocation, memory space is cleared /************************************/ /* My memory allocation, memory space is cleared */ */ /*****************************/ void* MyZMalloc( size_t nb_octets ) /*****************************/ { { void* pt_mem = MyMalloc( nb_octets ); void* pt_mem = MyMalloc( nb_octets ); Loading @@ -391,7 +420,8 @@ void* MyZMalloc( size_t nb_octets ) /*******************************/ /*******************************/ void MyFree( void* pt_mem ) void MyFree( void* pt_mem ) /*******************************/ /*******************************/ { { if( pt_mem ) if( pt_mem ) Loading @@ -399,14 +429,16 @@ void MyFree( void* pt_mem ) } } /**************************************************************/ /* wxString ReturnPcbLayerName( int layer_number, bool omitSpacePadding ) * Return the name of the layer number "layer_number". /**************************************************************/ /* Return the name of the layer number "layer_number". * if omitSpacePadding == TRUE, the name can be used for a file name * if omitSpacePadding == TRUE, the name can be used for a file name * (no spaces, replaced by _) * (no spaces, replaced by _) */ */ /**************************************************************/ wxString ReturnPcbLayerName( int layer_number, bool omitSpacePadding ) /**************************************************************/ { { const unsigned LAYER_LIMIT = 29; const unsigned LAYER_LIMIT = 29; Loading Loading @@ -455,11 +487,23 @@ EVT_CLOSE( WinEDA_TextFrame::OnClose ) END_EVENT_TABLE() END_EVENT_TABLE() /***************************************************************************/ /***************************************************************************/ WinEDA_TextFrame::WinEDA_TextFrame( wxWindow* parent, const wxString& title ) : WinEDA_TextFrame::WinEDA_TextFrame( wxWindow* parent, wxDialog( parent, -1, title, wxPoint( -1, -1 ), wxSize( 250, 350 ), const wxString& title ) : wxDEFAULT_DIALOG_STYLE | wxFRAME_FLOAT_ON_PARENT | MAYBE_RESIZE_BORDER ) wxDialog( parent, -1, title, wxPoint( -1, -1 ), wxSize( 250, 350 ), wxDEFAULT_DIALOG_STYLE | wxFRAME_FLOAT_ON_PARENT | MAYBE_RESIZE_BORDER ) /***************************************************************************/ /***************************************************************************/ { { /* * TODO background and foreground colors of WinEDA_TextFrame should be * controllable / settable with project settings or config file and not * hardcoded in binairy ! */ wxSize size; wxSize size; m_Parent = parent; m_Parent = parent; Loading @@ -467,18 +511,26 @@ WinEDA_TextFrame::WinEDA_TextFrame( wxWindow* parent, const wxString& title ) : CentreOnParent(); CentreOnParent(); size = GetClientSize(); size = GetClientSize(); m_List = new wxListBox( this, ID_TEXTBOX_LIST, m_List = new wxListBox( this, wxPoint( 0, 0 ), size, ID_TEXTBOX_LIST, wxPoint( 0, 0 ), size, 0, NULL, 0, NULL, wxLB_ALWAYS_SB | wxLB_SINGLE ); wxLB_ALWAYS_SB | wxLB_SINGLE ); m_List->SetBackgroundColour( wxColour( 200, 255, 255 ) ); /* The color of the text in the wxListBox (black) */ m_List->SetBackgroundColour( wxColour( 255, 255, 255 ) ); /* The foreground color of the wxListBox (white) */ m_List->SetForegroundColour( wxColour( 0, 0, 0 ) ); SetReturnCode( -1 ); SetReturnCode( -1 ); } } /***************************************************/ /***************************************************/ void WinEDA_TextFrame::Append( const wxString& text ) void WinEDA_TextFrame::Append( const wxString& text ) /***************************************************/ /***************************************************/ { { m_List->Append( text ); m_List->Append( text ); Loading @@ -486,7 +538,8 @@ void WinEDA_TextFrame::Append( const wxString& text ) /**********************************************************/ /**********************************************************/ void WinEDA_TextFrame::D_ClickOnList( wxCommandEvent& event ) void WinEDA_TextFrame::D_ClickOnList( wxCommandEvent& event ) /**********************************************************/ /**********************************************************/ { { int ii = m_List->GetSelection(); int ii = m_List->GetSelection(); Loading @@ -496,19 +549,15 @@ void WinEDA_TextFrame::D_ClickOnList( wxCommandEvent& event ) /*************************************************/ /*************************************************/ void WinEDA_TextFrame::OnClose( wxCloseEvent& event ) void WinEDA_TextFrame::OnClose( wxCloseEvent& event ) /*************************************************/ /*************************************************/ { { EndModal( -1 ); EndModal( -1 ); } } /*****************************************************************************/ /** 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. * Routine d'affichage d'un parametre. * pos_X = cadrage horizontal * pos_X = cadrage horizontal * si pos_X < 0 : la position horizontale est la derniere * si pos_X < 0 : la position horizontale est la derniere Loading @@ -519,18 +568,28 @@ void Affiche_1_Parametre( WinEDA_DrawFrame* frame, int pos_X, * si "", par d'affichage sur cette ligne * si "", par d'affichage sur cette ligne * color = couleur d'affichage * color = couleur d'affichage */ */ /*****************************************************************************/ void Affiche_1_Parametre( WinEDA_DrawFrame* frame, int pos_X, const wxString& texte_H, const wxString& texte_L, int color ) /*****************************************************************************/ { { frame->MsgPanel->Affiche_1_Parametre( pos_X, texte_H, texte_L, color ); frame->MsgPanel->Affiche_1_Parametre( pos_X, texte_H, texte_L, color ); } } /****************************************************************************/ void AfficheDoc( WinEDA_DrawFrame* frame, const wxString& Doc, const wxString& KeyW ) /****************************************************************************/ /* /* * Routine d'affichage de la documentation associee a un composant * Routine d'affichage de la documentation associee a un composant */ */ /****************************************************************************/ void AfficheDoc( WinEDA_DrawFrame* frame, const wxString& Doc, const wxString& KeyW ) /****************************************************************************/ { { wxString Line1( wxT( "Doc: " ) ), Line2( wxT( "KeyW: " ) ); wxString Line1( wxT( "Doc: " ) ), Line2( wxT( "KeyW: " ) ); Loading Loading @@ -564,17 +623,18 @@ int GetTimeStamp() } } /**************************************************************/ const wxString& valeur_param( int valeur, wxString& buf_texte ) /**************************************************************/ /** /** * @todo replace this obsolete funtion by ReturnStringFromValue * TODO replace this obsolete funtion by ReturnStringFromValue * Retourne pour affichage la valeur d'un parametre, selon type d'unites choisies * Retourne pour affichage la valeur d'un parametre, selon type d'unites choisies * entree : valeur en mils , buffer de texte * entree : valeur en mils , buffer de texte * retourne en buffer : texte : valeur exprimee en pouces ou millimetres * retourne en buffer : texte : valeur exprimee en pouces ou millimetres * suivie de " ou mm * suivie de " ou mm */ */ /*********************************************/ const wxString& valeur_param( int valeur, wxString& buf_texte ) /*********************************************/ { { if( g_UnitMetric ) if( g_UnitMetric ) { { Loading @@ -589,7 +649,14 @@ const wxString& valeur_param( int valeur, wxString& buf_texte ) } } wxString& operator <<( wxString& aString, const wxPoint& aPos ) /* * */ /**********************************/ wxString& operator <<( wxString& aString, const wxPoint& aPos ) /*********************************/ { { wxString temp; wxString temp; Loading @@ -601,11 +668,16 @@ wxString& operator <<( wxString& aString, const wxPoint& aPos ) } } #ifdef __MSVC__ // compilers that does not have the round function (posix) /* compilers that does not have the round function (posix) */ /* return the nearest rounded ( equivalent to the nearest integer value) #ifdef __MSVC__ /* * return the nearest rounded ( equivalent to the nearest integer value) * from aNumber * from aNumber */ */ double round( double aNumber ) /**********************/ double round( double aNumber ) /**********************/ { { return floor( aNumber + 0.5 ); return floor( aNumber + 0.5 ); } } Loading