diff lwlib/lwlib-Xaw.c @ 80:1ce6082ce73f r20-0b90

Import from CVS: tag r20-0b90
author cvs
date Mon, 13 Aug 2007 09:06:37 +0200
parents c7528f8e288d
children 6a378aca36af
line wrap: on
line diff
--- a/lwlib/lwlib-Xaw.c	Mon Aug 13 09:05:44 2007 +0200
+++ b/lwlib/lwlib-Xaw.c	Mon Aug 13 09:06:37 2007 +0200
@@ -14,12 +14,11 @@
 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
+along with XEmacs; see the file COPYING.  If not, write to
 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 Boston, MA 02111-1307, USA.  */
 
 #include <stdio.h>
-#include <stdlib.h>
 
 #include "lwlib-Xaw.h"
 
@@ -285,9 +284,9 @@
   override = XtParseTranslationTable (overrideTrans);
 
   ac = 0;
-  XtSetArg (av[ac], XtNtitle, shell_title); ac++;
+  XtSetArg (av[ac], XtNtitle, shell_title);	ac++;
   XtSetArg (av[ac], XtNallowShellResize, True); ac++;
-  XtSetArg (av[ac], XtNtransientFor, parent); ac++;
+  XtSetArg (av[ac], XtNtransientFor, parent);	ac++;
   shell = XtCreatePopupShell ("dialog", transientShellWidgetClass,
 			      parent, av, ac);
   XtOverrideTranslations (shell, override);
@@ -300,12 +299,12 @@
   for (i = 0; i < left_buttons; i++)
     {
       ac = 0;
-      XtSetArg (av [ac], XtNfromHoriz, button); ac++;
-      XtSetArg (av [ac], XtNleft, XtChainLeft); ac++;
-      XtSetArg (av [ac], XtNright, XtChainLeft); ac++;
-      XtSetArg (av [ac], XtNtop, XtChainBottom); ac++;
+      XtSetArg (av [ac], XtNfromHoriz, button);     ac++;
+      XtSetArg (av [ac], XtNleft,   XtChainLeft);   ac++;
+      XtSetArg (av [ac], XtNright,  XtChainLeft);   ac++;
+      XtSetArg (av [ac], XtNtop,    XtChainBottom); ac++;
       XtSetArg (av [ac], XtNbottom, XtChainBottom); ac++;
-      XtSetArg (av [ac], XtNresizable, True); ac++;
+      XtSetArg (av [ac], XtNresizable, True);       ac++;
       sprintf (button_name, "button%d", ++bc);
       button = XtCreateManagedWidget (button_name, commandWidgetClass,
 				      dialog, av, ac);
@@ -320,11 +319,11 @@
 	 window) but I can't seem to make it do it.  
        */
       ac = 0;
-      XtSetArg (av [ac], XtNfromHoriz, button); ac++;
+      XtSetArg (av [ac], XtNfromHoriz, button);	    ac++;
 /*  XtSetArg (av [ac], XtNfromVert, XtNameToWidget (dialog, "label")); ac++; */
-      XtSetArg (av [ac], XtNleft, XtChainLeft); ac++;
-      XtSetArg (av [ac], XtNright, XtChainRight); ac++;
-      XtSetArg (av [ac], XtNtop, XtChainBottom); ac++;
+      XtSetArg (av [ac], XtNleft,   XtChainLeft);   ac++;
+      XtSetArg (av [ac], XtNright,  XtChainRight);  ac++;
+      XtSetArg (av [ac], XtNtop,    XtChainBottom); ac++;
       XtSetArg (av [ac], XtNbottom, XtChainBottom); ac++;
       XtSetArg (av [ac], XtNlabel, ""); ac++;
       XtSetArg (av [ac], XtNwidth, 30); ac++;	/* #### aaack!! */
@@ -342,12 +341,12 @@
   for (i = 0; i < right_buttons; i++)
     {
       ac = 0;
-      XtSetArg (av [ac], XtNfromHoriz, button); ac++;
-      XtSetArg (av [ac], XtNleft, XtChainRight); ac++;
-      XtSetArg (av [ac], XtNright, XtChainRight); ac++;
-      XtSetArg (av [ac], XtNtop, XtChainBottom); ac++;
+      XtSetArg (av [ac], XtNfromHoriz, button);	    ac++;
+      XtSetArg (av [ac], XtNleft,   XtChainRight);  ac++;
+      XtSetArg (av [ac], XtNright,  XtChainRight);  ac++;
+      XtSetArg (av [ac], XtNtop,    XtChainBottom); ac++;
       XtSetArg (av [ac], XtNbottom, XtChainBottom); ac++;
-      XtSetArg (av [ac], XtNresizable, True); ac++;
+      XtSetArg (av [ac], XtNresizable, True);	    ac++;
       sprintf (button_name, "button%d", ++bc);
       button = XtCreateManagedWidget (button_name, commandWidgetClass,
 				      dialog, av, ac);
@@ -558,7 +557,7 @@
 {
   Arg av[10];
   int ac = 0;
-
+  
   static XtCallbackRec jumpCallbacks[2] =
   { {xaw_scrollbar_jump, NULL}, {NULL, NULL} };
   
@@ -573,28 +572,13 @@
      few people use the Athena scrollbar now that it really isn't
      worth the effort, at least not at the moment. */
   XtSetArg (av [ac], XtNborderWidth, 0); ac++;
-  if (vertical)
-    {
-      XtSetArg (av [ac], XtNorientation, XtorientVertical); ac++;
-    }
-  else
-    {
-      XtSetArg (av [ac], XtNorientation, XtorientHorizontal); ac++;
-    }
+  XtSetArg (av [ac], XtNorientation,
+	    vertical ? XtorientVertical : XtorientHorizontal); ac++;
+  XtSetArg (av [ac], "jumpProc",   jumpCallbacks);   ac++;
+  XtSetArg (av [ac], "scrollProc", scrollCallbacks); ac++;
 
-  scrollbar =
-    XtCreateWidget (instance->info->name, scrollbarWidgetClass,
-		    instance->parent, av, ac);
-
-  XtRemoveAllCallbacks (scrollbar, "jumpProc");
-  XtRemoveAllCallbacks (scrollbar, "scrollProc");
-
-  XtAddCallback (scrollbar, "jumpProc", xaw_scrollbar_jump,
-		 (XtPointer) instance);
-  XtAddCallback (scrollbar, "scrollProc", xaw_scrollbar_scroll,
-		 (XtPointer) instance);
-
-  return scrollbar;
+  return XtCreateWidget (instance->info->name, scrollbarWidgetClass,
+			 instance->parent, av, ac);
 }
 
 static Widget