* locate.el (locate-local-prompt): New var.
[bpt/emacs.git] / lwlib / lwlib-Xaw.c
index 058899a..be1990e 100644 (file)
@@ -1,22 +1,24 @@
 /* The lwlib interface to Athena widgets.
-   Copyright (C) 1993 Chuck Thompson <cthomp@cs.uiuc.edu>
+Copyright (C) 1993 Chuck Thompson <cthomp@cs.uiuc.edu>
+Copyright (C) 1994, 2001, 2002, 2003, 2004, 2005, 2006,
+  2007 Free Software Foundation, Inc.
 
 This file is part of the Lucid Widget Library.
 
-The Lucid Widget Library is free software; you can redistribute it and/or 
+The Lucid Widget Library is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License as published by
 the Free Software Foundation; either version 1, or (at your option)
 any later version.
 
 The Lucid Widget Library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of 
+but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
 along with GNU Emacs; see the file COPYING.  If not, write to
-the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA.  */
+the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA.  */
 
 #ifdef HAVE_CONFIG_H
 #include <config.h>
@@ -277,6 +279,9 @@ xaw_pop_instance (instance, up)
 
 static char overrideTrans[] =
        "<Message>WM_PROTOCOLS: lwlib_delete_dialog()";
+/* Dialogs pop down on any key press */
+static char dialogOverride[] =
+       "<KeyPress>Escape:      lwlib_delete_dialog()";
 static void wm_delete_window();
 static XtActionsRec xaw_actions [] = {
   {"lwlib_delete_dialog", wm_delete_window}
@@ -333,6 +338,8 @@ make_dialog (name, parent, pop_up_p, shell_title, icon_name, text_input_slot, ra
 
   ac = 0;
   dialog = XtCreateManagedWidget (name, dialogWidgetClass, shell, av, ac);
+  override = XtParseTranslationTable (dialogOverride);
+  XtOverrideTranslations (dialog, override);
 
   bc = 0;
   button = 0;
@@ -356,7 +363,7 @@ make_dialog (name, parent, pop_up_p, shell_title, icon_name, text_input_slot, ra
         I want the separator to take up the slack between the buttons on
         the right and the buttons on the left (that is I want the buttons
         after the separator to be packed against the right edge of the
-        window) but I can't seem to make it do it.  
+        window) but I can't seem to make it do it.
        */
       ac = 0;
       XtSetArg (av [ac], XtNfromHoriz, button); ac++;
@@ -440,7 +447,7 @@ xaw_create_dialog (instance)
     shell_name = "Question";
     break;
   }
-  
+
   total_buttons = name [1] - '0';
 
   if (name [3] == 'T' || name [3] == 't')
@@ -450,9 +457,9 @@ xaw_create_dialog (instance)
     }
   else if (name [3])
     right_buttons = name [4] - '0';
-  
+
   left_buttons = total_buttons - right_buttons;
-  
+
   widget = make_dialog (name, parent, pop_up_p,
                        shell_name, icon_name, text_input_slot, radio_box,
                        list, left_buttons, right_buttons);
@@ -511,8 +518,8 @@ xaw_generic_callback (widget, closure, call_data)
 }
 
 static void
-wm_delete_window (shell, closure, call_data)
-     Widget shell;
+wm_delete_window (w, closure, call_data)
+     Widget w;
      XtPointer closure;
      XtPointer call_data;
 {
@@ -520,7 +527,13 @@ wm_delete_window (shell, closure, call_data)
   Cardinal nkids;
   int i;
   Widget *kids = 0;
-  Widget widget;
+  Widget widget, shell;
+
+  if (XtIsSubclass (w, dialogWidgetClass))
+    shell = XtParent (w);
+  else
+    shell = w;
+
   if (! XtIsSubclass (shell, shellWidgetClass))
     abort ();
   XtVaGetValues (shell, XtNnumChildren, &nkids, NULL);
@@ -619,7 +632,7 @@ xaw_create_scrollbar (instance)
   Widget scrollbar;
 
   XtVaGetValues (instance->parent, XtNwidth, &width, NULL);
-  
+
   XtSetArg (av[ac], XtNshowGrip, 0); ac++;
   XtSetArg (av[ac], XtNresizeToPreferred, 1); ac++;
   XtSetArg (av[ac], XtNallowResize, True); ac++;
@@ -670,3 +683,6 @@ xaw_creation_table [] =
   {"main",                     xaw_create_main},
   {NULL, NULL}
 };
+
+/* arch-tag: fbbd3589-ae1c-41a0-9142-f628cfee6564
+   (do not change this comment) */