Loading kicad/kicad.cpp +173 −63 Original line number Diff line number Diff line /********************************/ /* kicad.cpp - module principal */ /********************************/ /*****************************************************************************/ /** * @file kicad.cpp * @brief Main kicad library manager file */ /*****************************************************************************/ #ifdef __GNUG__ #pragma implementation Loading @@ -13,13 +18,9 @@ #include <wx/image.h> //#define SPLASH_OK #ifdef SPLASH_OK /* Define Splash Image */ #ifdef USE_SPLASH_IMAGE #define SPLASH_IMAGE logo_kicad.png #include "wx/splash.h" #include "wx/mediactrl.h" #endif Loading @@ -35,95 +36,174 @@ #include <pyhandler.h> #endif /* Routines exportees */ /* Export functions */ /* fonctions importees */ /* Import functions */ char *GetFileName(char *FullPathName); void ShowLogo(char * FonteFileName); /* Routines locales */ /* Local functions */ /************************************/ /* Called to initialize the program */ /************************************/ // Create a new application object IMPLEMENT_APP(WinEDA_App) #ifdef KICAD_PYTHON using namespace boost::python; /*****************************************************************************/ // Global functions: /*****************************************************************************/ static WinEDA_MainFrame& GetMainFrame() { return *( wxGetApp().m_MainFrame ); } static void WinEDAPrint( str msg ) { GetMainFrame().PrintMsg( PyHandler::MakeStr( msg ) + wxT("\n") ); } static void WinEDAClear() { GetMainFrame().ClearMsg(); } static object GetTypeExt( enum TreeFileType type ) { return PyHandler::Convert( WinEDA_PrjFrame::GetFileExt( type ) ); } /*****************************************************************************/ // WinEDA_MainFrame Special binding functions: // (one line functions are simple wrappers) /*****************************************************************************/ object WinEDA_MainFrame::GetPrjName() const { return PyHandler::Convert( m_PrjFileName ); } object WinEDA_MainFrame::ToWx() { return object( handle<>( borrowed( wxPyMake_wxObject( this, false ) ) ) ); } WinEDA_PrjFrame* WinEDA_MainFrame::GetTree() const { return m_LeftWin; } /** * @brief TODO */ /*****************************************************************************/ void WinEDA_MainFrame::AddFastLaunchPy( object & button ) /*****************************************************************************/ { wxBitmapButton * btn; bool success = wxPyConvertSwigPtr( button.ptr(), (void**)&btn, _T("wxBitmapButton")); if ( !success ) return; if(!success) return; Py_INCREF( button.ptr() ); btn->Reparent( m_CommandWin ); m_CommandWin->AddFastLaunch( btn ); } /*****************************************************************************/ // WinEDA_PrjFrame Special binding functions: // (one line functions are simple wrappers) /*****************************************************************************/ // TODO To WxWidgets ? object WinEDA_PrjFrame::ToWx() { return object( handle<>( borrowed( wxPyMake_wxObject( this, false ) ) ) ); } // TODO Get ? object WinEDA_PrjFrame::GetFtExPy( enum TreeFileType type ) const { return PyHandler::Convert( GetFileExt( type ) ); } // Get python menu object WinEDA_PrjFrame::GetMenuPy( enum TreeFileType type ) { return object( handle<>( borrowed( wxPyMake_wxObject( GetContextMenu( (int) type ), false ) ) ) ); } // Get tree control object WinEDA_PrjFrame::GetTreeCtrl() { return object( handle<>( borrowed( wxPyMake_wxObject( m_TreeProject, false ) ) ) ); } // Get current menu object WinEDA_PrjFrame::GetCurrentMenu() { return object( handle<>( borrowed( wxPyMake_wxObject( m_PopupMenu, false ) ) ) ); } object WinEDA_PrjFrame::ToWx() { return object( handle<>( borrowed( wxPyMake_wxObject( this, false ) ) ) ); } object WinEDA_PrjFrame::GetFtExPy( enum TreeFileType type ) const { return PyHandler::Convert( GetFileExt( type ) ); } object WinEDA_PrjFrame::GetMenuPy( enum TreeFileType type ) { return object( handle<>( borrowed( wxPyMake_wxObject( GetContextMenu( (int) type ), false ) ) ) ); } object WinEDA_PrjFrame::GetTreeCtrl() { return object( handle<>( borrowed( wxPyMake_wxObject( m_TreeProject, false ) ) ) ); } object WinEDA_PrjFrame::GetCurrentMenu() { return object( handle<>( borrowed( wxPyMake_wxObject( m_PopupMenu, false ) ) ) ); } void WinEDA_PrjFrame::NewFilePy( const str & name, enum TreeFileType type, object & id ) /** * @brief TODO */ /*****************************************************************************/ void WinEDA_PrjFrame::NewFilePy( const str & name, enum TreeFileType type, object & id ) /*****************************************************************************/ { wxTreeItemId root; if (! wxPyConvertSwigPtr( id.ptr(), (void**)&root, _T("wxTreeItemId") ) ) return; NewFile( PyHandler::MakeStr( name ), type, root ); } /** * @brief Add a file to the tree under root, or m_root if conversion is wrong */ /*****************************************************************************/ void WinEDA_PrjFrame::AddFilePy( const str & file, object & root ) /* Add a file to the tree under root, or m_root if conversion is wrong */ /*****************************************************************************/ { wxTreeItemId * theroot = &m_root; if ( !wxPyConvertSwigPtr( root.ptr(), (void**)&root, _T("wxTreeItemId") ) ) { theroot = &m_root; } AddFile( PyHandler::MakeStr( file ), *theroot ); } /** * @brief convert wxTreeItem into TreePrjItemData */ /*****************************************************************************/ TreePrjItemData * WinEDA_PrjFrame::GetItemData( const object & item ) /* convert wxTreeItem into TreePrjItemData */ /*****************************************************************************/ { wxTreeItemId *id = NULL; if ( !wxPyConvertSwigPtr( item.ptr(), (void**)&id, _T("wxTreeItemId") ) ) return NULL; if (!wxPyConvertSwigPtr( item.ptr(), (void**)&id, _T("wxTreeItemId"))) { return NULL; } return dynamic_cast<TreePrjItemData *>( m_TreeProject->GetItemData( *id ) ); } /*****************************************************************************/ // TreePrjItemData Special binding functions // (one line functions are simple wrappers) /*****************************************************************************/ // Python rename bool TreePrjItemData::RenamePy( const str & newname, bool check ) { return Rename( PyHandler::MakeStr(newname), check ); } // Get python directory object TreePrjItemData::GetDirPy() const { return PyHandler::Convert( GetDir() ); } bool TreePrjItemData::RenamePy( const str & newname, bool check ) { return Rename( PyHandler::MakeStr(newname), check ); } object TreePrjItemData::GetDirPy() const { return PyHandler::Convert( GetDir() ); } object TreePrjItemData::GetFileNamePy() const { return PyHandler::Convert( GetFileName() ); } object TreePrjItemData::GetMenuPy() { return object( handle<>( borrowed( wxPyMake_wxObject( &m_fileMenu, false ) ) ) ); } // Get python filename object TreePrjItemData::GetFileNamePy() const { return PyHandler::Convert( GetFileName() ); } // kicad module init function // ( this function is called from PyHandler to init the kicad module ) // Get python menu object TreePrjItemData::GetMenuPy() { return object( handle<>( borrowed( wxPyMake_wxObject( &m_fileMenu, false ) ) ) ); } /** * @brief KiCad python module init, \n * This function is called from PyHandler to init the kicad module */ /*****************************************************************************/ static void py_kicad_init() /*****************************************************************************/ { def( "GetMainFrame", &GetMainFrame, return_value_policy< reference_existing_object >() ); def( "GetTypeExtension", &GetTypeExt ); Loading Loading @@ -156,6 +236,7 @@ static void py_kicad_init() .value( "DIRECTORY", TREE_DIRECTORY ) .value( "MAX", TREE_MAX ); class_<WinEDA_PrjFrame>( "TreeWindow" ) // wx Interface .def( "ToWx", &WinEDA_PrjFrame::ToWx ) Loading @@ -168,14 +249,38 @@ static void py_kicad_init() .def( "RemoveFilter", &WinEDA_PrjFrame::RemoveFilterPy ) .def( "GetFilters", &WinEDA_PrjFrame::GetFilters, return_value_policy < copy_const_reference >() ) .def( "GetCurrentMenu", &WinEDA_PrjFrame::GetCurrentMenu ) // Project tree control .def( "AddState", &WinEDA_PrjFrame::AddStatePy ) .def( "GetTreeCtrl", &WinEDA_PrjFrame::GetTreeCtrl ) .def( "GetItemData", &WinEDA_PrjFrame::GetItemData, return_value_policy < reference_existing_object >() ) .def( "FindItemData", &WinEDA_PrjFrame::FindItemData, return_value_policy < reference_existing_object >() ) .def( "NewFile", &WinEDA_PrjFrame::NewFilePy ) .def( "AddFile", &WinEDA_PrjFrame::AddFilePy ) ; /** Project tree control **/ // AddState .def( "AddState", &WinEDA_PrjFrame::AddStatePy ) // GetTreeCtrl .def( "GetTreeCtrl", &WinEDA_PrjFrame::GetTreeCtrl ) // GetItemData .def( "GetItemData", &WinEDA_PrjFrame::GetItemData, return_value_policy < reference_existing_object >() ) // FindItemData .def( "FindItemData", &WinEDA_PrjFrame::FindItemData, return_value_policy < reference_existing_object >() ) // NewFile .def( "NewFile", &WinEDA_PrjFrame::NewFilePy ) // AddFile .def( "AddFile", &WinEDA_PrjFrame::AddFilePy ) ; /* ENDOF class_<WinEDA_PrjFrame>( "TreeWindow" ) */ class_<WinEDA_MainFrame>( "MainFrame" ) // Wx interface Loading @@ -188,18 +293,25 @@ static void py_kicad_init() } // common module init function /** * @brief Common python module init */ /*****************************************************************************/ static void py_common_init() /*****************************************************************************/ { def( "Print", &WinEDAPrint ); def( "Clear", &WinEDAClear ); } #endif /*****************************************************************************/ bool WinEDA_App::OnInit() /*****************************************************************************/ { wxImage::AddHandler(new wxPNGHandler); Loading Loading @@ -236,8 +348,8 @@ bool WinEDA_App::OnInit() m_MainFrame->m_LeftWin->ReCreateTreePrj(); SetTopWindow(m_MainFrame); /* Splash Screen Logo */ #ifdef SPLASH_OK /* Splash screen logo */ #ifdef USE_SPLASH_IMAGE wxString logoname( wxString(m_BinDir) + _T("logokicad.png") ); wxBitmap splash_screen; if ( splash_screen.LoadFile( logoname, wxBITMAP_TYPE_PNG ) ) Loading @@ -247,7 +359,7 @@ bool WinEDA_App::OnInit() 3000, m_MainFrame, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSIMPLE_BORDER|wxSTAY_ON_TOP); } #endif #endif /* USE_SPLASH_IMAGE */ m_MainFrame->Show(TRUE); m_MainFrame->Raise(); Loading @@ -265,5 +377,3 @@ bool WinEDA_App::OnInit() return TRUE; } // vim: tabstop=4 : noexpandtab : kicad/mainframe.cpp +48 −42 Original line number Diff line number Diff line Loading @@ -21,16 +21,19 @@ #include "kicad.h" /****************/ /* Constructor */ /****************/ // Constructor /*****************************************************************************/ WinEDA_MainFrame::WinEDA_MainFrame( WinEDA_App* eda_app, wxWindow* parent, const wxString& title, const wxPoint& pos, const wxSize& size ) : wxWindow* parent, const wxString& title, const wxPoint& pos, const wxSize& size ) : WinEDA_BasicFrame( parent, KICAD_MAIN_FRAME, eda_app, title, pos, size ) /*****************************************************************************/ { wxString msg; wxString line; wxSize clientsize; m_FrameName = wxT( "KicadFrame" ); Loading @@ -44,8 +47,10 @@ WinEDA_MainFrame::WinEDA_MainFrame( WinEDA_App* eda_app, GetSettings(); if( m_Parent->m_EDA_Config ) { m_Parent->m_EDA_Config->Read( wxT( "LeftWinWidth" ), &m_LeftWin_Width ); m_Parent->m_EDA_Config->Read( wxT( "CommandWinWidth" ), &m_CommandWin_Height ); m_Parent->m_EDA_Config->Read( wxT( "LeftWinWidth" ), &m_LeftWin_Width ); m_Parent->m_EDA_Config->Read( wxT( "CommandWinWidth" ), &m_CommandWin_Height ); } SetSize( m_FramePos.x, m_FramePos.y, m_FrameSize.x, m_FrameSize.y ); Loading Loading @@ -91,13 +96,14 @@ WinEDA_MainFrame::WinEDA_MainFrame( WinEDA_App* eda_app, m_DialogWin->SetFont( *g_StdFont ); // m_CommandWin is the box with buttons which launch eechema, pcbnew ... m_CommandWin = new WinEDA_CommandFrame( this, ID_MAIN_COMMAND, m_CommandWin = new WinEDA_CommandFrame( this, ID_MAIN_COMMAND, wxPoint( m_LeftWin_Width, 0 ), wxSize( clientsize.x, m_CommandWin_Height ), wxSize( clientsize.x, m_CommandWin_Height ), wxNO_BORDER | wxSW_3D ); wxString line; msg = wxGetCwd(); line.Printf( _( "Ready\nWorking dir: %s\n" ), msg.GetData() ); PrintMsg( line ); Loading @@ -108,11 +114,9 @@ WinEDA_MainFrame::WinEDA_MainFrame( WinEDA_App* eda_app, } /***************/ /* Destructor */ /***************/ /*****************************************************************************/ WinEDA_MainFrame::~WinEDA_MainFrame() /*****************************************************************************/ { if( m_Parent->m_EDA_Config ) { Loading @@ -127,7 +131,6 @@ WinEDA_MainFrame::~WinEDA_MainFrame() /*******************************************************/ void WinEDA_MainFrame::PrintMsg( const wxString& text ) /*******************************************************/ /* * Put text in the dialog frame */ Loading Loading @@ -394,6 +397,7 @@ void WinEDA_MainFrame::OnRefresh( wxCommandEvent& event ) } /*********************************/ void WinEDA_MainFrame::ClearMsg() /*********************************/ Loading @@ -401,11 +405,13 @@ void WinEDA_MainFrame::ClearMsg() m_DialogWin->Clear(); } #ifdef KICAD_PYTHON /*****************************************************************************/ void WinEDA_MainFrame::OnRefreshPy() /*****************************************************************************/ { m_LeftWin->ReCreateTreePrj(); } #endif Loading
kicad/kicad.cpp +173 −63 Original line number Diff line number Diff line /********************************/ /* kicad.cpp - module principal */ /********************************/ /*****************************************************************************/ /** * @file kicad.cpp * @brief Main kicad library manager file */ /*****************************************************************************/ #ifdef __GNUG__ #pragma implementation Loading @@ -13,13 +18,9 @@ #include <wx/image.h> //#define SPLASH_OK #ifdef SPLASH_OK /* Define Splash Image */ #ifdef USE_SPLASH_IMAGE #define SPLASH_IMAGE logo_kicad.png #include "wx/splash.h" #include "wx/mediactrl.h" #endif Loading @@ -35,95 +36,174 @@ #include <pyhandler.h> #endif /* Routines exportees */ /* Export functions */ /* fonctions importees */ /* Import functions */ char *GetFileName(char *FullPathName); void ShowLogo(char * FonteFileName); /* Routines locales */ /* Local functions */ /************************************/ /* Called to initialize the program */ /************************************/ // Create a new application object IMPLEMENT_APP(WinEDA_App) #ifdef KICAD_PYTHON using namespace boost::python; /*****************************************************************************/ // Global functions: /*****************************************************************************/ static WinEDA_MainFrame& GetMainFrame() { return *( wxGetApp().m_MainFrame ); } static void WinEDAPrint( str msg ) { GetMainFrame().PrintMsg( PyHandler::MakeStr( msg ) + wxT("\n") ); } static void WinEDAClear() { GetMainFrame().ClearMsg(); } static object GetTypeExt( enum TreeFileType type ) { return PyHandler::Convert( WinEDA_PrjFrame::GetFileExt( type ) ); } /*****************************************************************************/ // WinEDA_MainFrame Special binding functions: // (one line functions are simple wrappers) /*****************************************************************************/ object WinEDA_MainFrame::GetPrjName() const { return PyHandler::Convert( m_PrjFileName ); } object WinEDA_MainFrame::ToWx() { return object( handle<>( borrowed( wxPyMake_wxObject( this, false ) ) ) ); } WinEDA_PrjFrame* WinEDA_MainFrame::GetTree() const { return m_LeftWin; } /** * @brief TODO */ /*****************************************************************************/ void WinEDA_MainFrame::AddFastLaunchPy( object & button ) /*****************************************************************************/ { wxBitmapButton * btn; bool success = wxPyConvertSwigPtr( button.ptr(), (void**)&btn, _T("wxBitmapButton")); if ( !success ) return; if(!success) return; Py_INCREF( button.ptr() ); btn->Reparent( m_CommandWin ); m_CommandWin->AddFastLaunch( btn ); } /*****************************************************************************/ // WinEDA_PrjFrame Special binding functions: // (one line functions are simple wrappers) /*****************************************************************************/ // TODO To WxWidgets ? object WinEDA_PrjFrame::ToWx() { return object( handle<>( borrowed( wxPyMake_wxObject( this, false ) ) ) ); } // TODO Get ? object WinEDA_PrjFrame::GetFtExPy( enum TreeFileType type ) const { return PyHandler::Convert( GetFileExt( type ) ); } // Get python menu object WinEDA_PrjFrame::GetMenuPy( enum TreeFileType type ) { return object( handle<>( borrowed( wxPyMake_wxObject( GetContextMenu( (int) type ), false ) ) ) ); } // Get tree control object WinEDA_PrjFrame::GetTreeCtrl() { return object( handle<>( borrowed( wxPyMake_wxObject( m_TreeProject, false ) ) ) ); } // Get current menu object WinEDA_PrjFrame::GetCurrentMenu() { return object( handle<>( borrowed( wxPyMake_wxObject( m_PopupMenu, false ) ) ) ); } object WinEDA_PrjFrame::ToWx() { return object( handle<>( borrowed( wxPyMake_wxObject( this, false ) ) ) ); } object WinEDA_PrjFrame::GetFtExPy( enum TreeFileType type ) const { return PyHandler::Convert( GetFileExt( type ) ); } object WinEDA_PrjFrame::GetMenuPy( enum TreeFileType type ) { return object( handle<>( borrowed( wxPyMake_wxObject( GetContextMenu( (int) type ), false ) ) ) ); } object WinEDA_PrjFrame::GetTreeCtrl() { return object( handle<>( borrowed( wxPyMake_wxObject( m_TreeProject, false ) ) ) ); } object WinEDA_PrjFrame::GetCurrentMenu() { return object( handle<>( borrowed( wxPyMake_wxObject( m_PopupMenu, false ) ) ) ); } void WinEDA_PrjFrame::NewFilePy( const str & name, enum TreeFileType type, object & id ) /** * @brief TODO */ /*****************************************************************************/ void WinEDA_PrjFrame::NewFilePy( const str & name, enum TreeFileType type, object & id ) /*****************************************************************************/ { wxTreeItemId root; if (! wxPyConvertSwigPtr( id.ptr(), (void**)&root, _T("wxTreeItemId") ) ) return; NewFile( PyHandler::MakeStr( name ), type, root ); } /** * @brief Add a file to the tree under root, or m_root if conversion is wrong */ /*****************************************************************************/ void WinEDA_PrjFrame::AddFilePy( const str & file, object & root ) /* Add a file to the tree under root, or m_root if conversion is wrong */ /*****************************************************************************/ { wxTreeItemId * theroot = &m_root; if ( !wxPyConvertSwigPtr( root.ptr(), (void**)&root, _T("wxTreeItemId") ) ) { theroot = &m_root; } AddFile( PyHandler::MakeStr( file ), *theroot ); } /** * @brief convert wxTreeItem into TreePrjItemData */ /*****************************************************************************/ TreePrjItemData * WinEDA_PrjFrame::GetItemData( const object & item ) /* convert wxTreeItem into TreePrjItemData */ /*****************************************************************************/ { wxTreeItemId *id = NULL; if ( !wxPyConvertSwigPtr( item.ptr(), (void**)&id, _T("wxTreeItemId") ) ) return NULL; if (!wxPyConvertSwigPtr( item.ptr(), (void**)&id, _T("wxTreeItemId"))) { return NULL; } return dynamic_cast<TreePrjItemData *>( m_TreeProject->GetItemData( *id ) ); } /*****************************************************************************/ // TreePrjItemData Special binding functions // (one line functions are simple wrappers) /*****************************************************************************/ // Python rename bool TreePrjItemData::RenamePy( const str & newname, bool check ) { return Rename( PyHandler::MakeStr(newname), check ); } // Get python directory object TreePrjItemData::GetDirPy() const { return PyHandler::Convert( GetDir() ); } bool TreePrjItemData::RenamePy( const str & newname, bool check ) { return Rename( PyHandler::MakeStr(newname), check ); } object TreePrjItemData::GetDirPy() const { return PyHandler::Convert( GetDir() ); } object TreePrjItemData::GetFileNamePy() const { return PyHandler::Convert( GetFileName() ); } object TreePrjItemData::GetMenuPy() { return object( handle<>( borrowed( wxPyMake_wxObject( &m_fileMenu, false ) ) ) ); } // Get python filename object TreePrjItemData::GetFileNamePy() const { return PyHandler::Convert( GetFileName() ); } // kicad module init function // ( this function is called from PyHandler to init the kicad module ) // Get python menu object TreePrjItemData::GetMenuPy() { return object( handle<>( borrowed( wxPyMake_wxObject( &m_fileMenu, false ) ) ) ); } /** * @brief KiCad python module init, \n * This function is called from PyHandler to init the kicad module */ /*****************************************************************************/ static void py_kicad_init() /*****************************************************************************/ { def( "GetMainFrame", &GetMainFrame, return_value_policy< reference_existing_object >() ); def( "GetTypeExtension", &GetTypeExt ); Loading Loading @@ -156,6 +236,7 @@ static void py_kicad_init() .value( "DIRECTORY", TREE_DIRECTORY ) .value( "MAX", TREE_MAX ); class_<WinEDA_PrjFrame>( "TreeWindow" ) // wx Interface .def( "ToWx", &WinEDA_PrjFrame::ToWx ) Loading @@ -168,14 +249,38 @@ static void py_kicad_init() .def( "RemoveFilter", &WinEDA_PrjFrame::RemoveFilterPy ) .def( "GetFilters", &WinEDA_PrjFrame::GetFilters, return_value_policy < copy_const_reference >() ) .def( "GetCurrentMenu", &WinEDA_PrjFrame::GetCurrentMenu ) // Project tree control .def( "AddState", &WinEDA_PrjFrame::AddStatePy ) .def( "GetTreeCtrl", &WinEDA_PrjFrame::GetTreeCtrl ) .def( "GetItemData", &WinEDA_PrjFrame::GetItemData, return_value_policy < reference_existing_object >() ) .def( "FindItemData", &WinEDA_PrjFrame::FindItemData, return_value_policy < reference_existing_object >() ) .def( "NewFile", &WinEDA_PrjFrame::NewFilePy ) .def( "AddFile", &WinEDA_PrjFrame::AddFilePy ) ; /** Project tree control **/ // AddState .def( "AddState", &WinEDA_PrjFrame::AddStatePy ) // GetTreeCtrl .def( "GetTreeCtrl", &WinEDA_PrjFrame::GetTreeCtrl ) // GetItemData .def( "GetItemData", &WinEDA_PrjFrame::GetItemData, return_value_policy < reference_existing_object >() ) // FindItemData .def( "FindItemData", &WinEDA_PrjFrame::FindItemData, return_value_policy < reference_existing_object >() ) // NewFile .def( "NewFile", &WinEDA_PrjFrame::NewFilePy ) // AddFile .def( "AddFile", &WinEDA_PrjFrame::AddFilePy ) ; /* ENDOF class_<WinEDA_PrjFrame>( "TreeWindow" ) */ class_<WinEDA_MainFrame>( "MainFrame" ) // Wx interface Loading @@ -188,18 +293,25 @@ static void py_kicad_init() } // common module init function /** * @brief Common python module init */ /*****************************************************************************/ static void py_common_init() /*****************************************************************************/ { def( "Print", &WinEDAPrint ); def( "Clear", &WinEDAClear ); } #endif /*****************************************************************************/ bool WinEDA_App::OnInit() /*****************************************************************************/ { wxImage::AddHandler(new wxPNGHandler); Loading Loading @@ -236,8 +348,8 @@ bool WinEDA_App::OnInit() m_MainFrame->m_LeftWin->ReCreateTreePrj(); SetTopWindow(m_MainFrame); /* Splash Screen Logo */ #ifdef SPLASH_OK /* Splash screen logo */ #ifdef USE_SPLASH_IMAGE wxString logoname( wxString(m_BinDir) + _T("logokicad.png") ); wxBitmap splash_screen; if ( splash_screen.LoadFile( logoname, wxBITMAP_TYPE_PNG ) ) Loading @@ -247,7 +359,7 @@ bool WinEDA_App::OnInit() 3000, m_MainFrame, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSIMPLE_BORDER|wxSTAY_ON_TOP); } #endif #endif /* USE_SPLASH_IMAGE */ m_MainFrame->Show(TRUE); m_MainFrame->Raise(); Loading @@ -265,5 +377,3 @@ bool WinEDA_App::OnInit() return TRUE; } // vim: tabstop=4 : noexpandtab :
kicad/mainframe.cpp +48 −42 Original line number Diff line number Diff line Loading @@ -21,16 +21,19 @@ #include "kicad.h" /****************/ /* Constructor */ /****************/ // Constructor /*****************************************************************************/ WinEDA_MainFrame::WinEDA_MainFrame( WinEDA_App* eda_app, wxWindow* parent, const wxString& title, const wxPoint& pos, const wxSize& size ) : wxWindow* parent, const wxString& title, const wxPoint& pos, const wxSize& size ) : WinEDA_BasicFrame( parent, KICAD_MAIN_FRAME, eda_app, title, pos, size ) /*****************************************************************************/ { wxString msg; wxString line; wxSize clientsize; m_FrameName = wxT( "KicadFrame" ); Loading @@ -44,8 +47,10 @@ WinEDA_MainFrame::WinEDA_MainFrame( WinEDA_App* eda_app, GetSettings(); if( m_Parent->m_EDA_Config ) { m_Parent->m_EDA_Config->Read( wxT( "LeftWinWidth" ), &m_LeftWin_Width ); m_Parent->m_EDA_Config->Read( wxT( "CommandWinWidth" ), &m_CommandWin_Height ); m_Parent->m_EDA_Config->Read( wxT( "LeftWinWidth" ), &m_LeftWin_Width ); m_Parent->m_EDA_Config->Read( wxT( "CommandWinWidth" ), &m_CommandWin_Height ); } SetSize( m_FramePos.x, m_FramePos.y, m_FrameSize.x, m_FrameSize.y ); Loading Loading @@ -91,13 +96,14 @@ WinEDA_MainFrame::WinEDA_MainFrame( WinEDA_App* eda_app, m_DialogWin->SetFont( *g_StdFont ); // m_CommandWin is the box with buttons which launch eechema, pcbnew ... m_CommandWin = new WinEDA_CommandFrame( this, ID_MAIN_COMMAND, m_CommandWin = new WinEDA_CommandFrame( this, ID_MAIN_COMMAND, wxPoint( m_LeftWin_Width, 0 ), wxSize( clientsize.x, m_CommandWin_Height ), wxSize( clientsize.x, m_CommandWin_Height ), wxNO_BORDER | wxSW_3D ); wxString line; msg = wxGetCwd(); line.Printf( _( "Ready\nWorking dir: %s\n" ), msg.GetData() ); PrintMsg( line ); Loading @@ -108,11 +114,9 @@ WinEDA_MainFrame::WinEDA_MainFrame( WinEDA_App* eda_app, } /***************/ /* Destructor */ /***************/ /*****************************************************************************/ WinEDA_MainFrame::~WinEDA_MainFrame() /*****************************************************************************/ { if( m_Parent->m_EDA_Config ) { Loading @@ -127,7 +131,6 @@ WinEDA_MainFrame::~WinEDA_MainFrame() /*******************************************************/ void WinEDA_MainFrame::PrintMsg( const wxString& text ) /*******************************************************/ /* * Put text in the dialog frame */ Loading Loading @@ -394,6 +397,7 @@ void WinEDA_MainFrame::OnRefresh( wxCommandEvent& event ) } /*********************************/ void WinEDA_MainFrame::ClearMsg() /*********************************/ Loading @@ -401,11 +405,13 @@ void WinEDA_MainFrame::ClearMsg() m_DialogWin->Clear(); } #ifdef KICAD_PYTHON /*****************************************************************************/ void WinEDA_MainFrame::OnRefreshPy() /*****************************************************************************/ { m_LeftWin->ReCreateTreePrj(); } #endif