regedit: context menu support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is from ReactOS tree, a bit cleaned up.

ChangeLog
    weiden@xxxxxxxxxxxx
    Add context menu support to regedit.

Index: programs/regedit/En.rc
===================================================================
RCS file: /var/cvs/wine/programs/regedit/En.rc,v
retrieving revision 1.6
diff -u -r1.6 En.rc
--- programs/regedit/En.rc	6 Jan 2004 20:38:56 -0000	1.6
+++ programs/regedit/En.rc	14 Jan 2004 05:00:26 -0000
@@ -102,6 +102,29 @@
     END
 END
 
+IDR_POPUP_MENUS MENU DISCARDABLE
+BEGIN
+  POPUP ""
+  BEGIN
+	MENUITEM "&Modify",                     ID_EDIT_MODIFY
+	MENUITEM "Modify Binary Data",          ID_EDIT_MODIFY_BIN
+	MENUITEM SEPARATOR
+	MENUITEM "&Delete\tDel",                ID_EDIT_DELETE
+	MENUITEM "&Rename",                     ID_EDIT_RENAME
+  END
+  POPUP ""
+  BEGIN
+        POPUP "&New"
+        BEGIN
+            MENUITEM "&Key",                        ID_EDIT_NEW_KEY
+            MENUITEM SEPARATOR
+            MENUITEM "&String Value",               ID_EDIT_NEW_STRINGVALUE
+            MENUITEM "&Binary Value",               ID_EDIT_NEW_BINARYVALUE
+            MENUITEM "&DWORD Value",                ID_EDIT_NEW_DWORDVALUE
+        END
+  END
+END
+
 
 /*
  * Dialog
Index: programs/regedit/listview.c
===================================================================
RCS file: /var/cvs/wine/programs/regedit/listview.c,v
retrieving revision 1.5
diff -u -r1.5 listview.c
--- programs/regedit/listview.c	13 Jan 2004 23:18:12 -0000	1.5
+++ programs/regedit/listview.c	14 Jan 2004 05:05:00 -0000
@@ -346,6 +346,13 @@
             return CallWindowProc(g_orgListWndProc, hWnd, message, wParam, lParam);
         }
         break;
+    case WM_CONTEXTMENU: {
+        POINTS pt = MAKEPOINTS(lParam);
+        int cnt = ListView_GetNextItem(hWnd, -1, LVNI_FOCUSED | LVNI_SELECTED);
+        TrackPopupMenu(GetSubMenu(hPopupMenus, cnt == -1 ? PM_NEW : PM_MODIFYVALUE), 
+		       TPM_RIGHTBUTTON, pt.x, pt.y, 0, hFrameWnd, NULL);
+        break;
+    }
     case WM_KEYDOWN:
         if (wParam == VK_TAB) {
             /*TODO: SetFocus(Globals.hDriveBar) */
Index: programs/regedit/main.c
===================================================================
RCS file: /var/cvs/wine/programs/regedit/main.c,v
retrieving revision 1.7
diff -u -r1.7 main.c
--- programs/regedit/main.c	12 Dec 2003 04:08:59 -0000	1.7
+++ programs/regedit/main.c	13 Jan 2004 23:33:47 -0000
@@ -42,6 +42,7 @@
 HWND hFrameWnd;
 HWND hStatusBar;
 HMENU hMenuFrame;
+HMENU hPopupMenus = 0;
 UINT nClipboardFormat;
 LPCTSTR strClipboardFormat = _T("TODO: SET CORRECT FORMAT");
 
@@ -104,6 +105,7 @@
     hChildWndClass = hChildWndClass; /* warning eater */
 
     hMenuFrame = LoadMenu(hInstance, MAKEINTRESOURCE(IDR_REGEDIT_MENU));
+    hPopupMenus = LoadMenu(hInstance, MAKEINTRESOURCE(IDR_POPUP_MENUS));
 
     /* Initialize the Windows Common Controls DLL */
     InitCommonControls();
Index: programs/regedit/main.h
===================================================================
RCS file: /var/cvs/wine/programs/regedit/main.h,v
retrieving revision 1.12
diff -u -r1.12 main.h
--- programs/regedit/main.h	13 Jan 2004 23:18:12 -0000	1.12
+++ programs/regedit/main.h	14 Jan 2004 05:14:58 -0000
@@ -32,6 +32,9 @@
 
 #define COUNT_OF(a) (sizeof(a)/sizeof(a[0]))
 
+#define PM_MODIFYVALUE  0
+#define PM_NEW          1
+
 extern HINSTANCE hInst;
 
 /******************************************************************************/
@@ -64,6 +67,7 @@
 extern HWND      hFrameWnd;
 extern HMENU     hMenuFrame;
 extern HWND      hStatusBar;
+extern HMENU     hPopupMenus;
 extern HFONT     hFont;
 extern enum OPTION_FLAGS Options;
 
Index: programs/regedit/resource.h
===================================================================
RCS file: /var/cvs/wine/programs/regedit/resource.h,v
retrieving revision 1.5
diff -u -r1.5 resource.h
--- programs/regedit/resource.h	6 Jan 2004 20:38:56 -0000	1.5
+++ programs/regedit/resource.h	13 Jan 2004 23:35:04 -0000
@@ -41,6 +41,7 @@
 #define IDD_DIALOG2                     132
 #define IDB_CLOSED_FILE                 133
 #define IDB_ROOT                        134
+#define IDR_POPUP_MENUS                 137
 #define IDC_LICENSE_EDIT                1029
 #define ID_REGISTRY_EXIT                32770
 #define ID_FAVOURITES_ADDTOFAVOURITES   32772
@@ -114,6 +115,7 @@
 #define IDC_DWORD_DEC			32854
 #define IDS_NEWKEY			32860
 #define IDS_NEWVALUE			32861
+#define ID_EDIT_MODIFY_BIN		32870
 
 #define IDD_EDIT_STRING			2000
 #define IDC_VALUE_NAME			2001


-- 
Dimi.



[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux