Author: ekohl
Date: Sun Nov 4 13:45:06 2007
New Revision: 30103
URL:
http://svn.reactos.org/svn/reactos?rev=30103&view=rev
Log:
- Made some local functions static.
- Pressing the "Del" key removes the currently selected environment variable.
Modified:
trunk/reactos/dll/cpl/sysdm/environment.c
Modified: trunk/reactos/dll/cpl/sysdm/environment.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/sysdm/environment.…
==============================================================================
--- trunk/reactos/dll/cpl/sysdm/environment.c (original)
+++ trunk/reactos/dll/cpl/sysdm/environment.c Sun Nov 4 13:45:06 2007
@@ -47,7 +47,7 @@
}
-INT_PTR CALLBACK
+static INT_PTR CALLBACK
EditVariableDlgProc(HWND hwndDlg,
UINT uMsg,
WPARAM wParam,
@@ -340,7 +340,7 @@
}
-VOID
+static VOID
OnNewVariable(HWND hwndDlg,
INT iDlgItem)
{
@@ -387,7 +387,7 @@
}
-VOID
+static VOID
OnEditVariable(HWND hwndDlg,
INT iDlgItem)
{
@@ -423,7 +423,7 @@
}
-VOID
+static VOID
OnDeleteVariable(HWND hwndDlg,
INT iDlgItem)
{
@@ -473,7 +473,7 @@
}
-VOID
+static VOID
ReleaseListViewItems(HWND hwndDlg,
INT iDlgItem)
{
@@ -515,7 +515,7 @@
}
-VOID
+static VOID
SetAllVars(HWND hwndDlg,
INT iDlgItem)
{
@@ -651,6 +651,35 @@
}
+static BOOL
+OnNotify(HWND hwndDlg, NMHDR *phdr)
+{
+ switch(phdr->code)
+ {
+ case NM_DBLCLK:
+ if (phdr->idFrom == IDC_USER_VARIABLE_LIST ||
+ phdr->idFrom == IDC_SYSTEM_VARIABLE_LIST)
+ {
+ OnEditVariable(hwndDlg, (INT)phdr->idFrom);
+ return TRUE;
+ }
+ break;
+
+ case LVN_KEYDOWN:
+ if (((LPNMLVKEYDOWN)phdr)->wVKey == VK_DELETE &&
+ (phdr->idFrom == IDC_USER_VARIABLE_LIST ||
+ phdr->idFrom == IDC_SYSTEM_VARIABLE_LIST))
+ {
+ OnDeleteVariable(hwndDlg, (INT)phdr->idFrom);
+ return TRUE;
+ }
+ break;
+ }
+
+ return FALSE;
+}
+
+
/* Environment dialog procedure */
INT_PTR CALLBACK
EnvironmentDlgProc(HWND hwndDlg,
@@ -709,24 +738,7 @@
break;
case WM_NOTIFY:
- {
- NMHDR *phdr;
-
- phdr = (NMHDR*)lParam;
- switch(phdr->code)
- {
- case NM_DBLCLK:
- {
- if (phdr->idFrom == IDC_USER_VARIABLE_LIST ||
- phdr->idFrom == IDC_SYSTEM_VARIABLE_LIST)
- {
- OnEditVariable(hwndDlg, (INT)phdr->idFrom);
- return TRUE;
- }
- }
- }
- }
- break;
+ return OnNotify(hwndDlg, (NMHDR*)lParam);
}
return FALSE;