Fix minor issues.
This commit is contained in:
parent
b8eba35cba
commit
7d85aa92a8
|
@ -93,11 +93,9 @@ void WinEDA_BasicFrame::SetLanguage( wxCommandEvent& event )
|
||||||
int id = event.GetId();
|
int id = event.GetId();
|
||||||
|
|
||||||
wxGetApp().SetLanguageIdentifier( id );
|
wxGetApp().SetLanguageIdentifier( id );
|
||||||
if ( wxGetApp().SetLanguage() )
|
wxGetApp().SetLanguage();
|
||||||
{
|
ReCreateMenuBar();
|
||||||
ReCreateMenuBar();
|
GetMenuBar()->Refresh();
|
||||||
Refresh();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -958,6 +958,9 @@ void LIB_EDIT_FRAME::SetLanguage( wxCommandEvent& event )
|
||||||
{
|
{
|
||||||
WinEDA_BasicFrame::SetLanguage( event );
|
WinEDA_BasicFrame::SetLanguage( event );
|
||||||
SCH_EDIT_FRAME *parent = (SCH_EDIT_FRAME *)GetParent();
|
SCH_EDIT_FRAME *parent = (SCH_EDIT_FRAME *)GetParent();
|
||||||
|
// Call parent->WinEDA_BasicFrame::SetLanguage and NOT
|
||||||
|
// parent->SetLanguage because parent->SetLanguage call
|
||||||
|
// LIB_EDIT_FRAME::SetLanguage
|
||||||
parent->WinEDA_BasicFrame::SetLanguage( event );
|
parent->WinEDA_BasicFrame::SetLanguage( event );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -11,14 +11,14 @@
|
||||||
|
|
||||||
#include "class_DCodeSelectionbox.h"
|
#include "class_DCodeSelectionbox.h"
|
||||||
|
|
||||||
/***************************************/
|
/*******************************************/
|
||||||
/* ListBox handling the footprint list */
|
/* Helper class for displaying DCodes list */
|
||||||
/***************************************/
|
/*******************************************/
|
||||||
|
|
||||||
DCODE_SELECTION_BOX::DCODE_SELECTION_BOX( WinEDA_Toolbar* aParent, wxWindowID aId,
|
DCODE_SELECTION_BOX::DCODE_SELECTION_BOX( WinEDA_Toolbar* aParent, wxWindowID aId,
|
||||||
const wxPoint& aLocation, const wxSize& aSize,
|
const wxPoint& aLocation, const wxSize& aSize,
|
||||||
const wxArrayString& aChoices ) :
|
const wxArrayString& aChoices ) :
|
||||||
wxChoice( aParent, aId, aLocation, aSize, aChoices )
|
wxComboBox( aParent, aId, wxEmptyString, aLocation, aSize, aChoices, wxCB_READONLY )
|
||||||
{
|
{
|
||||||
m_dcodeList = &aChoices;
|
m_dcodeList = &aChoices;
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,9 +7,9 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Define event type for DCODE_SELECTION_BOX
|
// Define event type for DCODE_SELECTION_BOX
|
||||||
#define EVT_SELECT_DCODE EVT_CHOICE
|
#define EVT_SELECT_DCODE EVT_COMBOBOX
|
||||||
|
|
||||||
class DCODE_SELECTION_BOX : public wxChoice
|
class DCODE_SELECTION_BOX : public wxComboBox
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
const wxArrayString* m_dcodeList;
|
const wxArrayString* m_dcodeList;
|
||||||
|
|
|
@ -71,7 +71,7 @@ END_EVENT_TABLE()
|
||||||
void WinEDA_MainFrame::ReCreateMenuBar()
|
void WinEDA_MainFrame::ReCreateMenuBar()
|
||||||
{
|
{
|
||||||
wxMenuItem *item;
|
wxMenuItem *item;
|
||||||
wxMenuBar *menuBar = GetMenuBar();
|
wxMenuBar *menuBar = new wxMenuBar();
|
||||||
|
|
||||||
if( ! menuBar )
|
if( ! menuBar )
|
||||||
menuBar = new wxMenuBar();
|
menuBar = new wxMenuBar();
|
||||||
|
@ -87,7 +87,7 @@ void WinEDA_MainFrame::ReCreateMenuBar()
|
||||||
// Files menu
|
// Files menu
|
||||||
wxMenu* filesMenu = new wxMenu;
|
wxMenu* filesMenu = new wxMenu;
|
||||||
|
|
||||||
/* Open */
|
// Open
|
||||||
item = new wxMenuItem( filesMenu, ID_LOAD_PROJECT, _( "&Open\tCtrl+O" ),
|
item = new wxMenuItem( filesMenu, ID_LOAD_PROJECT, _( "&Open\tCtrl+O" ),
|
||||||
_( "Open an existing project" ) );
|
_( "Open an existing project" ) );
|
||||||
|
|
||||||
|
@ -97,7 +97,7 @@ void WinEDA_MainFrame::ReCreateMenuBar()
|
||||||
|
|
||||||
filesMenu->Append( item );
|
filesMenu->Append( item );
|
||||||
|
|
||||||
/* Open Recent submenu */
|
// Open Recent submenu
|
||||||
wxMenu* openRecentMenu = new wxMenu();
|
wxMenu* openRecentMenu = new wxMenu();
|
||||||
wxGetApp().m_fileHistory.AddFilesToMenu( openRecentMenu );
|
wxGetApp().m_fileHistory.AddFilesToMenu( openRecentMenu );
|
||||||
ADD_MENUITEM_WITH_HELP_AND_SUBMENU( filesMenu, openRecentMenu,
|
ADD_MENUITEM_WITH_HELP_AND_SUBMENU( filesMenu, openRecentMenu,
|
||||||
|
@ -105,7 +105,7 @@ void WinEDA_MainFrame::ReCreateMenuBar()
|
||||||
_("Open a recent opened schematic project" ),
|
_("Open a recent opened schematic project" ),
|
||||||
open_project_xpm );
|
open_project_xpm );
|
||||||
|
|
||||||
/* New */
|
// New
|
||||||
item = new wxMenuItem( filesMenu, ID_NEW_PROJECT, _( "&New\tCtrl+N" ),
|
item = new wxMenuItem( filesMenu, ID_NEW_PROJECT, _( "&New\tCtrl+N" ),
|
||||||
_( "Start a new project" ) );
|
_( "Start a new project" ) );
|
||||||
|
|
||||||
|
@ -125,10 +125,8 @@ void WinEDA_MainFrame::ReCreateMenuBar()
|
||||||
|
|
||||||
filesMenu->Append( item );
|
filesMenu->Append( item );
|
||||||
|
|
||||||
/* Separator */
|
// Archive
|
||||||
filesMenu->AppendSeparator();
|
filesMenu->AppendSeparator();
|
||||||
|
|
||||||
/* Archive */
|
|
||||||
item = new wxMenuItem( filesMenu, ID_SAVE_AND_ZIP_FILES, _( "&Archive" ),
|
item = new wxMenuItem( filesMenu, ID_SAVE_AND_ZIP_FILES, _( "&Archive" ),
|
||||||
_( "Archive project files in zip archive" ) );
|
_( "Archive project files in zip archive" ) );
|
||||||
|
|
||||||
|
@ -138,7 +136,7 @@ void WinEDA_MainFrame::ReCreateMenuBar()
|
||||||
|
|
||||||
filesMenu->Append( item );
|
filesMenu->Append( item );
|
||||||
|
|
||||||
/* Unarchive */
|
// Unarchive
|
||||||
item = new wxMenuItem( filesMenu, ID_READ_ZIP_ARCHIVE, _( "&Unarchive" ),
|
item = new wxMenuItem( filesMenu, ID_READ_ZIP_ARCHIVE, _( "&Unarchive" ),
|
||||||
_( "Unarchive project files from zip file" ) );
|
_( "Unarchive project files from zip file" ) );
|
||||||
|
|
||||||
|
@ -161,12 +159,10 @@ void WinEDA_MainFrame::ReCreateMenuBar()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
// Browse menu
|
||||||
* Browse menu
|
|
||||||
*/
|
|
||||||
wxMenu* browseMenu = new wxMenu();
|
wxMenu* browseMenu = new wxMenu();
|
||||||
|
|
||||||
/* Text editor */
|
// Text editor
|
||||||
item = new wxMenuItem( browseMenu, ID_TO_EDITOR, _( "Text E&ditor" ),
|
item = new wxMenuItem( browseMenu, ID_TO_EDITOR, _( "Text E&ditor" ),
|
||||||
_( "Open preferred text editor" ) );
|
_( "Open preferred text editor" ) );
|
||||||
#if !defined( __WXMAC__ )
|
#if !defined( __WXMAC__ )
|
||||||
|
@ -187,12 +183,10 @@ void WinEDA_MainFrame::ReCreateMenuBar()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
// Preferences menu
|
||||||
* Preferences menu
|
|
||||||
*/
|
|
||||||
wxMenu* PreferencesMenu = new wxMenu;
|
wxMenu* PreferencesMenu = new wxMenu;
|
||||||
|
|
||||||
/* Text editor */
|
// Text editor
|
||||||
item = new wxMenuItem( PreferencesMenu, ID_SELECT_PREFERED_EDITOR,
|
item = new wxMenuItem( PreferencesMenu, ID_SELECT_PREFERED_EDITOR,
|
||||||
_( "&Text Editor" ),
|
_( "&Text Editor" ),
|
||||||
_( "Select your preferred text editor" ) );
|
_( "Select your preferred text editor" ) );
|
||||||
|
@ -202,13 +196,10 @@ void WinEDA_MainFrame::ReCreateMenuBar()
|
||||||
|
|
||||||
PreferencesMenu->Append( item );
|
PreferencesMenu->Append( item );
|
||||||
|
|
||||||
/**
|
// PDF Viewer submenu:System browser or user defined checkbox
|
||||||
* PDF Viewer submenu
|
|
||||||
* System browser or user defined checkbox
|
|
||||||
*/
|
|
||||||
wxMenu* SubMenuPdfBrowserChoice = new wxMenu;
|
wxMenu* SubMenuPdfBrowserChoice = new wxMenu;
|
||||||
|
|
||||||
/* Default */
|
// Default
|
||||||
item = new wxMenuItem( SubMenuPdfBrowserChoice,
|
item = new wxMenuItem( SubMenuPdfBrowserChoice,
|
||||||
ID_SELECT_DEFAULT_PDF_BROWSER,
|
ID_SELECT_DEFAULT_PDF_BROWSER,
|
||||||
_( "Default" ),
|
_( "Default" ),
|
||||||
|
@ -223,7 +214,7 @@ void WinEDA_MainFrame::ReCreateMenuBar()
|
||||||
SubMenuPdfBrowserChoice->Check( ID_SELECT_DEFAULT_PDF_BROWSER,
|
SubMenuPdfBrowserChoice->Check( ID_SELECT_DEFAULT_PDF_BROWSER,
|
||||||
wxGetApp().m_PdfBrowserIsDefault );
|
wxGetApp().m_PdfBrowserIsDefault );
|
||||||
|
|
||||||
/* Favourite */
|
// Favourite viewer
|
||||||
item = new wxMenuItem( SubMenuPdfBrowserChoice,
|
item = new wxMenuItem( SubMenuPdfBrowserChoice,
|
||||||
ID_SELECT_PREFERED_PDF_BROWSER,
|
ID_SELECT_PREFERED_PDF_BROWSER,
|
||||||
_( "Favourite" ),
|
_( "Favourite" ),
|
||||||
|
@ -258,11 +249,7 @@ void WinEDA_MainFrame::ReCreateMenuBar()
|
||||||
PreferencesMenu->AppendSeparator();
|
PreferencesMenu->AppendSeparator();
|
||||||
wxGetApp().AddMenuLanguageList( PreferencesMenu );
|
wxGetApp().AddMenuLanguageList( PreferencesMenu );
|
||||||
|
|
||||||
|
// Help menu
|
||||||
|
|
||||||
/**
|
|
||||||
* Help menu
|
|
||||||
*/
|
|
||||||
wxMenu* helpMenu = new wxMenu;
|
wxMenu* helpMenu = new wxMenu;
|
||||||
|
|
||||||
AddHelpVersionInfoMenuEntry( helpMenu );
|
AddHelpVersionInfoMenuEntry( helpMenu );
|
||||||
|
@ -277,20 +264,14 @@ void WinEDA_MainFrame::ReCreateMenuBar()
|
||||||
|
|
||||||
helpMenu->Append( item );
|
helpMenu->Append( item );
|
||||||
|
|
||||||
/* About on all platforms except WXMAC */
|
// About
|
||||||
#if !defined( __WXMAC__ )
|
|
||||||
|
|
||||||
helpMenu->AppendSeparator();
|
helpMenu->AppendSeparator();
|
||||||
item = new wxMenuItem( helpMenu, ID_KICAD_ABOUT, _( "&About" ),
|
item = new wxMenuItem( helpMenu, ID_KICAD_ABOUT, _( "&About" ),
|
||||||
_( "About kicad project manager" ) );
|
_( "About kicad project manager" ) );
|
||||||
item->SetBitmap( info_xpm );
|
item->SetBitmap( info_xpm );
|
||||||
helpMenu->Append( item );
|
helpMenu->Append( item );
|
||||||
|
|
||||||
#endif /* !defined( __WXMAC__ ) */
|
// Create the menubar and append all submenus
|
||||||
|
|
||||||
/**
|
|
||||||
* Create the menubar and append all submenus
|
|
||||||
*/
|
|
||||||
menuBar->Append( filesMenu, _( "&File" ) );
|
menuBar->Append( filesMenu, _( "&File" ) );
|
||||||
menuBar->Append( browseMenu, _( "&Browse" ) );
|
menuBar->Append( browseMenu, _( "&Browse" ) );
|
||||||
menuBar->Append( PreferencesMenu, _( "&Preferences" ) );
|
menuBar->Append( PreferencesMenu, _( "&Preferences" ) );
|
||||||
|
|
|
@ -98,11 +98,5 @@ void WinEDA_MainFrame::OnSelectPreferredEditor( wxCommandEvent& event )
|
||||||
|
|
||||||
void WinEDA_MainFrame::SetLanguage( wxCommandEvent& event )
|
void WinEDA_MainFrame::SetLanguage( wxCommandEvent& event )
|
||||||
{
|
{
|
||||||
wxGetApp().SetLanguageIdentifier( event.GetId() );
|
WinEDA_BasicFrame::SetLanguage( event );
|
||||||
if ( wxGetApp().SetLanguage() )
|
|
||||||
{
|
|
||||||
wxLogDebug( wxT( "Recreating menu bar due to language change." ) );
|
|
||||||
ReCreateMenuBar();
|
|
||||||
Refresh();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue