From 86a801aabc175e27111e6435fc6a2d3bef544c25 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Mon, 20 Aug 2018 14:46:38 +0100 Subject: [PATCH] Allow updating of file history size on the fly. Also updates the file menu IDs so that we can actually handle more than 9 items in the file history. Also adds configurable file history length to the other gerber files (zip, drill and job). Fixes: lp:1745729 * https://bugs.launchpad.net/kicad/+bug/1745729 --- common/bin_mod.cpp | 5 +-- common/dialogs/panel_common_settings.cpp | 4 +- common/draw_frame.cpp | 8 ++++ common/eda_base_frame.cpp | 9 +--- common/pgm_base.cpp | 17 ++++++++ eeschema/sch_edit_frame.cpp | 2 +- gerbview/events_called_functions.cpp | 8 ++-- gerbview/gerbview_frame.cpp | 14 +++++-- gerbview/gerbview_frame.h | 7 ++-- gerbview/gerbview_id.h | 52 ++++++++---------------- include/bin_mod.h | 3 +- include/kiface_i.h | 2 +- include/pgm_base.h | 22 +++++++++- kicad/kicad.h | 2 + kicad/mainframe.cpp | 8 ++++ kicad/menubar.cpp | 2 +- kicad/pgm_kicad.h | 2 +- pagelayout_editor/events_functions.cpp | 2 +- pcbnew/menubar_pcb_editor.cpp | 2 +- pcbnew/pcb_edit_frame.cpp | 2 +- 20 files changed, 104 insertions(+), 69 deletions(-) diff --git a/common/bin_mod.cpp b/common/bin_mod.cpp index 42191d1ba1..08513995e2 100644 --- a/common/bin_mod.cpp +++ b/common/bin_mod.cpp @@ -45,10 +45,9 @@ void BIN_MOD::Init() // get file history size from common settings int fileHistorySize; - Pgm().CommonSettings()->Read( FILE_HISTORY_SIZE, &fileHistorySize, DEFAULT_FILE_HISTORY_SIZE ); + Pgm().CommonSettings()->Read( FILE_HISTORY_SIZE_KEY, &fileHistorySize, DEFAULT_FILE_HISTORY_SIZE ); - // file history size can only be set in wxFileHistory constructor - m_history = new wxFileHistory( fileHistorySize ); + m_history = new FILE_HISTORY( (unsigned) std::max( 0, fileHistorySize ), ID_FILE1 ); m_history->Load( *m_config ); // Prepare On Line Help. Use only lower case for help file names, in order to diff --git a/common/dialogs/panel_common_settings.cpp b/common/dialogs/panel_common_settings.cpp index c4f2dbc5f3..738f9b53fa 100644 --- a/common/dialogs/panel_common_settings.cpp +++ b/common/dialogs/panel_common_settings.cpp @@ -52,7 +52,7 @@ bool PANEL_COMMON_SETTINGS::TransferDataToWindow() m_SaveTime->SetValue( msg ); int fileHistorySize; - commonSettings->Read( FILE_HISTORY_SIZE, &fileHistorySize, DEFAULT_FILE_HISTORY_SIZE ); + commonSettings->Read( FILE_HISTORY_SIZE_KEY, &fileHistorySize, DEFAULT_FILE_HISTORY_SIZE ); m_fileHistorySize->SetValue( fileHistorySize ); int scale_fourths; @@ -97,7 +97,7 @@ bool PANEL_COMMON_SETTINGS::TransferDataFromWindow() commonSettings->Write( AUTOSAVE_INTERVAL_KEY, m_SaveTime->GetValue() * 60 ); - commonSettings->Write( FILE_HISTORY_SIZE, m_fileHistorySize->GetValue() ); + commonSettings->Write( FILE_HISTORY_SIZE_KEY, m_fileHistorySize->GetValue() ); const int scale_fourths = m_scaleAuto->GetValue() ? -1 : m_scaleSlider->GetValue() / 25; commonSettings->Write( ICON_SCALE_KEY, scale_fourths ); diff --git a/common/draw_frame.cpp b/common/draw_frame.cpp index 8e2249ccb4..b3c89eec56 100644 --- a/common/draw_frame.cpp +++ b/common/draw_frame.cpp @@ -278,6 +278,14 @@ void EDA_DRAW_FRAME::CommonSettingsChanged() { EDA_BASE_FRAME::CommonSettingsChanged(); + int autosaveInterval; + Pgm().CommonSettings()->Read( AUTOSAVE_INTERVAL_KEY, &autosaveInterval ); + SetAutoSaveInterval( autosaveInterval ); + + int historySize; + Pgm().CommonSettings()->Read( FILE_HISTORY_SIZE_KEY, &historySize, DEFAULT_FILE_HISTORY_SIZE ); + Kiface().GetFileHistory().SetMaxFiles( (unsigned) std::max( 0, historySize ) ); + bool option; Pgm().CommonSettings()->Read( ENBL_MOUSEWHEEL_PAN_KEY, &option ); m_canvas->SetEnableMousewheelPan( option ); diff --git a/common/eda_base_frame.cpp b/common/eda_base_frame.cpp index 7e274317b0..45eec98450 100644 --- a/common/eda_base_frame.cpp +++ b/common/eda_base_frame.cpp @@ -243,10 +243,6 @@ void EDA_BASE_FRAME::ShowChangedLanguage() void EDA_BASE_FRAME::CommonSettingsChanged() { - int autosaveInterval; - Pgm().CommonSettings()->Read( AUTOSAVE_INTERVAL_KEY, &autosaveInterval ); - SetAutoSaveInterval( autosaveInterval ); - if( GetMenuBar() ) { // For icons in menus, icon scaling & hotkeys @@ -422,10 +418,7 @@ wxString EDA_BASE_FRAME::GetFileFromHistory( int cmdId, const wxString& type, return fn; else { - wxString msg = wxString::Format( - _( "File \"%s\" was not found." ), - GetChars( fn ) ); - + wxString msg = wxString::Format( _( "File \"%s\" was not found." ), fn ); wxMessageBox( msg ); fileHistory->RemoveFileFromHistory( i ); diff --git a/common/pgm_base.cpp b/common/pgm_base.cpp index de5c762a34..fde8ef628c 100644 --- a/common/pgm_base.cpp +++ b/common/pgm_base.cpp @@ -66,6 +66,23 @@ static const wxChar showEnvVarWarningDialog[] = wxT( "ShowEnvVarWarningDialog" ) static const wxChar traceEnvVars[] = wxT( "KIENVVARS" ); +FILE_HISTORY::FILE_HISTORY( size_t aMaxFiles, int aBaseFileId ) : + wxFileHistory( std::min( aMaxFiles, (size_t) MAX_FILE_HISTORY_SIZE ) ) +{ + SetBaseId( aBaseFileId ); +} + + +void FILE_HISTORY::SetMaxFiles( size_t aMaxFiles ) +{ + m_fileMaxFiles = std::min( aMaxFiles, (size_t) MAX_FILE_HISTORY_SIZE ); + + size_t numFiles = m_fileHistory.size(); + + while( numFiles > m_fileMaxFiles ) + RemoveFileFromHistory( --numFiles ); +} + /** * A small class to handle the list of existing translations. diff --git a/eeschema/sch_edit_frame.cpp b/eeschema/sch_edit_frame.cpp index 3c15b11680..73fe6e812c 100644 --- a/eeschema/sch_edit_frame.cpp +++ b/eeschema/sch_edit_frame.cpp @@ -224,7 +224,7 @@ BEGIN_EVENT_TABLE( SCH_EDIT_FRAME, EDA_DRAW_FRAME ) EVT_MENU( ID_NEW_PROJECT, SCH_EDIT_FRAME::OnNewProject ) EVT_MENU( ID_LOAD_PROJECT, SCH_EDIT_FRAME::OnLoadProject ) - EVT_MENU_RANGE( wxID_FILE1, wxID_FILE9, SCH_EDIT_FRAME::OnLoadFile ) + EVT_MENU_RANGE( ID_FILE1, ID_FILEMAX, SCH_EDIT_FRAME::OnLoadFile ) EVT_MENU( ID_APPEND_PROJECT, SCH_EDIT_FRAME::OnAppendProject ) EVT_MENU( ID_IMPORT_NON_KICAD_SCH, SCH_EDIT_FRAME::OnImportProject ) diff --git a/gerbview/events_called_functions.cpp b/gerbview/events_called_functions.cpp index 29bbbdf24c..72bc2544a1 100644 --- a/gerbview/events_called_functions.cpp +++ b/gerbview/events_called_functions.cpp @@ -67,15 +67,15 @@ BEGIN_EVENT_TABLE( GERBVIEW_FRAME, EDA_DRAW_FRAME ) EVT_MENU( ID_NEW_BOARD, GERBVIEW_FRAME::Files_io ) EVT_MENU( ID_GERBVIEW_EXPORT_TO_PCBNEW, GERBVIEW_FRAME::ExportDataInPcbnewFormat ) - EVT_MENU_RANGE( wxID_FILE1, wxID_FILE9, GERBVIEW_FRAME::OnGbrFileHistory ) + EVT_MENU_RANGE( ID_FILE1, ID_FILEMAX, GERBVIEW_FRAME::OnGbrFileHistory ) - EVT_MENU_RANGE( ID_GERBVIEW_DRILL_FILE1, ID_GERBVIEW_DRILL_FILE9, + EVT_MENU_RANGE( ID_GERBVIEW_DRILL_FILE1, ID_GERBVIEW_DRILL_FILEMAX, GERBVIEW_FRAME::OnDrlFileHistory ) - EVT_MENU_RANGE( ID_GERBVIEW_ZIP_FILE1, ID_GERBVIEW_ZIP_FILE9, + EVT_MENU_RANGE( ID_GERBVIEW_ZIP_FILE1, ID_GERBVIEW_ZIP_FILEMAX, GERBVIEW_FRAME::OnZipFileHistory ) - EVT_MENU_RANGE( ID_GERBVIEW_JOB_FILE1, ID_GERBVIEW_JOB_FILE9, + EVT_MENU_RANGE( ID_GERBVIEW_JOB_FILE1, ID_GERBVIEW_JOB_FILEMAX, GERBVIEW_FRAME::OnJobFileHistory ) EVT_MENU( wxID_EXIT, GERBVIEW_FRAME::OnQuit ) diff --git a/gerbview/gerbview_frame.cpp b/gerbview/gerbview_frame.cpp index 0f3c5c8df3..48a931b81b 100644 --- a/gerbview/gerbview_frame.cpp +++ b/gerbview/gerbview_frame.cpp @@ -66,7 +66,10 @@ COLORS_DESIGN_SETTINGS g_ColorsSettings( FRAME_GERBER ); GERBVIEW_FRAME::GERBVIEW_FRAME( KIWAY* aKiway, wxWindow* aParent ): EDA_DRAW_FRAME( aKiway, aParent, FRAME_GERBER, wxT( "GerbView" ), - wxDefaultPosition, wxDefaultSize, KICAD_DEFAULT_DRAWFRAME_STYLE, GERBVIEW_FRAME_NAME ) + wxDefaultPosition, wxDefaultSize, KICAD_DEFAULT_DRAWFRAME_STYLE, GERBVIEW_FRAME_NAME ), + m_zipFileHistory( DEFAULT_FILE_HISTORY_SIZE, ID_GERBVIEW_ZIP_FILE1 ), + m_drillFileHistory( DEFAULT_FILE_HISTORY_SIZE, ID_GERBVIEW_DRILL_FILE1 ), + m_jobFileHistory( DEFAULT_FILE_HISTORY_SIZE, ID_GERBVIEW_JOB_FILE1 ) { m_colorsSettings = &g_ColorsSettings; m_gerberLayout = NULL; @@ -90,9 +93,12 @@ GERBVIEW_FRAME::GERBVIEW_FRAME( KIWAY* aKiway, wxWindow* aParent ): m_SelNetnameBox = nullptr; m_SelAperAttributesBox = nullptr; m_displayMode = 0; - m_drillFileHistory.SetBaseId( ID_GERBVIEW_DRILL_FILE1 ); - m_zipFileHistory.SetBaseId( ID_GERBVIEW_ZIP_FILE1 ); - m_jobFileHistory.SetBaseId( ID_GERBVIEW_JOB_FILE1 ); + + int fileHistorySize; + Pgm().CommonSettings()->Read( FILE_HISTORY_SIZE_KEY, &fileHistorySize, DEFAULT_FILE_HISTORY_SIZE ); + m_drillFileHistory.SetMaxFiles( fileHistorySize ); + m_zipFileHistory.SetMaxFiles( fileHistorySize ); + m_jobFileHistory.SetMaxFiles( fileHistorySize ); EDA_DRAW_PANEL_GAL* galCanvas = new GERBVIEW_DRAW_PANEL_GAL( this, -1, wxPoint( 0, 0 ), m_FrameSize, diff --git a/gerbview/gerbview_frame.h b/gerbview/gerbview_frame.h index 0376260f04..ff7a22b12b 100644 --- a/gerbview/gerbview_frame.h +++ b/gerbview/gerbview_frame.h @@ -27,6 +27,7 @@ #define WX_GERBER_STRUCT_H +#include #include #include #include @@ -157,13 +158,13 @@ protected: GERBER_LAYER_WIDGET* m_LayersManager; // Auxiliary file history used to store zip files history. - wxFileHistory m_zipFileHistory; + FILE_HISTORY m_zipFileHistory; // Auxiliary file history used to store drill files history. - wxFileHistory m_drillFileHistory; + FILE_HISTORY m_drillFileHistory; // Auxiliary file history used to store job files history. - wxFileHistory m_jobFileHistory; + FILE_HISTORY m_jobFileHistory; /// The last filename chosen to be proposed to the user wxString m_lastFileName; diff --git a/gerbview/gerbview_id.h b/gerbview/gerbview_id.h index 39a2478430..6a3a690cdc 100644 --- a/gerbview/gerbview_id.h +++ b/gerbview/gerbview_id.h @@ -26,6 +26,7 @@ #define __GERBVIEW_ID_H__ #include +#include /** * Command IDs for the printed circuit board editor. @@ -54,42 +55,6 @@ enum gerbview_ids ID_GBR_AUX_TOOLBAR_PCB_NET_CHOICE, ID_GBR_AUX_TOOLBAR_PCB_APERATTRIBUTES_CHOICE, - // IDs for drill file history (wxID_FILEnn is already in use) - ID_GERBVIEW_DRILL_FILE, - ID_GERBVIEW_DRILL_FILE1, - ID_GERBVIEW_DRILL_FILE2, - ID_GERBVIEW_DRILL_FILE3, - ID_GERBVIEW_DRILL_FILE4, - ID_GERBVIEW_DRILL_FILE5, - ID_GERBVIEW_DRILL_FILE6, - ID_GERBVIEW_DRILL_FILE7, - ID_GERBVIEW_DRILL_FILE8, - ID_GERBVIEW_DRILL_FILE9, - - // IDs for job file history (wxID_FILEnn is already in use) - ID_GERBVIEW_JOB_FILE, - ID_GERBVIEW_JOB_FILE1, - ID_GERBVIEW_JOB_FILE2, - ID_GERBVIEW_JOB_FILE3, - ID_GERBVIEW_JOB_FILE4, - ID_GERBVIEW_JOB_FILE5, - ID_GERBVIEW_JOB_FILE6, - ID_GERBVIEW_JOB_FILE7, - ID_GERBVIEW_JOB_FILE8, - ID_GERBVIEW_JOB_FILE9, - - // IDs for zip file history (wxID_FILEnn is already in use) - ID_GERBVIEW_ZIP_FILE, - ID_GERBVIEW_ZIP_FILE1, - ID_GERBVIEW_ZIP_FILE2, - ID_GERBVIEW_ZIP_FILE3, - ID_GERBVIEW_ZIP_FILE4, - ID_GERBVIEW_ZIP_FILE5, - ID_GERBVIEW_ZIP_FILE6, - ID_GERBVIEW_ZIP_FILE7, - ID_GERBVIEW_ZIP_FILE8, - ID_GERBVIEW_ZIP_FILE9, - ID_TOOLBARH_GERBVIEW_SELECT_ACTIVE_LAYER, ID_GERBVIEW_ERASE_CURR_LAYER, ID_GERBVIEW_OPTIONS_SETUP, @@ -112,6 +77,21 @@ enum gerbview_ids ID_HIGHLIGHT_NET_ITEMS, ID_HIGHLIGHT_APER_ATTRIBUTE_ITEMS, + // IDs for drill file history (ID_FILEnn is already in use) + ID_GERBVIEW_DRILL_FILE = 4300, + ID_GERBVIEW_DRILL_FILE1, + ID_GERBVIEW_DRILL_FILEMAX = ID_GERBVIEW_DRILL_FILE + MAX_FILE_HISTORY_SIZE, + + // IDs for job file history (ID_FILEnn is already in use) + ID_GERBVIEW_JOB_FILE, + ID_GERBVIEW_JOB_FILE1, + ID_GERBVIEW_JOB_FILEMAX = ID_GERBVIEW_JOB_FILE + MAX_FILE_HISTORY_SIZE, + + // IDs for zip file history (ID_FILEnn is already in use) + ID_GERBVIEW_ZIP_FILE, + ID_GERBVIEW_ZIP_FILE1, + ID_GERBVIEW_ZIP_FILEMAX = ID_GERBVIEW_ZIP_FILE + MAX_FILE_HISTORY_SIZE, + ID_GERBER_END_LIST }; diff --git a/include/bin_mod.h b/include/bin_mod.h index 60837d9a02..d2ad208277 100644 --- a/include/bin_mod.h +++ b/include/bin_mod.h @@ -35,6 +35,7 @@ #include class wxConfigBase; +class FILE_HISTORY; /** * Struct BIN_MOD @@ -55,7 +56,7 @@ struct BIN_MOD const char* m_name; ///< name of this binary module, static C string. wxConfigBase* m_config; ///< maybe from $HOME/.${m_name} - wxFileHistory* m_history; + FILE_HISTORY* m_history; wxString m_help_file; SEARCH_STACK m_search; diff --git a/include/kiface_i.h b/include/kiface_i.h index 93d629e9fe..688d2e6af3 100644 --- a/include/kiface_i.h +++ b/include/kiface_i.h @@ -120,7 +120,7 @@ public: */ const wxString& GetHelpFileName() const { return m_bm.m_help_file; } - wxFileHistory& GetFileHistory() { return *m_bm.m_history; } + FILE_HISTORY& GetFileHistory() { return *m_bm.m_history; } /// Only for DSO specific 'non-library' files. /// (The library search path is in the PROJECT class.) diff --git a/include/pgm_base.h b/include/pgm_base.h index c04ae32510..f833501d9c 100644 --- a/include/pgm_base.h +++ b/include/pgm_base.h @@ -33,6 +33,7 @@ #include #include +#include #include #include @@ -47,12 +48,13 @@ #define ENBL_MOUSEWHEEL_PAN_KEY wxT( "MousewheelPAN" ) #define MIDDLE_BUTT_PAN_LIMITED_KEY wxT( "MiddleBtnPANLimited" ) #define ENBL_AUTO_PAN_KEY wxT( "AutoPAN" ) -#define FILE_HISTORY_SIZE wxT( "FileHistorySize" ) +#define FILE_HISTORY_SIZE_KEY wxT( "FileHistorySize" ) ///@} /// The default file history size is 9. #define DEFAULT_FILE_HISTORY_SIZE 9 +#define MAX_FILE_HISTORY_SIZE 99 class wxConfigBase; class wxSingleInstanceChecker; @@ -64,6 +66,24 @@ class FILENAME_RESOLVER; class EDA_DRAW_FRAME; + +enum FILE_HISTORY_IDS +{ + ID_FILE = 4200, + ID_FILE1, + ID_FILEMAX = ID_FILE + MAX_FILE_HISTORY_SIZE +}; + + +class FILE_HISTORY : public wxFileHistory +{ +public: + FILE_HISTORY( size_t aMaxFiles, int aBaseFileId ); + + void SetMaxFiles( size_t aMaxFiles ); +}; + + // inter program module calling #define VTBL_ENTRY virtual diff --git a/kicad/kicad.h b/kicad/kicad.h index 1dcfb14013..eebe582bac 100644 --- a/kicad/kicad.h +++ b/kicad/kicad.h @@ -229,6 +229,8 @@ public: void SaveSettings( wxConfigBase* aCfg ) override; + void CommonSettingsChanged() override; + /** * Open another KiCad application and logs a message. * diff --git a/kicad/mainframe.cpp b/kicad/mainframe.cpp index 6f06004bff..d5960a6670 100644 --- a/kicad/mainframe.cpp +++ b/kicad/mainframe.cpp @@ -507,6 +507,14 @@ void KICAD_MANAGER_FRAME::language_change( wxCommandEvent& event ) } +void KICAD_MANAGER_FRAME::CommonSettingsChanged() +{ + int historySize; + Pgm().CommonSettings()->Read( FILE_HISTORY_SIZE_KEY, &historySize, DEFAULT_FILE_HISTORY_SIZE ); + PgmTop().GetFileHistory().SetMaxFiles( (unsigned) std::max( 0, historySize ) ); +} + + void KICAD_MANAGER_FRAME::ClearMsg() { m_MessagesBox->Clear(); diff --git a/kicad/menubar.cpp b/kicad/menubar.cpp index 71d5541650..bd4acfcdec 100644 --- a/kicad/menubar.cpp +++ b/kicad/menubar.cpp @@ -70,7 +70,7 @@ BEGIN_EVENT_TABLE( KICAD_MANAGER_FRAME, EDA_BASE_FRAME ) EVT_MENU_RANGE( ID_LANGUAGE_CHOICE, ID_LANGUAGE_CHOICE_END, KICAD_MANAGER_FRAME::language_change ) - EVT_MENU_RANGE( wxID_FILE1, wxID_FILE9, KICAD_MANAGER_FRAME::OnFileHistory ) + EVT_MENU_RANGE( ID_FILE1, ID_FILEMAX, KICAD_MANAGER_FRAME::OnFileHistory ) // Show hotkeys EVT_MENU( ID_PREFERENCES_HOTKEY_SHOW_CURRENT_LIST, KICAD_MANAGER_FRAME::OnShowHotkeys ) diff --git a/kicad/pgm_kicad.h b/kicad/pgm_kicad.h index 63f909a414..c3eb04c74e 100644 --- a/kicad/pgm_kicad.h +++ b/kicad/pgm_kicad.h @@ -54,7 +54,7 @@ public: void MacOpenFile( const wxString& aFileName ) override; - wxFileHistory& GetFileHistory() { return *m_bm.m_history; } + FILE_HISTORY& GetFileHistory() { return *m_bm.m_history; } wxConfigBase* PgmSettings() { return m_bm.m_config; } diff --git a/pagelayout_editor/events_functions.cpp b/pagelayout_editor/events_functions.cpp index 529c4c7c3f..4e3a7074f7 100644 --- a/pagelayout_editor/events_functions.cpp +++ b/pagelayout_editor/events_functions.cpp @@ -66,7 +66,7 @@ BEGIN_EVENT_TABLE( PL_EDITOR_FRAME, EDA_DRAW_FRAME ) EVT_MENU( ID_GEN_PLOT, PL_EDITOR_FRAME::ToPlotter ) - EVT_MENU_RANGE( wxID_FILE1, wxID_FILE9, PL_EDITOR_FRAME::OnFileHistory ) + EVT_MENU_RANGE( ID_FILE1, ID_FILEMAX, PL_EDITOR_FRAME::OnFileHistory ) EVT_MENU( wxID_EXIT, PL_EDITOR_FRAME::OnQuit ) diff --git a/pcbnew/menubar_pcb_editor.cpp b/pcbnew/menubar_pcb_editor.cpp index 91407e2d62..c7778b3f1b 100644 --- a/pcbnew/menubar_pcb_editor.cpp +++ b/pcbnew/menubar_pcb_editor.cpp @@ -717,7 +717,7 @@ void prepareFilesMenu( wxMenu* aParentMenu, bool aIsOutsideProject ) // Some commands are available only if Pcbnew is run outside a project (run alone). // aIsOutsideProject is false when Pcbnew is run from Kicad manager. - wxFileHistory& fhist = Kiface().GetFileHistory(); + FILE_HISTORY& fhist = Kiface().GetFileHistory(); // Load Recent submenu static wxMenu* openRecentMenu; diff --git a/pcbnew/pcb_edit_frame.cpp b/pcbnew/pcb_edit_frame.cpp index fef6f8dc95..9149d4bde4 100644 --- a/pcbnew/pcb_edit_frame.cpp +++ b/pcbnew/pcb_edit_frame.cpp @@ -118,7 +118,7 @@ BEGIN_EVENT_TABLE( PCB_EDIT_FRAME, PCB_BASE_FRAME ) EVT_MENU( ID_SAVE_BOARD_AS, PCB_EDIT_FRAME::Files_io ) EVT_MENU( ID_COPY_BOARD_AS, PCB_EDIT_FRAME::Files_io ) EVT_MENU( ID_IMPORT_NON_KICAD_BOARD, PCB_EDIT_FRAME::Files_io ) - EVT_MENU_RANGE( wxID_FILE1, wxID_FILE9, PCB_EDIT_FRAME::OnFileHistory ) + EVT_MENU_RANGE( ID_FILE1, ID_FILEMAX, PCB_EDIT_FRAME::OnFileHistory ) EVT_MENU( ID_GEN_PLOT, PCB_EDIT_FRAME::ToPlotter )