Author: dchapyshev
Date: Sun Feb 24 13:56:35 2008
New Revision: 32464
URL:
http://svn.reactos.org/svn/reactos?rev=32464&view=rev
Log:
- Change ListBox to ListView
- Added list of code pages
Modified:
trunk/reactos/dll/cpl/intl/advanced.c
trunk/reactos/dll/cpl/intl/lang/bg-BG.rc
trunk/reactos/dll/cpl/intl/lang/de-DE.rc
trunk/reactos/dll/cpl/intl/lang/en-US.rc
trunk/reactos/dll/cpl/intl/lang/es-ES.rc
trunk/reactos/dll/cpl/intl/lang/fr-FR.rc
trunk/reactos/dll/cpl/intl/lang/it-IT.rc
trunk/reactos/dll/cpl/intl/lang/pl-PL.rc
trunk/reactos/dll/cpl/intl/lang/ru-RU.rc
trunk/reactos/dll/cpl/intl/lang/uk-UA.rc
Modified: trunk/reactos/dll/cpl/intl/advanced.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/intl/advanced.c?re…
==============================================================================
--- trunk/reactos/dll/cpl/intl/advanced.c (original)
+++ trunk/reactos/dll/cpl/intl/advanced.c Sun Feb 24 13:56:35 2008
@@ -1,9 +1,172 @@
#include <windows.h>
#include <commctrl.h>
+#include <setupapi.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <tchar.h>
#include <cpl.h>
#include "intl.h"
#include "resource.h"
+
+typedef struct CPStruct
+{
+ WORD Status;
+ UINT CPage;
+ HANDLE hCPage;
+ TCHAR Name[MAX_PATH];
+ struct CPStruct *NextItem;
+} CPAGE, *LPCPAGE;
+
+static LPCPAGE PCPage = NULL;
+static HINF hIntlInf;
+
+static BOOL
+GetSupportedCP(VOID)
+{
+ UINT uiCPage, Count, Number;
+ INFCONTEXT infCont;
+ LPCPAGE lpCPage;
+ HANDLE hCPage;
+
+ Count = (UINT) SetupGetLineCount(hIntlInf, _T("CodePages"));
+ if (Count <= 0) return FALSE;
+
+ for (Number = 0; Number < Count; Number++)
+ {
+ if (SetupGetLineByIndex(hIntlInf, _T("CodePages"), Number,
&infCont) &&
+ SetupGetIntField(&infCont, 0, (PINT)&uiCPage))
+ {
+ if (!(hCPage = GlobalAlloc(GHND, sizeof(CPAGE)))) return FALSE;
+
+ lpCPage = GlobalLock(hCPage);
+ lpCPage->CPage = uiCPage;
+ lpCPage->hCPage = hCPage;
+ lpCPage->Status = 0;
+ (lpCPage->Name)[0] = 0;
+
+ CPINFOEX cpInfEx;
+ if (GetCPInfoEx(uiCPage, 0, &cpInfEx))
+ {
+ _tcscpy(lpCPage->Name, cpInfEx.CodePageName);
+ }
+ else if (!SetupGetStringField(&infCont, 1, lpCPage->Name, MAX_PATH,
NULL))
+ {
+ GlobalUnlock(hCPage);
+ GlobalFree(hCPage);
+ continue;
+ }
+
+ TCHAR Section[MAX_PATH];
+ _stprintf(Section, TEXT("%s%d"), _T("CODEPAGE_REMOVE_"),
uiCPage);
+ if ((uiCPage == GetACP()) || (uiCPage == GetOEMCP()) ||
+ (!SetupFindFirstLine(hIntlInf, Section, _T("AddReg"),
&infCont)))
+ {
+ lpCPage->Status |= (0x0001 | 0x0002);
+ }
+
+ lpCPage->NextItem = PCPage;
+ PCPage = lpCPage;
+ }
+ }
+
+ return TRUE;
+}
+
+static BOOL CALLBACK
+InstalledCPProc(LPTSTR lpStr)
+{
+ LPCPAGE lpCP;
+ UINT uiCP;
+
+ lpCP = PCPage;
+ uiCP = _ttol(lpStr);
+ for (;;)
+ {
+ if (!lpCP) break;
+ if (lpCP->CPage == uiCP)
+ {
+ lpCP->Status |= 0x0001;
+ break;
+ }
+ lpCP = lpCP->NextItem;
+ }
+
+ return TRUE;
+}
+
+static VOID
+InitLangList(HWND hwndDlg)
+{
+ LPCPAGE lpCPage;
+ INT ItemIndex;
+ HWND hList;
+
+ hList = GetDlgItem(hwndDlg, IDC_CONV_TABLES);
+
+ hIntlInf = SetupOpenInfFile(_T("intl.inf"), NULL, INF_STYLE_WIN4, NULL);
+
+ if (hIntlInf == INVALID_HANDLE_VALUE) return;
+
+ if (!SetupOpenAppendInfFile(NULL, hIntlInf, NULL))
+ {
+ SetupCloseInfFile(hIntlInf);
+ hIntlInf = NULL;
+ return;
+ }
+
+ if (!GetSupportedCP()) return;
+
+ SetupCloseInfFile(hIntlInf);
+
+ if (!EnumSystemCodePages(InstalledCPProc, CP_INSTALLED)) return;
+
+ LV_COLUMN column;
+ LV_ITEM item;
+ RECT ListRect;
+
+ ZeroMemory(&column, sizeof(LV_COLUMN));
+ column.mask = LVCF_FMT|LVCF_TEXT|LVCF_WIDTH;
+ column.fmt = LVCFMT_LEFT;
+ GetClientRect(hList, &ListRect);
+ column.cx = ListRect.right - GetSystemMetrics(SM_CYHSCROLL);
+ (VOID) ListView_InsertColumn(hList, 0, &column);
+
+ (VOID) ListView_SetExtendedListViewStyle(hList,
LVS_EX_CHECKBOXES|LVS_EX_FULLROWSELECT);
+
+ lpCPage = PCPage;
+
+ for (;;)
+ {
+ if (!lpCPage) break;
+ ZeroMemory(&item, sizeof(LV_ITEM));
+ item.mask = LVIF_TEXT|LVIF_PARAM|LVIF_STATE;
+ item.state = 0;
+ item.stateMask = LVIS_STATEIMAGEMASK;
+ item.pszText = lpCPage->Name;
+ item.lParam = (LPARAM)lpCPage;
+
+ ItemIndex = ListView_InsertItem(hList, &item);
+
+ if (ItemIndex >= 0)
+ {
+ if (lpCPage->Status & 0x0001)
+ {
+ ListView_SetItemState(hList, ItemIndex,
+ INDEXTOSTATEIMAGEMASK(LVIS_SELECTED),
+ LVIS_STATEIMAGEMASK);
+ }
+ else
+ {
+ ListView_SetItemState(hList, ItemIndex,
+ INDEXTOSTATEIMAGEMASK(LVIS_FOCUSED),
+ LVIS_STATEIMAGEMASK);
+ }
+ }
+
+ lpCPage = lpCPage->NextItem;
+ }
+}
/* Property page dialog callback */
INT_PTR CALLBACK
@@ -15,7 +178,10 @@
switch(uMsg)
{
case WM_INITDIALOG:
- break;
+ {
+ InitLangList(hwndDlg);
+ }
+ break;
}
return FALSE;
Modified: trunk/reactos/dll/cpl/intl/lang/bg-BG.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/intl/lang/bg-BG.rc…
==============================================================================
--- trunk/reactos/dll/cpl/intl/lang/bg-BG.rc (original)
+++ trunk/reactos/dll/cpl/intl/lang/bg-BG.rc Sun Feb 24 13:56:35 2008
@@ -50,7 +50,7 @@
LTEXT "Òàçè íàñòðîéêà ïîçâîëÿâà íà íåóíèêîä ïðèëîæåíèÿòà äà ïîêàçâàò ïðàâèëíî
èçáîðíèöèòå è ïðîçîðöèòå íà ïðèñúùèÿ èì åçèê. Òÿ íå çàñÿãà óíèêîä ïðèëîæåíèÿòà, íî çàñÿãà
âñè÷êè ïîòðåáèòåëè íà êîìïþòúðà.", -1, 14, 18, 216, 33
LTEXT "Èçáåðåòå ïîäõîäÿù åçèê çà íåóíèêîä ïðèëîæåíèÿòà:", -1, 14, 55, 216,
10
GROUPBOX "Çíàêîâ íàáîð", -1, 6, 92, 233, 88
- LISTBOX IDC_CONV_TABLES, 14, 105, 218, 70, LBS_STANDARD
+ CONTROL "", IDC_CONV_TABLES, "SysListView32", LVS_REPORT |
LVS_SORTASCENDING | LVS_NOCOLUMNHEADER | WS_BORDER | WS_TABSTOP, 14, 114, 217, 70
GROUPBOX "Ïîäðàçáðàíè ïîòðåáèòåëñêè íàñòðîéêè", -1, 6, 183, 233, 33
CHECKBOX "Ïðèëàãàíå íà âñè÷êè íàñòðîéêè çà òåêóùèÿ ïîòðåáèòåë è ïî
ïîäðàçáèðàíå", IDC_APPLY_CUR_USER_DEF_PROFILE, 12, 192, 223, 22, BS_MULTILINE
END
Modified: trunk/reactos/dll/cpl/intl/lang/de-DE.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/intl/lang/de-DE.rc…
==============================================================================
--- trunk/reactos/dll/cpl/intl/lang/de-DE.rc (original)
+++ trunk/reactos/dll/cpl/intl/lang/de-DE.rc Sun Feb 24 13:56:35 2008
@@ -50,7 +50,7 @@
LTEXT "Diese Einstellung ermöglicht es Unicode-Inkompatiblen Programmen, Menüs
und Dialoge in der örtlichen Sprache darzustellen. Dies beeinflusst Unicode-Kompatible
Programme nicht, wird aber für alle Nutzer des Computers angewendet.", -1, 14, 18,
223, 33
LTEXT "Wählen Sie eine Sprache aus, die der Sprachversion des Programmes
entspricht, dass Sie nutzen wollen:", -1, 14, 55, 223, 18
GROUPBOX "Codepage Konvertierungstabellen", -1, 5, 101, 234, 88
- LISTBOX IDC_CONV_TABLES, 14, 114, 217, 77, LBS_STANDARD
+ CONTROL "", IDC_CONV_TABLES, "SysListView32", LVS_REPORT |
LVS_SORTASCENDING | LVS_NOCOLUMNHEADER | WS_BORDER | WS_TABSTOP, 14, 114, 217, 70
GROUPBOX "Standardeinstellungen für Benutzerkonten", -1, 5, 193, 234, 30
CHECKBOX "Einstellungen &auf das aktive und Standardkonto anwenden.",
IDC_APPLY_CUR_USER_DEF_PROFILE, 12, 200, 220, 22, BS_MULTILINE
END
Modified: trunk/reactos/dll/cpl/intl/lang/en-US.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/intl/lang/en-US.rc…
==============================================================================
--- trunk/reactos/dll/cpl/intl/lang/en-US.rc (original)
+++ trunk/reactos/dll/cpl/intl/lang/en-US.rc Sun Feb 24 13:56:35 2008
@@ -50,7 +50,7 @@
LTEXT "This system setting enables non-Unicode programs to display menus and
dialogs in their native language. It does not affect Unicode programs, but it does apply
to all users of this computer.", -1, 14, 18, 223, 33
LTEXT "Select a language to match the language version of the non-Unicode
programs you want to use:", -1, 14, 55, 223, 18
GROUPBOX "Code page conversion tables", -1, 5, 101, 234, 88
- LISTBOX IDC_CONV_TABLES, 14, 114, 217, 77, LBS_STANDARD
+ CONTROL "", IDC_CONV_TABLES, "SysListView32", LVS_REPORT |
LVS_SORTASCENDING | LVS_NOCOLUMNHEADER | WS_BORDER | WS_TABSTOP, 14, 114, 217, 70
GROUPBOX "Default user account settings", -1, 5, 193, 234, 30
CHECKBOX "Apply all settings to the current user account and to the
default", IDC_APPLY_CUR_USER_DEF_PROFILE, 12, 200, 220, 22, BS_MULTILINE
END
Modified: trunk/reactos/dll/cpl/intl/lang/es-ES.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/intl/lang/es-ES.rc…
==============================================================================
--- trunk/reactos/dll/cpl/intl/lang/es-ES.rc (original)
+++ trunk/reactos/dll/cpl/intl/lang/es-ES.rc Sun Feb 24 13:56:35 2008
@@ -56,7 +56,7 @@
LTEXT "Esta configuración de sistema permite que algunos programas no Unicode
muestren menús y diálogos en sus idiomas originales. No afecta a los programas Unicode
pero afecta a todos los usuarios de este equipo.", -1, 14, 18, 223, 33
LTEXT "Seleccione un idioma que coincida con la versión de idioma de los
programas no Unicode que desea utilizar:", -1, 14, 55, 223, 18
GROUPBOX "Tablas de conversión de páginas de código", -1, 5, 101, 234, 88
- LISTBOX IDC_CONV_TABLES, 14, 114, 217, 77, LBS_STANDARD
+ CONTROL "", IDC_CONV_TABLES, "SysListView32", LVS_REPORT |
LVS_SORTASCENDING | LVS_NOCOLUMNHEADER | WS_BORDER | WS_TABSTOP, 14, 114, 217, 70
GROUPBOX "Configuración de la cuenta de usuario predeterminada", -1, 5,
193, 234, 30
CHECKBOX "Aplicar toda la configuración a la cuenta de usuario actual y al
perfil de usuario predeterminado", IDC_APPLY_CUR_USER_DEF_PROFILE, 12, 200, 220, 22,
BS_MULTILINE
END
Modified: trunk/reactos/dll/cpl/intl/lang/fr-FR.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/intl/lang/fr-FR.rc…
==============================================================================
--- trunk/reactos/dll/cpl/intl/lang/fr-FR.rc (original)
+++ trunk/reactos/dll/cpl/intl/lang/fr-FR.rc Sun Feb 24 13:56:35 2008
@@ -53,7 +53,7 @@
LTEXT "Ce paramètre système permet aux programmes non-Unicode d'afficher les
menus et les dialogues dans leur langue native. Cela n'affecte pas es programmes
Unicode, mais s'applique à tous les utilisateurs de cet ordinateur.", -1, 14, 18,
223, 33
LTEXT "Sélectionnez une langue qui corresponde à la version de la langue des
programmes que vous voulez utiliser :", -1, 14, 55, 223, 18
GROUPBOX "Tables de conversion des pages de code", -1, 5, 101, 234, 88
- LISTBOX IDC_CONV_TABLES, 14, 114, 217, 77, LBS_STANDARD
+ CONTROL "", IDC_CONV_TABLES, "SysListView32", LVS_REPORT |
LVS_SORTASCENDING | LVS_NOCOLUMNHEADER | WS_BORDER | WS_TABSTOP, 14, 114, 217, 70
GROUPBOX "Paramètres du compte de l'utilisateur par défaut ", -1, 5,
193, 234, 30
CHECKBOX "Appliquer tous ces paramètres au compte utilisateur actuel et à celui
par défaut", IDC_APPLY_CUR_USER_DEF_PROFILE, 12, 200, 220, 22, BS_MULTILINE
END
Modified: trunk/reactos/dll/cpl/intl/lang/it-IT.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/intl/lang/it-IT.rc…
==============================================================================
--- trunk/reactos/dll/cpl/intl/lang/it-IT.rc (original)
+++ trunk/reactos/dll/cpl/intl/lang/it-IT.rc Sun Feb 24 13:56:35 2008
@@ -52,7 +52,7 @@
LTEXT "In base a questa impostazione di sistema è possibile visualizzare menù e
finestre di dialogo di programmi non Unicode nella lingua di origine. I programmi Unicode
resteranno invariati, ma l'impostazione verrà applicata per tutti gli utenti che
utilizzano il computer.", -1, 14, 18, 223, 33
LTEXT "Selezionare una lingua per i programmi non Unicode da utilizzare:",
-1, 14, 55, 223, 18
GROUPBOX "Tabella di conversione di tabelle codici", -1, 5, 101, 234, 88
- LISTBOX IDC_CONV_TABLES, 14, 114, 217, 77, LBS_STANDARD
+ CONTROL "", IDC_CONV_TABLES, "SysListView32", LVS_REPORT |
LVS_SORTASCENDING | LVS_NOCOLUMNHEADER | WS_BORDER | WS_TABSTOP, 14, 114, 217, 70
GROUPBOX "Impostazioni account utente predefinito", -1, 5, 193, 234, 30
CHECKBOX "Appli&ca tutte le impostazioni all'account utente corrente e
al profilo utente predefinito", IDC_APPLY_CUR_USER_DEF_PROFILE, 12, 200, 220, 22,
BS_MULTILINE
END
Modified: trunk/reactos/dll/cpl/intl/lang/pl-PL.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/intl/lang/pl-PL.rc…
==============================================================================
--- trunk/reactos/dll/cpl/intl/lang/pl-PL.rc (original)
+++ trunk/reactos/dll/cpl/intl/lang/pl-PL.rc Sun Feb 24 13:56:35 2008
@@ -57,7 +57,7 @@
LTEXT "Te ustawienia umo¿liwiaj¹ programom bez standardu Unicode wywietlaæ menu
i dialogi w odpowiednich jêzykach. Nie ma to wp³ywu na programy Unicode ale dotyczy
profili domylnych.", -1, 14, 18, 223, 33
LTEXT "Wybierz taki jêzyk, który ma byæ u¿ywany przez programy bez
Unicode:", -1, 14, 55, 223, 18
GROUPBOX "Tablice konwersji stron kodowych", -1, 5, 101, 234, 88
- LISTBOX IDC_CONV_TABLES, 14, 114, 217, 77, LBS_STANDARD
+ CONTROL "", IDC_CONV_TABLES, "SysListView32", LVS_REPORT |
LVS_SORTASCENDING | LVS_NOCOLUMNHEADER | WS_BORDER | WS_TABSTOP, 14, 114, 217, 70
GROUPBOX "Ustawienia domylne u¿ytkownika", -1, 5, 193, 234, 30
CHECKBOX "Zastosuj ustawienia dla obecnego konta jak i dla profilu
domylnego.", IDC_APPLY_CUR_USER_DEF_PROFILE, 12, 200, 220, 22, BS_MULTILINE
END
Modified: trunk/reactos/dll/cpl/intl/lang/ru-RU.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/intl/lang/ru-RU.rc…
==============================================================================
--- trunk/reactos/dll/cpl/intl/lang/ru-RU.rc (original)
+++ trunk/reactos/dll/cpl/intl/lang/ru-RU.rc Sun Feb 24 13:56:35 2008
@@ -51,7 +51,7 @@
LTEXT "Ýòîò ïàðàìåòð ïîçâîëÿåò ïðîãðàììàì, íå ïîääåðæèâàþùèì Þíèêîä, îòîáðàæàòü
ìåíþ è äèàëîãè íà ñâîåì ÿçûêå. Îí íå âëèÿåò íà Þíèêîä-ñîâìåñòèìûå ïðîãðàììû, íî
ïðèìåíÿåòñÿ äëÿ âñåõ ïîëüçîâàòåëåé ýòîãî êîìïüþòåðà.", -1, 14, 18, 223, 33
LTEXT "Âûáåðèòå ÿçûê, ñîîòâåòñòâóþùèé ÿçûêó èñïîëüçóåìûõ ïðîãðàìì, êîòîðûå íå
ïîääåðæèâàþò Þíèêîä:", -1, 14, 55, 223, 18
GROUPBOX "Êîäîâûå ñòðàíèöû òàáëèö ïðåîáðàçîâàíèÿ", -1, 5, 101, 234, 88
- LISTBOX IDC_CONV_TABLES, 14, 114, 217, 70, LBS_STANDARD
+ CONTROL "", IDC_CONV_TABLES, "SysListView32", LVS_REPORT |
LVS_SORTASCENDING | LVS_NOCOLUMNHEADER | WS_BORDER | WS_TABSTOP, 14, 114, 217, 70
GROUPBOX "Ïàðàìåòðû äëÿ ñòàíäàðòíîé ó÷åòíîé çàïèñè", -1, 5, 193, 234, 30
CHECKBOX "Ïðèìåíèòü ýòè ïàðàìåòðû äëÿ òåêóùåé ó÷åòíîé çàïèñè è äëÿ ñòàíäàðòíîãî
ïðîôèëÿ", IDC_APPLY_CUR_USER_DEF_PROFILE, 12, 200, 220, 22, BS_MULTILINE
END
Modified: trunk/reactos/dll/cpl/intl/lang/uk-UA.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/intl/lang/uk-UA.rc…
==============================================================================
--- trunk/reactos/dll/cpl/intl/lang/uk-UA.rc (original)
+++ trunk/reactos/dll/cpl/intl/lang/uk-UA.rc Sun Feb 24 13:56:35 2008
@@ -59,7 +59,7 @@
LTEXT "Öåé ñèñòåìíèé ïàðàìåòð äຠçìîãó ïðîãðàìàì, ÿê³ íå ï³äòðèìóþòü Þí³êîä,
ïîêàçóâàòè ìåíþ òà ä³àëîãè ð³äíîþ ìîâîþ. ³í íå âïëèâຠíà ïðîãðàìè ç ï³äòðèìêîþ Þí³êîäó,
àëå çàñòîñîâóºòüñÿ äî âñ³õ êîðèñòóâà÷³â öüîãî êîìï'þòåðà.", -1, 14, 18, 223, 33
LTEXT "Âèáåð³òü ìîâó, ÿêà â³äïîâ³äຠìîâí³é âåðñ³¿ áàæàíèõ ïðîãðàì áåç ï³äòðèìêè
Þí³êîäó.", -1, 14, 55, 223, 18
GROUPBOX "Òàáëèö³ ïåðåòâîðåííÿ êîäîâèõ ñòîð³íîê", -1, 5, 101, 234, 88
- LISTBOX IDC_CONV_TABLES, 14, 114, 217, 77, LBS_STANDARD
+ CONTROL "", IDC_CONV_TABLES, "SysListView32", LVS_REPORT |
LVS_SORTASCENDING | LVS_NOCOLUMNHEADER | WS_BORDER | WS_TABSTOP, 14, 114, 217, 70
GROUPBOX "Ïàðàìåòðè ñòàíäàðòíîãî îáë³êîâîãî çàïèñó", -1, 5, 193, 234, 30
CHECKBOX "Çàñòîñóâàòè âñ³ ïàðàìåòðè äî ïîòî÷íîãî îáë³êîâîãî çàïèñó òà äî
ñòàíäàðòíîãî ïðîô³ëþ êîðèñòóâà÷à", IDC_APPLY_CUR_USER_DEF_PROFILE, 12, 200, 220, 22,
BS_MULTILINE
END