X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=driver%2Fdialogs-Xaw.c;h=757a91eb2e4fbbe89041542197de4c6e3529d204;hb=cf665b135b41d4f42067f9d9a8111c9602777cc1;hp=1555544bb10a44d9b3ad201d165cd6572762beae;hpb=481b95e2617b69e6fd4444432747d7e1e0c3dc85;p=xscreensaver diff --git a/driver/dialogs-Xaw.c b/driver/dialogs-Xaw.c index 1555544b..757a91eb 100644 --- a/driver/dialogs-Xaw.c +++ b/driver/dialogs-Xaw.c @@ -1,5 +1,5 @@ /* dialogs-Xaw.c --- Athena widgets for demo, options, and password dialogs. - * xscreensaver, Copyright (c) 1997 Jamie Zawinski + * xscreensaver, Copyright (c) 1997, 1998 Jamie Zawinski * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -33,30 +33,21 @@ #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 preferences_dialog; +Widget preferences_form; Widget timeout_text; Widget cycle_text; Widget fade_text; -Widget ticks_text; -Widget lock_time_text; -Widget passwd_time_text; +Widget fade_ticks_text; +Widget lock_timeout_text; +Widget passwd_timeout_text; Widget verbose_toggle; -Widget cmap_toggle; +Widget install_cmap_toggle; Widget fade_toggle; Widget unfade_toggle; Widget lock_toggle; -Widget res_done; -Widget res_cancel; +Widget prefs_done; +Widget prefs_cancel; Widget demo_dialog; Widget demo_form; @@ -73,103 +64,43 @@ 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) +create_preferences_dialog(Widget parent, Visual *visual, Colormap colormap) { Widget rlabel; int depth = visual_depth(XtScreen(parent), visual); - resources_dialog = - XtVaCreatePopupShell("resources_dialog", transientShellWidgetClass, parent, - XtNtitle, NULL, - XtNoverrideRedirect, TRUE, + preferences_dialog = + XtVaCreatePopupShell("preferences_dialog", transientShellWidgetClass, parent, XtNvisual, visual, XtNcolormap, colormap, XtNdepth, depth, NULL); - resources_form = - XtVaCreateManagedWidget("resources_form", formWidgetClass, - resources_dialog, + preferences_form = + XtVaCreateManagedWidget("preferences_form", formWidgetClass, + preferences_dialog, XtNvisual, visual, XtNcolormap, colormap, XtNdepth, depth, NULL); - rlabel = XtVaCreateManagedWidget("label1", labelWidgetClass, resources_form, + rlabel = XtVaCreateManagedWidget("label1", labelWidgetClass, preferences_form, XtNleft, XtChainLeft, XtNright, XtChainRight, XtNtop, XtChainTop, NULL); textbox= - XtVaCreateManagedWidget("textbox", formWidgetClass, resources_form, + XtVaCreateManagedWidget("textbox", formWidgetClass, preferences_form, XtNleft, XtChainLeft, XtNfromVert, rlabel, NULL); okbox= - XtVaCreateManagedWidget("textbox", boxWidgetClass, resources_form, + XtVaCreateManagedWidget("textbox", boxWidgetClass, preferences_form, XtNleft, XtChainLeft, XtNright, XtChainRight, XtNfromVert, textbox, @@ -194,29 +125,29 @@ create_resources_dialog(Widget parent, Visual *visual, Colormap colormap) XtNfromVert, cycle_text, NULL); - ticks_text = + fade_ticks_text = XtVaCreateManagedWidget("ticks", dialogWidgetClass, textbox, XtNtop, XtChainTop, XtNright, XtChainRight, XtNfromHoriz, timeout_text, NULL); - lock_time_text = + lock_timeout_text = XtVaCreateManagedWidget("lockTime", dialogWidgetClass, textbox, - XtNfromVert, ticks_text, + XtNfromVert, fade_ticks_text, XtNright, XtChainRight, XtNfromHoriz, cycle_text, NULL); - passwd_time_text = + passwd_timeout_text = XtVaCreateManagedWidget("passwdTime", dialogWidgetClass, textbox, - XtNfromVert, lock_time_text, + XtNfromVert, lock_timeout_text, XtNright, XtChainRight, XtNfromHoriz, fade_text, NULL); buttonbox= - XtVaCreateManagedWidget("buttonbox", boxWidgetClass, resources_form, + XtVaCreateManagedWidget("buttonbox", boxWidgetClass, preferences_form, XtNfromVert, rlabel, XtNfromHoriz, textbox, XtNright, XtChainRight, @@ -225,7 +156,7 @@ create_resources_dialog(Widget parent, Visual *visual, Colormap colormap) verbose_toggle = XtVaCreateManagedWidget("verbose", toggleWidgetClass, buttonbox, NULL); - cmap_toggle = + install_cmap_toggle = XtVaCreateManagedWidget("cmap", toggleWidgetClass, buttonbox, NULL); fade_toggle = @@ -239,9 +170,9 @@ create_resources_dialog(Widget parent, Visual *visual, Colormap colormap) NULL); - res_done = XtVaCreateManagedWidget("done", commandWidgetClass, okbox, + prefs_done = XtVaCreateManagedWidget("done", commandWidgetClass, okbox, NULL); - res_cancel = XtVaCreateManagedWidget("cancel", commandWidgetClass, okbox, + prefs_cancel = XtVaCreateManagedWidget("cancel", commandWidgetClass, okbox, NULL); } @@ -253,8 +184,6 @@ create_demo_dialog(Widget parent, Visual *visual, Colormap colormap) demo_dialog = XtVaCreatePopupShell("demo_dialog", transientShellWidgetClass, parent, - XtNtitle, NULL, - XtNoverrideRedirect, TRUE, XtNvisual, visual, XtNcolormap, colormap, XtNdepth, depth, @@ -262,9 +191,12 @@ create_demo_dialog(Widget parent, Visual *visual, Colormap colormap) demo_form = XtVaCreateManagedWidget("demo_form", formWidgetClass, demo_dialog, - XtNvisual, visual, - XtNcolormap, colormap, - XtNdepth, depth, + XtNvisual, visual, + XtNcolormap, colormap, + XtNdepth, depth, + XtNleft, XtChainLeft, + XtNright, XtChainRight, + XtNtop, XtChainTop, NULL); label1 = XtVaCreateManagedWidget("label1", labelWidgetClass, demo_form, @@ -284,6 +216,7 @@ create_demo_dialog(Widget parent, Visual *visual, Colormap colormap) XtNleft, XtChainLeft, XtNright, XtChainRight, XtNfromVert, label2, + XtNresizable, True, NULL); viewport = XtVaCreateManagedWidget("viewport", viewportWidgetClass, subform, @@ -319,6 +252,8 @@ create_demo_dialog(Widget parent, Visual *visual, Colormap colormap) next = XtVaCreateManagedWidget("next", commandWidgetClass, box, NULL); prev = XtVaCreateManagedWidget("prev", commandWidgetClass, box, NULL); edit = XtVaCreateManagedWidget("edit", commandWidgetClass, box, NULL); +#if 0 restart = XtVaCreateManagedWidget("restart", commandWidgetClass, box, NULL); +#endif done = XtVaCreateManagedWidget("done", commandWidgetClass, box, NULL); }