From 731a87db257bc999ae787efb0d7df45138888c6e Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Thu, 21 Jan 2016 11:15:13 +0100 Subject: [PATCH] Fix Bug #1536427 ("User (Custom)" size selection in"Page Settings" issue in non English languages). Remove also a no more in use code --- common/class_page_info.cpp | 30 -------------------- common/dialogs/dialog_page_settings.cpp | 35 +++++++++++++----------- gerbview/class_gerbview_layer_widget.cpp | 1 + 3 files changed, 20 insertions(+), 46 deletions(-) diff --git a/common/class_page_info.cpp b/common/class_page_info.cpp index 30a694a0e1..2cf94d4cc2 100644 --- a/common/class_page_info.cpp +++ b/common/class_page_info.cpp @@ -89,36 +89,6 @@ const PAGE_INFO PAGE_INFO::pageUSLedger( wxSize( 17000, 11000 ), wxT( "USLedge int PAGE_INFO::s_user_width = 17000; int PAGE_INFO::s_user_height = 11000; -/* -wxArrayString PAGE_INFO::GetStandardSizes() -{ - wxArrayString ret; - - static const PAGE_INFO* stdPageSizes[] = { - &pageA4, - &pageA3, - &pageA2, - &pageA1, - &pageA0, - &pageA, - &pageB, - &pageC, - &pageD, - &pageE, - // &pageGERBER, // standard? - &pageUSLetter, - &pageUSLegal, - &pageUSLedger, - &pageUser, - }; - - for( unsigned i=0; i < DIM( stdPageSizes ); ++i ) - ret.Add( stdPageSizes[i]->GetType() ); - - return ret; -} -*/ - inline void PAGE_INFO::updatePortrait() { diff --git a/common/dialogs/dialog_page_settings.cpp b/common/dialogs/dialog_page_settings.cpp index 93bd8c7231..819d68a893 100644 --- a/common/dialogs/dialog_page_settings.cpp +++ b/common/dialogs/dialog_page_settings.cpp @@ -52,26 +52,29 @@ // List of page formats. -// should be statically initialized, because we need both -// the translated and the not translated version. +// they are prefixed by "_HKI" (already in use for hotkeys) instead of "_", +// because we need both the translated and the not translated version. // when displayed in dialog we should explicitely call wxGetTranslation() // to show the translated version. +// See hotkeys_basic.h for more info +#define _HKI( x ) wxT( x ) static const wxString pageFmts[] = { - _("A4 210x297mm"), - _("A3 297x420mm"), - _("A2 420x594mm"), - _("A1 594x841mm"), - _("A0 841x1189mm"), - _("A 8.5x11in"), - _("B 11x17in"), - _("C 17x22in"), - _("D 22x34in"), - _("E 34x44in"), - _("USLetter 8.5x11in"), // USLetter without space is correct - _("USLegal 8.5x14in"), // USLegal without space is correct - _("USLedger 11x17in"), // USLedger without space is correct - _("User (Custom)"), + _HKI("A4 210x297mm"), + _HKI("A3 297x420mm"), + _HKI("A2 420x594mm"), + _HKI("A1 594x841mm"), + _HKI("A0 841x1189mm"), + _HKI("A 8.5x11in"), + _HKI("B 11x17in"), + _HKI("C 17x22in"), + _HKI("D 22x34in"), + _HKI("E 34x44in"), + _HKI("USLetter 8.5x11in"), // USLetter without space is correct + _HKI("USLegal 8.5x14in"), // USLegal without space is correct + _HKI("USLedger 11x17in"), // USLedger without space is correct + _HKI("User (Custom)"), // size defined by user. The string must contain "Custom" + // to be reconized in code }; void EDA_DRAW_FRAME::Process_PageSettings( wxCommandEvent& event ) diff --git a/gerbview/class_gerbview_layer_widget.cpp b/gerbview/class_gerbview_layer_widget.cpp index e0968ac722..f2108ac58a 100644 --- a/gerbview/class_gerbview_layer_widget.cpp +++ b/gerbview/class_gerbview_layer_widget.cpp @@ -130,6 +130,7 @@ void GERBER_LAYER_WIDGET::ReFillRender() void GERBER_LAYER_WIDGET::installRightLayerClickHandler() { int rowCount = GetLayerRowCount(); + for( int row=0; row