Commit 6e6134ea authored by charras's avatar charras

improved wxWidgets 3 compatibility

parent 1e6a4652
...@@ -72,11 +72,6 @@ wxString g_UserLibDirBuffer; ...@@ -72,11 +72,6 @@ wxString g_UserLibDirBuffer;
int g_DebugLevel; int g_DebugLevel;
int g_MouseOldButtons; int g_MouseOldButtons;
int g_KeyPressed; int g_KeyPressed;
wxFont* g_FixedFont = NULL; /* Affichage de Texte en fenetres de dialogue,
* fonte a pas fixe)*/
int g_FixedFontPointSize; /* taille de la fonte */
int g_FontMinPointSize; /* taille minimum des fontes */
// Nom (full file name) du file Configuration par defaut (kicad.pro) // Nom (full file name) du file Configuration par defaut (kicad.pro)
wxString g_Prj_Default_Config_FullFilename; wxString g_Prj_Default_Config_FullFilename;
...@@ -393,18 +388,18 @@ wxArrayString* wxStringSplit(wxString txt, wxChar splitter) ...@@ -393,18 +388,18 @@ wxArrayString* wxStringSplit(wxString txt, wxChar splitter)
int index=txt.Find(splitter); int index=txt.Find(splitter);
if (index == wxNOT_FOUND) if (index == wxNOT_FOUND)
break; break;
wxString tmp; wxString tmp;
tmp = txt.Mid(0,index); tmp = txt.Mid(0,index);
txt = txt.Mid( index+1, txt.size() - index); txt = txt.Mid( index+1, txt.size() - index);
list->Add(tmp); list->Add(tmp);
} }
if (!txt.IsEmpty()) if (!txt.IsEmpty())
{ {
list->Add(txt); list->Add(txt);
} }
return list; return list;
} }
......
...@@ -248,7 +248,6 @@ WinEDA_App::~WinEDA_App() ...@@ -248,7 +248,6 @@ WinEDA_App::~WinEDA_App()
if( m_EDA_CommonConfig ) if( m_EDA_CommonConfig )
delete m_EDA_CommonConfig; delete m_EDA_CommonConfig;
delete m_EDA_Config; delete m_EDA_Config;
delete g_FixedFont;
if( m_Checker ) if( m_Checker )
delete m_Checker; delete m_Checker;
delete m_Locale; delete m_Locale;
...@@ -303,12 +302,6 @@ void WinEDA_App::InitEDA_Appl( const wxString& aName, id_app_type aId ) ...@@ -303,12 +302,6 @@ void WinEDA_App::InitEDA_Appl( const wxString& aName, id_app_type aId )
m_EDA_CommonConfig = new wxConfig( CommonConfigPath ); m_EDA_CommonConfig = new wxConfig( CommonConfigPath );
wxASSERT( m_EDA_CommonConfig != NULL ); wxASSERT( m_EDA_CommonConfig != NULL );
/* Create the fonts used in dialogs and messages */
g_FixedFontPointSize = FONT_DEFAULT_SIZE;
g_FixedFont = new wxFont( g_FixedFontPointSize, wxFONTFAMILY_MODERN,
wxNORMAL, wxNORMAL );
/* Install some image handlers, mainly for help */ /* Install some image handlers, mainly for help */
wxImage::AddHandler( new wxPNGHandler ); wxImage::AddHandler( new wxPNGHandler );
wxImage::AddHandler( new wxGIFHandler ); wxImage::AddHandler( new wxGIFHandler );
...@@ -626,7 +619,6 @@ void WinEDA_App::GetSettings() ...@@ -626,7 +619,6 @@ void WinEDA_App::GetSettings()
wxASSERT( m_EDA_Config != NULL && m_EDA_CommonConfig != NULL ); wxASSERT( m_EDA_Config != NULL && m_EDA_CommonConfig != NULL );
wxString Line; wxString Line;
unsigned ii;
m_HelpSize.x = 500; m_HelpSize.x = 500;
m_HelpSize.y = 400; m_HelpSize.y = 400;
...@@ -639,12 +631,6 @@ void WinEDA_App::GetSettings() ...@@ -639,12 +631,6 @@ void WinEDA_App::GetSettings()
m_fileHistory.Load( *m_EDA_Config ); m_fileHistory.Load( *m_EDA_Config );
/* Set default font sizes */
g_FixedFontPointSize = m_EDA_Config->Read( wxT( "FixedFontSize" ),
FONT_DEFAULT_SIZE );
g_FixedFont->SetPointSize( g_FixedFontPointSize );
m_EDA_Config->Read( wxT( "ShowPageLimits" ), &g_ShowPageLimits ); m_EDA_Config->Read( wxT( "ShowPageLimits" ), &g_ShowPageLimits );
if( m_EDA_Config->Read( wxT( "WorkingDir" ), &Line ) && wxDirExists( Line ) ) if( m_EDA_Config->Read( wxT( "WorkingDir" ), &Line ) && wxDirExists( Line ) )
...@@ -664,18 +650,9 @@ void WinEDA_App::GetSettings() ...@@ -664,18 +650,9 @@ void WinEDA_App::GetSettings()
void WinEDA_App::SaveSettings() void WinEDA_App::SaveSettings()
{ {
wxASSERT( m_EDA_Config != NULL ); wxASSERT( m_EDA_Config != NULL );
/* Sdt font settings */
#if wxCHECK_VERSION( 2, 9, 0 )
#warning TODO: under wxWidgets 3.0, see how to replace the next lines
#else
/* Misc settings */
m_EDA_Config->Write( wxT( "FixedFontSize" ), g_FixedFontPointSize );
m_EDA_Config->Write( wxT( "ShowPageLimits" ), g_ShowPageLimits ); m_EDA_Config->Write( wxT( "ShowPageLimits" ), g_ShowPageLimits );
m_EDA_Config->Write( wxT( "WorkingDir" ), wxGetCwd() ); m_EDA_Config->Write( wxT( "WorkingDir" ), wxGetCwd() );
m_EDA_Config->Write( wxT( "BgColor" ), g_DrawBgColor ); m_EDA_Config->Write( wxT( "BgColor" ), g_DrawBgColor );
#endif // wxCHECK_VERSION
/* Save the file history list */ /* Save the file history list */
m_fileHistory.Save( *m_EDA_Config ); m_fileHistory.Save( *m_EDA_Config );
......
...@@ -26,42 +26,42 @@ void WinEDA_CvpcbFrame::ReCreateHToolbar() ...@@ -26,42 +26,42 @@ void WinEDA_CvpcbFrame::ReCreateHToolbar()
m_HToolBar = new WinEDA_Toolbar( TOOLBAR_MAIN, this, ID_H_TOOLBAR, TRUE ); m_HToolBar = new WinEDA_Toolbar( TOOLBAR_MAIN, this, ID_H_TOOLBAR, TRUE );
SetToolBar( m_HToolBar ); SetToolBar( m_HToolBar );
m_HToolBar->AddTool( ID_CVPCB_READ_INPUT_NETLIST, wxBitmap( open_xpm ), m_HToolBar->AddTool( ID_CVPCB_READ_INPUT_NETLIST, wxEmptyString, wxBitmap( open_xpm ),
_( "Open a NetList file" ) ); _( "Open a NetList file" ) );
m_HToolBar->AddTool( ID_CVPCB_SAVEQUITCVPCB, wxBitmap( save_xpm ), m_HToolBar->AddTool( ID_CVPCB_SAVEQUITCVPCB, wxEmptyString, wxBitmap( save_xpm ),
_( "Save NetList and Footprints List files" ) ); _( "Save NetList and Footprints List files" ) );
m_HToolBar->AddSeparator(); m_HToolBar->AddSeparator();
m_HToolBar->AddTool( ID_CVPCB_CREATE_CONFIGWINDOW, wxBitmap( config_xpm ), m_HToolBar->AddTool( ID_CVPCB_CREATE_CONFIGWINDOW, wxEmptyString, wxBitmap( config_xpm ),
_( "Configuration" ) ); _( "Configuration" ) );
m_HToolBar->AddSeparator(); m_HToolBar->AddSeparator();
m_HToolBar->AddTool( ID_CVPCB_CREATE_SCREENCMP, wxBitmap( module_xpm ), m_HToolBar->AddTool( ID_CVPCB_CREATE_SCREENCMP, wxEmptyString, wxBitmap( module_xpm ),
_( "View selected footprint" ) ); _( "View selected footprint" ) );
m_HToolBar->AddTool( ID_CVPCB_AUTO_ASSOCIE, wxBitmap( auto_associe_xpm ), m_HToolBar->AddTool( ID_CVPCB_AUTO_ASSOCIE, wxEmptyString, wxBitmap( auto_associe_xpm ),
_( "Automatic Association" ) ); _( "Automatic Association" ) );
m_HToolBar->AddSeparator(); m_HToolBar->AddSeparator();
m_HToolBar->AddTool( ID_CVPCB_GOTO_PREVIOUSNA, wxBitmap( left_xpm ), m_HToolBar->AddTool( ID_CVPCB_GOTO_PREVIOUSNA, wxEmptyString, wxBitmap( left_xpm ),
_( "Select previous free component" ) ); _( "Select previous free component" ) );
m_HToolBar->AddTool( ID_CVPCB_GOTO_FIRSTNA, wxBitmap( right_xpm ), m_HToolBar->AddTool( ID_CVPCB_GOTO_FIRSTNA, wxEmptyString, wxBitmap( right_xpm ),
_( "Select next free component" ) ); _( "Select next free component" ) );
m_HToolBar->AddSeparator(); m_HToolBar->AddSeparator();
m_HToolBar->AddTool( ID_CVPCB_DEL_ASSOCIATIONS, m_HToolBar->AddTool( ID_CVPCB_DEL_ASSOCIATIONS, wxEmptyString,
wxBitmap( delete_association_xpm ), wxBitmap( delete_association_xpm ),
_( "Delete all associations" ) ); _( "Delete all associations" ) );
m_HToolBar->AddSeparator(); m_HToolBar->AddSeparator();
m_HToolBar->AddTool( ID_CVPCB_CREATE_STUFF_FILE, m_HToolBar->AddTool( ID_CVPCB_CREATE_STUFF_FILE, wxEmptyString,
wxBitmap( save_cmpstuff_xpm ), wxBitmap( save_cmpstuff_xpm ),
_( "Create export file (component/footprint list, used by eeschema to fill the footprint field of components)" ) ); _( "Create export file (component/footprint list, used by eeschema to fill the footprint field of components)" ) );
m_HToolBar->AddSeparator(); m_HToolBar->AddSeparator();
m_HToolBar->AddTool( ID_PCB_DISPLAY_FOOTPRINT_DOC, m_HToolBar->AddTool( ID_PCB_DISPLAY_FOOTPRINT_DOC, wxEmptyString,
wxBitmap( datasheet_xpm ), wxBitmap( datasheet_xpm ),
_( "Display footprints list documentation" ) ); _( "Display footprints list documentation" ) );
......
This diff is collapsed.
...@@ -150,16 +150,8 @@ extern int g_DebugLevel; // 0= Pas de debug */ ...@@ -150,16 +150,8 @@ extern int g_DebugLevel; // 0= Pas de debug */
extern int g_MouseOldButtons; extern int g_MouseOldButtons;
extern int g_KeyPressed; extern int g_KeyPressed;
// Font used by kicad.
// these font have a size which do not depend on default size system font
extern wxFont* g_FixedFont; /* Affichage de Texte en fenetres de dialogue,
* fonte a pas fixe)*/
extern int g_FixedFontPointSize; /* taille de la fonte */
extern int g_FontMinPointSize; /* taille minimum des fontes */
extern bool g_ShowPageLimits; // TRUE to display the page limits extern bool g_ShowPageLimits; // TRUE to display the page limits
/* File name extension definitions. */ /* File name extension definitions. */
extern const wxString ProjectFileExtension; extern const wxString ProjectFileExtension;
extern const wxString SchematicFileExtension; extern const wxString SchematicFileExtension;
......
...@@ -146,7 +146,6 @@ bool TEXTE_PCB::Save( FILE* aFile ) const ...@@ -146,7 +146,6 @@ bool TEXTE_PCB::Save( FILE* aFile ) const
if( fprintf( aFile, "$TEXTPCB\n" ) != sizeof("$TEXTPCB\n") - 1 ) if( fprintf( aFile, "$TEXTPCB\n" ) != sizeof("$TEXTPCB\n") - 1 )
return false; return false;
bool rc = false;
const char* style = m_Italic ? "Italic" : "Normal"; const char* style = m_Italic ? "Italic" : "Normal";
wxArrayString* list = wxStringSplit( m_Text, '\n' ); wxArrayString* list = wxStringSplit( m_Text, '\n' );
......
...@@ -201,10 +201,8 @@ void WinEDA_ModuleEditFrame::ReCreateOptToolbar() ...@@ -201,10 +201,8 @@ void WinEDA_ModuleEditFrame::ReCreateOptToolbar()
m_OptionsToolBar = new WinEDA_Toolbar( TOOLBAR_OPTION, this, m_OptionsToolBar = new WinEDA_Toolbar( TOOLBAR_OPTION, this,
ID_OPT_TOOLBAR, FALSE ); ID_OPT_TOOLBAR, FALSE );
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_GRID, wxBitmap( grid_xpm ), m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_GRID, wxEmptyString,
wxNullBitmap, wxBitmap( grid_xpm ),
TRUE,
-1, -1, (wxObject*) NULL,
_( "Display Grid OFF" ) ); _( "Display Grid OFF" ) );
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_POLAR_COORD, wxEmptyString, m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_POLAR_COORD, wxEmptyString,
...@@ -219,33 +217,21 @@ void WinEDA_ModuleEditFrame::ReCreateOptToolbar() ...@@ -219,33 +217,21 @@ void WinEDA_ModuleEditFrame::ReCreateOptToolbar()
wxBitmap( unit_mm_xpm ), wxBitmap( unit_mm_xpm ),
_( "Units in millimeters" ), wxITEM_CHECK ); _( "Units in millimeters" ), wxITEM_CHECK );
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SELECT_CURSOR, m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SELECT_CURSOR, wxEmptyString,
wxBitmap( cursor_shape_xpm ), wxBitmap( cursor_shape_xpm ),
wxNullBitmap,
TRUE,
-1, -1, (wxObject*) NULL,
_( "Change Cursor Shape" ) ); _( "Change Cursor Shape" ) );
m_OptionsToolBar->AddSeparator(); m_OptionsToolBar->AddSeparator();
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_PADS_SKETCH, m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_PADS_SKETCH, wxEmptyString,
wxBitmap( pad_sketch_xpm ), wxBitmap( pad_sketch_xpm ),
wxNullBitmap,
TRUE,
-1, -1, (wxObject*) NULL,
_( "Show Pads Sketch" ) ); _( "Show Pads Sketch" ) );
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_MODULE_TEXT_SKETCH, m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_MODULE_TEXT_SKETCH, wxEmptyString,
wxBitmap( text_sketch_xpm ), wxBitmap( text_sketch_xpm ),
wxNullBitmap,
TRUE,
-1, -1, (wxObject*) NULL,
_( "Show Texts Sketch" ) ); _( "Show Texts Sketch" ) );
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_MODULE_EDGE_SKETCH, m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_MODULE_EDGE_SKETCH, wxEmptyString,
wxBitmap( show_mod_edge_xpm ), wxBitmap( show_mod_edge_xpm ),
wxNullBitmap,
TRUE,
-1, -1, (wxObject*) NULL,
_( "Show Edges Sketch" ) ); _( "Show Edges Sketch" ) );
m_OptionsToolBar->Realize(); m_OptionsToolBar->Realize();
......
...@@ -490,37 +490,27 @@ void WinEDA_PcbFrame::ReCreateAuxVToolbar() ...@@ -490,37 +490,27 @@ void WinEDA_PcbFrame::ReCreateAuxVToolbar()
ID_AUX_V_TOOLBAR, FALSE ); ID_AUX_V_TOOLBAR, FALSE );
// Set up toolbar // Set up toolbar
m_AuxVToolBar->AddTool( ID_PCB_MUWAVE_TOOL_SELF_CMD, m_AuxVToolBar->AddTool( ID_PCB_MUWAVE_TOOL_SELF_CMD, wxEmptyString,
wxBitmap( mw_Add_Line_xpm ), wxBitmap( mw_Add_Line_xpm ),
wxNullBitmap, TRUE,
-1, -1, (wxObject*) NULL,
_( "Create line of specified length for microwave applications" ) ); _( "Create line of specified length for microwave applications" ) );
m_AuxVToolBar->AddTool( ID_PCB_MUWAVE_TOOL_GAP_CMD, m_AuxVToolBar->AddTool( ID_PCB_MUWAVE_TOOL_GAP_CMD, wxEmptyString,
wxBitmap( mw_Add_Gap_xpm ), wxBitmap( mw_Add_Gap_xpm ),
wxNullBitmap, TRUE,
-1, -1, (wxObject*) NULL,
_( "Create gap of specified length for microwave applications" ) ); _( "Create gap of specified length for microwave applications" ) );
m_AuxVToolBar->AddSeparator(); m_AuxVToolBar->AddSeparator();
m_AuxVToolBar->AddTool( ID_PCB_MUWAVE_TOOL_STUB_CMD, m_AuxVToolBar->AddTool( ID_PCB_MUWAVE_TOOL_STUB_CMD, wxEmptyString,
wxBitmap( mw_Add_Stub_xpm ), wxBitmap( mw_Add_Stub_xpm ),
wxNullBitmap, TRUE,
-1, -1, (wxObject*) NULL,
_( "Create stub of specified length for microwave applications" ) ); _( "Create stub of specified length for microwave applications" ) );
m_AuxVToolBar->AddTool( ID_PCB_MUWAVE_TOOL_STUB_ARC_CMD, m_AuxVToolBar->AddTool( ID_PCB_MUWAVE_TOOL_STUB_ARC_CMD, wxEmptyString,
wxBitmap( mw_Add_stub_arc_xpm ), wxBitmap( mw_Add_stub_arc_xpm ),
wxNullBitmap, TRUE,
-1, -1, (wxObject*) NULL,
_( "Create stub (arc) of specified length for microwave applications" ) _( "Create stub (arc) of specified length for microwave applications" )
); );
m_AuxVToolBar->AddTool( ID_PCB_MUWAVE_TOOL_FUNCTION_SHAPE_CMD, m_AuxVToolBar->AddTool( ID_PCB_MUWAVE_TOOL_FUNCTION_SHAPE_CMD, wxEmptyString,
wxBitmap( mw_Add_Shape_xpm ), wxBitmap( mw_Add_Shape_xpm ),
wxNullBitmap, TRUE,
-1, -1, (wxObject*) NULL,
_( "Create a polynomial shape for microwave applications" ) ); _( "Create a polynomial shape for microwave applications" ) );
m_AuxVToolBar->Realize(); m_AuxVToolBar->Realize();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment