From 9e7738992b3acb3d7675b20a41f02f2d99a90f1b Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Tue, 24 Aug 2010 16:39:29 +0000 Subject: [PATCH] Set the radiobuttons depending on the currency symbol position. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38336 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/preferences/locale/FormatSettingsView.cpp | 12 ++++++++---- src/preferences/locale/FormatSettingsView.h | 2 ++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/preferences/locale/FormatSettingsView.cpp b/src/preferences/locale/FormatSettingsView.cpp index f80dd10964..a7df328130 100644 --- a/src/preferences/locale/FormatSettingsView.cpp +++ b/src/preferences/locale/FormatSettingsView.cpp @@ -234,10 +234,10 @@ FormatView::FormatView(const BLocale& locale) BCheckBox* currencyLeadingZero = new BCheckBox("", B_TRANSLATE("Leading 0"), new BMessage(kSettingsContentsModified)); - BRadioButton* beforeRadioButton = new BRadioButton("", + fCurrencySymbolBefore = new BRadioButton("CurrencySymbolPosition", B_TRANSLATE("Before"), new BMessage(kSettingsContentsModified)); - BRadioButton* afterRadioButton = new BRadioButton("", + fCurrencySymbolAfter = new BRadioButton("CurrencySymbolPosition", B_TRANSLATE("After"), new BMessage(kSettingsContentsModified)); fMonetaryView = new BStringView("", ""); @@ -327,8 +327,8 @@ FormatView::FormatView(const BLocale& locale) .Add(fCurrencySymbolView) .AddGroup(B_HORIZONTAL, spacing) .AddGlue() - .Add(beforeRadioButton) - .Add(afterRadioButton) + .Add(fCurrencySymbolBefore) + .Add(fCurrencySymbolAfter) .End() .Add(currencyNegative) .Add(currencyDecimal) @@ -674,6 +674,10 @@ FormatView::_ParseCurrencyFormat() switch (fieldID[i]) { case B_NUMBER_ELEMENT_CURRENCY: fCurrencySymbolView->SetText(currentSymbol); + if (i > fieldCount / 2) + fCurrencySymbolAfter->SetValue(1); + else + fCurrencySymbolBefore->SetValue(1); break; default: break; diff --git a/src/preferences/locale/FormatSettingsView.h b/src/preferences/locale/FormatSettingsView.h index 099bf6284e..79c827638c 100644 --- a/src/preferences/locale/FormatSettingsView.h +++ b/src/preferences/locale/FormatSettingsView.h @@ -77,6 +77,8 @@ private: BStringView* fMonetaryView; BTextControl* fCurrencySymbolView; + BRadioButton* fCurrencySymbolBefore; + BRadioButton* fCurrencySymbolAfter; bool f24HrClock;