From b3d7d566bb96d0e6292f611aef4f1650ccc51697 Mon Sep 17 00:00:00 2001 From: Charlie Fenton Date: Thu, 23 Oct 2014 02:05:16 -0700 Subject: [PATCH] MGR: Fix a bug which shrunk the height of the project URL textedit field in the Attach Wizard's Project Info Page so you could not read it when the language is Czech, Russian, Slovak or Ukrainian. * NOTE: all static text fields must be filled in with the localized strings _before_ determining window size by calling Fit(), Layout(), etc. Setting labels in OnPageChanged() is too late. --- clientgui/ProjectInfoPage.cpp | 71 ++++++++++------------------------- 1 file changed, 20 insertions(+), 51 deletions(-) diff --git a/clientgui/ProjectInfoPage.cpp b/clientgui/ProjectInfoPage.cpp index b8bab22439..27bb9c5f4f 100644 --- a/clientgui/ProjectInfoPage.cpp +++ b/clientgui/ProjectInfoPage.cpp @@ -218,12 +218,15 @@ void CProjectInfoPage::CreateControls() itemWizardPage23->SetSizer(itemBoxSizer24); m_pTitleStaticCtrl = new wxStaticText; - m_pTitleStaticCtrl->Create( itemWizardPage23, wxID_STATIC, wxT(""), wxDefaultPosition, wxDefaultSize, 0 ); + m_pTitleStaticCtrl->Create( itemWizardPage23, wxID_STATIC, _("Choose a project"), + wxDefaultPosition, wxDefaultSize, 0 ); m_pTitleStaticCtrl->SetFont(wxFont(10, wxSWISS, wxNORMAL, wxBOLD, FALSE, _T("Verdana"))); itemBoxSizer24->Add(m_pTitleStaticCtrl, 0, wxALIGN_LEFT|wxALL, 5); m_pDescriptionStaticCtrl = new wxStaticText; - m_pDescriptionStaticCtrl->Create( itemWizardPage23, wxID_STATIC, wxT(""), wxDefaultPosition, wxDefaultSize, 0 ); + m_pDescriptionStaticCtrl->Create( itemWizardPage23, wxID_STATIC, + _("To choose a project, click its name or type its URL below."), + wxDefaultPosition, wxDefaultSize, 0 ); itemBoxSizer24->Add(m_pDescriptionStaticCtrl, 0, wxALIGN_LEFT|wxALL, 5); itemBoxSizer24->Add(5, 5, 0, wxALIGN_LEFT|wxALL, 5); @@ -239,7 +242,8 @@ void CProjectInfoPage::CreateControls() wxBoxSizer* itemBoxSizer7 = new wxBoxSizer(wxVERTICAL); itemFlexGridSizer6->Add(itemBoxSizer7, 0, wxALIGN_LEFT|wxALIGN_TOP, 0); - m_pProjectCategoriesStaticCtrl = new wxStaticText( itemWizardPage23, wxID_STATIC, wxT(""), wxDefaultPosition, wxDefaultSize, 0 ); + m_pProjectCategoriesStaticCtrl = new wxStaticText( itemWizardPage23, wxID_STATIC, + _("Categories:"), wxDefaultPosition, wxDefaultSize, 0 ); itemBoxSizer7->Add(m_pProjectCategoriesStaticCtrl, 0, wxALIGN_LEFT|wxRIGHT|wxBOTTOM, 5); // We must populate the combo box before our sizers can calculate its width. @@ -259,7 +263,8 @@ void CProjectInfoPage::CreateControls() ); itemBoxSizer7->Add(m_pProjectCategoriesCtrl, 0, wxGROW|wxLEFT|wxRIGHT, 5); - m_pProjectsStaticCtrl = new wxStaticText( itemWizardPage23, wxID_STATIC, wxT(""), wxDefaultPosition, wxDefaultSize, 0 ); + m_pProjectsStaticCtrl = new wxStaticText( itemWizardPage23, wxID_STATIC, + _("Projects:"), wxDefaultPosition, wxDefaultSize, 0 ); itemBoxSizer7->Add(m_pProjectsStaticCtrl, 0, wxALIGN_LEFT|wxTOP|wxRIGHT|wxBOTTOM, 5); wxFlexGridSizer* itemFlexGridSizer11 = new wxFlexGridSizer(1, 0, 0); @@ -271,7 +276,7 @@ void CProjectInfoPage::CreateControls() m_pProjectsCtrl = new wxListBox( itemWizardPage23, ID_PROJECTS, wxDefaultPosition, wxSize(-1, ADJUSTFORYDPI(175)), m_pProjectsCtrlStrings, wxLB_SINGLE|wxLB_SORT ); itemFlexGridSizer11->Add(m_pProjectsCtrl, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 0); - m_pProjectDetailsStaticCtrl = new wxStaticBox(itemWizardPage23, wxID_ANY, wxT("")); + m_pProjectDetailsStaticCtrl = new wxStaticBox(itemWizardPage23, wxID_ANY, _("Project details")); wxStaticBoxSizer* itemStaticBoxSizer13 = new wxStaticBoxSizer(m_pProjectDetailsStaticCtrl, wxVERTICAL); itemFlexGridSizer6->Add(itemStaticBoxSizer13, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5); @@ -282,7 +287,8 @@ void CProjectInfoPage::CreateControls() itemFlexGridSizer16->AddGrowableCol(1); itemStaticBoxSizer13->Add(itemFlexGridSizer16, 0, wxGROW|wxALL, 0); - m_pProjectDetailsResearchAreaStaticCtrl = new wxStaticText( itemWizardPage23, wxID_STATIC, wxT(""), wxDefaultPosition, wxDefaultSize, 0 ); + m_pProjectDetailsResearchAreaStaticCtrl = new wxStaticText( itemWizardPage23, wxID_STATIC, + _("Research area:"), wxDefaultPosition, wxDefaultSize, 0 ); itemFlexGridSizer16->Add(m_pProjectDetailsResearchAreaStaticCtrl, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxRIGHT|wxBOTTOM, 2); m_pProjectDetailsResearchAreaCtrl = new wxStaticText( itemWizardPage23, wxID_STATIC, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); @@ -292,7 +298,8 @@ void CProjectInfoPage::CreateControls() itemFlexGridSizer19->AddGrowableCol(1); itemStaticBoxSizer13->Add(itemFlexGridSizer19, 0, wxGROW|wxALL, 0); - m_pProjectDetailsOrganizationStaticCtrl = new wxStaticText( itemWizardPage23, wxID_STATIC, wxT(""), wxDefaultPosition, wxDefaultSize, 0 ); + m_pProjectDetailsOrganizationStaticCtrl = new wxStaticText( itemWizardPage23, wxID_STATIC, + _("Organization:"), wxDefaultPosition, wxDefaultSize, 0 ); itemFlexGridSizer19->Add(m_pProjectDetailsOrganizationStaticCtrl, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxRIGHT|wxBOTTOM, 2); m_pProjectDetailsOrganizationCtrl = new wxStaticText( itemWizardPage23, wxID_STATIC, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); @@ -302,7 +309,8 @@ void CProjectInfoPage::CreateControls() itemFlexGridSizer20->AddGrowableCol(1); itemStaticBoxSizer13->Add(itemFlexGridSizer20, 0, wxGROW|wxALL, 0); - m_pProjectDetailsURLStaticCtrl = new wxStaticText( itemWizardPage23, wxID_STATIC, wxT(""), wxDefaultPosition, wxDefaultSize, 0 ); + m_pProjectDetailsURLStaticCtrl = new wxStaticText( itemWizardPage23, wxID_STATIC, + _("Web site:"), wxDefaultPosition, wxDefaultSize, 0 ); itemFlexGridSizer20->Add(m_pProjectDetailsURLStaticCtrl, 0, wxALIGN_LEFT|wxRIGHT|wxBOTTOM, 2); m_pProjectDetailsURLCtrl = new wxHyperlinkCtrl( itemWizardPage23, wxID_STATIC, wxT("BOINC"), wxT("http://boinc.berkeley.edu/"), wxDefaultPosition, wxDefaultSize, wxNO_BORDER|wxHL_CONTEXTMENU|wxHL_ALIGN_LEFT); @@ -313,7 +321,8 @@ void CProjectInfoPage::CreateControls() itemFlexGridSizer24->AddGrowableCol(0); itemStaticBoxSizer13->Add(itemFlexGridSizer24, 0, wxGROW|wxALL, 0); - m_pProjectDetailsSupportedPlatformsStaticCtrl = new wxStaticText( itemWizardPage23, wxID_STATIC, wxT(""), wxDefaultPosition, wxDefaultSize, 0 ); + m_pProjectDetailsSupportedPlatformsStaticCtrl = new wxStaticText( itemWizardPage23, wxID_STATIC, + _("Supported systems:"), wxDefaultPosition, wxDefaultSize, 0 ); itemFlexGridSizer24->Add(m_pProjectDetailsSupportedPlatformsStaticCtrl, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxRIGHT|wxBOTTOM, 5); wxBoxSizer* itemBoxSizer26 = new wxBoxSizer(wxHORIZONTAL); @@ -350,7 +359,8 @@ void CProjectInfoPage::CreateControls() itemFlexGridSizer33->AddGrowableCol(1); itemFlexGridSizer4->Add(itemFlexGridSizer33, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 0); - m_pProjectURLStaticCtrl = new wxStaticText( itemWizardPage23, ID_PROJECTURLSTATICCTRL, wxT(""), wxDefaultPosition, wxDefaultSize, 0 ); + m_pProjectURLStaticCtrl = new wxStaticText( itemWizardPage23, ID_PROJECTURLSTATICCTRL, + _("Project URL:"), wxDefaultPosition, wxDefaultSize, 0 ); itemFlexGridSizer33->Add(m_pProjectURLStaticCtrl, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL, 5); m_pProjectURLCtrl = new wxTextCtrl( itemWizardPage23, ID_PROJECTURLCTRL, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); @@ -622,47 +632,6 @@ void CProjectInfoPage::OnPageChanged( wxWizardExEvent& event ) { wxASSERT(m_pProjectURLStaticCtrl); wxASSERT(m_pProjectURLCtrl); - m_pTitleStaticCtrl->SetLabel( - _("Choose a project") - ); - - m_pDescriptionStaticCtrl->SetLabel( - _("To choose a project, click its name or type its URL below.") - ); - - m_pProjectCategoriesStaticCtrl->SetLabel( - _("Categories:") - ); - - m_pProjectsStaticCtrl->SetLabel( - _("Projects:") - ); - - m_pProjectDetailsStaticCtrl->SetLabel( - _("Project details") - ); - - m_pProjectDetailsResearchAreaStaticCtrl->SetLabel( - _("Research area:") - ); - - m_pProjectDetailsOrganizationStaticCtrl->SetLabel( - _("Organization:") - ); - - m_pProjectDetailsURLStaticCtrl->SetLabel( - _("Web site:") - ); - - m_pProjectDetailsSupportedPlatformsStaticCtrl->SetLabel( - _("Supported systems:") - ); - - m_pProjectURLStaticCtrl->SetLabel( - _("Project URL:") - ); - - // Populate the ProjectInfo data structure with the list of projects we want to show and // any other activity we need to prep the page. if (!m_bProjectListPopulated) {