http://ftp.x.org/contrib/applications/xscreensaver-2.34.tar.gz
[xscreensaver] / driver / dialogs-Xaw.c
index 179381368744020672add8f2a0dad31de5e2086b..5b652b11e86a9afd75001c71c4b33f73ac0d441d 100644 (file)
@@ -1,5 +1,5 @@
 /* dialogs-Xaw.c --- Athena widgets for demo, options, and password dialogs.
- * xscreensaver, Copyright (c) 1997 Jamie Zawinski <jwz@netscape.com>
+ * xscreensaver, Copyright (c) 1997, 1998 Jamie Zawinski <jwz@jwz.org>
  *
  * Permission to use, copy, modify, distribute, and sell this software and its
  * documentation for any purpose is hereby granted without fee, provided that
 #include <X11/Xaw/Toggle.h>
 #include <X11/Xaw/Viewport.h>
 #include <X11/Xaw/Dialog.h>
+#include <X11/Xaw/AsciiText.h>
 
 #include <stdio.h>
 
 #include "visual.h"    /* for visual_depth() */
 
-Widget passwd_dialog;
-Widget passwd_form;
-Widget roger_label;
-Widget passwd_label1;
-Widget passwd_label3;
-/*Widget passwd_text;*/
-/*Widget passwd_done;*/
-/*Widget passwd_cancel;*/
-
 Widget resources_dialog;
 Widget resources_form;
 Widget timeout_text;
@@ -72,67 +64,9 @@ Widget done;
 Widget restart;
 /*Widget spacer;*/
 
-
 static Widget buttonbox, textbox, okbox;
 
 
-void
-create_passwd_dialog(Widget parent, Visual *visual, Colormap colormap)
-{
-  Widget box, passwd_label2;
-  int depth = visual_depth(XtScreen(parent), visual);
-
-  passwd_dialog = 
-    XtVaCreatePopupShell("passwd_dialog", transientShellWidgetClass, parent,
-                        XtNtitle, NULL,
-                        XtNoverrideRedirect, TRUE,
-                        XtNvisual, visual,
-                        XtNcolormap, colormap,
-                        XtNdepth, depth,
-                        NULL);
-
-  box = XtVaCreateManagedWidget("box", formWidgetClass, passwd_dialog,
-                           XtNleft, XtChainLeft,
-                           XtNright, XtChainRight,
-                           XtNtop, XtChainTop,
-                           XtNbottom, XtChainBottom,
-                        XtNvisual, visual,
-                        XtNcolormap, colormap,
-                        XtNdepth, depth,
-                           NULL);
-
-  roger_label = XtVaCreateManagedWidget("roger", labelWidgetClass, box,
-                                       XtNlabel, "",
-                                       XtNleft, XtChainLeft,
-                                       XtNright, XtChainRight,
-                                       XtNtop, XtChainTop,
-                                       NULL);
-
-  passwd_label1 = XtVaCreateManagedWidget("label1", labelWidgetClass, box,
-                                         XtNfromHoriz, roger_label,
-                                         XtNright, XtChainRight,
-                                         XtNtop, XtChainTop,
-                                         NULL);
-  passwd_label2 = XtVaCreateManagedWidget("label2", labelWidgetClass, box,
-                                         XtNfromHoriz, roger_label,
-                                         XtNright, XtChainRight,
-                                         XtNfromVert, passwd_label1,
-                                         NULL);
-  passwd_label3 = XtVaCreateManagedWidget("label3", labelWidgetClass, box,
-                                         XtNfromHoriz, roger_label,
-                                         XtNright, XtChainRight,
-                                         XtNfromVert, passwd_label2,
-                                         NULL);
-  
-  passwd_form =
-    XtVaCreateManagedWidget("passwd_form", dialogWidgetClass, box,
-                           XtNfromHoriz, roger_label,
-                           XtNright, XtChainRight,
-                           XtNfromVert, passwd_label3,
-                           NULL);
-}
-
-
 void
 create_resources_dialog(Widget parent, Visual *visual, Colormap colormap)
 {
@@ -278,33 +212,45 @@ create_demo_dialog(Widget parent, Visual *visual, Colormap colormap)
                            XtNfromVert, label1,
                            NULL);
 
-  subform=
+  subform =
     XtVaCreateManagedWidget("subform", formWidgetClass, demo_form,
                            XtNleft, XtChainLeft,
                            XtNright, XtChainRight,
                            XtNfromVert, label2,
-                           XtNbottom, XtChainBottom,
                            NULL);
-  viewport=
+  viewport =
     XtVaCreateManagedWidget("viewport", viewportWidgetClass, subform,
+                           XtNtop, XtChainTop,
+                           XtNleft, XtChainLeft,
+                           XtNright, XtChainRight,
                            XtNallowVert, TRUE,
                            XtNallowHoriz, TRUE,
                            XtNforceBars, TRUE,
                            NULL);
 
   demo_list = XtVaCreateManagedWidget("demo_list", listWidgetClass, viewport,
-                                   XtNverticalList, TRUE,
-                                   XtNdefaultColumns, 1,
-                                   NULL);
-  box=
+                                     XtNverticalList, TRUE,
+                                     XtNdefaultColumns, 1,
+                                     NULL);
+
+  text_line = XtVaCreateManagedWidget("text", asciiTextWidgetClass, subform,
+                                     XtNleft, XtChainLeft,
+                                     XtNright, XtChainRight,
+                                     XtNfromVert, viewport,
+                                     XtNbottom, XtChainBottom,
+                                     XtNeditType, XawtextEdit,
+                                     NULL);
+
+  box =
     XtVaCreateManagedWidget("box", boxWidgetClass, demo_form,
-                           XtNfromHoriz, subform,
-                           XtNfromVert, label2,
+                           XtNleft, XtChainLeft,
+                           XtNfromVert, subform,
                            XtNbottom, XtChainBottom,
                            XtNright, XtChainRight,
+                           XtNorientation, XtEhorizontal,
                            NULL);
-  prev = XtVaCreateManagedWidget("prev", commandWidgetClass, box, NULL);
   next = XtVaCreateManagedWidget("next", commandWidgetClass, box, NULL);
+  prev = XtVaCreateManagedWidget("prev", commandWidgetClass, box, NULL);
   edit = XtVaCreateManagedWidget("edit", commandWidgetClass, box, NULL);
   restart = XtVaCreateManagedWidget("restart", commandWidgetClass, box, NULL);
   done = XtVaCreateManagedWidget("done", commandWidgetClass, box, NULL);