Fix minor issues.

This commit is contained in:
jean-pierre charras 2010-12-18 09:59:04 +01:00
parent b8eba35cba
commit 7d85aa92a8
6 changed files with 29 additions and 53 deletions

View File

@ -93,11 +93,9 @@ void WinEDA_BasicFrame::SetLanguage( wxCommandEvent& event )
int id = event.GetId();
wxGetApp().SetLanguageIdentifier( id );
if ( wxGetApp().SetLanguage() )
{
wxGetApp().SetLanguage();
ReCreateMenuBar();
Refresh();
}
GetMenuBar()->Refresh();
}

View File

@ -958,6 +958,9 @@ void LIB_EDIT_FRAME::SetLanguage( wxCommandEvent& event )
{
WinEDA_BasicFrame::SetLanguage( event );
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 );
}

View File

@ -11,14 +11,14 @@
#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,
const wxPoint& aLocation, const wxSize& aSize,
const wxArrayString& aChoices ) :
wxChoice( aParent, aId, aLocation, aSize, aChoices )
wxComboBox( aParent, aId, wxEmptyString, aLocation, aSize, aChoices, wxCB_READONLY )
{
m_dcodeList = &aChoices;
}

View File

@ -7,9 +7,9 @@
*/
// 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:
const wxArrayString* m_dcodeList;

View File

@ -71,7 +71,7 @@ END_EVENT_TABLE()
void WinEDA_MainFrame::ReCreateMenuBar()
{
wxMenuItem *item;
wxMenuBar *menuBar = GetMenuBar();
wxMenuBar *menuBar = new wxMenuBar();
if( ! menuBar )
menuBar = new wxMenuBar();
@ -87,7 +87,7 @@ void WinEDA_MainFrame::ReCreateMenuBar()
// Files menu
wxMenu* filesMenu = new wxMenu;
/* Open */
// Open
item = new wxMenuItem( filesMenu, ID_LOAD_PROJECT, _( "&Open\tCtrl+O" ),
_( "Open an existing project" ) );
@ -97,7 +97,7 @@ void WinEDA_MainFrame::ReCreateMenuBar()
filesMenu->Append( item );
/* Open Recent submenu */
// Open Recent submenu
wxMenu* openRecentMenu = new wxMenu();
wxGetApp().m_fileHistory.AddFilesToMenu( openRecentMenu );
ADD_MENUITEM_WITH_HELP_AND_SUBMENU( filesMenu, openRecentMenu,
@ -105,7 +105,7 @@ void WinEDA_MainFrame::ReCreateMenuBar()
_("Open a recent opened schematic project" ),
open_project_xpm );
/* New */
// New
item = new wxMenuItem( filesMenu, ID_NEW_PROJECT, _( "&New\tCtrl+N" ),
_( "Start a new project" ) );
@ -125,10 +125,8 @@ void WinEDA_MainFrame::ReCreateMenuBar()
filesMenu->Append( item );
/* Separator */
// Archive
filesMenu->AppendSeparator();
/* Archive */
item = new wxMenuItem( filesMenu, ID_SAVE_AND_ZIP_FILES, _( "&Archive" ),
_( "Archive project files in zip archive" ) );
@ -138,7 +136,7 @@ void WinEDA_MainFrame::ReCreateMenuBar()
filesMenu->Append( item );
/* Unarchive */
// Unarchive
item = new wxMenuItem( filesMenu, ID_READ_ZIP_ARCHIVE, _( "&Unarchive" ),
_( "Unarchive project files from zip file" ) );
@ -161,12 +159,10 @@ void WinEDA_MainFrame::ReCreateMenuBar()
/**
* Browse menu
*/
// Browse menu
wxMenu* browseMenu = new wxMenu();
/* Text editor */
// Text editor
item = new wxMenuItem( browseMenu, ID_TO_EDITOR, _( "Text E&ditor" ),
_( "Open preferred text editor" ) );
#if !defined( __WXMAC__ )
@ -187,12 +183,10 @@ void WinEDA_MainFrame::ReCreateMenuBar()
/**
* Preferences menu
*/
// Preferences menu
wxMenu* PreferencesMenu = new wxMenu;
/* Text editor */
// Text editor
item = new wxMenuItem( PreferencesMenu, ID_SELECT_PREFERED_EDITOR,
_( "&Text Editor" ),
_( "Select your preferred text editor" ) );
@ -202,13 +196,10 @@ void WinEDA_MainFrame::ReCreateMenuBar()
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;
/* Default */
// Default
item = new wxMenuItem( SubMenuPdfBrowserChoice,
ID_SELECT_DEFAULT_PDF_BROWSER,
_( "Default" ),
@ -223,7 +214,7 @@ void WinEDA_MainFrame::ReCreateMenuBar()
SubMenuPdfBrowserChoice->Check( ID_SELECT_DEFAULT_PDF_BROWSER,
wxGetApp().m_PdfBrowserIsDefault );
/* Favourite */
// Favourite viewer
item = new wxMenuItem( SubMenuPdfBrowserChoice,
ID_SELECT_PREFERED_PDF_BROWSER,
_( "Favourite" ),
@ -258,11 +249,7 @@ void WinEDA_MainFrame::ReCreateMenuBar()
PreferencesMenu->AppendSeparator();
wxGetApp().AddMenuLanguageList( PreferencesMenu );
/**
* Help menu
*/
// Help menu
wxMenu* helpMenu = new wxMenu;
AddHelpVersionInfoMenuEntry( helpMenu );
@ -277,20 +264,14 @@ void WinEDA_MainFrame::ReCreateMenuBar()
helpMenu->Append( item );
/* About on all platforms except WXMAC */
#if !defined( __WXMAC__ )
// About
helpMenu->AppendSeparator();
item = new wxMenuItem( helpMenu, ID_KICAD_ABOUT, _( "&About" ),
_( "About kicad project manager" ) );
item->SetBitmap( info_xpm );
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( browseMenu, _( "&Browse" ) );
menuBar->Append( PreferencesMenu, _( "&Preferences" ) );

View File

@ -98,11 +98,5 @@ void WinEDA_MainFrame::OnSelectPreferredEditor( wxCommandEvent& event )
void WinEDA_MainFrame::SetLanguage( wxCommandEvent& event )
{
wxGetApp().SetLanguageIdentifier( event.GetId() );
if ( wxGetApp().SetLanguage() )
{
wxLogDebug( wxT( "Recreating menu bar due to language change." ) );
ReCreateMenuBar();
Refresh();
}
WinEDA_BasicFrame::SetLanguage( event );
}