3 source/menu.c | 22 +++++++++++++++++++++-
5 2 files changed, 23 insertions(+), 2 deletions(-)
7 diff --quilt old/source/menu.c new/source/menu.c
10 @@ -105,10 +105,11 @@ typedef void (*menuCallbackProc)();
12 extern void _XmDismissTearOff(Widget, XtPointer, XtPointer);
14 static void doActionCB(Widget w, XtPointer clientData, XtPointer callData);
15 static void doTabActionCB(Widget w, XtPointer clientData, XtPointer callData);
16 +static void closeCB(Widget w, XtPointer clientData, XtPointer callData);
17 static void pasteColCB(Widget w, XtPointer clientData, XtPointer callData);
18 static void shiftLeftCB(Widget w, XtPointer clientData, XtPointer callData);
19 static void shiftRightCB(Widget w, XtPointer clientData, XtPointer callData);
20 static void findCB(Widget w, XtPointer clientData, XtPointer callData);
21 static void findSameCB(Widget w, XtPointer clientData, XtPointer callData);
22 @@ -696,12 +697,15 @@ Widget CreateMenuBar(Widget parent, Wind
23 XtSetSensitive(window->prevOpenMenuItem, NPrevOpen != 0);
24 XtAddCallback(window->prevOpenMenuItem, XmNcascadingCallback,
25 (XtCallbackProc)prevOpenMenuCB, window);
27 createMenuSeparator(menuPane, "sep1", SHORT);
29 window->closeItem = createMenuItem(menuPane, "close", "Close", 'C',
30 - doActionCB, "close", SHORT);
31 + closeCB, window, SHORT);
32 + createFakeMenuItem(menuPane, "closeShift", closeCB, window);
34 createMenuItem(menuPane, "save", "Save", 'S', doActionCB, "save", SHORT);
35 createMenuItem(menuPane, "saveAs", "Save As...", 'A', doActionCB,
36 "save_as_dialog", SHORT);
37 createMenuItem(menuPane, "revertToSaved", "Revert to Saved", 'R',
38 doActionCB, "revert_to_saved_dialog", SHORT);
39 @@ -1456,10 +1460,26 @@ static void doActionCB(Widget w, XtPoint
40 HidePointerOnKeyedEvent(widget, event);
42 XtCallActionProc(widget, action, event, NULL, 0);
45 +static void closeCB(Widget w, XtPointer clientData, XtPointer callData)
47 + static char *params[1] = { "nosave" };
49 + HidePointerOnKeyedEvent(WidgetToWindow(MENU_WIDGET(w))->lastFocus,
50 + ((XmAnyCallbackStruct *)callData)->event);
51 + if (((XmAnyCallbackStruct *)callData)->event->xbutton.state & ShiftMask) {
52 + XtCallActionProc(WidgetToWindow(MENU_WIDGET(w))->lastFocus, "close",
53 + ((XmAnyCallbackStruct *)callData)->event, params, 1);
56 + XtCallActionProc(WidgetToWindow(MENU_WIDGET(w))->lastFocus, "close",
57 + ((XmAnyCallbackStruct *)callData)->event, NULL, 0);
61 static void pasteColCB(Widget w, XtPointer clientData, XtPointer callData)
63 static char *params[1] = {"rect"};
65 HidePointerOnKeyedEvent(WidgetToWindow(MENU_WIDGET(w))->lastFocus,
66 diff --quilt old/source/nedit.c new/source/nedit.c
67 --- old/source/nedit.c
68 +++ new/source/nedit.c
69 @@ -239,11 +239,12 @@ static char *fallbackResources[] = {
70 "*fileMenu.open.accelerator: Ctrl<Key>o",
71 "*fileMenu.open.acceleratorText: Ctrl+O",
72 "*fileMenu.openSelected.accelerator: Ctrl<Key>y",
73 "*fileMenu.openSelected.acceleratorText: Ctrl+Y",
74 "*fileMenu.close.accelerator: Ctrl<Key>w",
75 - "*fileMenu.close.acceleratorText: Ctrl+W",
76 + "*fileMenu.close.acceleratorText: [Shift]Ctrl+W",
77 + "*fileMenu.closeShift.accelerator: Shift Ctrl<Key>w",
78 "*fileMenu.save.accelerator: Ctrl<Key>s",
79 "*fileMenu.save.acceleratorText: Ctrl+S",
80 "*fileMenu.includeFile.accelerator: Alt<Key>i",
81 "*fileMenu.includeFile.acceleratorText: Alt+I",
82 "*fileMenu.print.accelerator: Ctrl<Key>p",