From 3576b67db9fa0a3d8d5c1747cc3560504d31d125 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 5 Mar 2014 12:52:30 +0000 Subject: - adaptation for standard Windows ways of handling Unicode; - obsoleted code removed; - code cleaning git-svn-id: http://svn.miranda-ng.org/main/trunk@8407 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/HistoryStats/src/column_inoutgraph.cpp | 132 ++++++++++++------------- 1 file changed, 66 insertions(+), 66 deletions(-) (limited to 'plugins/HistoryStats/src/column_inoutgraph.cpp') diff --git a/plugins/HistoryStats/src/column_inoutgraph.cpp b/plugins/HistoryStats/src/column_inoutgraph.cpp index a28c4b7fd5..3d8065929f 100644 --- a/plugins/HistoryStats/src/column_inoutgraph.cpp +++ b/plugins/HistoryStats/src/column_inoutgraph.cpp @@ -55,21 +55,21 @@ void ColInOutGraph::impl_configToUI(OptionsCtrl& Opt, OptionsCtrl::Item hGroup) { OptionsCtrl::Group hTemp; - /**/hTemp = Opt.insertGroup(hGroup, i18n(muT("Data source"))); - /**/ m_hSource = Opt.insertRadio(hTemp, NULL, i18n(muT("Characters"))); - /**/ Opt.insertRadio(hTemp, m_hSource, i18n(muT("Messages"))); - /**/ Opt.insertRadio(hTemp, m_hSource, i18n(muT("Chats"))); - /**/hTemp = Opt.insertGroup(hGroup, i18n(muT("Display as"))); - /**/ m_hAbsolute = Opt.insertRadio(hTemp, NULL, i18n(muT("Absolute"))); - /**/ m_hAbsolute = Opt.insertRadio(hTemp, m_hAbsolute, i18n(muT("Average")), OptionsCtrl::OCF_DISABLECHILDSONUNCHECK); - /**/ m_hAbsTime = Opt.insertRadio(m_hAbsolute, NULL, i18n(muT("Units per day"))); - /**/ Opt.insertRadio(m_hAbsolute, m_hAbsTime, i18n(muT("Units per week"))); - /**/ Opt.insertRadio(m_hAbsolute, m_hAbsTime, i18n(muT("Units per month (30 days)"))); - /**/m_hShowSum = Opt.insertCheck(hGroup, i18n(muT("Show sum of incoming and outgoing"))); - /**/m_hDetail = Opt.insertCheck(hGroup, i18n(muT("In/out details (tooltip)")), OptionsCtrl::OCF_DISABLECHILDSONUNCHECK); - /**/ m_hDetailPercent = Opt.insertCheck(m_hDetail, i18n(muT("Percentage in tooltip"))); - /**/ m_hDetailInvert = Opt.insertCheck(m_hDetail, i18n(muT("Absolute in tooltip if average selected and vice versa"))); - /**/m_hGraphPercent = Opt.insertCheck(hGroup, i18n(muT("Percentage in bar graph"))); + hTemp = Opt.insertGroup(hGroup, TranslateT("Data source")); + m_hSource = Opt.insertRadio(hTemp, NULL, TranslateT("Characters")); + Opt.insertRadio(hTemp, m_hSource, TranslateT("Messages")); + Opt.insertRadio(hTemp, m_hSource, TranslateT("Chats")); + hTemp = Opt.insertGroup(hGroup, TranslateT("Display as")); + m_hAbsolute = Opt.insertRadio(hTemp, NULL, TranslateT("Absolute")); + m_hAbsolute = Opt.insertRadio(hTemp, m_hAbsolute, TranslateT("Average"), OptionsCtrl::OCF_DISABLECHILDSONUNCHECK); + m_hAbsTime = Opt.insertRadio(m_hAbsolute, NULL, TranslateT("Units per day")); + Opt.insertRadio(m_hAbsolute, m_hAbsTime, TranslateT("Units per week")); + Opt.insertRadio(m_hAbsolute, m_hAbsTime, TranslateT("Units per month (30 days)")); + m_hShowSum = Opt.insertCheck(hGroup, TranslateT("Show sum of incoming and outgoing")); + m_hDetail = Opt.insertCheck(hGroup, TranslateT("In/out details (tooltip)"), OptionsCtrl::OCF_DISABLECHILDSONUNCHECK); + m_hDetailPercent = Opt.insertCheck(m_hDetail, TranslateT("Percentage in tooltip")); + m_hDetailInvert = Opt.insertCheck(m_hDetail, TranslateT("Absolute in tooltip if average selected and vice versa")); + m_hGraphPercent = Opt.insertCheck(hGroup, TranslateT("Percentage in bar graph")); Opt.setRadioChecked(m_hSource , m_nSource ); Opt.setRadioChecked(m_hAbsolute , m_bAbsolute ? 0 : 1); @@ -99,24 +99,24 @@ Column::StyleList ColInOutGraph::impl_outputGetAdditionalStyles(IDProvider& idp) m_CSS = idp.getID(); - l.push_back(StylePair(muT("td.") + m_CSS, muT("vertical-align: middle; padding: 2px 2px 2px 2px;"))); + l.push_back(StylePair(_T("td.") + m_CSS, _T("vertical-align: middle; padding: 2px 2px 2px 2px;"))); if (m_bShowSum) { - l.push_back(StylePair(muT("td.") + m_CSS + muT(" div.n"), muT("text-align: center;"))); + l.push_back(StylePair(_T("td.") + m_CSS + _T(" div.n"), _T("text-align: center;"))); } if (!usePNG()) { - l.push_back(StylePair(muT("div.") + m_CSS, muT("position: relative; left: 50%; margin-left: -50px; width: 100px; height: 15px; background-color: ") + utils::colorToHTML(con::ColorBack) + muT(";"))); - l.push_back(StylePair(muT("div.") + m_CSS + muT(" div"), muT("position: absolute; top: 0px; height: 15px; overflow: hidden; font-size: 80%; color: ") + utils::colorToHTML(con::ColorBack) + muT(";"))); - l.push_back(StylePair(muT("div.") + m_CSS + muT(" div.obar"), muT("left: 0px; background-color: ") + utils::colorToHTML(con::ColorOut) + muT(";"))); - l.push_back(StylePair(muT("div.") + m_CSS + muT(" div.ibar"), muT("right: 0px; background-color: ") + utils::colorToHTML(con::ColorIn) + muT(";"))); + l.push_back(StylePair(_T("div.") + m_CSS, _T("position: relative; left: 50%; margin-left: -50px; width: 100px; height: 15px; background-color: ") + utils::colorToHTML(con::ColorBack) + _T(";"))); + l.push_back(StylePair(_T("div.") + m_CSS + _T(" div"), _T("position: absolute; top: 0px; height: 15px; overflow: hidden; font-size: 80%; color: ") + utils::colorToHTML(con::ColorBack) + _T(";"))); + l.push_back(StylePair(_T("div.") + m_CSS + _T(" div.obar"), _T("left: 0px; background-color: ") + utils::colorToHTML(con::ColorOut) + _T(";"))); + l.push_back(StylePair(_T("div.") + m_CSS + _T(" div.ibar"), _T("right: 0px; background-color: ") + utils::colorToHTML(con::ColorIn) + _T(";"))); if (m_bGraphPercent) { - l.push_back(StylePair(muT("div.") + m_CSS + muT(" div.otext"), muT("left: 2px; width: 48px; text-align: left; z-index: 9;"))); - l.push_back(StylePair(muT("div.") + m_CSS + muT(" div.itext"), muT("right: 2px; width: 48px; text-align: right; z-index: 9;"))); + l.push_back(StylePair(_T("div.") + m_CSS + _T(" div.otext"), _T("left: 2px; width: 48px; text-align: left; z-index: 9;"))); + l.push_back(StylePair(_T("div.") + m_CSS + _T(" div.itext"), _T("right: 2px; width: 48px; text-align: right; z-index: 9;"))); } } @@ -132,16 +132,16 @@ SIZE ColInOutGraph::impl_outputMeasureHeader() const void ColInOutGraph::impl_outputRenderHeader(ext::ostream& tos, int row, int rowSpan) const { - static const mu_text* szSourceDesc[] = { - I18N(muT("Characters")), - I18N(muT("Messages")), - I18N(muT("Chats")) + static const TCHAR* szSourceDesc[] = { + LPGENT("Characters"), + LPGENT("Messages"), + LPGENT("Chats") }; - static const mu_text* szSourceUnit[] = { - I18N(muT("day")), - I18N(muT("week")), - I18N(muT("month")), + static const TCHAR* szSourceUnit[] = { + LPGENT("day"), + LPGENT("week"), + LPGENT("month"), }; if (row == 1) @@ -150,21 +150,21 @@ void ColInOutGraph::impl_outputRenderHeader(ext::ostream& tos, int row, int rowS if (m_bAbsolute) { - strTitle = i18n(szSourceDesc[m_nSource]); + strTitle = TranslateTS(szSourceDesc[m_nSource]); } else { - strTitle = str(ext::kformat(i18n(muT("#{data} per #{unit}"))) - % muT("#{data}") * i18n(szSourceDesc[m_nSource]) - % muT("#{unit}") * i18n(szSourceUnit[m_nAbsTime])); + strTitle = str(ext::kformat(TranslateT("#{data} per #{unit}")) + % _T("#{data}") * TranslateTS(szSourceDesc[m_nSource]) + % _T("#{unit}") * TranslateTS(szSourceUnit[m_nAbsTime])); } - writeRowspanTD(tos, getCustomTitle(i18n(szSourceDesc[m_nSource]), strTitle) + muT("
"), 1, 2, rowSpan, 2); + writeRowspanTD(tos, getCustomTitle(TranslateTS(szSourceDesc[m_nSource]), strTitle) + _T("
"), 1, 2, rowSpan, 2); } else if (row == 2) { - writeRowspanTD(tos, i18n(muT("Outgoing")), 2, 2, rowSpan); - writeRowspanTD(tos, i18n(muT("Incoming")), 2, 2, rowSpan); + writeRowspanTD(tos, TranslateT("Outgoing"), 2, 2, rowSpan); + writeRowspanTD(tos, TranslateT("Incoming"), 2, 2, rowSpan); } } @@ -194,7 +194,7 @@ void ColInOutGraph::impl_outputRenderRow(ext::ostream& tos, const Contact& conta double avgTotal = avgFactor[m_nAbsTime] * (contact.*getAvgTotal[m_nSource])(); // begin output - tos << muT(""); + tos << _T("\" title=\"") + << utils::htmlEscape(ext::str(ext::kformat(TranslateT("[Out] #{out_amount} (#{out_ratio}) / [In] #{in_amount} (#{in_ratio})")) + % _T("#{out_amount}") * strOut + % _T("#{out_ratio}") * utils::ratioToPercent(numOut, numTotal) + % _T("#{in_amount}") * strIn + % _T("#{in_ratio}") * utils::ratioToPercent(numIn, numTotal))) + << _T("\">"); } else { - tos << muT("\" title=\"") - << utils::htmlEscape(ext::str(ext::kformat(i18n(muT("[Out] #{out_amount} / [In] #{in_amount}"))) - % muT("#{out_amount}") * strOut - % muT("#{in_amount}") * strIn)) - << muT("\">"); + tos << _T("\" title=\"") + << utils::htmlEscape(ext::str(ext::kformat(TranslateT("[Out] #{out_amount} / [In] #{in_amount}")) + % _T("#{out_amount}") * strOut + % _T("#{in_amount}") * strIn)) + << _T("\">"); } } else { - tos << muT("\">"); + tos << _T("\">"); } if (numOut + numIn == 0) @@ -256,12 +256,12 @@ void ColInOutGraph::impl_outputRenderRow(ext::ostream& tos, const Contact& conta if (usePNG()) { - tos << muT("
"); + tos << _T("
"); if (m_bShowSum) { tos << (m_bAbsolute ? utils::intToGrouped(numTotal) : utils::floatToGrouped(avgTotal, 1)) - << muT("
"); + << _T("
"); } // draw graph @@ -298,7 +298,7 @@ void ColInOutGraph::impl_outputRenderRow(ext::ostream& tos, const Contact& conta CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_SWISS, - muT("Verdana") + _T("Verdana") }; HFONT hFont = CreateFontIndirect(&lf); @@ -317,40 +317,40 @@ void ColInOutGraph::impl_outputRenderRow(ext::ostream& tos, const Contact& conta if (getStatistic()->newFilePNG(canvas, strFinalFile)) { - tos << muT(""); + tos << _T(""); } - tos << muT("
"); + tos << _T("
"); } else { if (m_bShowSum) { - tos << muT("
") + tos << _T("
") << (m_bAbsolute ? utils::intToGrouped(numTotal) : utils::floatToGrouped(avgTotal, 1)) - << muT("
"); + << _T("
"); } - tos << muT("
"); + tos << _T("
"); if (outW != 0) { - tos << muT("
"); + tos << _T("
"); } if (inW != 0) { - tos << muT("
"); + tos << _T("
"); } if (m_bGraphPercent) { - tos << muT("
") << utils::ratioToPercent(numOut, allNum) << muT("
"); - tos << muT("
") << utils::ratioToPercent(numIn, allNum) << muT("
"); + tos << _T("
") << utils::ratioToPercent(numOut, allNum) << _T("
"); + tos << _T("
") << utils::ratioToPercent(numIn, allNum) << _T("
"); } - tos << muT("
"); + tos << _T("
"); } - tos << muT("") << ext::endl; + tos << _T("") << ext::endl; } -- cgit v1.2.3