Commit 47bfe663 authored by charras's avatar charras

Setting a new language now update the layer manager.

parent 1661d6d4
...@@ -77,6 +77,23 @@ void WinEDA_BasicFrame::ReCreateMenuBar() ...@@ -77,6 +77,23 @@ void WinEDA_BasicFrame::ReCreateMenuBar()
} }
/** Vitual function SetLanguage
* called on a language menu selection
* when using a derived function, do not forget to call this one
*/
void WinEDA_BasicFrame::SetLanguage( wxCommandEvent& event )
{
int id = event.GetId();
wxGetApp().SetLanguageIdentifier( id );
if ( wxGetApp().SetLanguage() )
{
wxLogDebug( wxT( "Recreating menu bar due to language change." ) );
ReCreateMenuBar();
Refresh();
}
}
/** /**
* Load common frame parameters from configuration. * Load common frame parameters from configuration.
......
...@@ -6,10 +6,10 @@ ...@@ -6,10 +6,10 @@
#endif #endif
#ifndef KICAD_BUILD_VERSION #ifndef KICAD_BUILD_VERSION
#define KICAD_BUILD_VERSION "(2010-02-21)" #define KICAD_BUILD_VERSION "(2010-02-26)"
#endif #endif
#define VERSION_STABILITY "RC4" #define VERSION_STABILITY "RC5"
/** Function GetBuildVersion() /** Function GetBuildVersion()
* Return the build date and version * Return the build date and version
......
...@@ -533,17 +533,13 @@ void WinEDA_DrawFrame::AdjustScrollBars() ...@@ -533,17 +533,13 @@ void WinEDA_DrawFrame::AdjustScrollBars()
} }
/** function SetLanguage
* called on a language menu selection
* when using a derived function, do not forget to call this one
*/
void WinEDA_DrawFrame::SetLanguage( wxCommandEvent& event ) void WinEDA_DrawFrame::SetLanguage( wxCommandEvent& event )
{ {
int id = event.GetId(); WinEDA_BasicFrame::SetLanguage( event );
wxGetApp().SetLanguageIdentifier( id );
if ( wxGetApp().SetLanguage() )
{
wxLogDebug( wxT( "Recreating menu bar due to language change." ) );
ReCreateMenuBar();
Refresh();
}
} }
/** /**
......
...@@ -506,14 +506,12 @@ void WinEDA_CvpcbFrame::DisplayModule( wxCommandEvent& event ) ...@@ -506,14 +506,12 @@ void WinEDA_CvpcbFrame::DisplayModule( wxCommandEvent& event )
} }
/** Vitual function SetLanguage
* called on a language menu selection
*/
void WinEDA_CvpcbFrame::SetLanguage( wxCommandEvent& event ) void WinEDA_CvpcbFrame::SetLanguage( wxCommandEvent& event )
{ {
int id = event.GetId(); WinEDA_BasicFrame::SetLanguage( event );
wxGetApp().SetLanguageIdentifier( id );
wxGetApp().SetLanguage();
ReCreateMenuBar();
Refresh();
} }
......
...@@ -77,6 +77,9 @@ GERBER_LAYER_WIDGET::GERBER_LAYER_WIDGET( WinEDA_GerberFrame* aParent, wxWindow* ...@@ -77,6 +77,9 @@ GERBER_LAYER_WIDGET::GERBER_LAYER_WIDGET( WinEDA_GerberFrame* aParent, wxWindow*
AppendRenderRows( renderRows, DIM(renderRows) ); AppendRenderRows( renderRows, DIM(renderRows) );
// Update default tabs labels for gerbview
SetLayersManagerTabsText( );
//-----<Popup menu>------------------------------------------------- //-----<Popup menu>-------------------------------------------------
// handle the popup menu over the layer window. // handle the popup menu over the layer window.
m_LayerScrolledWindow->Connect( wxEVT_RIGHT_DOWN, m_LayerScrolledWindow->Connect( wxEVT_RIGHT_DOWN,
...@@ -91,6 +94,16 @@ GERBER_LAYER_WIDGET::GERBER_LAYER_WIDGET( WinEDA_GerberFrame* aParent, wxWindow* ...@@ -91,6 +94,16 @@ GERBER_LAYER_WIDGET::GERBER_LAYER_WIDGET( WinEDA_GerberFrame* aParent, wxWindow*
// using installRightLayerClickHandler // using installRightLayerClickHandler
} }
/** Function SetLayersManagerTabsText
* Update the layer manager tabs labels
* Useful when changing Language or to set labels to a non default value
*/
void GERBER_LAYER_WIDGET::SetLayersManagerTabsText( )
{
m_notebook->SetPageText(0, _("Layer") );
m_notebook->SetPageText(1, _("Render") );
}
void GERBER_LAYER_WIDGET::installRightLayerClickHandler() void GERBER_LAYER_WIDGET::installRightLayerClickHandler()
{ {
...@@ -175,6 +188,7 @@ void GERBER_LAYER_WIDGET::onPopupSelection( wxCommandEvent& event ) ...@@ -175,6 +188,7 @@ void GERBER_LAYER_WIDGET::onPopupSelection( wxCommandEvent& event )
} }
void GERBER_LAYER_WIDGET::ReFill() void GERBER_LAYER_WIDGET::ReFill()
{ {
BOARD* brd = myframe->GetBoard(); BOARD* brd = myframe->GetBoard();
......
...@@ -77,6 +77,11 @@ public: ...@@ -77,6 +77,11 @@ public:
void OnLayerVisible( int aLayer, bool isVisible, bool isFinal ); void OnLayerVisible( int aLayer, bool isVisible, bool isFinal );
void OnRenderColorChange( int aId, int aColor ); void OnRenderColorChange( int aId, int aColor );
void OnRenderEnable( int aId, bool isEnabled ); void OnRenderEnable( int aId, bool isEnabled );
/** Function SetLayersManagerTabsText
* Update the layer manager tabs labels
* Useful when changing Language or to set labels to a non default value
*/
void SetLayersManagerTabsText( );
//-----</implement LAYER_WIDGET abstract callback functions>---------- //-----</implement LAYER_WIDGET abstract callback functions>----------
}; };
......
...@@ -182,8 +182,6 @@ WinEDA_GerberFrame::WinEDA_GerberFrame( wxWindow* father, ...@@ -182,8 +182,6 @@ WinEDA_GerberFrame::WinEDA_GerberFrame( wxWindow* father,
// LAYER_WIDGET is floatable, but initially docked at far right // LAYER_WIDGET is floatable, but initially docked at far right
wxAuiPaneInfo lyrs; wxAuiPaneInfo lyrs;
lyrs.MinSize( m_LayersManager->GetBestSize() ); // updated in ReFillLayerWidget
lyrs.BestSize( m_LayersManager->GetBestSize() );
lyrs.CloseButton( false ); lyrs.CloseButton( false );
lyrs.Caption( _( "Visibles" ) ); lyrs.Caption( _( "Visibles" ) );
lyrs.IsFloatable(); lyrs.IsFloatable();
...@@ -210,9 +208,10 @@ WinEDA_GerberFrame::WinEDA_GerberFrame( wxWindow* father, ...@@ -210,9 +208,10 @@ WinEDA_GerberFrame::WinEDA_GerberFrame( wxWindow* father,
m_auimgr.AddPane( MsgPanel, m_auimgr.AddPane( MsgPanel,
wxAuiPaneInfo( horiz ).Name( wxT( "MsgPanel" ) ).Bottom() ); wxAuiPaneInfo( horiz ).Name( wxT( "MsgPanel" ) ).Bottom() );
ReFillLayerWidget(); // this is near end because contents establish size
m_auimgr.Update(); m_auimgr.Update();
ReFillLayerWidget(); // this is near end because contents establish size
} }
...@@ -485,3 +484,17 @@ void WinEDA_GerberFrame::syncLayerBox() ...@@ -485,3 +484,17 @@ void WinEDA_GerberFrame::syncLayerBox()
m_SelLayerBox->SetSelection( getActiveLayer() ); m_SelLayerBox->SetSelection( getActiveLayer() );
} }
/** function SetLanguage
* called on a language menu selection
* Update Layer manager title and tabs texts
*/
void WinEDA_GerberFrame::SetLanguage( wxCommandEvent& event )
{
WinEDA_DrawFrame::SetLanguage( event );
m_LayersManager->SetLayersManagerTabsText( );
wxAuiPaneInfo& pane_info = m_auimgr.GetPane(m_LayersManager);
pane_info.Caption( _( "Visibles" ) );
m_auimgr.Update();
ReFillLayerWidget();
}
...@@ -179,6 +179,11 @@ public: ...@@ -179,6 +179,11 @@ public:
*/ */
virtual void SaveSettings(); virtual void SaveSettings();
/** function SetLanguage
* called on a language menu selection
*/
virtual void SetLanguage( wxCommandEvent& event );
void Process_Special_Functions( wxCommandEvent& event ); void Process_Special_Functions( wxCommandEvent& event );
void RedrawActiveWindow( wxDC* DC, bool EraseBg ); void RedrawActiveWindow( wxDC* DC, bool EraseBg );
void ReCreateHToolbar(); void ReCreateHToolbar();
......
...@@ -909,6 +909,12 @@ public: ...@@ -909,6 +909,12 @@ public:
*/ */
virtual void SaveSettings(); virtual void SaveSettings();
/** function SetLanguage
* called on a language menu selection
*/
virtual void SetLanguage( wxCommandEvent& event );
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
}; };
......
...@@ -126,7 +126,11 @@ public: ...@@ -126,7 +126,11 @@ public:
int ReadHotkeyConfigFile( const wxString& Filename, int ReadHotkeyConfigFile( const wxString& Filename,
struct Ki_HotkeyInfoSectionDescriptor* DescList, struct Ki_HotkeyInfoSectionDescriptor* DescList,
bool verbose ); bool verbose );
void SetLanguage( wxCommandEvent& event ); /** function SetLanguage
* called on a language menu selection
* when using a derived function, do not forget to call this one
*/
virtual void SetLanguage( wxCommandEvent& event );
wxString GetFileFromHistory( int cmdId, const wxString& type ); wxString GetFileFromHistory( int cmdId, const wxString& type );
void SetLastProject( const wxString& FullFileName ); void SetLastProject( const wxString& FullFileName );
...@@ -230,7 +234,12 @@ public: ...@@ -230,7 +234,12 @@ public:
void EraseMsgBox(); void EraseMsgBox();
void Process_PageSettings( wxCommandEvent& event ); void Process_PageSettings( wxCommandEvent& event );
virtual void SetToolbars(); virtual void SetToolbars();
void SetLanguage( wxCommandEvent& event ); /** function SetLanguage
* called on a language menu selection
* when using a derived function, do not forget to call this one
*/
virtual void SetLanguage( wxCommandEvent& event );
virtual void ReCreateHToolbar() = 0; virtual void ReCreateHToolbar() = 0;
virtual void ReCreateVToolbar() = 0; virtual void ReCreateVToolbar() = 0;
virtual void ReCreateMenuBar(); virtual void ReCreateMenuBar();
......
No preview for this file type
This diff is collapsed.
...@@ -99,6 +99,9 @@ PCB_LAYER_WIDGET::PCB_LAYER_WIDGET( WinEDA_PcbFrame* aParent, wxWindow* aFocusOw ...@@ -99,6 +99,9 @@ PCB_LAYER_WIDGET::PCB_LAYER_WIDGET( WinEDA_PcbFrame* aParent, wxWindow* aFocusOw
AppendRenderRows( renderRows, DIM(renderRows) ); AppendRenderRows( renderRows, DIM(renderRows) );
// Update default tabs labels for gerbview
SetLayersManagerTabsText( );
//-----<Popup menu>------------------------------------------------- //-----<Popup menu>-------------------------------------------------
// handle the popup menu over the layer window. // handle the popup menu over the layer window.
m_LayerScrolledWindow->Connect( wxEVT_RIGHT_DOWN, m_LayerScrolledWindow->Connect( wxEVT_RIGHT_DOWN,
...@@ -196,6 +199,16 @@ void PCB_LAYER_WIDGET::onPopupSelection( wxCommandEvent& event ) ...@@ -196,6 +199,16 @@ void PCB_LAYER_WIDGET::onPopupSelection( wxCommandEvent& event )
} }
} }
/** Function SetLayersManagerTabsText
* Update the layer manager tabs labels
* Useful when changing Language or to set labels to a non default value
*/
void PCB_LAYER_WIDGET::SetLayersManagerTabsText( )
{
m_notebook->SetPageText(0, _("Layer") );
m_notebook->SetPageText(1, _("Render") );
}
void PCB_LAYER_WIDGET::ReFill() void PCB_LAYER_WIDGET::ReFill()
{ {
......
...@@ -75,6 +75,11 @@ public: ...@@ -75,6 +75,11 @@ public:
void OnLayerVisible( int aLayer, bool isVisible, bool isFinal ); void OnLayerVisible( int aLayer, bool isVisible, bool isFinal );
void OnRenderColorChange( int aId, int aColor ); void OnRenderColorChange( int aId, int aColor );
void OnRenderEnable( int aId, bool isEnabled ); void OnRenderEnable( int aId, bool isEnabled );
/** Function SetLayersManagerTabsText
* Update the layer manager tabs labels
* Useful when changing Language or to set labels to a non default value
*/
void SetLayersManagerTabsText( );
//-----</implement LAYER_WIDGET abstract callback functions>---------- //-----</implement LAYER_WIDGET abstract callback functions>----------
}; };
......
...@@ -128,7 +128,7 @@ BEGIN_EVENT_TABLE( WinEDA_PcbFrame, WinEDA_BasePcbFrame ) ...@@ -128,7 +128,7 @@ BEGIN_EVENT_TABLE( WinEDA_PcbFrame, WinEDA_BasePcbFrame )
WinEDA_PcbFrame::Process_Special_Functions ) WinEDA_PcbFrame::Process_Special_Functions )
EVT_MENU_RANGE( ID_LANGUAGE_CHOICE, ID_LANGUAGE_CHOICE_END, EVT_MENU_RANGE( ID_LANGUAGE_CHOICE, ID_LANGUAGE_CHOICE_END,
WinEDA_DrawFrame::SetLanguage ) WinEDA_PcbFrame::SetLanguage )
// menu Postprocess // menu Postprocess
EVT_MENU( ID_PCB_GEN_POS_MODULES_FILE, WinEDA_PcbFrame::GenModulesPosition ) EVT_MENU( ID_PCB_GEN_POS_MODULES_FILE, WinEDA_PcbFrame::GenModulesPosition )
...@@ -617,3 +617,15 @@ void WinEDA_PcbFrame::SetVisibleAlls( ) ...@@ -617,3 +617,15 @@ void WinEDA_PcbFrame::SetVisibleAlls( )
m_Layers->SetRenderState( ii, true ); m_Layers->SetRenderState( ii, true );
} }
/** function SetLanguage
* called on a language menu selection
*/
void WinEDA_PcbFrame::SetLanguage( wxCommandEvent& event )
{
WinEDA_DrawFrame::SetLanguage( event );
m_Layers->SetLayersManagerTabsText( );
wxAuiPaneInfo& pane_info = m_auimgr.GetPane(m_Layers);
pane_info.Caption( _( "Visibles" ) );
m_auimgr.Update();
ReFillLayerWidget();
}
release version: release version:
2010 feb 21 2010 feb 26
files (.zip,.tgz): files (.zip,.tgz):
kicad-2010-02-21-RC4 kicad-2010-02-26-RC5
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment