Code cleaning. Coding policy fixes.

This commit is contained in:
jean-pierre charras 2011-04-17 15:54:17 +02:00
parent e70eac296f
commit 401ea10e8f
25 changed files with 161 additions and 127 deletions

View File

@ -213,7 +213,6 @@ void EDA_BASE_FRAME::UpdateFileHistory( const wxString& FullFileName,
fileHistory = & wxGetApp().m_fileHistory;
fileHistory->AddFileToHistory( FullFileName );
ReCreateMenuBar();
}
@ -245,7 +244,6 @@ wxString EDA_BASE_FRAME::GetFileFromHistory( int cmdId, const wxString& type,
DisplayError( this, msg );
fileHistory->RemoveFileFromHistory( i );
fn = wxEmptyString;
ReCreateMenuBar();
}
}

View File

@ -41,7 +41,7 @@ BEGIN_EVENT_TABLE( CVPCB_MAINFRAME, EDA_BASE_FRAME )
CVPCB_MAINFRAME::SaveQuitCvpcb )
EVT_MENU( wxID_EXIT,
CVPCB_MAINFRAME::OnQuit )
EVT_MENU( ID_GENERAL_HELP,
EVT_MENU( wxID_HELP,
CVPCB_MAINFRAME::GetKicadHelp )
EVT_MENU( wxID_ABOUT,
CVPCB_MAINFRAME::GetKicadAbout )

View File

@ -45,8 +45,14 @@ void CVPCB_MAINFRAME::ReCreateMenuBar()
open_document_xpm );
// Open Recent submenu
wxMenu* openRecentMenu = new wxMenu();
wxGetApp().m_fileHistory.AddFilesToMenu( openRecentMenu );
static wxMenu* openRecentMenu;
// Add this menu to list menu managed by m_fileHistory
// (the file history will be updated when adding/removing files in history
if( openRecentMenu )
wxGetApp().m_fileHistory.RemoveMenu( openRecentMenu );
openRecentMenu = new wxMenu();
wxGetApp().m_fileHistory.UseMenu( openRecentMenu );
wxGetApp().m_fileHistory.AddFilesToMenu( );
ADD_MENUITEM_WITH_HELP_AND_SUBMENU( filesMenu, openRecentMenu, -1,
_( "Open &Recent" ),
_("Open a recent opened netlist document" ),
@ -111,8 +117,8 @@ void CVPCB_MAINFRAME::ReCreateMenuBar()
AddHelpVersionInfoMenuEntry( helpMenu );
// Contents
ADD_MENUITEM_WITH_HELP( helpMenu, ID_GENERAL_HELP, _( "&Contents" ),
_( "Open the cvpcb manual" ),
ADD_MENUITEM_WITH_HELP( helpMenu, wxID_HELP, _( "&Contents" ),
_( "Open the Cvpcb handbook" ),
online_help_xpm );
// About

View File

@ -114,7 +114,7 @@ BEGIN_EVENT_TABLE( LIB_EDIT_FRAME, EDA_DRAW_FRAME )
EVT_MENU( ID_LIBEDIT_SAVE_CURRENT_LIB_AS, LIB_EDIT_FRAME::SaveActiveLibrary )
EVT_MENU( ID_LIBEDIT_GEN_PNG_FILE, LIB_EDIT_FRAME::OnPlotCurrentComponent )
EVT_MENU( ID_LIBEDIT_GEN_SVG_FILE, LIB_EDIT_FRAME::OnPlotCurrentComponent )
EVT_MENU( ID_GENERAL_HELP, EDA_DRAW_FRAME::GetKicadHelp )
EVT_MENU( wxID_HELP, EDA_DRAW_FRAME::GetKicadHelp )
EVT_MENU( ID_COLORS_SETUP, LIB_EDIT_FRAME::OnColorConfig )
EVT_MENU( ID_CONFIG_REQ, LIB_EDIT_FRAME::InstallConfigFrame )

View File

@ -61,10 +61,16 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
fileMenu->Append( item );
// Open Recent submenu
wxMenu* openRecentMenu = new wxMenu();
static wxMenu* openRecentMenu;
// Add this menu to list menu managed by m_fileHistory
// (the file history will be updated when adding/removing files in history
if( openRecentMenu )
wxGetApp().m_fileHistory.RemoveMenu( openRecentMenu );
openRecentMenu = new wxMenu();
wxGetApp().m_fileHistory.UseMenu( openRecentMenu );
wxGetApp().m_fileHistory.AddFilesToMenu( openRecentMenu );
ADD_MENUITEM_WITH_HELP_AND_SUBMENU( fileMenu, openRecentMenu,
-1, _( "Open &Recent" ),
wxID_ANY, _( "Open &Recent" ),
_( "Open a recent opened schematic project" ),
open_project_xpm );
// Separator
@ -464,9 +470,9 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
// Contents
item = new wxMenuItem( helpMenu,
ID_GENERAL_HELP,
wxID_HELP,
_( "&Contents" ),
_( "Open the eeschema manual" ) );
_( "Open the Eeschema handbook" ) );
SET_BITMAP( online_help_xpm );
helpMenu->Append( item );

View File

@ -275,7 +275,7 @@ void LIB_EDIT_FRAME::ReCreateMenuBar()
// Contens
item = new wxMenuItem( helpMenu,
ID_GENERAL_HELP,
wxID_HELP,
_( "&Contents" ),
_( "Open the eeschema manual" ) );
SET_BITMAP( online_help_xpm );

View File

@ -99,7 +99,7 @@ BEGIN_EVENT_TABLE( SCH_EDIT_FRAME, EDA_DRAW_FRAME )
EVT_TOOL( ID_FIND_ITEMS, SCH_EDIT_FRAME::OnFindItems )
EVT_TOOL( ID_BACKANNO_ITEMS, SCH_EDIT_FRAME::OnLoadStuffFile )
EVT_MENU( ID_GENERAL_HELP, EDA_DRAW_FRAME::GetKicadHelp )
EVT_MENU( wxID_HELP, EDA_DRAW_FRAME::GetKicadHelp )
EVT_MENU( wxID_ABOUT, EDA_DRAW_FRAME::GetKicadAbout )
// Tools and buttons for vertical toolbar.

View File

@ -60,7 +60,7 @@ EVT_MENU( ID_MENU_GERBVIEW_SELECT_PREFERED_EDITOR,
EVT_MENU( ID_GERBVIEW_GLOBAL_DELETE, GERBVIEW_FRAME::Process_Special_Functions )
// Menu Help
EVT_MENU( ID_GENERAL_HELP, EDA_DRAW_FRAME::GetKicadHelp )
EVT_MENU( wxID_HELP, EDA_DRAW_FRAME::GetKicadHelp )
EVT_MENU( wxID_ABOUT, EDA_DRAW_FRAME::GetKicadAbout )
EVT_TOOL( wxID_CUT, GERBVIEW_FRAME::Process_Special_Functions )

View File

@ -55,8 +55,14 @@ void GERBVIEW_FRAME::ReCreateMenuBar( void )
gerber_open_dcode_file_xpm );
// Recent gerber files
wxMenu* openRecentGbrMenu = new wxMenu();
wxGetApp().m_fileHistory.AddFilesToMenu( openRecentGbrMenu );
static wxMenu* openRecentGbrMenu;
// Add this menu to list menu managed by m_fileHistory
// (the file history will be updated when adding/removing files in history
if( openRecentGbrMenu )
wxGetApp().m_fileHistory.RemoveMenu( openRecentGbrMenu );
openRecentGbrMenu = new wxMenu();
wxGetApp().m_fileHistory.UseMenu( openRecentGbrMenu );
wxGetApp().m_fileHistory.AddFilesToMenu();
ADD_MENUITEM_WITH_HELP_AND_SUBMENU( fileMenu, openRecentGbrMenu,
wxID_ANY,
_( "Open &Recent Gerber File" ),
@ -64,8 +70,12 @@ void GERBVIEW_FRAME::ReCreateMenuBar( void )
gerber_recent_files_xpm );
// Recent drill files
wxMenu* openRecentDrlMenu = new wxMenu();
m_drillFileHistory.AddFilesToMenu( openRecentDrlMenu );
static wxMenu* openRecentDrlMenu;
if( openRecentDrlMenu )
wxGetApp().m_fileHistory.RemoveMenu( openRecentDrlMenu );
openRecentDrlMenu = new wxMenu();
wxGetApp().m_fileHistory.UseMenu( openRecentDrlMenu );
m_drillFileHistory.AddFilesToMenu( );
ADD_MENUITEM_WITH_HELP_AND_SUBMENU( fileMenu, openRecentDrlMenu,
wxID_ANY,
_( "Open Recent &Drill File" ),
@ -184,9 +194,9 @@ void GERBVIEW_FRAME::ReCreateMenuBar( void )
// Contents
ADD_MENUITEM_WITH_HELP( helpMenu,
ID_GENERAL_HELP,
wxID_HELP,
_( "&Contents" ),
_( "Open the gerbview manual" ),
_( "Open the Gerbview handbook" ),
help_xpm );
// About gerbview

View File

@ -51,13 +51,7 @@ enum main_id
ID_GEN_COPY_BLOCK_TO_CLIPBOARD,
ID_GEN_EXPORT_FILE,
ID_GEN_EXPORT_SPECCTRA,
ID_GEN_EXPORT_FILE_GENCADFORMAT,
ID_GEN_EXPORT_FILE_MODULE_REPORT,
ID_GEN_IMPORT_FILE,
ID_GEN_IMPORT_SPECCTRA_SESSION,
ID_GEN_IMPORT_SPECCTRA_DESIGN,
ID_EXIT,
ID_OPTIONS_SETUP,
@ -68,10 +62,7 @@ enum main_id
ID_OPT_TOOLBAR,
ID_AUX_TOOLBAR,
ID_GENERAL_HELP,
ID_HELP_COPY_VERSION_STRING,
ID_LOCAL_HELP,
ID_KICAD_ABOUT, // @todo all handle by wxID_ABOUT
ID_EDIT,
ID_NO_TOOL_SELECTED,

View File

@ -192,6 +192,9 @@ public:
/**
* Function GetFileFromHistory
* fetches the file name from the file history list.
* and removes the selected file, if this file does not exists
* Note also the menu is updated, if wxFileHistory::UseMenu
* was called at init time
* @param cmdId The command ID associated with the \a aFileHistory object.
* @param type Please document me!
* @param aFileHistory The wxFileHistory in use. If null, the main application file
@ -203,15 +206,23 @@ public:
/**
* Function UpdateFileHistory
* ypdates the list of recently opened files.
* Updates the list of recently opened files.
* Note also the menu is updated, if wxFileHistory::UseMenu
* was called at init time
* @param FullFileName The full file name including the path.
* @param aFileHistory The wxFileHistory in use. If NULL, the main application file
* history is used.
* @param aFileHistory The wxFileHistory in use.
* If NULL, the main application file history is used.
*/
void UpdateFileHistory( const wxString& FullFileName,
wxFileHistory * aFileHistory = NULL );
void DisplayActivity( int PerCent, const wxString& Text );
/**
* Function ReCreateMenuBar
* Creates recreates the menu bar.
* Needed when the language is changed
*/
virtual void ReCreateMenuBar();
};

View File

@ -11,7 +11,7 @@
#include "../bitmap2component/bitmap2component.xpm"
RIGHT_KM_FRAME::RIGHT_KM_FRAME( WinEDA_MainFrame* parent ) :
RIGHT_KM_FRAME::RIGHT_KM_FRAME( KICAD_MANAGER_FRAME* parent ) :
wxSashLayoutWindow( parent, wxID_ANY )
{
#define BUTTON_HEIGHT 32

View File

@ -27,11 +27,11 @@ static const wxString ZipFileExtension( wxT( "zip" ) );
static const wxString ZipFileWildcard( wxT( "Zip file (*.zip) | *.zip" ) );
void WinEDA_MainFrame::OnFileHistory( wxCommandEvent& event )
void KICAD_MANAGER_FRAME::OnFileHistory( wxCommandEvent& event )
{
wxString fn;
fn = GetFileFromHistory( event.GetId(), _( "Printed circuit board" ) );
fn = GetFileFromHistory( event.GetId(), _( "Kicad project file" ) );
if( fn != wxEmptyString )
{
@ -39,11 +39,9 @@ void WinEDA_MainFrame::OnFileHistory( wxCommandEvent& event )
m_ProjectFileName = fn;
OnLoadProject( cmd );
}
ReCreateMenuBar();
}
void WinEDA_MainFrame::OnUnarchiveFiles( wxCommandEvent& event )
void KICAD_MANAGER_FRAME::OnUnarchiveFiles( wxCommandEvent& event )
{
wxFileName fn = m_ProjectFileName;
fn.SetExt( ZipFileExtension );
@ -109,7 +107,7 @@ void WinEDA_MainFrame::OnUnarchiveFiles( wxCommandEvent& event )
}
void WinEDA_MainFrame::OnArchiveFiles( wxCommandEvent& event )
void KICAD_MANAGER_FRAME::OnArchiveFiles( wxCommandEvent& event )
{
size_t i;
wxFileName fileName = m_ProjectFileName;

View File

@ -43,7 +43,7 @@ IMPLEMENT_APP( WinEDA_App )
* http://wiki.wxwidgets.org/WxMac-specific_topics
*/
void WinEDA_App::MacOpenFile(const wxString &fileName) {
WinEDA_MainFrame * frame = ((WinEDA_MainFrame*)GetTopWindow());
KICAD_MANAGER_FRAME * frame = ((KICAD_MANAGER_FRAME*)GetTopWindow());
wxFileName fn = fileName;
frame->m_ProjectFileName = fn;
@ -75,7 +75,7 @@ void WinEDA_App::MacOpenFile(const wxString &fileName) {
bool WinEDA_App::OnInit()
/*****************************************************************************/
{
WinEDA_MainFrame* frame;
KICAD_MANAGER_FRAME* frame;
InitEDA_Appl( wxT( "KiCad" ), APP_TYPE_KICAD );
@ -86,7 +86,7 @@ bool WinEDA_App::OnInit()
/* Make nameless project translatable */
wxFileName namelessProject( wxGetCwd(), NAMELESS_PROJECT, ProjectFileExtension );
frame = new WinEDA_MainFrame( NULL, wxT( "KiCad" ),
frame = new KICAD_MANAGER_FRAME( NULL, wxT( "KiCad" ),
wxPoint( 30, 20 ), wxSize( 600, 400 ) );
if( argc > 1 )

View File

@ -54,10 +54,10 @@ enum id_kicad_frm {
};
/* class WinEDA_MainFrame
/* class KICAD_MANAGER_FRAME
* This is the main kicad frame
*/
class WinEDA_MainFrame : public EDA_BASE_FRAME
class KICAD_MANAGER_FRAME : public EDA_BASE_FRAME
{
public:
TREE_PROJECT_FRAME* m_LeftWin;
@ -72,10 +72,10 @@ private:
public:
WinEDA_MainFrame( wxWindow* parent, const wxString& title,
KICAD_MANAGER_FRAME( wxWindow* parent, const wxString& title,
const wxPoint& pos, const wxSize& size );
~WinEDA_MainFrame();
~KICAD_MANAGER_FRAME();
/**
* Function CreateCommandToolbar
@ -143,7 +143,7 @@ class RIGHT_KM_FRAME : public wxSashLayoutWindow
public:
wxTextCtrl* m_DialogWin;
private:
WinEDA_MainFrame* m_Parent;
KICAD_MANAGER_FRAME* m_Parent;
int m_ButtonsPanelHeight;
wxPanel* m_ButtPanel;
int m_ButtonSeparation; // button distance in pixels
@ -153,7 +153,7 @@ private:
wxPoint m_ButtonLastPosition; // position of the last button in the window
public:
RIGHT_KM_FRAME( WinEDA_MainFrame* parent );
RIGHT_KM_FRAME( KICAD_MANAGER_FRAME* parent );
~RIGHT_KM_FRAME() { };
void OnSize( wxSizeEvent& event );

View File

@ -1,5 +1,5 @@
/***********************************************************/
/* mdiframe.cpp - WinEDA_MainFrame is the kicad main frame */
/* mdiframe.cpp - KICAD_MANAGER_FRAME is the kicad main frame */
/***********************************************************/
#ifdef __GNUG__
@ -21,7 +21,7 @@
static const wxString TreeFrameWidthEntry( wxT( "LeftWinWidth" ) );
WinEDA_MainFrame::WinEDA_MainFrame( wxWindow* parent,
KICAD_MANAGER_FRAME::KICAD_MANAGER_FRAME( wxWindow* parent,
const wxString& title,
const wxPoint& pos,
const wxSize& size ) :
@ -99,7 +99,7 @@ WinEDA_MainFrame::WinEDA_MainFrame( wxWindow* parent,
}
WinEDA_MainFrame::~WinEDA_MainFrame()
KICAD_MANAGER_FRAME::~KICAD_MANAGER_FRAME()
{
m_auimgr.UnInit();
}
@ -108,7 +108,7 @@ WinEDA_MainFrame::~WinEDA_MainFrame()
/*
* Put text in the dialog frame
*/
void WinEDA_MainFrame::PrintMsg( const wxString& text )
void KICAD_MANAGER_FRAME::PrintMsg( const wxString& text )
{
m_RightWin->m_DialogWin->AppendText( text );
}
@ -116,13 +116,13 @@ void WinEDA_MainFrame::PrintMsg( const wxString& text )
/* Resize windows when dragging window borders
*/
void WinEDA_MainFrame::OnSashDrag( wxSashEvent& event )
void KICAD_MANAGER_FRAME::OnSashDrag( wxSashEvent& event )
{
event.Skip();
}
void WinEDA_MainFrame::OnSize( wxSizeEvent& event )
void KICAD_MANAGER_FRAME::OnSize( wxSizeEvent& event )
{
if( m_auimgr.GetManagedWindow() )
m_auimgr.Update();
@ -131,7 +131,7 @@ void WinEDA_MainFrame::OnSize( wxSizeEvent& event )
}
void WinEDA_MainFrame::OnCloseWindow( wxCloseEvent& Event )
void KICAD_MANAGER_FRAME::OnCloseWindow( wxCloseEvent& Event )
{
int px, py;
@ -166,18 +166,18 @@ void WinEDA_MainFrame::OnCloseWindow( wxCloseEvent& Event )
}
void WinEDA_MainFrame::OnExit( wxCommandEvent& event )
void KICAD_MANAGER_FRAME::OnExit( wxCommandEvent& event )
{
Close( true );
}
void WinEDA_MainFrame::OnRunBitmapConverter( wxCommandEvent& event )
void KICAD_MANAGER_FRAME::OnRunBitmapConverter( wxCommandEvent& event )
{
ExecuteFile( this, BITMAPCONVERTER_EXE, wxEmptyString );
}
void WinEDA_MainFrame::OnRunPcbNew( wxCommandEvent& event )
void KICAD_MANAGER_FRAME::OnRunPcbNew( wxCommandEvent& event )
{
wxFileName fn( m_ProjectFileName );
@ -186,7 +186,7 @@ void WinEDA_MainFrame::OnRunPcbNew( wxCommandEvent& event )
}
void WinEDA_MainFrame::OnRunCvpcb( wxCommandEvent& event )
void KICAD_MANAGER_FRAME::OnRunCvpcb( wxCommandEvent& event )
{
wxFileName fn( m_ProjectFileName );
@ -195,7 +195,7 @@ void WinEDA_MainFrame::OnRunCvpcb( wxCommandEvent& event )
}
void WinEDA_MainFrame::OnRunEeschema( wxCommandEvent& event )
void KICAD_MANAGER_FRAME::OnRunEeschema( wxCommandEvent& event )
{
wxFileName fn( m_ProjectFileName );
@ -204,7 +204,7 @@ void WinEDA_MainFrame::OnRunEeschema( wxCommandEvent& event )
}
void WinEDA_MainFrame::OnRunGerbview( wxCommandEvent& event )
void KICAD_MANAGER_FRAME::OnRunGerbview( wxCommandEvent& event )
{
wxFileName fn( m_ProjectFileName );
wxString path = wxT("\"");
@ -214,7 +214,7 @@ void WinEDA_MainFrame::OnRunGerbview( wxCommandEvent& event )
}
void WinEDA_MainFrame::OnOpenTextEditor( wxCommandEvent& event )
void KICAD_MANAGER_FRAME::OnOpenTextEditor( wxCommandEvent& event )
{
wxString editorname = wxGetApp().GetEditorName();
@ -223,7 +223,7 @@ void WinEDA_MainFrame::OnOpenTextEditor( wxCommandEvent& event )
}
void WinEDA_MainFrame::OnOpenFileInTextEditor( wxCommandEvent& event )
void KICAD_MANAGER_FRAME::OnOpenFileInTextEditor( wxCommandEvent& event )
{
wxString mask( wxT( "*" ) );
@ -246,13 +246,13 @@ void WinEDA_MainFrame::OnOpenFileInTextEditor( wxCommandEvent& event )
}
void WinEDA_MainFrame::OnRefresh( wxCommandEvent& event )
void KICAD_MANAGER_FRAME::OnRefresh( wxCommandEvent& event )
{
m_LeftWin->ReCreateTreePrj();
}
void WinEDA_MainFrame::ClearMsg()
void KICAD_MANAGER_FRAME::ClearMsg()
{
m_RightWin->m_DialogWin->Clear();
}
@ -264,7 +264,7 @@ void WinEDA_MainFrame::ClearMsg()
* Don't forget to call this base method from any derived classes or the
* settings will not get loaded.
*/
void WinEDA_MainFrame::LoadSettings()
void KICAD_MANAGER_FRAME::LoadSettings()
{
wxASSERT( wxGetApp().m_EDA_Config != NULL );
@ -281,7 +281,7 @@ void WinEDA_MainFrame::LoadSettings()
* Don't forget to call this base method from any derived classes or the
* settings will not get saved.
*/
void WinEDA_MainFrame::SaveSettings()
void KICAD_MANAGER_FRAME::SaveSettings()
{
wxASSERT( wxGetApp().m_EDA_Config != NULL );
@ -291,4 +291,3 @@ void WinEDA_MainFrame::SaveSettings()
cfg->Write( TreeFrameWidthEntry, m_LeftWin->GetSize().x );
}

View File

@ -10,49 +10,49 @@
#include "bitmaps.h"
/* Menubar and toolbar event table */
BEGIN_EVENT_TABLE( WinEDA_MainFrame, EDA_BASE_FRAME )
BEGIN_EVENT_TABLE( KICAD_MANAGER_FRAME, EDA_BASE_FRAME )
/* Window events */
EVT_SIZE( WinEDA_MainFrame::OnSize )
EVT_CLOSE( WinEDA_MainFrame::OnCloseWindow )
EVT_SIZE( KICAD_MANAGER_FRAME::OnSize )
EVT_CLOSE( KICAD_MANAGER_FRAME::OnCloseWindow )
/* Sash drag events */
EVT_SASH_DRAGGED( ID_LEFT_FRAME, WinEDA_MainFrame::OnSashDrag )
EVT_SASH_DRAGGED( ID_LEFT_FRAME, KICAD_MANAGER_FRAME::OnSashDrag )
/* Toolbar events */
EVT_TOOL( ID_NEW_PROJECT, WinEDA_MainFrame::OnLoadProject )
EVT_TOOL( ID_LOAD_PROJECT, WinEDA_MainFrame::OnLoadProject )
EVT_TOOL( ID_SAVE_PROJECT, WinEDA_MainFrame::OnSaveProject )
EVT_TOOL( ID_SAVE_AND_ZIP_FILES, WinEDA_MainFrame::OnArchiveFiles )
EVT_TOOL( ID_NEW_PROJECT, KICAD_MANAGER_FRAME::OnLoadProject )
EVT_TOOL( ID_LOAD_PROJECT, KICAD_MANAGER_FRAME::OnLoadProject )
EVT_TOOL( ID_SAVE_PROJECT, KICAD_MANAGER_FRAME::OnSaveProject )
EVT_TOOL( ID_SAVE_AND_ZIP_FILES, KICAD_MANAGER_FRAME::OnArchiveFiles )
/* Menu events */
EVT_MENU( ID_SAVE_PROJECT, WinEDA_MainFrame::OnSaveProject )
EVT_MENU( wxID_EXIT, WinEDA_MainFrame::OnExit )
EVT_MENU( ID_TO_EDITOR, WinEDA_MainFrame::OnOpenTextEditor )
EVT_MENU( ID_BROWSE_AN_SELECT_FILE, WinEDA_MainFrame::OnOpenFileInTextEditor )
EVT_MENU( ID_SAVE_PROJECT, KICAD_MANAGER_FRAME::OnSaveProject )
EVT_MENU( wxID_EXIT, KICAD_MANAGER_FRAME::OnExit )
EVT_MENU( ID_TO_EDITOR, KICAD_MANAGER_FRAME::OnOpenTextEditor )
EVT_MENU( ID_BROWSE_AN_SELECT_FILE, KICAD_MANAGER_FRAME::OnOpenFileInTextEditor )
EVT_MENU( ID_SELECT_PREFERED_EDITOR, EDA_BASE_FRAME::OnSelectPreferredEditor )
EVT_MENU( ID_SELECT_DEFAULT_PDF_BROWSER, WinEDA_MainFrame::OnSelectDefaultPdfBrowser )
EVT_MENU( ID_SELECT_PREFERED_PDF_BROWSER, WinEDA_MainFrame::OnSelectPreferredPdfBrowser )
EVT_MENU( ID_SELECT_PREFERED_PDF_BROWSER_NAME, WinEDA_MainFrame::OnSelectPreferredPdfBrowser )
EVT_MENU( ID_SAVE_AND_ZIP_FILES, WinEDA_MainFrame::OnArchiveFiles )
EVT_MENU( ID_READ_ZIP_ARCHIVE, WinEDA_MainFrame::OnUnarchiveFiles )
EVT_MENU( ID_PROJECT_TREE_REFRESH, WinEDA_MainFrame::OnRefresh )
EVT_MENU( ID_GENERAL_HELP, WinEDA_MainFrame::GetKicadHelp )
EVT_MENU( wxID_ABOUT, WinEDA_MainFrame::GetKicadAbout )
EVT_MENU( ID_SELECT_DEFAULT_PDF_BROWSER, KICAD_MANAGER_FRAME::OnSelectDefaultPdfBrowser )
EVT_MENU( ID_SELECT_PREFERED_PDF_BROWSER, KICAD_MANAGER_FRAME::OnSelectPreferredPdfBrowser )
EVT_MENU( ID_SELECT_PREFERED_PDF_BROWSER_NAME, KICAD_MANAGER_FRAME::OnSelectPreferredPdfBrowser )
EVT_MENU( ID_SAVE_AND_ZIP_FILES, KICAD_MANAGER_FRAME::OnArchiveFiles )
EVT_MENU( ID_READ_ZIP_ARCHIVE, KICAD_MANAGER_FRAME::OnUnarchiveFiles )
EVT_MENU( ID_PROJECT_TREE_REFRESH, KICAD_MANAGER_FRAME::OnRefresh )
EVT_MENU( wxID_HELP, KICAD_MANAGER_FRAME::GetKicadHelp )
EVT_MENU( wxID_ABOUT, KICAD_MANAGER_FRAME::GetKicadAbout )
/* Range menu events */
EVT_MENU_RANGE( ID_LANGUAGE_CHOICE, ID_LANGUAGE_CHOICE_END, WinEDA_MainFrame::SetLanguage )
EVT_MENU_RANGE( ID_LANGUAGE_CHOICE, ID_LANGUAGE_CHOICE_END, KICAD_MANAGER_FRAME::SetLanguage )
EVT_MENU_RANGE( wxID_FILE1, wxID_FILE9, WinEDA_MainFrame::OnFileHistory )
EVT_MENU_RANGE( wxID_FILE1, wxID_FILE9, KICAD_MANAGER_FRAME::OnFileHistory )
/* Button events */
EVT_BUTTON( ID_TO_PCB, WinEDA_MainFrame::OnRunPcbNew )
EVT_BUTTON( ID_TO_CVPCB, WinEDA_MainFrame::OnRunCvpcb )
EVT_BUTTON( ID_TO_EESCHEMA, WinEDA_MainFrame::OnRunEeschema )
EVT_BUTTON( ID_TO_GERBVIEW, WinEDA_MainFrame::OnRunGerbview )
EVT_BUTTON( ID_TO_BITMAP_CONVERTER, WinEDA_MainFrame::OnRunBitmapConverter )
EVT_BUTTON( ID_TO_PCB, KICAD_MANAGER_FRAME::OnRunPcbNew )
EVT_BUTTON( ID_TO_CVPCB, KICAD_MANAGER_FRAME::OnRunCvpcb )
EVT_BUTTON( ID_TO_EESCHEMA, KICAD_MANAGER_FRAME::OnRunEeschema )
EVT_BUTTON( ID_TO_GERBVIEW, KICAD_MANAGER_FRAME::OnRunGerbview )
EVT_BUTTON( ID_TO_BITMAP_CONVERTER, KICAD_MANAGER_FRAME::OnRunBitmapConverter )
EVT_UPDATE_UI( ID_SELECT_DEFAULT_PDF_BROWSER, WinEDA_MainFrame::OnUpdateDefaultPdfBrowser )
EVT_UPDATE_UI( ID_SELECT_PREFERED_PDF_BROWSER, WinEDA_MainFrame::OnUpdatePreferredPdfBrowser )
EVT_UPDATE_UI( ID_SELECT_DEFAULT_PDF_BROWSER, KICAD_MANAGER_FRAME::OnUpdateDefaultPdfBrowser )
EVT_UPDATE_UI( ID_SELECT_PREFERED_PDF_BROWSER, KICAD_MANAGER_FRAME::OnUpdatePreferredPdfBrowser )
END_EVENT_TABLE()
@ -60,7 +60,7 @@ END_EVENT_TABLE()
/**
* @brief (Re)Create the menubar
*/
void WinEDA_MainFrame::ReCreateMenuBar()
void KICAD_MANAGER_FRAME::ReCreateMenuBar()
{
// Create and try to get the current menubar
wxMenuItem* item;
@ -88,8 +88,14 @@ void WinEDA_MainFrame::ReCreateMenuBar()
open_project_xpm );
// Open Recent submenu
wxMenu* openRecentMenu = new wxMenu();
wxGetApp().m_fileHistory.AddFilesToMenu( openRecentMenu );
static wxMenu* openRecentMenu;
// Add this menu to list menu managed by m_fileHistory
// (the file history will be updated when adding/removing files in history
if( openRecentMenu )
wxGetApp().m_fileHistory.RemoveMenu( openRecentMenu );
openRecentMenu = new wxMenu();
wxGetApp().m_fileHistory.UseMenu( openRecentMenu );
wxGetApp().m_fileHistory.AddFilesToMenu( );
ADD_MENUITEM_WITH_HELP_AND_SUBMENU( fileMenu, openRecentMenu,
wxID_ANY,
_( "Open &Recent" ),
@ -217,9 +223,9 @@ void WinEDA_MainFrame::ReCreateMenuBar()
// Contents
ADD_MENUITEM_WITH_HELP( helpMenu,
ID_GENERAL_HELP,
wxID_HELP,
_( "&Contents" ),
_( "Open the kicad manual" ),
_( "Open the Kicad handbook" ),
online_help_xpm );
// Separator
@ -251,7 +257,7 @@ void WinEDA_MainFrame::ReCreateMenuBar()
/**
* @brief (Re)Create the horizontal toolbar
*/
void WinEDA_MainFrame::RecreateBaseHToolbar()
void KICAD_MANAGER_FRAME::RecreateBaseHToolbar()
{
// Check if toolbar is not already created
if( m_HToolBar != NULL )

View File

@ -18,26 +18,26 @@
#include <wx/fontdlg.h>
void WinEDA_MainFrame::OnUpdateDefaultPdfBrowser( wxUpdateUIEvent& event )
void KICAD_MANAGER_FRAME::OnUpdateDefaultPdfBrowser( wxUpdateUIEvent& event )
{
event.Check( wxGetApp().m_PdfBrowserIsDefault );
}
void WinEDA_MainFrame::OnSelectDefaultPdfBrowser( wxCommandEvent& event )
void KICAD_MANAGER_FRAME::OnSelectDefaultPdfBrowser( wxCommandEvent& event )
{
wxGetApp().m_PdfBrowserIsDefault = true;
wxGetApp().WritePdfBrowserInfos();
}
void WinEDA_MainFrame::OnUpdatePreferredPdfBrowser( wxUpdateUIEvent& event )
void KICAD_MANAGER_FRAME::OnUpdatePreferredPdfBrowser( wxUpdateUIEvent& event )
{
event.Check( !wxGetApp().m_PdfBrowserIsDefault );
}
void WinEDA_MainFrame::OnSelectPreferredPdfBrowser( wxCommandEvent& event )
void KICAD_MANAGER_FRAME::OnSelectPreferredPdfBrowser( wxCommandEvent& event )
{
bool select = event.GetId() == ID_SELECT_PREFERED_PDF_BROWSER_NAME;
@ -69,7 +69,7 @@ void WinEDA_MainFrame::OnSelectPreferredPdfBrowser( wxCommandEvent& event )
wxGetApp().WritePdfBrowserInfos();
}
void WinEDA_MainFrame::SetLanguage( wxCommandEvent& event )
void KICAD_MANAGER_FRAME::SetLanguage( wxCommandEvent& event )
{
EDA_BASE_FRAME::SetLanguage( event );
}

View File

@ -21,7 +21,7 @@ static const wxString SchematicRootNameEntry( wxT( "RootSch" ) );
static const wxString BoardFileNameEntry( wxT( "BoardNm" ) );
void WinEDA_MainFrame::CreateNewProject( const wxString PrjFullFileName )
void KICAD_MANAGER_FRAME::CreateNewProject( const wxString PrjFullFileName )
{
wxString filename;
wxFileName newProjectName = PrjFullFileName;
@ -59,7 +59,7 @@ void WinEDA_MainFrame::CreateNewProject( const wxString PrjFullFileName )
/**
* Loading a new project
*/
void WinEDA_MainFrame::OnLoadProject( wxCommandEvent& event )
void KICAD_MANAGER_FRAME::OnLoadProject( wxCommandEvent& event )
{
int style;
wxString title;
@ -78,7 +78,6 @@ void WinEDA_MainFrame::OnLoadProject( wxCommandEvent& event )
style = wxFD_OPEN | wxFD_FILE_MUST_EXIST;
}
UpdateFileHistory( m_ProjectFileName.GetFullPath() );
wxFileDialog dlg( this, title, wxGetCwd(), wxEmptyString,
ProjectFileWildcard, style );
@ -98,8 +97,6 @@ void WinEDA_MainFrame::OnLoadProject( wxCommandEvent& event )
}
CreateNewProject( m_ProjectFileName.GetFullPath() );
}
UpdateFileHistory( m_ProjectFileName.GetFullPath() );
}
wxLogDebug( wxT( "Loading Kicad project file: " ) +
@ -136,7 +133,7 @@ void WinEDA_MainFrame::OnLoadProject( wxCommandEvent& event )
/**
* Save the project top level configuration parameters.
*/
void WinEDA_MainFrame::OnSaveProject( wxCommandEvent& event )
void KICAD_MANAGER_FRAME::OnSaveProject( wxCommandEvent& event )
{
wxString fn;

View File

@ -94,7 +94,7 @@ END_EVENT_TABLE()
/******************************************************************/
TREE_PROJECT_FRAME::TREE_PROJECT_FRAME( WinEDA_MainFrame* parent ) :
TREE_PROJECT_FRAME::TREE_PROJECT_FRAME( KICAD_MANAGER_FRAME* parent ) :
wxSashLayoutWindow( parent,
ID_LEFT_FRAME,
wxDefaultPosition,

View File

@ -66,7 +66,7 @@ protected:
TREEPROJECT_ITEM* GetItemIdData(wxTreeItemId aId);
public:
WinEDA_MainFrame* m_Parent;
KICAD_MANAGER_FRAME* m_Parent;
TREEPROJECTFILES* m_TreeProject;
wxTreeItemId m_root;
@ -75,7 +75,7 @@ public:
static wxString GetFileExt( TreeFileType type );
static wxString GetFileWildcard( TreeFileType type );
TREE_PROJECT_FRAME( WinEDA_MainFrame* parent );
TREE_PROJECT_FRAME( KICAD_MANAGER_FRAME* parent );
~TREE_PROJECT_FRAME();
void OnSelect( wxTreeEvent& Event );
void OnExpand( wxTreeEvent& Event );

View File

@ -304,9 +304,9 @@ void WinEDA_ModuleEditFrame::ReCreateMenuBar()
// Contents
item = new wxMenuItem( helpMenu,
ID_GENERAL_HELP,
wxID_HELP,
_( "&Contents" ),
_( "Open the PCBNew manual" ) );
_( "Open the PCBNew handbook" ) );
SET_BITMAP( online_help_xpm );
helpMenu->Append( item );

View File

@ -53,8 +53,14 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
filesMenu->Append( item );
// Load Recent submenu
wxMenu* openRecentMenu = new wxMenu();
wxGetApp().m_fileHistory.AddFilesToMenu( openRecentMenu );
static wxMenu* openRecentMenu;
// Add this menu to list menu managed by m_fileHistory
// (the file history will be updated when adding/removing files in history
if( openRecentMenu )
wxGetApp().m_fileHistory.RemoveMenu( openRecentMenu );
openRecentMenu = new wxMenu();
wxGetApp().m_fileHistory.UseMenu( openRecentMenu );
wxGetApp().m_fileHistory.AddFilesToMenu();
ADD_MENUITEM_WITH_HELP_AND_SUBMENU( filesMenu, openRecentMenu,
-1, _( "Open &Recent" ),
_( "Open a recent opened board" ),
@ -599,9 +605,9 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
AddHelpVersionInfoMenuEntry( helpMenu );
// Contents
item = new wxMenuItem( helpMenu, ID_GENERAL_HELP,
item = new wxMenuItem( helpMenu, wxID_HELP,
_( "&Contents" ),
_( "Open the on line PCBnew documentation" ) );
_( "Open the PCBNew handbook" ) );
SET_BITMAP( online_help_xpm );
helpMenu->Append( item );

View File

@ -139,7 +139,7 @@ BEGIN_EVENT_TABLE( PCB_EDIT_FRAME, PCB_BASE_FRAME )
PCB_EDIT_FRAME::Process_Special_Functions )
// Menu Help
EVT_MENU( ID_GENERAL_HELP, EDA_DRAW_FRAME::GetKicadHelp )
EVT_MENU( wxID_HELP, EDA_DRAW_FRAME::GetKicadHelp )
EVT_MENU( wxID_ABOUT, EDA_BASE_FRAME::GetKicadAbout )
// Menu 3D Frame

View File

@ -223,7 +223,13 @@ enum pcbnew_ids
ID_MENU_PCB_SWAP_LAYERS,
ID_MENU_PCB_RESET_TEXTMODULE_REFERENCE_SIZES,
ID_MENU_PCB_RESET_TEXTMODULE_VALUE_SIZES,
ID_GEN_EXPORT_FILE_VRML,
ID_GEN_EXPORT_SPECCTRA,
ID_GEN_EXPORT_FILE_GENCADFORMAT,
ID_GEN_EXPORT_FILE_MODULE_REPORT,
ID_GEN_IMPORT_SPECCTRA_SESSION,
ID_GEN_IMPORT_SPECCTRA_DESIGN,
ID_TOOLBARH_PCB_MODE_MODULE,
ID_TOOLBARH_PCB_MODE_TRACKS,