Eeschema: make menu file history working again.

(the bug was due to an unexpected menuitem ID range used for the  menuitems of the history)
This commit is contained in:
jean-pierre charras 2019-05-25 20:58:28 +02:00
parent b8e2054b23
commit a6e6e914af
4 changed files with 15 additions and 14 deletions

View File

@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application. * This program source code file is part of KiCad, a free EDA CAD application.
* *
* Copyright (C) 2014 CERN * Copyright (C) 2014 CERN
* Copyright (C) 2014 KiCad Developers, see CHANGELOG.TXT for contributors. * Copyright (C) 2019 KiCad Developers, see AUTHORS.txt for contributors.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
@ -25,6 +25,7 @@
#include <bin_mod.h> #include <bin_mod.h>
#include <common.h> #include <common.h>
#include <pgm_base.h> #include <pgm_base.h>
#include <id.h> // for ID_FILE1 and FILE_HISTORY_SIZE
BIN_MOD::BIN_MOD( const char* aName ) : BIN_MOD::BIN_MOD( const char* aName ) :

View File

@ -29,6 +29,7 @@
#include <dpi_scaling.h> #include <dpi_scaling.h>
#include <kiface_i.h> #include <kiface_i.h>
#include <pgm_base.h> #include <pgm_base.h>
#include <id.h>
#include <wx/graphics.h> #include <wx/graphics.h>

View File

@ -63,6 +63,12 @@
#define ROOM_FOR_3D_VIEWER 100 #define ROOM_FOR_3D_VIEWER 100
#define ROOM_FOR_PANEL_PREV_MODEL 50 #define ROOM_FOR_PANEL_PREV_MODEL 50
/// IDs range for menuitems file history:
/// The default range file history size is 9 (compatible with default wxWidget range).
#define DEFAULT_FILE_HISTORY_SIZE 9
#define MAX_FILE_HISTORY_SIZE 99
enum main_id enum main_id
{ {
ID_RUN_PCB = wxID_HIGHEST, ID_RUN_PCB = wxID_HIGHEST,
@ -87,6 +93,12 @@ enum main_id
ID_CONFIG_SAVE, ID_CONFIG_SAVE,
ID_CONFIG_READ, ID_CONFIG_READ,
// ID for menuitems used in our file history management,
// when we do not use wxFILE_ID (restricted to 9 items)
ID_FILE,
ID_FILE1,
ID_FILEMAX = ID_FILE + MAX_FILE_HISTORY_SIZE,
ID_MENU_CANVAS_LEGACY, ID_MENU_CANVAS_LEGACY,
ID_MENU_CANVAS_OPENGL, ID_MENU_CANVAS_OPENGL,
ID_MENU_CANVAS_CAIRO, ID_MENU_CANVAS_CAIRO,

View File

@ -57,10 +57,6 @@
///@} ///@}
/// The default file history size is 9.
#define DEFAULT_FILE_HISTORY_SIZE 9
#define MAX_FILE_HISTORY_SIZE 99
class wxConfigBase; class wxConfigBase;
class wxSingleInstanceChecker; class wxSingleInstanceChecker;
class wxApp; class wxApp;
@ -71,15 +67,6 @@ class FILENAME_RESOLVER;
class EDA_DRAW_FRAME; 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 class FILE_HISTORY : public wxFileHistory
{ {
public: public: