Commit 6ab5ad27 authored by dickelbeck's avatar dickelbeck

Wayne Stambaugh's patch which allows infospgm.cpp to be compiled once rather than for each program

parent eaa147c1
...@@ -25,8 +25,12 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.4.6 FATAL_ERROR) ...@@ -25,8 +25,12 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.4.6 FATAL_ERROR)
# Path to local CMake modules # Path to local CMake modules
SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/CMakeModules) SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/CMakeModules)
# Command line option to enable or disable building minizip. Minizip
# is building is enabled by defaut. Use -DKICAD_MINZIP=OFF to disable
# building minizip.
OPTION(KICAD_MINIZIP "enable/disable building minizip (default ON)" ON)
# Comment this out if you don't want to build minizip. # Comment this out if you don't want to build minizip.
SET(KICAD_MINIZIP ON CACHE BOOL "Build minizip?") #SET(KICAD_MINIZIP ON CACHE BOOL "Build minizip?")
# Comment this out if you don't want to build with Python support. # Comment this out if you don't want to build with Python support.
# SET(KICAD_PYTHON ON CACHE BOOL "Build with Python support?") # SET(KICAD_PYTHON ON CACHE BOOL "Build with Python support?")
......
...@@ -31,6 +31,7 @@ SET(COMMON_SRCS ...@@ -31,6 +31,7 @@ SET(COMMON_SRCS
toolbars.cpp toolbars.cpp
trigo.cpp trigo.cpp
worksheet.cpp worksheet.cpp
wxwineda.cpp) wxwineda.cpp
../share/infospgm.cpp)
ADD_LIBRARY(common ${COMMON_SRCS}) ADD_LIBRARY(common ${COMMON_SRCS})
...@@ -222,7 +222,7 @@ void WinEDA_BasicFrame::GetKicadHelp(wxCommandEvent& event) ...@@ -222,7 +222,7 @@ void WinEDA_BasicFrame::GetKicadHelp(wxCommandEvent& event)
void WinEDA_BasicFrame::GetKicadAbout(wxCommandEvent& event) void WinEDA_BasicFrame::GetKicadAbout(wxCommandEvent& event)
/**********************************************************/ /**********************************************************/
{ {
Print_Kicad_Infos(this); Print_Kicad_Infos(this, m_AboutTitle);
} }
/********************************************************************/ /********************************************************************/
......
...@@ -140,7 +140,7 @@ void PyHandler::DoInitModules() ...@@ -140,7 +140,7 @@ void PyHandler::DoInitModules()
for ( unsigned int i = 0; i < m_ModuleRegistry.size(); i ++ ) for ( unsigned int i = 0; i < m_ModuleRegistry.size(); i ++ )
{ {
detail::init_module( m_ModuleRegistry[i].name.fn_str(), &InitPyModules ); detail::init_module( m_ModuleRegistry[i].name.mb_str(), &InitPyModules );
} }
} }
...@@ -244,14 +244,14 @@ bool PyHandler::RunScript( const wxString & name ) ...@@ -244,14 +244,14 @@ bool PyHandler::RunScript( const wxString & name )
object ns = module.attr( "__dict__" ); object ns = module.attr( "__dict__" );
bool ret = true; bool ret = true;
FILE * file = fopen( name.fn_str(), "r" ); FILE * file = fopen( name.mb_str(), "r" );
wxPyBlock_t blocked = wxPyBeginBlockThreads(); wxPyBlock_t blocked = wxPyBeginBlockThreads();
if ( !file ) if ( !file )
{ {
// do something // do something
std::cout << "Unable to Load " << name.fn_str() << "\n"; std::cout << "Unable to Load " << name.mb_str() << "\n";
ret = false; ret = false;
} }
else else
...@@ -265,7 +265,7 @@ bool PyHandler::RunScript( const wxString & name ) ...@@ -265,7 +265,7 @@ bool PyHandler::RunScript( const wxString & name )
try try
{ {
ns["currentScript"] = Convert( name ); ns["currentScript"] = Convert( name );
handle<> ignored( PyRun_File( file, name.fn_str(), Py_file_input, ns.ptr(), ns.ptr() ) ); handle<> ignored( PyRun_File( file, name.mb_str(), Py_file_input, ns.ptr(), ns.ptr() ) );
} }
catch ( error_already_set ) catch ( error_already_set )
{ {
...@@ -286,7 +286,7 @@ bool PyHandler::RunSimpleString( const wxString & code ) ...@@ -286,7 +286,7 @@ bool PyHandler::RunSimpleString( const wxString & code )
wxPyBlock_t blocked = wxPyBeginBlockThreads(); wxPyBlock_t blocked = wxPyBeginBlockThreads();
try try
{ {
PyRun_SimpleString( code.fn_str() ); PyRun_SimpleString( code.mb_str() );
} }
catch ( error_already_set ) catch ( error_already_set )
{ {
...@@ -346,7 +346,7 @@ void PyHandler::TriggerEvent( const wxString & key, const object & param ) ...@@ -346,7 +346,7 @@ void PyHandler::TriggerEvent( const wxString & key, const object & param )
} }
catch (error_already_set) catch (error_already_set)
{ {
std::cout << "Error in event " << key.fn_str() << " callback" << std::endl; std::cout << "Error in event " << key.mb_str() << " callback" << std::endl;
PyErr_Print(); PyErr_Print();
} }
} }
...@@ -378,6 +378,6 @@ void PyHandler::UnRegisterCallback( const wxString & key, const object & callbac ...@@ -378,6 +378,6 @@ void PyHandler::UnRegisterCallback( const wxString & key, const object & callbac
wxString PyHandler::MakeStr( const object & objStr ) { return wxString( extract<const char *>( objStr ), wxConvLocal ); } wxString PyHandler::MakeStr( const object & objStr ) { return wxString( extract<const char *>( objStr ), wxConvLocal ); }
object PyHandler::Convert( const wxString & wxStr ) { return str( std::string( wxStr.fn_str() ).c_str() ); } object PyHandler::Convert( const wxString & wxStr ) { return str( std::string( wxStr.mb_str() ).c_str() ); }
// vim: set tabstop=4 : // vim: set tabstop=4 :
...@@ -54,7 +54,6 @@ SET(CVPCB_EXTRA_SRCS ...@@ -54,7 +54,6 @@ SET(CVPCB_EXTRA_SRCS
../share/drawframe.cpp ../share/drawframe.cpp
../share/drawpanel.cpp ../share/drawpanel.cpp
../share/infospgm.cpp
../share/zoom.cpp) ../share/zoom.cpp)
IF(WIN32) IF(WIN32)
......
...@@ -25,6 +25,7 @@ WinEDA_CvpcbFrame::WinEDA_CvpcbFrame( WinEDA_App* parent, const wxString& title, ...@@ -25,6 +25,7 @@ WinEDA_CvpcbFrame::WinEDA_CvpcbFrame( WinEDA_App* parent, const wxString& title,
WinEDA_BasicFrame( NULL, CVPCB_FRAME, parent, title, wxDefaultPosition, wxDefaultSize, style ) WinEDA_BasicFrame( NULL, CVPCB_FRAME, parent, title, wxDefaultPosition, wxDefaultSize, style )
{ {
m_FrameName = wxT( "CvpcbFrame" ); m_FrameName = wxT( "CvpcbFrame" );
m_AboutTitle = g_CvpcbAboutTitle;
m_ListCmp = NULL; m_ListCmp = NULL;
m_FootprintList = NULL; m_FootprintList = NULL;
DrawFrame = NULL; DrawFrame = NULL;
......
...@@ -97,7 +97,6 @@ SET(EESCHEMA_SRCS ...@@ -97,7 +97,6 @@ SET(EESCHEMA_SRCS
SET(EESCHEMA_EXTRA_SRCS SET(EESCHEMA_EXTRA_SRCS
../share/drawframe.cpp ../share/drawframe.cpp
../share/drawpanel.cpp ../share/drawpanel.cpp
../share/infospgm.cpp
../share/setpage.cpp ../share/setpage.cpp
../share/svg_print.cpp ../share/svg_print.cpp
../share/wxprint.cpp ../share/wxprint.cpp
......
...@@ -120,6 +120,7 @@ WinEDA_SchematicFrame:: WinEDA_SchematicFrame(wxWindow * father, WinEDA_App *par ...@@ -120,6 +120,7 @@ WinEDA_SchematicFrame:: WinEDA_SchematicFrame(wxWindow * father, WinEDA_App *par
WinEDA_DrawFrame(father, SCHEMATIC_FRAME, parent, title, pos, size, style) WinEDA_DrawFrame(father, SCHEMATIC_FRAME, parent, title, pos, size, style)
{ {
m_FrameName = wxT("SchematicFrame"); m_FrameName = wxT("SchematicFrame");
m_AboutTitle = g_EeschemaAboutTitle;
m_Draw_Axis = FALSE; // TRUE to show axis m_Draw_Axis = FALSE; // TRUE to show axis
m_Draw_Grid = g_ShowGrid; // TRUE to show a grid m_Draw_Grid = g_ShowGrid; // TRUE to show a grid
m_Draw_Sheet_Ref = TRUE; // TRUE to show sheet references m_Draw_Sheet_Ref = TRUE; // TRUE to show sheet references
......
...@@ -29,7 +29,7 @@ SET(GERBVIEW_SRCS ...@@ -29,7 +29,7 @@ SET(GERBVIEW_SRCS
# pcbtexte.cpp # pcbtexte.cpp
# process_config.cpp # process_config.cpp
readgerb.cpp readgerb.cpp
reglage.cpp reglage.cpp
rs274d.cpp rs274d.cpp
rs274x.cpp rs274x.cpp
select_layers_to_pcb.cpp select_layers_to_pcb.cpp
...@@ -54,7 +54,6 @@ SET(GERBVIEW_EXTRA_SRCS ...@@ -54,7 +54,6 @@ SET(GERBVIEW_EXTRA_SRCS
../share/drawframe.cpp ../share/drawframe.cpp
../share/drawpanel.cpp ../share/drawpanel.cpp
../share/infospgm.cpp
../share/setpage.cpp ../share/setpage.cpp
../share/wxprint.cpp ../share/wxprint.cpp
../share/zoom.cpp) ../share/zoom.cpp)
......
...@@ -128,6 +128,7 @@ WinEDA_GerberFrame::WinEDA_GerberFrame(wxWindow * father, WinEDA_App *parent, ...@@ -128,6 +128,7 @@ WinEDA_GerberFrame::WinEDA_GerberFrame(wxWindow * father, WinEDA_App *parent,
WinEDA_BasePcbFrame(father, parent, GERBER_FRAME, title, pos, size, style) WinEDA_BasePcbFrame(father, parent, GERBER_FRAME, title, pos, size, style)
{ {
m_FrameName = wxT("GerberFrame"); m_FrameName = wxT("GerberFrame");
m_AboutTitle = g_GerbviewAboutTitle;
m_Draw_Axis = TRUE; // TRUE pour avoir les axes dessines m_Draw_Axis = TRUE; // TRUE pour avoir les axes dessines
m_Draw_Grid = TRUE; // TRUE pour avoir la axes dessinee m_Draw_Grid = TRUE; // TRUE pour avoir la axes dessinee
m_Draw_Sheet_Ref = FALSE; // TRUE pour avoir le cartouche dessin m_Draw_Sheet_Ref = FALSE; // TRUE pour avoir le cartouche dessin
...@@ -313,4 +314,3 @@ wxSize size; ...@@ -313,4 +314,3 @@ wxSize size;
return(bestzoom); return(bestzoom);
} }
...@@ -554,7 +554,13 @@ char* to_point( char* Text ); ...@@ -554,7 +554,13 @@ char* to_point( char* Text );
/****************/ /****************/
/* infospgm.cpp */ /* infospgm.cpp */
/****************/ /****************/
void Print_Kicad_Infos( wxWindow* frame ); extern wxString g_KicadAboutTitle;
extern wxString g_CvpcbAboutTitle;
extern wxString g_EeschemaAboutTitle;
extern wxString g_PcbnewAboutTitle;
extern wxString g_GerbviewAboutTitle;
void Print_Kicad_Infos( wxWindow* frame, const wxString& title );
/**************/ /**************/
/* common.cpp */ /* common.cpp */
......
...@@ -146,6 +146,7 @@ public: ...@@ -146,6 +146,7 @@ public:
bool m_FrameIsActive; bool m_FrameIsActive;
wxString m_FrameName; // name used for writting and reading setup wxString m_FrameName; // name used for writting and reading setup
// It is "SchematicFrame", "PcbFrame" .... // It is "SchematicFrame", "PcbFrame" ....
wxString m_AboutTitle; // Name of program displayed in About.
public: public:
......
...@@ -13,9 +13,6 @@ SET(KICAD_SRCS ...@@ -13,9 +13,6 @@ SET(KICAD_SRCS
treeprj_datas.cpp treeprj_datas.cpp
treeprj_frame.cpp) treeprj_frame.cpp)
SET(KICAD_EXTRA_SRCS
../share/infospgm.cpp)
IF(WIN32) IF(WIN32)
IF(MINGW) IF(MINGW)
# resource compilation for mingw (http://www.cmake.org/Bug/view.php?id=4068) # resource compilation for mingw (http://www.cmake.org/Bug/view.php?id=4068)
......
...@@ -63,8 +63,8 @@ WinEDA_PrjFrame* WinEDA_MainFrame::GetTree() const { return m_LeftWin; ...@@ -63,8 +63,8 @@ WinEDA_PrjFrame* WinEDA_MainFrame::GetTree() const { return m_LeftWin;
void WinEDA_MainFrame::AddFastLaunchPy( object & button ) void WinEDA_MainFrame::AddFastLaunchPy( object & button )
{ {
wxButton * btn; wxBitmapButton * btn;
bool success = wxPyConvertSwigPtr( button.ptr(), (void**)&btn, _T("wxButton")); bool success = wxPyConvertSwigPtr( button.ptr(), (void**)&btn, _T("wxBitmapButton"));
if ( !success ) return; if ( !success ) return;
Py_INCREF( button.ptr() ); Py_INCREF( button.ptr() );
......
...@@ -34,6 +34,7 @@ WinEDA_MainFrame::WinEDA_MainFrame( WinEDA_App* eda_app, ...@@ -34,6 +34,7 @@ WinEDA_MainFrame::WinEDA_MainFrame( WinEDA_App* eda_app,
wxSize clientsize; wxSize clientsize;
m_FrameName = wxT( "KicadFrame" ); m_FrameName = wxT( "KicadFrame" );
m_AboutTitle = g_KicadAboutTitle;
m_VToolBar = NULL; m_VToolBar = NULL;
m_LeftWin = NULL; m_LeftWin = NULL;
m_BottomWin = NULL; m_BottomWin = NULL;
...@@ -393,7 +394,6 @@ void WinEDA_MainFrame::ClearMsg() ...@@ -393,7 +394,6 @@ void WinEDA_MainFrame::ClearMsg()
m_DialogWin->Clear(); m_DialogWin->Clear();
} }
#ifdef KICAD_PYTHON #ifdef KICAD_PYTHON
void WinEDA_MainFrame::OnRefreshPy() void WinEDA_MainFrame::OnRefreshPy()
{ {
......
...@@ -3,7 +3,10 @@ IF(ZLIB_FOUND) ...@@ -3,7 +3,10 @@ IF(ZLIB_FOUND)
MESSAGE(STATUS "Check for installed ZLIB -- found") MESSAGE(STATUS "Check for installed ZLIB -- found")
ELSE(ZLIB_FOUND) ELSE(ZLIB_FOUND)
MESSAGE(STATUS "Check for installed zlib -- not found") MESSAGE(STATUS "Check for installed zlib -- not found")
MESSAGE(FATAL_ERROR "zlib was not found - it is required to build KiCad") IF (NOT MINGW)
MESSAGE(FATAL_ERROR
"zlib was not found - it is required to build KiCad")
ENDIF (NOT MINGW)
ENDIF(ZLIB_FOUND) ENDIF(ZLIB_FOUND)
SET(MINIZIP_SRCS SET(MINIZIP_SRCS
......
...@@ -4,7 +4,7 @@ FIND_PACKAGE(Boost) ...@@ -4,7 +4,7 @@ FIND_PACKAGE(Boost)
INCLUDE_DIRECTORIES( INCLUDE_DIRECTORIES(
${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}
${Boost_INCLUDE_DIRS} ${Boost_INCLUDE_DIR}
bitmaps bitmaps
../3d-viewer ../3d-viewer
../polygon) ../polygon)
...@@ -145,7 +145,6 @@ SET(PCBNEW_SRCS ...@@ -145,7 +145,6 @@ SET(PCBNEW_SRCS
SET(PCBNEW_EXTRA_SRCS SET(PCBNEW_EXTRA_SRCS
../share/drawframe.cpp ../share/drawframe.cpp
../share/drawpanel.cpp ../share/drawpanel.cpp
../share/infospgm.cpp
../share/setpage.cpp ../share/setpage.cpp
../share/wxprint.cpp ../share/wxprint.cpp
../share/zoom.cpp) ../share/zoom.cpp)
......
...@@ -183,6 +183,7 @@ WinEDA_PcbFrame::WinEDA_PcbFrame( wxWindow* father, WinEDA_App* parent, ...@@ -183,6 +183,7 @@ WinEDA_PcbFrame::WinEDA_PcbFrame( wxWindow* father, WinEDA_App* parent,
WinEDA_BasePcbFrame( father, parent, PCB_FRAME, title, pos, size, style ) WinEDA_BasePcbFrame( father, parent, PCB_FRAME, title, pos, size, style )
{ {
m_FrameName = wxT( "PcbFrame" ); m_FrameName = wxT( "PcbFrame" );
m_AboutTitle = g_PcbnewAboutTitle;
m_Draw_Axis = TRUE; // TRUE pour avoir les axes dessines m_Draw_Axis = TRUE; // TRUE pour avoir les axes dessines
m_Draw_Grid = g_ShowGrid; // TRUE pour avoir la grille dessinee m_Draw_Grid = g_ShowGrid; // TRUE pour avoir la grille dessinee
m_Draw_Sheet_Ref = TRUE; // TRUE pour avoir le cartouche dessine m_Draw_Sheet_Ref = TRUE; // TRUE pour avoir le cartouche dessine
......
...@@ -2422,6 +2422,9 @@ public: ...@@ -2422,6 +2422,9 @@ public:
class CONNECT : public ELEM class CONNECT : public ELEM
{ {
public:
CONNECT( ELEM* parent ) :
ELEM( T_connect, parent ) {}
}; };
......
...@@ -14,36 +14,23 @@ ...@@ -14,36 +14,23 @@
// Import: // Import:
extern wxString g_Main_Title; extern wxString g_Main_Title;
// Local /* Program title strings used in about dialog. They are kept hear to make
#ifdef GERBVIEW * it easy to update the copyright dates. */
static wxString MsgInfos(wxT("** GERBVIEW (jul 2001 .. 2008) **")); wxString g_KicadAboutTitle = wxT("** KICAD (jul 2000 .. 2008) **");
#else wxString g_CvpcbAboutTitle = wxT("** CVPCB (sept 1992 .. 2008) **");
#ifdef PCBNEW wxString g_EeschemaAboutTitle = wxT("** EESCHEMA (sept 1994 .. 2008) **");
static wxString MsgInfos(wxT("** PCBNEW (sept 1992 .. 2008) **")); wxString g_PcbnewAboutTitle = wxT("** PCBNEW (sept 1992 .. 2008) **");
#endif wxString g_GerbviewAboutTitle = wxT("** GERBVIEW (jul 2001 .. 2008) **");
#endif
#ifdef CVPCB
static wxString MsgInfos(wxT("** CVPCB (sept 1992 .. 2008) **"));
#endif
#ifdef KICAD
static wxString MsgInfos(wxT("** KICAD (jul 2000 .. 2008) **"));
#endif
#ifdef EESCHEMA
static wxString MsgInfos(wxT("** EESCHEMA (sept 1994 .. 2008) **"));
#endif
// Routines Locales // Routines Locales
/*******************************************/ /*******************************************/
void Print_Kicad_Infos(wxWindow * frame) void Print_Kicad_Infos(wxWindow * frame, const wxString& title)
/*******************************************/ /*******************************************/
{ {
wxString AboutCaption = wxT("About "); wxString AboutCaption = wxT("About ");
wxString Msg = title;
wxString Msg = MsgInfos;
Msg << wxT("\n\n") << _("Build Version:") << wxT("\n") ; Msg << wxT("\n\n") << _("Build Version:") << wxT("\n") ;
Msg << g_Main_Title << wxT(" ") << GetBuildVersion(); Msg << g_Main_Title << wxT(" ") << GetBuildVersion();
......
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