4 * Loading, saving, alteration and setting of preferences
6 * © 1994-1998 Straylight
9 /*----- Licensing note ----------------------------------------------------*
11 * This file is part of Straylight's Glass.
13 * Glass is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 2, or (at your option)
18 * Glass is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
23 * You should have received a copy of the GNU General Public License
24 * along with Glass. If not, write to the Free Software Foundation,
25 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
28 /*----- Header files ------------------------------------------------------*/
31 * ANSI standard headers
39 #include "steel/Steel.h"
41 #include "steel/prefs.h"
42 #include "steel/pane.h"
43 #include "steel/blinkC.h"
44 #include "steel/buttons.h"
45 #include "steel/akbd.h"
57 #include "colSelect.h"
60 /*----- Macros ------------------------------------------------------------*/
62 #define gPrefs__DEFAULTTIME 5
63 #define gPrefs__DEFAULTCOUNT 50
65 /*----- Static global variables -------------------------------------------*/
67 static gPrefs_prefs gPrefs__current=
69 gPrefs_MINUTES, /* Autosave_TimeUnits */
70 10, /* Autosave_Time */
71 0, /* Autosave_Alterations */
72 TRUE, /* Autosave_Prompt */
74 TRUE, /* Interface_DisplayBorders */
75 TRUE, /* Interface_SlabIcons */
76 TRUE, /* Interface_DragboxAroundBorder*/
77 FALSE, /* Interface_SlabMenu */
79 TRUE, /* WimpExt_DisplayBorders */
80 TRUE, /* WimpExt_KeyPress */
81 TRUE, /* WimpExt_DragboxAroundBorder */
83 TRUE, /* Sculptrix_DisplayBorders */
84 TRUE, /* Sculptrix_SlabIcons */
85 TRUE, /* Sculptrix_DragboxAroundBorder*/
86 FALSE, /* Sculptrix_SlabMenu */
88 TRUE, /* Sprites_LoadSprites */
89 TRUE, /* Sprites_Load!Sprites */
90 TRUE, /* Sprites_LoadDefaults */
92 gPrefs_SMALL, /* Files_IconSize */
93 gPrefs_NAME, /* Files_SortBy */
95 FALSE, /* Grid_Display */
96 FALSE, /* Grid_Lock */
99 FALSE, /* Grid_DrawLines */
100 8, /* Grid_GridColour */
101 14, /* Grid_GuideColour */
102 13, /* Grid_SelectedGuideColour */
104 TRUE, /* Select_DrawBorder */
105 TRUE, /* Select_DottedBorder */
106 3, /* Select_BorderColour */
107 TRUE, /* Select_EdgeHandles */
108 4, /* Select_HandleSize */
109 7, /* Select_HandleColour */
110 11, /* Select_SpecialColour */
112 TRUE, /* Confirm_Quit */
113 TRUE, /* Confirm_Close */
114 TRUE, /* Confirm_DelWind */
115 FALSE, /* Confirm_DelIcon */
116 FALSE, /* Confirm_TestCloseEdit */
117 TRUE, /* Confirm_Overwrite */
119 TRUE, /* Toolbar_Display */
120 FALSE, /* Toolbar_Floating */
121 {0,0}, /* Toolbar_Position */
122 TRUE, /* Toolbar_OnLeft */
124 TRUE, /* Infobar_Display */
125 FALSE, /* Infobar_Floating */
126 {0,0}, /* Infobar_Position */
127 TRUE, /* Infobar_Underneath */
129 FALSE, /* Misc_DrawHatch */
130 TRUE, /* Misc_BlinkCursor */
131 TRUE, /* Misc_VisibleInWork */
132 TRUE, /* Misc_CreateOnTop */
133 TRUE, /* Misc_RenumberOnDelete */
134 FALSE, /* Misc_ControlToEdit */
137 static gPrefs_prefs gPrefs__new;
138 static dbox gPrefs__dbox;
139 static pane gPrefs__pane;
140 static dbox gPrefs__panel;
141 static dbox_field gPrefs__currentPanel;
143 /*----- Interpreters for new preferences data types -----------------------*/
145 static char *gPrefs__readUnit(char *tag,char *args,void *handle);
146 static char *gPrefs__writeUnit(char *tag,FILE *fp,void *handle);
147 static char *gPrefs__readIconSize(char *tag,char *args,void *handle);
148 static char *gPrefs__writeIconSize(char *tag,FILE *fp,void *handle);
149 static char *gPrefs__readSort(char *tag,char *args,void *handle);
150 static char *gPrefs__writeSort(char *tag,FILE *fp,void *handle);
151 static char *gPrefs__readCoords(char *tag,char *args,void *handle);
152 static char *gPrefs__writeCoords(char *tag,FILE *fp,void *handle);
154 /*----- Preferences file description --------------------------------------*/
156 static prefs_prefstr gPrefs__prefs[]=
159 "; Glass preferences\n"
166 "Autosave_TimeUnits",
169 &gPrefs__current.aUnit,
173 &gPrefs__current.aTime,
174 "Autosave_Alterations",
177 &gPrefs__current.aAlts,
181 &gPrefs__current.aPrompt,
187 "Interface_DisplayBorders",
190 &gPrefs__current.iDispBorders,
191 "Interface_SlabIcons",
194 &gPrefs__current.iSlabIcons,
195 "Interface_DragboxAroundBorder",
198 &gPrefs__current.iIncBorder,
199 "Interface_SlabOnMenu",
202 &gPrefs__current.iSlabMenu,
208 "WimpExtension_DisplayBorders",
211 &gPrefs__current.wDispBorders,
212 "WimpExtension_KeyPress",
215 &gPrefs__current.wKeyPress,
216 "WimpExtension_DragboxAroundBorder",
219 &gPrefs__current.wIncBorder,
225 "Sculptrix_DisplayBorders",
228 &gPrefs__current.sDispBorders,
229 "Sculptrix_SlabIcons",
232 &gPrefs__current.sSlabIcons,
233 "Sculptrix_DragboxAroundBorder",
236 &gPrefs__current.sIncBorder,
237 "Sculptrix_SlabOnMenu",
240 &gPrefs__current.sSlabMenu,
246 "Sprites_LoadSprites",
249 &gPrefs__current.sLoadSpr,
250 "Sprites_Load!Sprites",
253 &gPrefs__current.sLoadPSpr,
254 "Sprites_LoadDefaults",
257 &gPrefs__current.sLoadDef,
264 gPrefs__readIconSize,
265 gPrefs__writeIconSize,
266 &gPrefs__current.fIcons,
270 &gPrefs__current.fSort,
279 &gPrefs__current.gDisp,
283 &gPrefs__current.gLock,
287 &gPrefs__current.gWidth,
291 &gPrefs__current.gHeight,
295 &gPrefs__current.gLines,
299 &gPrefs__current.gGridCol,
303 &gPrefs__current.gGdeCol,
304 "Grid_SelectedGuideColour",
307 &gPrefs__current.gGdeSelCol,
316 &gPrefs__current.sBorder,
317 "Select_DottedBorder",
320 &gPrefs__current.sDotted,
321 "Select_BorderColour",
324 &gPrefs__current.sBColour,
325 "Select_EdgeHandles",
328 &gPrefs__current.sEdgeHandles,
332 &gPrefs__current.sHandSize,
333 "Select_HandleColour",
336 &gPrefs__current.sHColour,
337 "Select_SpecialColour",
340 &gPrefs__current.sSColour,
349 &gPrefs__current.cQuit,
353 &gPrefs__current.cClose,
357 &gPrefs__current.cDelWind,
361 &gPrefs__current.cDelIcon,
362 "Confirm_TestCloseEdit",
365 &gPrefs__current.cTest,
369 &gPrefs__current.cSave,
378 &gPrefs__current.tDisplay,
382 &gPrefs__current.tFloating,
386 &gPrefs__current.tPosn,
390 &gPrefs__current.tLeft,
399 &gPrefs__current.iDisplay,
403 &gPrefs__current.iFloating,
407 &gPrefs__current.iPosn,
408 "Infobar_Underneath",
411 &gPrefs__current.iUnder,
420 &gPrefs__current.mDrawHatch,
424 &gPrefs__current.mBlink,
425 "Misc_VisibleInWork",
428 &gPrefs__current.mVisInWork,
432 &gPrefs__current.mCreateTop,
433 "Misc_RenumberOnDelete",
436 &gPrefs__current.mDeleteRenum,
437 "Misc_ControlToEdit",
440 &gPrefs__current.mCtrlEdit,
447 /*----- Miscelaneous tables -----------------------------------------------*/
449 static char *gPrefs__panels[]=
462 static char *gPrefs__units[]=
470 /*----- Support routines --------------------------------------------------*/
472 #define max2(a,b) ((a)>(b) ? (a) : (b))
473 #define min2(a,b) ((a)<(b) ? (a) : (b))
476 * char *gPrefs__readUnit(char *tag,char *args,void *handle)
479 * Interprets a time unit variable in preferences file.
482 * char *tag == the name of the tag to interpret
483 * char *args == pointer to args string to interpret
484 * void *handle == pointer to approriately typed variable
487 * 0 for success, or pointer to an error string.
490 static char *gPrefs__readUnit(char *tag,char *args,void *handle)
493 if (utils_caselessCmp(args,"hours")==0)
494 *(gPrefs_autoUnits *)handle=gPrefs_HOURS;
495 else if (utils_caselessCmp(args,"minutes")==0)
496 *(gPrefs_autoUnits *)handle=gPrefs_MINUTES;
497 else if (utils_caselessCmp(args,"seconds")==0)
498 *(gPrefs_autoUnits *)handle=gPrefs_SECONDS;
501 return (msgs_lookup("prBTU"));
507 * char *gPrefs__writeUnit(char *tag,FILE *fp,void *handle)
510 * Writes a time unit variable to preferences file.
513 * char *tag == the name of the tag to interpret
514 * FILE *fp == the file handle for the file
515 * void *handle == pointer to approriately typed variable
518 * 0 for success, or pointer to an error string.
521 static char *gPrefs__writeUnit(char *tag,FILE *fp,void *handle)
523 static char *units[]={0,"hours","minutes","seconds"};
524 fprintf(fp,"%s=%s\n",tag,units[*(gPrefs_autoUnits *)handle]);
529 * char *gPrefs__readIconSize(char *tag,char *args,void *handle)
532 * Interprets an icon size variable in preferences file.
535 * char *tag == the name of the tag to interpret
536 * char *args == pointer to args string to interpret
537 * void *handle == pointer to approriately typed variable
540 * 0 for success, or pointer to an error string.
543 static char *gPrefs__readIconSize(char *tag,char *args,void *handle)
546 if (utils_caselessCmp(args,"large")==0)
547 *(gPrefs_iconSize *)handle=gPrefs_LARGE;
548 else if (utils_caselessCmp(args,"small")==0)
549 *(gPrefs_iconSize *)handle=gPrefs_SMALL;
552 return (msgs_lookup("prBIS"));
558 * char *gPrefs__writeIconSize(char *tag,FILE *fp,void *handle)
561 * Writes an icon size variable to preferences file.
564 * char *tag == the name of the tag to interpret
565 * FILE *fp == the file handle for the file
566 * void *handle == pointer to approriately typed variable
569 * 0 for success, or pointer to an error string.
572 static char *gPrefs__writeIconSize(char *tag,FILE *fp,void *handle)
574 static char *units[]={0,"large","small"};
575 fprintf(fp,"%s=%s\n",tag,units[*(gPrefs_iconSize *)handle]);
580 * char *gPrefs__readSort(char *tag,char *args,void *handle)
583 * Interprets a sort type variable in preferences file.
586 * char *tag == the name of the tag to interpret
587 * char *args == pointer to args string to interpret
588 * void *handle == pointer to approriately typed variable
591 * 0 for success, or pointer to an error string.
594 static char *gPrefs__readSort(char *tag,char *args,void *handle)
597 if (utils_caselessCmp(args,"name")==0)
598 *(gPrefs_sortType *)handle=gPrefs_NAME;
599 else if (utils_caselessCmp(args,"size")==0)
600 *(gPrefs_sortType *)handle=gPrefs_SIZE;
601 else if (utils_caselessCmp(args,"icons")==0)
602 *(gPrefs_sortType *)handle=gPrefs_ICONS;
603 else if (utils_caselessCmp(args,"noSort")==0)
604 *(gPrefs_sortType *)handle=gPrefs_NOSORT;
607 return (msgs_lookup("prBST"));
613 * char *gPrefs__writeSort(char *tag,FILE *fp,void *handle)
616 * Writes a sort type variable to preferences file.
619 * char *tag == the name of the tag to interpret
620 * FILE *fp == the file handle for the file
621 * void *handle == pointer to approriately typed variable
624 * 0 for success, or pointer to an error string.
627 static char *gPrefs__writeSort(char *tag,FILE *fp,void *handle)
629 static char *units[]={0,"name","size","icons","noSort"};
630 fprintf(fp,"%s %s\n",tag,units[*(gPrefs_sortType *)handle]);
635 * char *gPrefs__readCoords(char *tag,char *args,void *handle)
638 * Interprets a coordinates type variable in preferences file.
641 * char *tag == the name of the tag to interpret
642 * char *args == pointer to args string to interpret
643 * void *handle == pointer to approriately typed variable
646 * 0 for success, or pointer to an error string.
649 static char *gPrefs__readCoords(char *tag,char *args,void *handle)
651 gPrefs_coords *c=handle;
653 sscanf(args,"%d,%d",&c->x,&c->y);
658 * char *gPrefs__writeCoords(char *tag,FILE *fp,void *handle)
661 * Writes a sort type variable to preferences file.
664 * char *tag == the name of the tag to interpret
665 * FILE *fp == the file handle for the file
666 * void *handle == pointer to approriately typed variable
669 * 0 for success, or pointer to an error string.
672 static char *gPrefs__writeCoords(char *tag,FILE *fp,void *handle)
674 gPrefs_coords *c=handle;
675 fprintf(fp,"%s=%i,%i\n",tag,c->x,c->y);
680 * void gPrefs__setupPanel(void)
683 * Reads the settings in a panel before it is closed.
686 static void gPrefs__setupPanel(void)
688 dbox d=gPrefs__panel;
689 switch (gPrefs__currentPanel)
691 case glass_PMAUTOSAVE:
692 if (gPrefs__new.aTime)
694 dbox_selecticon(d,glass_PATIMED,dbox_SETSTATE);
695 dbox_shadeicon(d,glass_PATIMEDOWN,dbox_RESETSTATE);
696 dbox_shadeicon(d,glass_PATIMEWRITE,dbox_RESETSTATE);
697 dbox_shadeicon(d,glass_PATIMEUP,dbox_RESETSTATE);
698 dbox_shadeicon(d,glass_PAUNITSDISP,dbox_RESETSTATE);
699 dbox_shadeicon(d,glass_PAUNITSMENU,dbox_RESETSTATE);
700 dbox_setfield(d,glass_PATIMEWRITE,"%i",gPrefs__new.aTime);
704 dbox_selecticon(d,glass_PATIMED,dbox_RESETSTATE);
705 dbox_shadeicon(d,glass_PATIMEDOWN,dbox_SETSTATE);
706 dbox_shadeicon(d,glass_PATIMEWRITE,dbox_SETSTATE);
707 dbox_shadeicon(d,glass_PATIMEUP,dbox_SETSTATE);
708 dbox_shadeicon(d,glass_PAUNITSDISP,dbox_SETSTATE);
709 dbox_shadeicon(d,glass_PAUNITSMENU,dbox_SETSTATE);
710 dbox_setfield(d,glass_PATIMEWRITE,"%i",gPrefs__DEFAULTTIME);
712 dbox_setfield(d,glass_PAUNITSDISP,"%s",
713 msgs_lookup(gPrefs__units[gPrefs__new.aUnit]));
714 if (gPrefs__new.aAlts)
716 dbox_selecticon(d,glass_PACOUNTED,dbox_SETSTATE);
717 dbox_shadeicon(d,glass_PACOUNTDOWN,dbox_RESETSTATE);
718 dbox_shadeicon(d,glass_PACOUNTWRITE,dbox_RESETSTATE);
719 dbox_shadeicon(d,glass_PACOUNTUP,dbox_RESETSTATE);
720 dbox_setfield(d,glass_PACOUNTWRITE,"%i",gPrefs__new.aAlts);
724 dbox_selecticon(d,glass_PACOUNTED,dbox_RESETSTATE);
725 dbox_shadeicon(d,glass_PACOUNTDOWN,dbox_SETSTATE);
726 dbox_shadeicon(d,glass_PACOUNTWRITE,dbox_SETSTATE);
727 dbox_shadeicon(d,glass_PACOUNTUP,dbox_SETSTATE);
728 dbox_setfield(d,glass_PACOUNTWRITE,"%i",gPrefs__DEFAULTCOUNT);
730 dbox_selecticon(d,glass_PAPROMPT,gPrefs__new.aPrompt);
732 case glass_PMINTERFACE:
733 dbox_selecticon(d,glass_PIDISPBORDER,gPrefs__new.iDispBorders);
734 dbox_selecticon(d,glass_PIMOUSECLICK,gPrefs__new.iSlabIcons);
735 dbox_selecticon(d,glass_PIMENUCLICK,gPrefs__new.iSlabMenu);
736 dbox_shadeicon(d,glass_PIMENUCLICK,!gPrefs__new.iSlabIcons);
737 dbox_selecticon(d,glass_PIINCBORDER,gPrefs__new.iIncBorder);
739 dbox_selecticon(d,glass_PWDISPBORDER,gPrefs__new.wDispBorders);
740 dbox_selecticon(d,glass_PWKEYPRESS,gPrefs__new.wKeyPress);
741 dbox_selecticon(d,glass_PWINCBORDER,gPrefs__new.wIncBorder);
743 dbox_selecticon(d,glass_PSDISPBORDER,gPrefs__new.sDispBorders);
744 dbox_selecticon(d,glass_PSMOUSECLICK,gPrefs__new.sSlabIcons);
745 dbox_selecticon(d,glass_PSMENUCLICK,gPrefs__new.sSlabMenu);
746 dbox_shadeicon(d,glass_PSMENUCLICK,!gPrefs__new.sSlabIcons);
747 dbox_selecticon(d,glass_PSINCBORDER,gPrefs__new.sIncBorder);
750 case glass_PMSPRITES:
751 dbox_selecticon(d,glass_PSSPRITES,gPrefs__new.sLoadSpr);
752 dbox_selecticon(d,glass_PSPSPRITES,gPrefs__new.sLoadPSpr);
753 dbox_selecticon(d,glass_PSDEFAULTS,gPrefs__new.sLoadDef);
755 case glass_PMFILEDISP:
756 dbox_selecticon(d,glass_PFLARGE,gPrefs__new.fIcons==gPrefs_LARGE);
757 dbox_selecticon(d,glass_PFSMALL,gPrefs__new.fIcons==gPrefs_SMALL);
758 dbox_selecticon(d,glass_PFNAME,gPrefs__new.fSort==gPrefs_NAME);
759 dbox_selecticon(d,glass_PFSIZE,gPrefs__new.fSort==gPrefs_SIZE);
760 dbox_selecticon(d,glass_PFICONS,gPrefs__new.fSort==gPrefs_ICONS);
761 dbox_selecticon(d,glass_PFNOSORT,gPrefs__new.fSort==gPrefs_NOSORT);
764 dbox_selecticon(d,glass_PGDISP,gPrefs__new.gDisp);
765 dbox_selecticon(d,glass_PGLOCK,gPrefs__new.gLock);
766 dbox_setfield(d,glass_PGWWRITE,"%i",gPrefs__new.gWidth);
767 dbox_setfield(d,glass_PGHWRITE,"%i",gPrefs__new.gHeight);
768 dbox_selecticon(d,glass_PGLINES,gPrefs__new.gLines);
769 dbox_selecticon(d,glass_PGPOINTS,!gPrefs__new.gLines);
770 colSelect_setColourButton(d,glass_PGGRIDCOL,gPrefs__new.gGridCol);
771 colSelect_setColourButton(d,glass_PGGUIDECOL,gPrefs__new.gGdeCol);
772 colSelect_setColourButton(d,
774 gPrefs__new.gGdeSelCol);
776 case glass_PMSELECTION:
777 dbox_selecticon(d,glass_PSBORDER,gPrefs__new.sBorder);
778 dbox_shadeicon(d,glass_PSDOTTED,!gPrefs__new.sBorder);
779 dbox_shadeicon(d,glass_PSBCOLLABEL,!gPrefs__new.sBorder);
780 dbox_shadeicon(d,glass_PSBCOLOUR,!gPrefs__new.sBorder);
781 dbox_selecticon(d,glass_PSDOTTED,gPrefs__new.sDotted);
782 colSelect_setColourButton(d,glass_PSBCOLOUR,gPrefs__new.sBColour);
783 dbox_selecticon(d,glass_PSCORNEDGE,gPrefs__new.sEdgeHandles);
784 dbox_selecticon(d,glass_PSCORNONLY,!gPrefs__new.sEdgeHandles);
785 dbox_setfield(d,glass_PSSIZEWRITE,"%i",gPrefs__new.sHandSize);
786 colSelect_setColourButton(d,glass_PSHCOLOUR,gPrefs__new.sHColour);
787 colSelect_setColourButton(d,glass_PSSCOLOUR,gPrefs__new.sSColour);
789 case glass_PMCONFIRM:
790 dbox_selecticon(d,glass_PCQUIT,gPrefs__new.cQuit);
791 dbox_selecticon(d,glass_PCCLOSE,gPrefs__new.cClose);
792 dbox_selecticon(d,glass_PCDELWIN,gPrefs__new.cDelWind);
793 dbox_selecticon(d,glass_PCDELICON,gPrefs__new.cDelIcon);
794 dbox_selecticon(d,glass_PCTEST,gPrefs__new.cTest);
795 dbox_selecticon(d,glass_PCOVERWRITE,gPrefs__new.cSave);
797 case glass_PMTOOLINFO:
798 if (gPrefs__new.tDisplay)
800 dbox_selecticon(d,glass_PTTOOLDISP,dbox_SETSTATE);
801 dbox_shadeicon(d,glass_PTTOOLFLOAT,dbox_RESETSTATE);
805 dbox_selecticon(d,glass_PTTOOLDISP,dbox_RESETSTATE);
806 dbox_shadeicon(d,glass_PTTOOLFLOAT,dbox_SETSTATE);
808 dbox_selecticon(d,glass_PTTOOLFLOAT,gPrefs__new.tFloating);
809 if (gPrefs__new.iDisplay)
811 dbox_selecticon(d,glass_PTINFODISP,dbox_SETSTATE);
812 dbox_shadeicon(d,glass_PTINFOFLOAT,dbox_RESETSTATE);
816 dbox_selecticon(d,glass_PTINFODISP,dbox_RESETSTATE);
817 dbox_shadeicon(d,glass_PTINFOFLOAT,dbox_SETSTATE);
819 dbox_selecticon(d,glass_PTINFOFLOAT,gPrefs__new.iFloating);
822 dbox_selecticon(d,glass_PMHATCH,gPrefs__new.mDrawHatch);
823 dbox_selecticon(d,glass_PMBLINK,gPrefs__new.mBlink);
824 dbox_selecticon(d,glass_PMVISINWORK,gPrefs__new.mVisInWork);
825 dbox_selecticon(d,glass_PMNEWONTOP,gPrefs__new.mCreateTop);
826 dbox_selecticon(d,glass_PMRENDEL,gPrefs__new.mDeleteRenum);
827 dbox_selecticon(d,glass_PMCTRLEDIT,gPrefs__new.mCtrlEdit);
833 * void gPrefs__closePanel(void)
836 * Reads the settings in a panel before it is closed.
839 #define Q dbox_READSTATE
841 static void gPrefs__closePanel(void)
843 dbox d=gPrefs__panel;
844 switch (gPrefs__currentPanel)
846 case glass_PMAUTOSAVE:
847 if (dbox_selecticon(d,glass_PATIMED,Q))
849 dbox_scanfield(d,glass_PATIMEWRITE,"%d",&gPrefs__new.aTime);
850 if (!gPrefs__new.aTime)
852 gPrefs__new.aTime=gPrefs__DEFAULTTIME;
853 dbox_setfield(d,glass_PATIMEWRITE,"%i",gPrefs__new.aTime);
854 note(msgs_lookup("prSILT"),
855 gPrefs__DEFAULTTIME);
860 if (dbox_selecticon(d,glass_PACOUNTED,Q))
862 dbox_scanfield(d,glass_PACOUNTWRITE,"%d",&gPrefs__new.aAlts);
863 if (!gPrefs__new.aAlts)
865 gPrefs__new.aAlts=gPrefs__DEFAULTCOUNT;
866 dbox_setfield(d,glass_PACOUNTWRITE,"%i",gPrefs__new.aTime);
867 note(msgs_lookup("prSILC"),
868 gPrefs__DEFAULTCOUNT);
873 gPrefs__new.aPrompt=dbox_selecticon(d,glass_PAPROMPT,Q);
875 case glass_PMINTERFACE:
876 gPrefs__new.iDispBorders=dbox_selecticon(d,glass_PIDISPBORDER,Q);
877 gPrefs__new.iSlabIcons=dbox_selecticon(d,glass_PIMOUSECLICK,Q);
878 if (gPrefs__new.iSlabIcons)
879 gPrefs__new.iSlabMenu=dbox_selecticon(d,glass_PIMENUCLICK,Q);
881 gPrefs__new.iSlabMenu=FALSE;
882 gPrefs__new.iIncBorder=dbox_selecticon(d,glass_PIINCBORDER,Q);
884 gPrefs__new.wDispBorders=dbox_selecticon(d,glass_PWDISPBORDER,Q);
885 gPrefs__new.wKeyPress=dbox_selecticon(d,glass_PWKEYPRESS,Q);
886 gPrefs__new.wIncBorder=dbox_selecticon(d,glass_PWINCBORDER,Q);
888 gPrefs__new.sDispBorders=dbox_selecticon(d,glass_PSDISPBORDER,Q);
889 gPrefs__new.sSlabIcons=dbox_selecticon(d,glass_PSMOUSECLICK,Q);
890 if (gPrefs__new.sSlabIcons)
891 gPrefs__new.sSlabMenu=dbox_selecticon(d,glass_PSMENUCLICK,Q);
893 gPrefs__new.sSlabMenu=FALSE;
894 gPrefs__new.sIncBorder=dbox_selecticon(d,glass_PSINCBORDER,Q);
897 case glass_PMSPRITES:
898 gPrefs__new.sLoadSpr=dbox_selecticon(d,glass_PSSPRITES,Q);
899 gPrefs__new.sLoadPSpr=dbox_selecticon(d,glass_PSPSPRITES,Q);
900 gPrefs__new.sLoadDef=dbox_selecticon(d,glass_PSDEFAULTS,Q);
902 case glass_PMFILEDISP:
903 if (dbox_selecticon(d,glass_PFLARGE,Q))
904 gPrefs__new.fIcons=gPrefs_LARGE;
906 gPrefs__new.fIcons=gPrefs_SMALL;
907 if (dbox_selecticon(d,glass_PFNAME,Q))
908 gPrefs__new.fSort=gPrefs_NAME;
909 else if (dbox_selecticon(d,glass_PFSIZE,Q))
910 gPrefs__new.fSort=gPrefs_SIZE;
911 else if (dbox_selecticon(d,glass_PFICONS,Q))
912 gPrefs__new.fSort=gPrefs_ICONS;
914 gPrefs__new.fSort=gPrefs_NOSORT;
917 gPrefs__new.gDisp=dbox_selecticon(d,glass_PGDISP,Q);
918 gPrefs__new.gLock=dbox_selecticon(d,glass_PGLOCK,Q);
919 dbox_scanfield(d,glass_PGWWRITE,"%d",&gPrefs__new.gWidth);
920 dbox_scanfield(d,glass_PGHWRITE,"%d",&gPrefs__new.gHeight);
921 gPrefs__new.gLines=dbox_selecticon(d,glass_PGLINES,Q);
923 case glass_PMSELECTION:
924 gPrefs__new.sBorder=dbox_selecticon(d,glass_PSBORDER,Q);
925 gPrefs__new.sDotted=dbox_selecticon(d,glass_PSDOTTED,Q);
926 gPrefs__new.sEdgeHandles=dbox_selecticon(d,glass_PSCORNEDGE,Q);
927 dbox_scanfield(d,glass_PSSIZEWRITE,"%d",&gPrefs__new.sHandSize);
929 case glass_PMCONFIRM:
930 gPrefs__new.cQuit=dbox_selecticon(d,glass_PCQUIT,Q);
931 gPrefs__new.cClose=dbox_selecticon(d,glass_PCCLOSE,Q);
932 gPrefs__new.cDelWind=dbox_selecticon(d,glass_PCDELWIN,Q);
933 gPrefs__new.cDelIcon=dbox_selecticon(d,glass_PCDELICON,Q);
934 gPrefs__new.cTest=dbox_selecticon(d,glass_PCTEST,Q);
935 gPrefs__new.cSave=dbox_selecticon(d,glass_PCOVERWRITE,Q);
937 case glass_PMTOOLINFO:
938 gPrefs__new.tDisplay=dbox_selecticon(d,glass_PTTOOLDISP,Q);
939 gPrefs__new.tFloating=dbox_selecticon(d,glass_PTTOOLFLOAT,Q);
940 gPrefs__new.iDisplay=dbox_selecticon(d,glass_PTINFODISP,Q);
941 gPrefs__new.iFloating=dbox_selecticon(d,glass_PTINFOFLOAT,Q);
944 gPrefs__new.mDrawHatch=dbox_selecticon(d,glass_PMHATCH,Q);
945 gPrefs__new.mBlink=dbox_selecticon(d,glass_PMBLINK,Q);
946 gPrefs__new.mVisInWork=dbox_selecticon(d,glass_PMVISINWORK,Q);
947 gPrefs__new.mCreateTop=dbox_selecticon(d,glass_PMNEWONTOP,Q);
948 gPrefs__new.mDeleteRenum=dbox_selecticon(d,glass_PMRENDEL,Q);
949 gPrefs__new.mCtrlEdit=dbox_selecticon(d,glass_PMCTRLEDIT,Q);
957 * void gPrefs__setPanel(dbox_field f)
960 * Creates a new panel based on a radio button click or some-such.
963 * dbox_field f == the radio button associated with the desired panel
966 static void gPrefs__panelHandler(dbox d,dbox_field f,void *handle);
967 static BOOL gPrefs__panelRaw(dbox d,wimp_eventstr *e,void *handle);
969 static void gPrefs__setPanel(dbox_field f)
979 if (f==gPrefs__currentPanel)
981 gPrefs__closePanel();
982 wimpt_noerr(wimp_get_wind_state(dbox_syshandle(gPrefs__dbox),&s));
983 wimpt_noerr(wimp_get_icon_info(dbox_syshandle(gPrefs__dbox),
987 if (d=dbox_create(gPrefs__panels[f-glass_PMAUTOSAVE]),!d)
989 dbox_eventHandler(d,gPrefs__panelHandler,0);
990 dbox_rawEventHandler(d,gPrefs__panelRaw,0);
991 if (gPrefs__currentPanel)
993 wimpt_noerr(wimp_get_caret_pos(&c));
994 ownCaret=(c.w==dbox_syshandle(gPrefs__dbox) ||
995 c.w==dbox_syshandle(gPrefs__panel));
996 dbox_selecticon(gPrefs__dbox,gPrefs__currentPanel,dbox_RESETSTATE);
997 wimpt_noerr(wimp_get_wind_state(dbox_syshandle(gPrefs__panel),&s));
998 pane_removePane(gPrefs__pane,dbox_syshandle(gPrefs__panel));
999 dbox_delete(gPrefs__panel);
1001 dbox_selecticon(gPrefs__dbox,f,dbox_SETSTATE);
1003 wimpt_noerr(wimp_get_wind_state(dbox_syshandle(d),&s));
1004 width=s.o.box.x1-s.o.box.x0;
1005 height=s.o.box.y1-s.o.box.y0;
1006 s.o.box.x0=i.box.x0+ox+wimpt_dx();
1007 s.o.box.y0=i.box.y0+oy+wimpt_dy();
1008 s.o.box.x1=s.o.box.x0+width;
1009 s.o.box.y1=s.o.box.y0+height;
1013 gPrefs__currentPanel=f;
1014 gPrefs__setupPanel();
1015 wimpt_noerr(wimp_open_wind(&s.o));
1018 c.w=dbox_syshandle(d);
1022 c.height=0x02000000;
1023 wimpt_noerr(wimp_set_caret_pos(&c));
1025 pane_addPane(gPrefs__pane,dbox_syshandle(d));
1028 /*----- Event handlers ----------------------------------------------------*/
1031 * void gPrefs__dboxHandler(dbox d,dbox_field f,void *handle)
1034 * Handles any and all events directed at the dbox. Well, almost all...
1037 * dbox d == the dbox handle (gPrefs__dbox)
1038 * dbox_field f == the event that happened
1039 * void *handle == unused data handle
1042 static void gPrefs__dboxHandler(dbox d,dbox_field f,void *handle)
1053 dbox_deleteNoUpdate(gPrefs__panel);
1054 pane_delete(gPrefs__pane);
1055 dbox_delete(gPrefs__dbox);
1057 gPrefs__currentPanel=0;
1061 help_addLine(msgs_lookup("prhPREFS"));
1062 help_readFromIcon();
1065 case glass_PMCANCEL:
1066 dbox_clickicon(d,f);
1067 if (!dbox_wasAdjustClick())
1068 pane_close(gPrefs__pane);
1071 gPrefs__new=gPrefs__current;
1072 gPrefs__setupPanel();
1075 if (!dbox_wasAdjustClick())
1077 dbox_deleteNoUpdate(gPrefs__panel);
1078 pane_delete(gPrefs__pane);
1079 dbox_delete(gPrefs__dbox);
1081 gPrefs__currentPanel=0;
1086 dbox_clickicon(d,f);
1087 adjust=dbox_wasAdjustClick();
1088 gPrefs__closePanel();
1089 oldTime=gPrefs_autoTiming();
1092 (gPrefs__new.iDispBorders!=gPrefs__current.iDispBorders) ||
1093 (gPrefs__new.iIncBorder!=gPrefs__current.iIncBorder) ||
1094 (gPrefs__new.wDispBorders!=gPrefs__current.wDispBorders) ||
1095 (gPrefs__new.wIncBorder!=gPrefs__current.wIncBorder) ||
1096 (gPrefs__new.sDispBorders!=gPrefs__current.sDispBorders) ||
1097 (gPrefs__new.sIncBorder!=gPrefs__current.sIncBorder) ||
1098 (gPrefs__new.mDrawHatch!=gPrefs__current.mDrawHatch) ||
1099 (gPrefs__new.sBorder!=gPrefs__current.sBorder) ||
1100 (gPrefs__new.sDotted!=gPrefs__current.sDotted) ||
1101 (gPrefs__new.sEdgeHandles!=gPrefs__current.sEdgeHandles) ||
1102 (gPrefs__new.sHandSize!=gPrefs__current.sHandSize) ||
1103 (gPrefs__new.sBColour!=gPrefs__current.sBColour) ||
1104 (gPrefs__new.sHColour!=gPrefs__current.sHColour) ||
1105 (gPrefs__new.sSColour!=gPrefs__current.sSColour) ||
1106 (gPrefs__new.gLines!=gPrefs__current.gLines) ||
1107 (gPrefs__new.gGridCol!=gPrefs__current.gGridCol) ||
1108 (gPrefs__new.gGdeCol!=gPrefs__current.gGdeCol) ||
1109 (gPrefs__new.gGdeSelCol!=gPrefs__current.gGdeSelCol)
1114 (gPrefs__new.tDisplay!=gPrefs__current.tDisplay) ||
1115 (gPrefs__new.tFloating!=gPrefs__current.tFloating) ||
1116 (gPrefs__new.iDisplay!=gPrefs__current.iDisplay) ||
1117 (gPrefs__new.iFloating!=gPrefs__current.iFloating)
1120 if (gPrefs__new.aAlts!=gPrefs__current.aAlts)
1122 gPrefs__current=gPrefs__new;
1124 intMsgs_send(glass_REDRAW,0);
1125 if (gPrefs_autoTiming()!=oldTime)
1126 intMsgs_send(glass_AUTOSAVE,gPrefs_autoTiming());
1128 window_updateToolbar();
1129 blinkCursor(gPrefs__current.mBlink);
1130 if (f==glass_PMSAVE)
1133 pane_close(gPrefs__pane);
1137 dbox_deleteNoUpdate(gPrefs__panel);
1138 pane_delete(gPrefs__pane);
1139 dbox_delete(gPrefs__dbox);
1141 gPrefs__currentPanel=0;
1144 case glass_PMAUTOSAVE:
1145 case glass_PMINTERFACE:
1146 case glass_PMSPRITES:
1147 case glass_PMFILEDISP:
1149 case glass_PMSELECTION:
1150 case glass_PMCONFIRM:
1151 case glass_PMTOOLINFO:
1153 gPrefs__setPanel(f);
1159 * BOOL gPrefs__dboxRaw(dbox d,wimp_eventstr *e,void *handle)
1162 * Handles open window requests and things for the main Preferences dbox.
1165 * dbox d == the dbox handle
1166 * wimp_eventstr *e == the event that happened
1167 * void *handle == a unused pointer
1170 * TRUE if the event has been handled;
1173 static BOOL gPrefs__dboxRaw(dbox d,wimp_eventstr *e,void *handle)
1181 pane_moved(gPrefs__pane);
1185 switch (e->data.key.chcode)
1187 case akbd_UpK+akbd_Sh:
1188 gPrefs__setPanel(max2(gPrefs__currentPanel-1,glass_PMAUTOSAVE));
1191 case akbd_DownK+akbd_Sh:
1192 gPrefs__setPanel(min2(gPrefs__currentPanel+1,glass_PMMISC));
1202 * void gPrefs__panelHandler(dbox d,dbox_field f,void *handle)
1205 * Handles normal dbox-type events for the preferences panel.
1208 * dbox d == the dbox handle for the panel
1209 * dbox_field f == the event type
1210 * void *handle == nothing in particular
1213 static void gPrefs__panelHandler(dbox d,dbox_field f,void *handle)
1215 buttons_simpleArrow ast={1,59,FALSE};
1216 buttons_simpleArrow asc={1,999,FALSE};
1217 buttons_simpleArrow sa={0,999,FALSE};
1225 case glass_PMCANCEL:
1226 gPrefs__dboxHandler(gPrefs__dbox,f,0);
1229 switch (gPrefs__currentPanel)
1231 case glass_PMAUTOSAVE:
1235 dbox_shadeicon(d,glass_PATIMEDOWN,dbox_TOGGLESTATE);
1236 dbox_shadeicon(d,glass_PATIMEUP,dbox_TOGGLESTATE);
1237 dbox_shadeicon(d,glass_PATIMEWRITE,dbox_TOGGLESTATE);
1238 dbox_shadeicon(d,glass_PAUNITSDISP,dbox_TOGGLESTATE);
1239 dbox_shadeicon(d,glass_PAUNITSMENU,dbox_TOGGLESTATE);
1241 case glass_PACOUNTED:
1242 dbox_shadeicon(d,glass_PACOUNTUP,dbox_TOGGLESTATE);
1243 dbox_shadeicon(d,glass_PACOUNTDOWN,dbox_TOGGLESTATE);
1244 dbox_shadeicon(d,glass_PACOUNTWRITE,dbox_TOGGLESTATE);
1246 case glass_PATIMEDOWN:
1247 buttons_arrow(d,f,d,glass_PATIMEWRITE,0,-1,&ast);
1249 case glass_PATIMEUP:
1250 buttons_arrow(d,f,d,glass_PATIMEWRITE,0,+1,&ast);
1252 case glass_PACOUNTDOWN:
1253 buttons_arrow(d,f,d,glass_PACOUNTWRITE,0,-1,&asc);
1255 case glass_PACOUNTUP:
1256 buttons_arrow(d,f,d,glass_PACOUNTWRITE,0,+1,&asc);
1260 case glass_PMINTERFACE:
1263 case glass_PIMOUSECLICK:
1264 dbox_shadeicon(d,glass_PIMENUCLICK,dbox_TOGGLESTATE);
1266 case glass_PSMOUSECLICK:
1267 dbox_shadeicon(d,glass_PSMENUCLICK,dbox_TOGGLESTATE);
1271 case glass_PMTOOLINFO:
1274 case glass_PTTOOLDISP:
1275 dbox_shadeicon(d,glass_PTTOOLFLOAT,dbox_TOGGLESTATE);
1277 case glass_PTINFODISP:
1278 dbox_shadeicon(d,glass_PTINFOFLOAT,dbox_TOGGLESTATE);
1286 buttons_arrow(d,f,d,glass_PGWWRITE,0,+1,&sa);
1289 buttons_arrow(d,f,d,glass_PGWWRITE,0,-1,&sa);
1292 buttons_arrow(d,f,d,glass_PGHWRITE,0,+1,&sa);
1295 buttons_arrow(d,f,d,glass_PGHWRITE,0,-1,&sa);
1299 case glass_PMSELECTION:
1302 case glass_PSSIZEUP:
1303 buttons_arrow(d,f,d,glass_PSSIZEWRITE,0,+1,&sa);
1305 case glass_PSSIZEDOWN:
1306 buttons_arrow(d,f,d,glass_PSSIZEWRITE,0,-1,&sa);
1308 case glass_PSBORDER:
1309 dbox_shadeicon(d,glass_PSDOTTED,dbox_TOGGLESTATE);
1310 dbox_shadeicon(d,glass_PSBCOLLABEL,dbox_TOGGLESTATE);
1311 dbox_shadeicon(d,glass_PSBCOLOUR,dbox_TOGGLESTATE);
1319 * menu gPrefs__unitsMaker(void *handle)
1322 * Generates the units menu for the autosave panel and put a tick in the
1326 * void *handle == something pointless.
1329 * A pointer to the menu.
1332 static menu gPrefs__unitsMaker(void *handle)
1337 m=menu_new(msgs_lookup("prUNITT"),
1338 msgs_lookup("prUNIT"));
1339 menu_setflags(m,glass_PUHOURS,FALSE,FALSE);
1340 menu_setflags(m,glass_PUMINUTES,FALSE,FALSE);
1341 menu_setflags(m,glass_PUSECONDS,FALSE,FALSE);
1342 menu_setflags(m,gPrefs__new.aUnit,TRUE,FALSE);
1347 * void gPrefs__unitsHandler(int hit[],void *handle)
1350 * Responds to menu clicks on the units menu
1353 * int hit[] == the menu hits
1354 * void *handle == an unused data pointer
1357 static void gPrefs__unitsHandler(int hit[],void *handle)
1363 case glass_PUMINUTES:
1364 case glass_PUSECONDS:
1365 gPrefs__new.aUnit=hit[0];
1366 if (gPrefs__currentPanel==glass_PMAUTOSAVE)
1367 dbox_setfield(gPrefs__panel,
1370 msgs_lookup(gPrefs__units[hit[0]]));
1376 * void gPrefs__unitsHelp(int hit[],void *handle)
1379 * Responds to help requests for the units menu
1382 * int hit[] == the menu hits
1383 * void *handle == an unused data pointer
1386 static void gPrefs__unitsHelp(int hit[],void *handle)
1390 help_readFromMenu("prhmUN",hit);
1395 * void gPrefs__colourHandler(dbox d,dbox_field f,int colour,void *handle)
1398 * Handles the colour buttons in the Preferences dialogue (all of them)
1401 * dbox d == irrelevant dbox handle
1402 * dbox_field f == which colour button has been prodded
1403 * int colour == what it has been prodded to
1404 * void *handle == a pointer (ignored)
1407 static void gPrefs__colourHandler(dbox d,
1414 switch (gPrefs__currentPanel)
1419 case glass_PGGRIDCOL:
1420 gPrefs__new.gGridCol=colour;
1422 case glass_PGGUIDECOL:
1423 gPrefs__new.gGdeCol=colour;
1425 case glass_PGGDESELCOL:
1426 gPrefs__new.gGdeSelCol=colour;
1430 case glass_PMSELECTION:
1433 case glass_PSBCOLOUR:
1434 gPrefs__new.sBColour=colour;
1436 case glass_PSHCOLOUR:
1437 gPrefs__new.sHColour=colour;
1439 case glass_PSSCOLOUR:
1440 gPrefs__new.sSColour=colour;
1448 * BOOL gPrefs__panelRaw(dbox d,wimp_eventstr *e,void *handle)
1451 * Handles more unusual events concerned with dialogue boxes.
1454 * dbox d == the panel's handle
1455 * wimp_eventstr *e == the full event
1456 * void *handle == an unused handle
1459 * TRUE if the event has been handled
1462 static BOOL gPrefs__panelRaw(dbox d,wimp_eventstr *e,void *handle)
1467 if (e->e==wimp_EKEY)
1469 switch (e->data.key.chcode)
1471 case akbd_UpK+akbd_Sh:
1472 gPrefs__setPanel(max2(gPrefs__currentPanel-1,glass_PMAUTOSAVE));
1475 case akbd_DownK+akbd_Sh:
1476 gPrefs__setPanel(min2(gPrefs__currentPanel+1,glass_PMMISC));
1481 if (!handled) switch (gPrefs__currentPanel)
1483 case glass_PMAUTOSAVE:
1487 switch (e->data.but.m.i)
1489 case glass_PAUNITSDISP:
1490 menu_make(gPrefs__unitsMaker,
1491 gPrefs__unitsHandler,
1492 gPrefs__unitsHelp,0);
1494 case glass_PAUNITSMENU:
1495 dbox_clickicon(d,glass_PAUNITSMENU);
1496 menu_make(gPrefs__unitsMaker,
1497 gPrefs__unitsHandler,
1498 gPrefs__unitsHelp,0);
1504 switch (e->data.key.c.i)
1506 case glass_PATIMEWRITE:
1507 switch (e->data.key.chcode)
1512 case akbd_TabK+akbd_Sh:
1513 case akbd_UpK+akbd_Ctl:
1514 case akbd_DownK+akbd_Ctl:
1518 handled=buttons_insertChar(d,e->data.key.chcode,'0','9');
1519 if (handled || cursor)
1520 buttons_arrowClick(d,glass_PATIMEWRITE,1,59,0,FALSE);
1522 case glass_PACOUNTWRITE:
1523 switch (e->data.key.chcode)
1528 case akbd_TabK+akbd_Sh:
1529 case akbd_UpK+akbd_Ctl:
1530 case akbd_DownK+akbd_Ctl:
1534 handled=buttons_insertChar(d,e->data.key.chcode,'0','9');
1535 if (handled || cursor)
1536 buttons_arrowClick(d,glass_PACOUNTWRITE,1,999,0,FALSE);
1546 switch (e->data.but.m.i)
1548 case glass_PGGRIDCOL:
1551 e->data.but.m.bbits,
1552 msgs_lookup("prGCOL"),
1554 gPrefs__colourHandler,
1558 case glass_PGGUIDECOL:
1561 e->data.but.m.bbits,
1562 msgs_lookup("prGDCOL"),
1564 gPrefs__colourHandler,
1568 case glass_PGGDESELCOL:
1571 e->data.but.m.bbits,
1572 msgs_lookup("prSGDCOL"),
1574 gPrefs__colourHandler,
1582 case glass_PMSELECTION:
1586 switch (e->data.but.m.i)
1588 case glass_PSBCOLOUR:
1591 e->data.but.m.bbits,
1592 msgs_lookup("prSBCOL"),
1594 gPrefs__colourHandler,
1598 case glass_PSHCOLOUR:
1601 e->data.but.m.bbits,
1602 msgs_lookup("prSHCOL"),
1604 gPrefs__colourHandler,
1608 case glass_PSSCOLOUR:
1611 e->data.but.m.bbits,
1612 msgs_lookup("prSSCOL"),
1614 gPrefs__colourHandler,
1626 /*----- External routines -------------------------------------------------*/
1629 * void gPrefs_init(void)
1632 * Reads preferences file and initialises things accordingly
1635 void gPrefs_init(void)
1637 prefs_preferences(gPrefs__prefs);
1640 blinkCursor(gPrefs__current.mBlink);
1644 * gPrefs_prefs *gPrefs_current(void)
1647 * Returns the current preferences settings.
1650 * A pointer to the structure as defined above.
1653 gPrefs_prefs *gPrefs_current(void)
1655 return (&gPrefs__current);
1659 * int gPrefs_autoTiming(void)
1662 * Returns the current autosave time in centiseconds, or 0 for no timed
1666 int gPrefs_autoTiming(void)
1668 static int mult[]={0,360000,6000,100};
1669 return (gPrefs__current.aTime*mult[gPrefs__current.aUnit]);
1673 * void gPrefs_edit(void)
1676 * Opens the preferences dialogue box to allow editing of preferences.
1679 void gPrefs_edit(void)
1683 dbox_display(gPrefs__dbox,dbox_STATIC_LASTPOS);
1684 pane_front(gPrefs__pane);
1688 if (gPrefs__dbox=dbox_create("preferences"),!gPrefs__dbox)
1690 else if (gPrefs__pane=pane_create(dbox_syshandle(gPrefs__dbox)),
1693 dbox_delete(gPrefs__dbox);
1697 gPrefs__new=gPrefs__current;
1698 dbox_eventHandler(gPrefs__dbox,gPrefs__dboxHandler,0);
1699 dbox_rawEventHandler(gPrefs__dbox,gPrefs__dboxRaw,0);
1700 dbox_display(gPrefs__dbox,dbox_STATIC_LASTPOS);
1701 gPrefs__setPanel(glass_PMAUTOSAVE);