Make some messages translatable.

Make dialog footprint wizard list resizable.
This commit is contained in:
jean-pierre charras 2013-04-08 09:13:26 +02:00
parent e04b6a04a6
commit 7bb04c8f63
4 changed files with 45 additions and 35 deletions

View File

@ -197,40 +197,46 @@ EDA_ITEM* SEGVIA::Clone() const
wxString SEGVIA::GetSelectMenuText() const
{
// Note: we use here Printf to make message translatable.
wxString text;
wxString format;
NETINFO_ITEM* net;
BOARD* board = GetBoard();
int shape = GetShape();
if( shape == VIA_BLIND_BURIED )
text << wxT( " " ) << _( "Blind/Buried " );
format = _( "Blind/Buried Via %s, net[%s] (%d) on layers %s/%s" );
else if( shape == VIA_MICROVIA )
text << wxT( " " ) << _( "Micro " );
format = _( "Micro Via %s, Net [%s] (%d) on layers %s/%s" );
// else say nothing about normal (through) vias
text << _( "Via" ) << wxT( " " ) << ShowWidth();
else format = _( "Via %s net [%s] (%d) on layers %s/%s" );
if( board )
{
net = board->FindNet( GetNet() );
wxString netname;
if( net )
text << wxT( " [" ) << net->GetNetname() << wxT( "]" );
text << wxChar( ' ' ) << _( "Net:" ) << GetNet();
netname = net->GetNetname();
// say which layers, only two for now
LAYER_NUM topLayer;
LAYER_NUM botLayer;
ReturnLayerPair( &topLayer, &botLayer );
text << _( " on " ) << board->GetLayerName( topLayer ) << wxT( "/" )
<< board->GetLayerName( botLayer );
text.Printf( format.GetData(), GetChars( ShowWidth() ),
GetChars( netname ), GetNet(),
GetChars( board->GetLayerName( topLayer ) ),
GetChars( board->GetLayerName( botLayer ) ) );
}
else
{
wxFAIL_MSG( wxT( "SEGVIA::GetSelectMenuText: BOARD is NULL" ) );
text << wxT( "???" );
text.Printf( format.GetData(), GetChars( ShowWidth() ),
wxT( "???" ), 0,
wxT( "??" ), wxT( "??" ) );
}
return text;
@ -1116,7 +1122,7 @@ void TRACK::GetMsgPanelInfoBase( std::vector< MSG_PANEL_ITEM >& aList )
LAYER_NUM top_layer, bottom_layer;
Via->ReturnLayerPair( &top_layer, &bottom_layer );
msg = board->GetLayerName( top_layer ) + wxT( "/" )
msg = board->GetLayerName( top_layer ) + wxT( "/" )
+ board->GetLayerName( bottom_layer );
}
else
@ -1507,29 +1513,31 @@ int TRACK::GetEndSegments( int aCount, TRACK** aStartTrace, TRACK** aEndTrace )
wxString TRACK::GetSelectMenuText() const
{
wxString text;
wxString temp;
wxString netname;
NETINFO_ITEM* net;
BOARD* board = GetBoard();
// deleting tracks requires all the information we can get to
// disambiguate all the choices under the cursor!
text << _( "Track" ) << wxT( " " ) << ShowWidth();
if( board )
{
net = board->FindNet( GetNet() );
if( net )
text << wxT( " [" ) << net->GetNetname() << wxT( "]" );
netname = net->GetNetname();
else
netname = _("Not found");
}
else
{
wxFAIL_MSG( wxT( "TRACK::GetSelectMenuText: BOARD is NULL" ) );
text << wxT( "???" );
netname = wxT( "???" );
}
text << _( " on " ) << GetLayerName() << wxT(", ") << _("Net:") << GetNet()
<< wxT(", ") << _("Length:") << ::LengthDoubleToString( GetLength() );
text.Printf( _("Track %s, net [%s] (%d) on layer %s, length: %s" ),
GetChars( ShowWidth() ), GetChars( netname ),
GetNet(), GetLayerName(),
GetChars( ::LengthDoubleToString( GetLength() ) ) );
return text;
}

View File

@ -39,11 +39,11 @@
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="minimum_size">400,200</property>
<property name="name">DIALOG_FOOTPRINT_WIZARD_LIST_BASE</property>
<property name="pos"></property>
<property name="size"></property>
<property name="style">wxDEFAULT_DIALOG_STYLE</property>
<property name="size">404,200</property>
<property name="style">wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER</property>
<property name="subclass">DIALOG_SHIM; dialog_shim.h</property>
<property name="title">Footprint Wizards</property>
<property name="tooltip"></property>
@ -88,12 +88,12 @@
<event name="OnUpdateUI"></event>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">bSizer4</property>
<property name="name">bSizerMain</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">1</property>
<object class="wxGrid" expanded="1">
<property name="BottomDockable">1</property>
@ -153,7 +153,7 @@
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size">-1,120</property>
<property name="minimum_size">485,120</property>
<property name="moveable">1</property>
<property name="name">m_footprintWizardsGrid</property>
<property name="pane_border">1</property>
@ -255,7 +255,7 @@
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default">0</property>
<property name="default">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 10 2012)
// C++ code generated with wxFormBuilder (version Oct 8 2012)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
@ -11,10 +11,10 @@
DIALOG_FOOTPRINT_WIZARD_LIST_BASE::DIALOG_FOOTPRINT_WIZARD_LIST_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style )
{
this->SetSizeHints( wxDefaultSize, wxDefaultSize );
this->SetSizeHints( wxSize( 400,200 ), wxDefaultSize );
wxBoxSizer* bSizer4;
bSizer4 = new wxBoxSizer( wxVERTICAL );
wxBoxSizer* bSizerMain;
bSizerMain = new wxBoxSizer( wxVERTICAL );
m_footprintWizardsGrid = new wxGrid( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
@ -47,17 +47,17 @@ DIALOG_FOOTPRINT_WIZARD_LIST_BASE::DIALOG_FOOTPRINT_WIZARD_LIST_BASE( wxWindow*
// Cell Defaults
m_footprintWizardsGrid->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP );
m_footprintWizardsGrid->SetMinSize( wxSize( -1,120 ) );
m_footprintWizardsGrid->SetMinSize( wxSize( 485,120 ) );
bSizer4->Add( m_footprintWizardsGrid, 1, wxALL, 5 );
bSizerMain->Add( m_footprintWizardsGrid, 1, wxALL|wxEXPAND, 5 );
m_btOpen = new wxButton( this, wxID_ANY, _("Open"), wxDefaultPosition, wxDefaultSize, 0 );
bSizer4->Add( m_btOpen, 0, wxALIGN_CENTER|wxALL, 5 );
m_btOpen->SetDefault();
bSizerMain->Add( m_btOpen, 0, wxALIGN_CENTER|wxALL, 5 );
this->SetSizer( bSizer4 );
this->SetSizer( bSizerMain );
this->Layout();
bSizer4->Fit( this );
this->Centre( wxBOTH );

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 10 2012)
// C++ code generated with wxFormBuilder (version Oct 8 2012)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
@ -11,6 +11,8 @@
#include <wx/artprov.h>
#include <wx/xrc/xmlres.h>
#include <wx/intl.h>
class DIALOG_SHIM;
#include "dialog_shim.h"
#include <wx/colour.h>
#include <wx/settings.h>
@ -43,7 +45,7 @@ class DIALOG_FOOTPRINT_WIZARD_LIST_BASE : public DIALOG_SHIM
public:
DIALOG_FOOTPRINT_WIZARD_LIST_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Footprint Wizards"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE );
DIALOG_FOOTPRINT_WIZARD_LIST_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Footprint Wizards"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 404,200 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_FOOTPRINT_WIZARD_LIST_BASE();
};