Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/kornelski/7z.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Pavlov <ipavlov@users.sourceforge.net>2007-08-27 04:00:00 +0400
committerKornel LesiƄski <kornel@geekhood.net>2016-05-28 02:15:54 +0300
commit051769bbc577aeede90558b6ab5c9be187940ca0 (patch)
treee6330cb80f2d4a526d8aa27812528e053b0cda90 /CPP/7zip/UI/FileManager/LangPage.cpp
parent33ccab7e728a996800e166d849fe1e92a17e1afe (diff)
4.53 beta
Diffstat (limited to 'CPP/7zip/UI/FileManager/LangPage.cpp')
-rwxr-xr-xCPP/7zip/UI/FileManager/LangPage.cpp90
1 files changed, 90 insertions, 0 deletions
diff --git a/CPP/7zip/UI/FileManager/LangPage.cpp b/CPP/7zip/UI/FileManager/LangPage.cpp
new file mode 100755
index 00000000..3300213b
--- /dev/null
+++ b/CPP/7zip/UI/FileManager/LangPage.cpp
@@ -0,0 +1,90 @@
+// LangPage.cpp
+
+#include "StdAfx.h"
+#include "LangPageRes.h"
+#include "LangPage.h"
+
+#include "Common/StringConvert.h"
+
+#include "Windows/ResourceString.h"
+
+#include "RegistryUtils.h"
+#include "HelpUtils.h"
+#include "LangUtils.h"
+
+static CIDLangPair kIDLangPairs[] =
+{
+ { IDC_LANG_STATIC_LANG, 0x01000401}
+};
+
+static LPCWSTR kLangTopic = L"fm/options.htm#language";
+
+bool CLangPage::OnInit()
+{
+ _langWasChanged = false;
+ LangSetDlgItemsText(HWND(*this), kIDLangPairs, sizeof(kIDLangPairs) / sizeof(kIDLangPairs[0]));
+
+ _langCombo.Attach(GetItem(IDC_LANG_COMBO_LANG));
+
+ UString s = NWindows::MyLoadStringW(IDS_LANG_ENGLISH);
+ s += L" (";
+ s += NWindows::MyLoadStringW(IDS_LANG_NATIVE);
+ s += L")";
+ int index = (int)_langCombo.AddString(s);
+ _langCombo.SetItemData(index, _paths.Size());
+ _paths.Add(L"-");
+ _langCombo.SetCurSel(0);
+
+ CObjectVector<CLangEx> langs;
+ LoadLangs(langs);
+ for (int i = 0; i < langs.Size(); i++)
+ {
+ const CLangEx &lang = langs[i];
+ UString name;
+ UString englishName, nationalName;
+ if (lang.Lang.GetMessage(0x00000000, englishName))
+ name = englishName;
+ else
+ name = lang.ShortName;
+ if (lang.Lang.GetMessage(0x00000001, nationalName))
+ {
+ if (!nationalName.IsEmpty())
+ {
+ name += L" (";
+ name += nationalName;
+ name += L")";
+ }
+ }
+ index = (int)_langCombo.AddString(name);
+ _langCombo.SetItemData(index, _paths.Size());
+ _paths.Add(lang.ShortName);
+ if (g_LangID.CompareNoCase(lang.ShortName) == 0)
+ _langCombo.SetCurSel(index);
+ }
+ return CPropertyPage::OnInit();
+}
+
+LONG CLangPage::OnApply()
+{
+ int selectedIndex = _langCombo.GetCurSel();
+ int pathIndex = (int)_langCombo.GetItemData(selectedIndex);
+ SaveRegLang(_paths[pathIndex]);
+ ReloadLang();
+ _langWasChanged = true;
+ return PSNRET_NOERROR;
+}
+
+void CLangPage::OnNotifyHelp()
+{
+ ShowHelpWindow(NULL, kLangTopic); // change it
+}
+
+bool CLangPage::OnCommand(int code, int itemID, LPARAM param)
+{
+ if (code == CBN_SELCHANGE && itemID == IDC_LANG_COMBO_LANG)
+ {
+ Changed();
+ return true;
+ }
+ return CPropertyPage::OnCommand(code, itemID, param);
+}