4.44 beta

This commit is contained in:
Igor Pavlov
2007-01-20 00:00:00 +00:00
committed by Kornel Lesiński
parent 804edc5756
commit d9666cf046
1331 changed files with 10535 additions and 13791 deletions

View File

@@ -0,0 +1,90 @@
// LangPage.cpp
#include "StdAfx.h"
#include "resource.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);
}

View File

@@ -0,0 +1,21 @@
// LangPage.h
#ifndef __LANGPAGE_H
#define __LANGPAGE_H
#include "Windows/Control/PropertyPage.h"
#include "Windows/Control/ComboBox.h"
class CLangPage: public NWindows::NControl::CPropertyPage
{
NWindows::NControl::CComboBox _langCombo;
UStringVector _paths;
public:
bool _langWasChanged;
virtual bool OnInit();
virtual void OnNotifyHelp();
virtual bool OnCommand(int code, int itemID, LPARAM param);
virtual LONG OnApply();
};
#endif

View File

@@ -0,0 +1,16 @@
// stdafx.h
#ifndef __STDAFX_H
#define __STDAFX_H
#define _WIN32_WINNT 0x0400
// it's for Windows NT supporting (MENUITEMINFOW)
#define WINVER 0x0400
#include <windows.h>
#include <commctrl.h>
#include "Common/NewHandler.h"
#endif

View File

@@ -0,0 +1,6 @@
#define IDD_LANG 900
#define IDS_LANG_ENGLISH 995
#define IDS_LANG_NATIVE 996
#define IDC_LANG_STATIC_LANG 1000
#define IDC_LANG_COMBO_LANG 1001

View File

@@ -0,0 +1,21 @@
#include "resource.h"
#include "../../../GuiCommon.rc"
#define xSize2 238
#define ySize2 204
#define xSize (xSize2 + marg + marg)
#define ySize (ySize2 + marg + marg)
IDD_LANG DIALOG 0, 0, xSize, ySize MY_PAGE_STYLE
CAPTION "Language"
MY_FONT
BEGIN
LTEXT "Language:", IDC_LANG_STATIC_LANG, marg, marg, xSize2, 8
COMBOBOX IDC_LANG_COMBO_LANG, marg, 20, 146, ySize2 - 12, CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
END
STRINGTABLE
BEGIN
IDS_LANG_ENGLISH "English"
IDS_LANG_NATIVE "English"
END