Author: cwittich
Date: Sun Jul 29 02:34:42 2007
New Revision: 27980
URL:
http://svn.reactos.org/svn/reactos?rev=27980&view=rev
Log:
-replace the ListView in swappage dialog with a ListBox
-fix some minor issues
Modified:
trunk/reactos/dll/cpl/sysdm/lang/de-DE.rc
trunk/reactos/dll/cpl/sysdm/lang/en-US.rc
trunk/reactos/dll/cpl/sysdm/lang/fr-FR.rc
trunk/reactos/dll/cpl/sysdm/lang/id-ID.rc
trunk/reactos/dll/cpl/sysdm/lang/it-IT.rc
trunk/reactos/dll/cpl/sysdm/lang/pl-PL.rc
trunk/reactos/dll/cpl/sysdm/lang/ru-RU.rc
trunk/reactos/dll/cpl/sysdm/lang/uk-UA.rc
trunk/reactos/dll/cpl/sysdm/precomp.h
trunk/reactos/dll/cpl/sysdm/virtmem.c
Modified: trunk/reactos/dll/cpl/sysdm/lang/de-DE.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/sysdm/lang/de-DE.r…
==============================================================================
--- trunk/reactos/dll/cpl/sysdm/lang/de-DE.rc (original)
+++ trunk/reactos/dll/cpl/sysdm/lang/de-DE.rc Sun Jul 29 02:34:42 2007
@@ -185,9 +185,7 @@
BEGIN
LTEXT "Laufwerk [Bezeichnung]", IDC_STATIC, 12, 5, 96, 9
LTEXT "Auslagerungsdatei (MB)", IDC_STATIC, 115, 5, 96, 9
- CONTROL "", IDC_PAGEFILELIST, "SysListView32", LVS_REPORT |
LVS_NOCOLUMNHEADER | WS_TABSTOP,
- 10, 16, 204, 52, WS_EX_CLIENTEDGE
-
+ LISTBOX IDC_PAGEFILELIST, 10, 16, 204, 52, LBS_NOTIFY | LBS_USETABSTOPS
GROUPBOX "Größe der Auslagerungsdatei für das gewählte Laufwerk",
IDC_DRIVEGROUP, 10, 70, 204, 104
LTEXT "Laufwerk:", IDC_STATIC, 20, 80, 40, 8
LTEXT "", IDC_DRIVE, 105, 81, 100, 9
Modified: trunk/reactos/dll/cpl/sysdm/lang/en-US.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/sysdm/lang/en-US.r…
==============================================================================
--- trunk/reactos/dll/cpl/sysdm/lang/en-US.rc (original)
+++ trunk/reactos/dll/cpl/sysdm/lang/en-US.rc Sun Jul 29 02:34:42 2007
@@ -177,9 +177,7 @@
BEGIN
LTEXT "Drive [Volume Label]", IDC_STATIC, 12, 5, 96, 9
LTEXT "Paging File Size (MB)", IDC_STATIC, 115, 5, 96, 9
- CONTROL "", IDC_PAGEFILELIST, "SysListView32", LVS_REPORT |
LVS_NOCOLUMNHEADER | WS_TABSTOP,
- 10, 16, 204, 52, WS_EX_CLIENTEDGE
-
+ LISTBOX IDC_PAGEFILELIST, 10, 16, 204, 52, LBS_NOTIFY | LBS_USETABSTOPS
GROUPBOX "Paging file size for selected drive", IDC_DRIVEGROUP, 10, 70,
204, 104
LTEXT "Drive:", IDC_STATIC, 20, 80, 20, 8
LTEXT "", IDC_DRIVE, 88, 81, 100, 9
Modified: trunk/reactos/dll/cpl/sysdm/lang/fr-FR.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/sysdm/lang/fr-FR.r…
==============================================================================
--- trunk/reactos/dll/cpl/sysdm/lang/fr-FR.rc (original)
+++ trunk/reactos/dll/cpl/sysdm/lang/fr-FR.rc Sun Jul 29 02:34:42 2007
@@ -181,10 +181,7 @@
BEGIN
LTEXT "Lecteur [Nom de Volume]", IDC_STATIC, 12, 5, 96, 9
LTEXT "Taille de fichier swap (MB)", IDC_STATIC, 115, 5, 96, 9
- CONTROL "", IDC_PAGEFILELIST, "SysListView32", LVS_REPORT |
LVS_NOCOLUMNHEADER | WS_TABSTOP,
- 10, 16, 204, 52, WS_EX_CLIENTEDGE
-
- GROUPBOX "Taille de fichier swap pour le disque sélectionné",
IDC_DRIVEGROUP, 10, 70, 204, 104
+ LISTBOX IDC_PAGEFILELIST, 10, 16, 204, 52, LBS_NOTIFY | LBS_USETABSTOPS
GROUPBOX "Taille de fichier swap pour le disque sélectionné", IDC_DRIVEGROUP,
10, 70, 204, 104
LTEXT "Lecteur :", IDC_STATIC, 20, 80, 30, 8
LTEXT "", IDC_DRIVE, 88, 81, 100, 9
LTEXT "Espace disponible :", IDC_STATIC, 20, 92, 66, 9
Modified: trunk/reactos/dll/cpl/sysdm/lang/id-ID.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/sysdm/lang/id-ID.r…
==============================================================================
--- trunk/reactos/dll/cpl/sysdm/lang/id-ID.rc (original)
+++ trunk/reactos/dll/cpl/sysdm/lang/id-ID.rc Sun Jul 29 02:34:42 2007
@@ -177,10 +177,7 @@
BEGIN
LTEXT "Drive [Label Volume]", IDC_STATIC, 12, 5, 96, 9
LTEXT "Ukuran File Paging (MB)", IDC_STATIC, 115, 5, 96, 9
- CONTROL "", IDC_PAGEFILELIST, "SysListView32", LVS_REPORT |
LVS_NOCOLUMNHEADER | WS_TABSTOP,
- 10, 16, 204, 52, WS_EX_CLIENTEDGE
-
- GROUPBOX "Ukuran file paging untuk drive yang dipilih", IDC_DRIVEGROUP,
10, 70, 204, 104
+ LISTBOX IDC_PAGEFILELIST, 10, 16, 204, 52, LBS_NOTIFY | LBS_USETABSTOPS
GROUPBOX "Ukuran file paging untuk drive yang dipilih", IDC_DRIVEGROUP, 10,
70, 204, 104
LTEXT "Drive:", IDC_STATIC, 20, 80, 20, 8
LTEXT "", IDC_DRIVE, 88, 81, 100, 9
LTEXT "Ruang tersedia:", IDC_STATIC, 20, 92, 56, 9
Modified: trunk/reactos/dll/cpl/sysdm/lang/it-IT.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/sysdm/lang/it-IT.r…
==============================================================================
--- trunk/reactos/dll/cpl/sysdm/lang/it-IT.rc (original)
+++ trunk/reactos/dll/cpl/sysdm/lang/it-IT.rc Sun Jul 29 02:34:42 2007
@@ -177,9 +177,7 @@
BEGIN
LTEXT "Disco [Etichetta Volume]", IDC_STATIC, 12, 5, 96, 9
LTEXT "Dimensione del file di paginazione (MB)", IDC_STATIC, 115, 5,
96, 9
- CONTROL "", IDC_PAGEFILELIST, "SysListView32", LVS_REPORT |
LVS_NOCOLUMNHEADER | WS_TABSTOP,
- 10, 16, 204, 52, WS_EX_CLIENTEDGE
-
+ LISTBOX IDC_PAGEFILELIST, 10, 16, 204, 52, LBS_NOTIFY | LBS_USETABSTOPS
GROUPBOX "Dimensione del file di paginazione per il disco selezionato",
IDC_DRIVEGROUP, 10, 70, 204, 104
LTEXT "Disco:", IDC_STATIC, 20, 80, 20, 8
LTEXT "", IDC_DRIVE, 88, 81, 100, 9
Modified: trunk/reactos/dll/cpl/sysdm/lang/pl-PL.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/sysdm/lang/pl-PL.r…
==============================================================================
--- trunk/reactos/dll/cpl/sysdm/lang/pl-PL.rc (original)
+++ trunk/reactos/dll/cpl/sysdm/lang/pl-PL.rc Sun Jul 29 02:34:42 2007
@@ -183,10 +183,7 @@
BEGIN
LTEXT "&Dysk [Etykieta woluminu]", IDC_STATIC, 12, 5, 96, 9
LTEXT "Rozmiar pliku stronicowania (MB)", IDC_STATIC, 115, 5, 96, 9
- CONTROL "", IDC_PAGEFILELIST, "SysListView32", LVS_REPORT |
LVS_NOCOLUMNHEADER | WS_TABSTOP,
- 10, 16, 204, 52, WS_EX_CLIENTEDGE
-
- GROUPBOX "Rozmiar pliku stronicowania dla wybranego dysku",
IDC_DRIVEGROUP, 10, 70, 204, 104
+ LISTBOX IDC_PAGEFILELIST, 10, 16, 204, 52, LBS_NOTIFY | LBS_USETABSTOPS
GROUPBOX "Rozmiar pliku stronicowania dla wybranego dysku", IDC_DRIVEGROUP,
10, 70, 204, 104
LTEXT "Dysk:", IDC_STATIC, 20, 80, 20, 8
LTEXT "", IDC_DRIVE, 88, 81, 100, 9
LTEXT "Dostêpne miejsce:", IDC_STATIC, 20, 92, 56, 9
Modified: trunk/reactos/dll/cpl/sysdm/lang/ru-RU.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/sysdm/lang/ru-RU.r…
==============================================================================
--- trunk/reactos/dll/cpl/sysdm/lang/ru-RU.rc (original)
+++ trunk/reactos/dll/cpl/sysdm/lang/ru-RU.rc Sun Jul 29 02:34:42 2007
@@ -177,9 +177,7 @@
BEGIN
LTEXT "Äèñê [ìåòêà òîìà]", IDC_STATIC, 12, 5, 96, 9
LTEXT "Ôàéë ïîäêà÷êè (MB)", IDC_STATIC, 115, 5, 96, 9
- CONTROL "", IDC_PAGEFILELIST, "SysListView32", LVS_REPORT |
LVS_NOCOLUMNHEADER | WS_TABSTOP,
- 10, 16, 204, 52, WS_EX_CLIENTEDGE
-
+ LISTBOX IDC_PAGEFILELIST, 10, 16, 204, 52, LBS_NOTIFY | LBS_USETABSTOPS
GROUPBOX "Ðàçìåð ôàéëà ïîäêà÷êè äëÿ âûáðàííîãî äèñêà", IDC_DRIVEGROUP,
10, 70, 204, 104
LTEXT "Äèñê:", IDC_STATIC, 20, 80, 20, 8
LTEXT "", IDC_DRIVE, 88, 81, 100, 9
Modified: trunk/reactos/dll/cpl/sysdm/lang/uk-UA.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/sysdm/lang/uk-UA.r…
==============================================================================
--- trunk/reactos/dll/cpl/sysdm/lang/uk-UA.rc (original)
+++ trunk/reactos/dll/cpl/sysdm/lang/uk-UA.rc Sun Jul 29 02:34:42 2007
@@ -185,9 +185,7 @@
BEGIN
LTEXT "Äèñê [ì³òêà òîìó]", IDC_STATIC, 12, 5, 96, 9
LTEXT "Ôàéë äîâàíòàæåííÿ (ÌÁ)", IDC_STATIC, 115, 5, 96, 9
- CONTROL "", IDC_PAGEFILELIST, "SysListView32", LVS_REPORT |
LVS_NOCOLUMNHEADER | WS_TABSTOP,
- 10, 16, 204, 52, WS_EX_CLIENTEDGE
-
+ LISTBOX IDC_PAGEFILELIST, 10, 16, 204, 52, LBS_NOTIFY | LBS_USETABSTOPS
GROUPBOX "Ðîçì³ð ôàéëó äîâàíòàæåííÿ äëÿ âèáðàíîãî äèñêà",
IDC_DRIVEGROUP, 10, 70, 204, 104
LTEXT "Äèñê:", IDC_STATIC, 20, 80, 20, 8
LTEXT "", IDC_DRIVE, 88, 81, 100, 9
Modified: trunk/reactos/dll/cpl/sysdm/precomp.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/sysdm/precomp.h?re…
==============================================================================
--- trunk/reactos/dll/cpl/sysdm/precomp.h (original)
+++ trunk/reactos/dll/cpl/sysdm/precomp.h Sun Jul 29 02:34:42 2007
@@ -58,7 +58,7 @@
typedef struct _VIRTMEM
{
HWND hSelf;
- HWND hListView;
+ HWND hListBox;
LPTSTR szPagingFiles;
TCHAR szDrive[10];
INT Count;
Modified: trunk/reactos/dll/cpl/sysdm/virtmem.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/sysdm/virtmem.c?re…
==============================================================================
--- trunk/reactos/dll/cpl/sysdm/virtmem.c (original)
+++ trunk/reactos/dll/cpl/sysdm/virtmem.c Sun Jul 29 02:34:42 2007
@@ -89,8 +89,9 @@
{
TCHAR szDrives[1024]; // all drives
LPTSTR DrivePtr = szDrives;
- TCHAR szDrive[MAX_PATH]; // single drive
+ TCHAR szDrive[4]; // single drive
TCHAR szVolume[MAX_PATH];
+ TCHAR *szDisplayString;
INT InitialSize = 0;
INT MaxSize = 0;
INT DriveLen;
@@ -99,9 +100,12 @@
DriveLen = GetLogicalDriveStrings(1023,
szDrives);
+ szDisplayString = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (MAX_PATH * 2 + 70) *
sizeof(TCHAR));
+ if (szDisplayString == NULL)
+ return;
+
while (DriveLen != 0)
{
- LVITEM Item;
INT Len;
Len = lstrlen(DrivePtr) + 1;
@@ -134,12 +138,8 @@
lstrcpy(pVirtMem->Pagefile[PgCnt].szDrive, szDrive);
}
- /* fill out the listview */
- ZeroMemory(&Item, sizeof(Item));
- Item.mask = LVIF_TEXT;
- Item.iItem = ListView_GetItemCount(pVirtMem->hListView);
- Item.pszText = szDrive;
- (void)ListView_InsertItem(pVirtMem->hListView, &Item);
+ _tcscpy(szDisplayString, szDrive);
+ _tcscat(szDisplayString, _T("\t"));
/* set a volume label if there is one */
if (GetVolumeInformation(DrivePtr,
@@ -154,12 +154,8 @@
if (szVolume[0] != _T('\0'))
{
TCHAR szVol[MAX_PATH + 2];
-
_stprintf(szVol, _T("[%s]"), szVolume);
-
- Item.iSubItem = 1;
- Item.pszText = szVol;
- (void)ListView_InsertItem(pVirtMem->hListView, &Item);
+ _tcscat(szDisplayString, szVol);
}
}
@@ -168,18 +164,19 @@
TCHAR szSize[64];
_stprintf(szSize, _T("%i - %i"), InitialSize, MaxSize);
-
- Item.iSubItem = 2;
- Item.pszText = szSize;
- (void)ListView_InsertItem(pVirtMem->hListView, &Item);
- }
-
+ _tcscat(szDisplayString, _T("\t"));
+ _tcscat(szDisplayString, szSize);
+ }
+
+ SendMessage(pVirtMem->hListBox, LB_ADDSTRING, (WPARAM)0,
(LPARAM)szDisplayString);
PgCnt++;
}
DrivePtr += Len;
}
+ SendMessage(pVirtMem->hListBox, LB_SETCURSEL, (WPARAM)0, (LPARAM)0);
+ HeapFree(GetProcessHeap(), 0, szDisplayString);
pVirtMem->Count = PgCnt;
}
@@ -245,31 +242,10 @@
static VOID
-SetListViewColumns(HWND hwndListView)
-{
- RECT rect;
- LV_COLUMN lvc;
-
- GetClientRect(hwndListView, &rect);
-
- (void)ListView_SetExtendedListViewStyle(hwndListView,
- LVS_EX_FULLROWSELECT);
-
- ZeroMemory(&lvc, sizeof(lvc));
- lvc.mask = LVCF_SUBITEM | LVCF_WIDTH | LVCF_FMT;
- lvc.fmt = LVCFMT_LEFT;
-
- lvc.cx = (INT)((rect.right - rect.left) * 0.1);
- lvc.iSubItem = 0;
- (void)ListView_InsertColumn(hwndListView, 0, &lvc);
-
- lvc.cx = (INT)((rect.right - rect.left) * 0.3);
- lvc.iSubItem = 1;
- (void)ListView_InsertColumn(hwndListView, 1, &lvc);
-
- lvc.cx = (INT)((rect.right - rect.left) * 0.6);
- lvc.iSubItem = 2;
- (void)ListView_InsertColumn(hwndListView, 2, &lvc);
+SetListBoxColumns(HWND hwndListBox)
+{
+ INT tabs[2] = {30, 170};
+ SendMessage(hwndListBox, LB_SETTABSTOPS, (WPARAM)2, (LPARAM)(LPINT) &tabs[0]);
}
@@ -481,10 +457,10 @@
}
pVirtMem->hSelf = hwnd;
- pVirtMem->hListView = GetDlgItem(hwnd, IDC_PAGEFILELIST);
+ pVirtMem->hListBox = GetDlgItem(hwnd, IDC_PAGEFILELIST);
pVirtMem->bSave = FALSE;
- SetListViewColumns(pVirtMem->hListView);
+ SetListBoxColumns(pVirtMem->hListBox);
/* Load the pagefile systems from the reg */
if (ReadPageFileSettings(pVirtMem))