disable promotion of c++ warnings to errors if paranoia builds are enabled.
[AROS-Contrib.git] / dopus / Config / main9.c
blobf1e60d1d01a91d97810a0a84c6f1d85d0f66b1f0
1 /*
3 Directory Opus 4
4 Original GPL release version 4.12
5 Copyright 1993-2000 Jonathan Potter
7 This program is free software; you can redistribute it and/or
8 modify it under the terms of the GNU General Public License
9 as published by the Free Software Foundation; either version 2
10 of the License, or (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 All users of Directory Opus 4 (including versions distributed
22 under the GPL) are entitled to upgrade to the latest version of
23 Directory Opus version 5 at a reduced price. Please see
24 http://www.gpsoft.com.au for more information.
26 The release of Directory Opus 4 under the GPL in NO WAY affects
27 the existing commercial status of Directory Opus 5.
31 #include "config.h"
32 #ifndef __AROS__
33 #include <proto/powerpacker.h>
34 #endif
36 void readhelp()
38 BPTR in;
39 char helpname[40],helpfilename[256];
40 ULONG id;
43 LFreeRemember(&helpkey);
44 helpbuffer=NULL;
45 helpsize=0;
47 lsprintf(helpname,"CO_%s.HLP",config->language);
48 if (!config->language[0] ||
49 !(FindSystemFile(helpname,helpfilename,256,SYSFILE_DATA)))
50 FindSystemFile("ConfigOpus.HLP",helpfilename,256,SYSFILE_DATA);
52 if (CheckExist(helpfilename,&helpsize)>=0) return;
53 if (in=Open(helpfilename,MODE_OLDFILE))
55 Read(in, &id, 4);
56 if ((id == 'PX20') || (id == 'PP11') || (id == 'PP20'))
58 struct PPBase *PPBase;
59 char *pptemp;
61 Close(in);
62 #ifndef __AROS__
63 if (PPBase = OpenLibrary("powerpacker.library",0))
65 if (!(ppLoadData(helpfilename,DECR_NONE,MEMF_CLEAR,&pptemp,&helpsize,NULL)))
67 if (helpbuffer=LAllocRemember(&helpkey,helpsize+1,MEMF_CLEAR))
68 CopyMem(pptemp,helpbuffer,helpsize);
69 FreeMem(pptemp,helpsize);
71 CloseLibrary(PPBase);
73 #endif
75 else
77 Seek(in,0,OFFSET_BEGINNING);
78 if (helpbuffer=LAllocRemember(&helpkey,helpsize+1,MEMF_CLEAR)) Read(in,helpbuffer,helpsize);
79 Close(in);
84 void makehelpname(path)
85 char *path;
87 int a,b;
89 if (path==(char *)-1) {
90 b=strlen(currenthelpname)-2;
91 for (a=b;a>=0;a--) {
92 if (currenthelpname[a]=='/') {
93 currenthelpname[a]=0;
94 break;
98 else TackOn(currenthelpname,path,256);
101 void doconfighelp()
103 int a,test=1;
105 if (!helpbuffer) return;
106 for (a=0;a<helpsize;a++) {
107 if (helpbuffer[a]==0) {
108 if (test==-1) {
109 busy();
110 dohelpmsg(&helpbuffer[a+1]);
111 unbusy();
112 return;
114 if (test) test=0;
115 else test=1;
117 else if (test==1) {
118 D(bug("doconfighelp: LStrCmpI(\"%s\",\"%s\")\n",&helpbuffer[a],currenthelpname));
119 if (LStrCmpI(&helpbuffer[a],currenthelpname)==0) test=-1;
120 else ++test;
125 void dohelpmsg(text)
126 char *text;
128 struct Window *wind;
129 char **helpbuf,*buf;
130 int size,lines,a,b,pos;
131 struct DOpusListView *view;
132 ULONG class;
133 UWORD gadgetid;
134 struct DOpusRemember *key=NULL;
136 D(bug("dohelpmsg: %s\n",text));
137 size=strlen(text);
138 if (!(buf=LAllocRemember(&key,size+1,MEMF_CLEAR))) return;
139 for (a=0,lines=0;a<size;a++) {
140 if (text[a]=='\n') {
141 buf[a]=0;
142 ++lines;
144 else buf[a]=text[a];
146 if (!(helpbuf=LAllocRemember(&key,(lines+2)*4,MEMF_CLEAR))) {
147 LFreeRemember(&key);
148 return;
150 for (a=0,b=0,pos=0;a<size;a++) {
151 if (pos==0) {
152 helpbuf[(b++)]=&buf[a];
153 if (b>lines) break;
155 if (buf[a]==0) pos=0;
156 else ++pos;
159 setup_list_window(&requestwin,&helplist,&helpcancelgad,1);
161 requestwin.Title=currenthelpname;
162 if (wind=openwindow(&requestwin)) {
163 setuplist(&helplist,-1,-1);
164 helplist.items=helpbuf;
165 helplist.flags|=DLVF_DUMB;
166 helplist.topitem=0;
167 helplist.window=wind;
168 if (AddListView(&helplist,1)) {
169 SetAPen(wind->RPort,screen_pens[1].pen);
170 AddGadgets(wind,
171 &helpcancelgad,
172 editfuncgads,
174 screen_pens[config->gadgettopcol].pen,screen_pens[config->gadgetbotcol].pen,1);
175 FOREVER {
176 Wait(1<<wind->UserPort->mp_SigBit);
177 while (IMsg=(struct IntuiMessage *)GetMsg(wind->UserPort)) {
178 if ((view=ListViewIDCMP(&helplist,IMsg))==(struct DOpusListView *)-1) {
179 class=IMsg->Class;
180 if (class==IDCMP_GADGETUP)
181 gadgetid=((struct Gadget *)IMsg->IAddress)->GadgetID;
182 ReplyMsg((struct Message *)IMsg);
183 if (class==IDCMP_GADGETUP && gadgetid==0) goto endhelp;
187 endhelp:
188 RemoveListView(&helplist,1);
190 CloseWindow(wind);
192 LFreeRemember(&key);
196 struct clipboard_data {
197 long form;
198 long length;
199 long docp;
200 long size;
203 void load_clips()
205 struct Clip clip,*curclip=NULL,*newclip;
206 struct clipboard_data cdata;
207 char *funcbuf;
209 if (!clip_io ||
210 (OpenDevice("clipboard.device",0,(struct IORequest *)clip_io,0))) return;
212 clip_io->io_Error=0;
213 clip_io->io_ClipID=0;
215 clip_io->io_Command=CMD_READ;
216 clip_io->io_Data=(char *)&cdata;
217 clip_io->io_Length=sizeof(struct clipboard_data);
218 clip_io->io_Offset=0;
220 if (!(DoIO((struct IORequest *)clip_io)) &&
221 cdata.form=='FORM' && cdata.docp=='DOCP') {
223 FOREVER {
224 clip_io->io_Command=CMD_READ;
225 clip_io->io_Data=(char *)&clip;
226 clip_io->io_Length=sizeof(struct Clip);
227 if (DoIO((struct IORequest *)clip_io) ||
228 clip_io->io_Actual<sizeof(struct Clip)) break;
229 if (clip.func.function &&
230 (funcbuf=LAllocRemember(&clipkey,(int)clip.func.function,0))) {
231 clip_io->io_Command=CMD_READ;
232 clip_io->io_Data=funcbuf;
233 clip_io->io_Length=(int)clip.func.function;
234 if (DoIO((struct IORequest *)clip_io) ||
235 clip_io->io_Actual<(int)clip.func.function) break;
237 else funcbuf=NULL;
238 clip.func.function=funcbuf;
239 if (newclip=LAllocRemember(&clipkey,sizeof(struct Clip),0)) {
240 CopyMem((char *)&clip,(char *)newclip,sizeof(struct Clip));
241 if (curclip) curclip->next=newclip;
242 else firstclip=newclip;
243 curclip=newclip;
244 ++clipcount;
249 CloseDevice((struct IORequest *)clip_io);
252 void save_clips()
254 int size=0;
255 struct Clip *clip;
256 struct clipboard_data cdata;
257 char *function;
259 if (!clip_io ||
260 (OpenDevice("clipboard.device",0,(struct IORequest *)clip_io,0))) return;
262 clip=firstclip;
263 while (clip) {
264 size+=sizeof(struct Clip);
265 if (clip->func.function) size+=strlen(clip->func.function)+1;
266 clip=clip->next;
269 cdata.form='FORM';
270 cdata.length=size+8;
271 cdata.docp='DOCP';
272 cdata.size=size;
274 clip_io->io_Error=0;
275 clip_io->io_ClipID=0;
277 clip_io->io_Data=(char *)&cdata;
278 clip_io->io_Length=sizeof(struct clipboard_data);
279 clip_io->io_Command=CMD_WRITE;
280 clip_io->io_Offset=0;
282 if (!(DoIO((struct IORequest *)clip_io))) {
283 clip=firstclip;
284 while (clip) {
285 if ((function=clip->func.function))
286 clip->func.function=(char *)strlen(function)+1;
288 clip_io->io_Data=(char *)clip;
289 clip_io->io_Length=sizeof(struct Clip);
290 clip_io->io_Command=CMD_WRITE;
291 if (DoIO((struct IORequest *)clip_io)) break;
292 if (function) {
293 clip_io->io_Data=function;
294 clip_io->io_Length=(int)clip->func.function;
295 clip_io->io_Command=CMD_WRITE;
296 if (DoIO((struct IORequest *)clip_io)) break;
298 clip=clip->next;
302 clip_io->io_Command=CMD_UPDATE;
303 DoIO((struct IORequest *)clip_io);
305 CloseDevice((struct IORequest *)clip_io);
309 void load_clips()
311 struct Clip clip,*curclip=NULL,*newclip;
312 char *funcbuf;
313 BPTR file;
315 if (!(file=Open("t:configopus.clip",MODE_OLDFILE))) return;
317 FOREVER {
318 if ((Read(file,(char *)&clip,sizeof(struct Clip)))<sizeof(struct Clip))
319 break;
320 if (clip.func.function &&
321 (funcbuf=LAllocRemember(&clipkey,(int)clip.func.function,0))) {
322 if ((Read(file,funcbuf,(int)clip.func.function))<(int)clip.func.function)
323 break;
325 else funcbuf=NULL;
326 clip.func.function=funcbuf;
327 if (newclip=LAllocRemember(&clipkey,sizeof(struct Clip),0)) {
328 CopyMem((char *)&clip,(char *)newclip,sizeof(struct Clip));
329 if (curclip) curclip->next=newclip;
330 else firstclip=newclip;
331 curclip=newclip;
332 ++clipcount;
336 Close(file);
339 void save_clips()
341 int file;
342 struct Clip *clip;
343 char *function;
345 if (!(file=Open("t:configopus.clip",MODE_NEWFILE))) return;
347 clip=firstclip;
348 while (clip) {
349 if ((function=clip->func.function))
350 clip->func.function=(char *)strlen(function)+1;
351 if ((Write(file,(char *)clip,sizeof(struct Clip)))<sizeof(struct Clip))
352 break;
353 if (function &&
354 ((Write(file,(char *)function,(int)clip->func.function))<(int)clip->func.function))
355 break;
356 clip=clip->next;
359 Close(file);
362 readfile(name,buf,size)
363 char *name,**buf;
364 int *size;
366 BPTR in;
368 if (CheckExist(name,size)>=0 || !(in=Open(name,MODE_OLDFILE))) return(-1);
369 if (!(*buf=AllocMem(*size,MEMF_CLEAR))) {
370 Close(in);
371 return(-2);
373 Read(in,*buf,*size);
374 Close(in);
375 return(0);
378 void init_strings()
380 int a;
382 insertbankrmb.txt[0].text=cfg_string[STR_NEW_BANK];
383 insertbankrmb.txt[1].text=cfg_string[STR_INSERT_BANK];
384 nextbankrmb.txt[0].text=cfg_string[STR_NEXT_BANK];
385 nextbankrmb.txt[1].text=cfg_string[STR_LAST_BANK];
386 formatclearrmb.txt[0].text=cfg_string[STR_CLEAR];
387 formatclearrmb.txt[1].text=cfg_string[STR_CLEAR_LAST];
388 sampleclearrmb.txt[0].text=cfg_string[STR_EDIT_SAMPLE];
389 sampleclearrmb.txt[1].text=cfg_string[STR_CLEAR];
391 newtext.IText=cfg_string[STR_MENU_DEFAULT];
392 opentext.IText=cfg_string[STR_MENU_OPEN];
393 savetext.IText=cfg_string[STR_MENU_SAVE];
394 saveastext.IText=cfg_string[STR_MENU_SAVE_AS];
395 cuttext.IText=cfg_string[STR_MENU_CUT];
396 copytext.IText=cfg_string[STR_MENU_COPY];
397 pastetext.IText=cfg_string[STR_MENU_PASTE];
398 erasetext.IText=cfg_string[STR_MENU_ERASE];
399 clearcliptext.IText=cfg_string[STR_MENU_CLEARCLIPS];
400 newclasstext.IText=cfg_string[STR_MENU_NEW];
401 editclasstext.IText=cfg_string[STR_MENU_EDIT];
402 duplicateclasstext.IText=cfg_string[STR_MENU_DUPLICATE];
403 deleteclasstext.IText=cfg_string[STR_MENU_DELETE];
404 clearclasstext.IText=cfg_string[STR_CLEAR];
406 for (a=0;a<5;a++) {
407 gadrowstext[a].FrontPen=0;
408 gadrowstext[a].DrawMode=JAM1;
409 gadrowstext[a].LeftEdge=1;
410 gadrowstext[a].TopEdge=1;
411 gadrowstext[a].ITextFont=NULL;
412 gadrowstext[a].IText=cfg_string[STR_GADGETROWS_NONE+a];
413 gadrowstext[a].NextText=NULL;
416 paintmodetext.IText=cfg_string[STR_NEAT_PAINT_MODE];
418 projectmenu.MenuName=cfg_string[STR_MENUNAME_CONFIGURE];
419 gadrowsmenu.MenuName=cfg_string[STR_MENUNAME_GADGETROWS];
420 editmenu.MenuName=cfg_string[STR_EDIT_MENU];
421 classmenu.MenuName=cfg_string[STR_MENUNAME_CLASSES];
422 neatstuffmenu.MenuName=cfg_string[STR_MENUNAME_NEATSTUFF];
424 for (a=0;a<3;a++) fileclasstype[a]=cfg_string[STR_FILECLASS_DEFINE+a];
425 fileclasstype[3]=cfg_string[STR_FILECLASS_DUPLICATE];
427 for (a=0;a<9;a++) fontplacenames[a]=cfg_string[STR_FONTPLACE_CLOCK+a];
428 fontplacenames[a++]=cfg_string[STR_FONTPLACE_SCREEN];
429 fontplacenames[a++]=cfg_string[STR_FONTPLACE_STATUS];
430 fontplacenames[a++]=cfg_string[STR_FONTPLACE_TEXTVIEWER];
431 fontplacenames[a]=NULL;
433 palettelist.title=cfg_string[STR_PALETTE_PRESETS];
434 iconlistview.title=cfg_string[STR_ICONLIST_TITLE];
436 for (a=0;a<6;a++) formatnames[a]=cfg_string[STR_FORMAT_NAME+a];
437 if (network) {
438 formatnames[6]=cfg_string[STR_FORMAT_OWNER];
439 formatnames[7]=cfg_string[STR_FORMAT_GROUP];
440 formatnames[8]=cfg_string[STR_FORMAT_GROUPBITS];
441 formatnames[9]=NULL;
443 else formatnames[6]=NULL;
445 for (a=0;a<3;a++) icontypes[a]=cfg_string[STR_ICONS_DRAWER+a];
447 for (a=0;a<8;a++) mainmenugads[a]=cfg_string[STR_MAINMENU_GADGETS+a];
448 mainmenugads[8]="";
449 mainmenugads[9]="";
450 mainmenugads[10]=cfg_string[STR_MENU_SAVE];
451 mainmenugads[11]=cfg_string[STR_USE];
452 mainmenugads[12]=cfg_string[STR_CANCEL];
453 mainmenugads[13]=NULL;
455 listviewgads[0]=cfg_string[STR_OKAY];
456 listviewgads[1]=cfg_string[STR_CANCEL];
457 listviewgads[2]=NULL;
459 listviewgads2[0]=cfg_string[STR_OKAY];
460 listviewgads2[1]=cfg_string[STR_ALL];
461 listviewgads2[2]=cfg_string[STR_CANCEL];
462 listviewgads2[3]=NULL;
464 operationgads[0]=cfg_string[STR_MENU_COPY];
465 for (a=0;a<7;a++) operationgads[a+1]=cfg_string[STR_OPERATION_DATEFORMAT+a];
466 for (a=8;a<11;a++) operationgads[a]="";
467 operationgads[11]=cfg_string[STR_OKAY];
468 operationgads[12]=cfg_string[STR_CANCEL];
469 operationgads[13]=NULL;
471 for (a=0;a<3;a++) systemgads[a]=cfg_string[STR_SYSTEM_AMIGADOS+a];
472 systemgads[3]=cfg_string[STR_HOTKEY];
473 for (a=3;a<8;a++) systemgads[a+1]=cfg_string[STR_SYSTEM_AMIGADOS+a];
474 systemgads[9]="";
475 systemgads[10]="";
476 systemgads[11]=cfg_string[STR_OKAY];
477 systemgads[12]=cfg_string[STR_CANCEL];
478 systemgads[13]=NULL;
480 gadgetgads[0]=cfg_string[STR_NEXT_BANK];
481 gadgetgads[1]=cfg_string[STR_NEW_BANK];
482 for (a=0;a<6;a++) gadgetgads[a+2]=cfg_string[STR_GADGET_COPYBANK+a];
483 gadgetgads[8]=cfg_string[STR_OKAY];
484 gadgetgads[9]=cfg_string[STR_CANCEL];
485 gadgetgads[10]=NULL;
487 for (a=0;a<16;a++) gadflaglist[a]=cfg_string[STR_FLAG_AUTOICONIFY+a];
488 gadflaglist[16]=NULL;
490 editfuncgads[0]=cfg_string[STR_OKAY];
491 for (a=1;a<4;a++) editfuncgads[a]="";
492 editfuncgads[4]=cfg_string[STR_CANCEL];
493 editfuncgads[5]=NULL;
495 for (a=0;a<5;a++) editfuncgads2[a]=cfg_string[STR_EDIT_NAME+a];
496 editfuncgads2[5]=cfg_string[STR_OPERATION_DELETE];
497 for (a=5;a<8;a++) editfuncgads2[a+1]=cfg_string[STR_EDIT_NAME+a];
498 for (a=9;a<12;a++) editfuncgads2[a]=(char *)-1;
499 editfuncgads2[12]="{}";
500 editfuncgads2[13]=cfg_string[STR_EDIT_ACTION];
501 editfuncgads2[14]=cfg_string[STR_EDIT_CLASS];
502 editfuncgads2[15]=NULL;
504 editclassgads[0]=cfg_string[STR_EDITCLASS_FILECLASS];
505 editclassgads[1]=cfg_string[STR_EDITCLASS_CLASSID];
506 editclassgads[2]=cfg_string[STR_EDIT_NEWENTRY];
507 editclassgads[3]=cfg_string[STR_EDIT_DUPLICATE];
508 editclassgads[4]=cfg_string[STR_EDIT_SWAP];
509 editclassgads[5]=cfg_string[STR_OPERATION_DELETE];
510 editclassgads[6]=(char *)-1;
511 editclassgads[7]=(char *)-1;
512 editclassgads[8]=cfg_string[STR_EDITCLASS_FILEVIEWER];
513 editclassgads[9]=NULL;
515 for (a=0;a<8;a++) menugadgets[a]=cfg_string[STR_MENU_COPYMENU+a];
516 menugadgets[8]=cfg_string[STR_OKAY];
517 menugadgets[9]=cfg_string[STR_CANCEL];
518 menugadgets[10]=NULL;
520 drivegadgets[0]=cfg_string[STR_DRIVES_GETDRIVES];
521 for (a=0;a<3;a++) drivegadgets[a+1]=cfg_string[STR_GADGET_COPYBANK+a];
522 for (a=0;a<5;a++) drivegadgets[a+4]=cfg_string[STR_DRIVES_SORTBANK+a];
523 drivegadgets[8]=cfg_string[STR_OKAY];
524 drivegadgets[9]=cfg_string[STR_CANCEL];
525 drivegadgets[10]=NULL;
527 drivegadgets2[0]=cfg_string[STR_EDIT_NAME];
528 drivegadgets2[1]=cfg_string[STR_EDIT_SAMPLE];
529 drivegadgets2[2]="";
530 drivegadgets2[3]="";
531 drivegadgets2[4]=NULL;
533 hotkeysgadgets[0]=cfg_string[STR_HOTKEYS_NEWHOTKEY];
534 hotkeysgadgets[1]="";
535 hotkeysgadgets[2]=cfg_string[STR_OPERATION_DELETE];
536 hotkeysgadgets[3]="";
537 hotkeysgadgets[4]=cfg_string[STR_EDIT_DUPLICATE];
538 hotkeysgadgets[5]=cfg_string[STR_OKAY];
539 hotkeysgadgets[6]="";
540 hotkeysgadgets[7]=cfg_string[STR_EDIT_SWAP];
541 hotkeysgadgets[8]="";
542 hotkeysgadgets[9]=cfg_string[STR_CANCEL];
543 hotkeysgadgets[10]=NULL;
545 screengadgets[0]=cfg_string[STR_COLOR_ARROWS];
546 for (a=0;a<2;a++) screengadgets[a+1]=cfg_string[STR_SCREEN_COLORS+a];
547 screengadgets[3]=cfg_string[STR_SCREEN_GENERAL];
548 screengadgets[4]=cfg_string[STR_SCREEN_PALETTE];
549 screengadgets[5]=cfg_string[STR_SCREEN_SCREENMODE];
550 screengadgets[6]=cfg_string[STR_SCREEN_SLIDERS];
551 for (a=7;a<11;a++) screengadgets[a]="";
552 screengadgets[11]=cfg_string[STR_OKAY];
553 screengadgets[12]=cfg_string[STR_CANCEL];
554 screengadgets[13]=NULL;
556 for (a=0;a<3;a++) palettegadgets[a]=(char *)-1;
557 for (a=0;a<3;a++) palettegadgets[a+3]=cfg_string[STR_PALETTE_RED+a];
558 palettegadgets[6]=NULL;
560 for (a=0;a<15;a++) coloursgadgets[a]=cfg_string[STR_COLOR_STATUS+a];
561 coloursgadgets[15]=NULL;
563 for (a=0;a<4;a++) screenmodegadgets[a]=cfg_string[STR_SCREENMODE_WIDTH+a];
564 screenmodegadgets[4]=cfg_string[STR_SCREENMODE_DEFAULT];
565 screenmodegadgets[5]=cfg_string[STR_SCREENMODE_HALFHEIGHT];
566 screenmodegadgets[6]=NULL;
568 formatgadgets[0]=cfg_string[STR_LISTFORMAT_TITLE];
569 formatgadgets[1]=cfg_string[STR_SIZE_KMGMODE];
570 formatgadgets[2]=cfg_string[STR_LISTFORMAT_RESET]; //HUX was 1
571 formatgadgets[3]=cfg_string[STR_CLEAR]; //HUX was 2
572 formatgadgets[4]=(char *)-1; //HUX was 3
573 formatgadgets[5]=cfg_string[STR_LISTFORMAT_REVERSE]; //HUX was 4
574 formatgadgets[6]=cfg_string[STR_FORMAT_NAME]; //HUX was 5
575 formatgadgets[7]=cfg_string[STR_FORMAT_COMMENT]; //HUX was 6
576 formatgadgets[8]=cfg_string[STR_FORMAT_TYPE]; //HUX was 7
577 formatgadgets[9]=cfg_string[STR_FORMAT_OWNER]; //HUX was 8
578 formatgadgets[10]=cfg_string[STR_FORMAT_GROUP]; //HUX was 9
580 hotkeygadgets[0]=cfg_string[STR_EDIT_SAMPLE];
581 hotkeygadgets[1]=cfg_string[STR_USE_MMB];
582 hotkeygadgets[2]=NULL;
584 for (a=0;a<3;a++) arrowgadtxt[a]=cfg_string[STR_ARROWS_INSIDE+a];
585 arrowgadtxt[3]=NULL;
587 for (a=0;a<3;a++) arrowtypetxt[a]=cfg_string[STR_ARROWTYPE_UPDOWN+a];
589 filetypeactiongadgets[0]=cfg_string[STR_NEW];
590 filetypeactiongadgets[1]="";
591 filetypeactiongadgets[2]=cfg_string[STR_EDIT_SWAP];
592 filetypeactiongadgets[3]="";
593 filetypeactiongadgets[4]=cfg_string[STR_OPERATION_DELETE];
594 filetypeactiongadgets[5]=cfg_string[STR_OKAY];
595 for (a=6;a<9;a++) filetypeactiongadgets[a]="";
596 filetypeactiongadgets[9]=cfg_string[STR_CANCEL];
597 filetypeactiongadgets[10]=NULL;
599 editlists[1].title=cfg_string[STR_EDITLIST_TITLE1];
600 editlists[2].title=cfg_string[STR_EDITLIST_TITLE2];
601 filetypeactionlist.title=cfg_string[STR_FILETYPEACTIONLIST_TITLE];
602 hotkeyslist.title=cfg_string[STR_HOTKEYSLIST_TITLE];
603 screenmodeview.title=cfg_string[STR_SCREENMODELIST_TITLE];
604 modulelist.title=cfg_string[STR_MODULE_LIST_TITLE];
605 // languagelist.title=cfg_string[STR_LANGUAGE_LIST_TITLE];
607 windownames[0]=cfg_string[STR_LEFT_WINDOW];
608 windownames[1]=cfg_string[STR_RIGHT_WINDOW];
610 for (a=0;a<3;a++) separatenames[a]=cfg_string[STR_SEP_MIX_FILES+a];
612 for (a=0;a<94;a++) commandlist[a]=cfg_string[func_list_items[a]];
613 commandlist[94]=NULL;
615 for (a=0;a<16;a++) arglist[a]=cfg_string[STR_COMMANDSEQ_DESTINATION+a];
616 arglist[16]=cfg_string[STR_COMMANDSEQ_VARIABLE];
617 arglist[17]=NULL;
619 for (a=0;a<11;a++) classopslist[a]=cfg_string[STR_CLASSOPS_AND+a];
620 classopslist[11]=cfg_string[STR_CLASSOPS_MATCHI];
621 classopslist[12]=NULL;
623 for (a=0;a<4;a++) palettenames[a]=cfg_string[STR_PALETTE_RESET+a];
624 for (a=0;a<9;a++) palettenames[a+4]=cfg_string[STR_PALETTE_TINT+a];
625 palettenames[13]=NULL;
627 for (a=0;a<3;a++)
628 lsprintf(functypelist[a]," %-11s %s",
629 cfg_string[STR_FTYPE_ACTION],cfg_string[STR_FTYPE_CLICKMCLICK+a]);
630 for (a=0;a<10;a++)
631 lsprintf(functypelist[a+3]," %-11s %s",
632 cfg_string[STR_FTYPE_COMMAND],ftype_funcs[a]);
634 fileview_types[0]=cfg_string[STR_FILEVIEW_HEX];
635 fileview_types[1]=cfg_string[STR_FILEVIEW_DEC];
637 for (a=0;a<5;a++) functypestr[a]=cfg_string[STR_FUNCTION_COMMAND+a];
638 functypestr[5]="----";
640 left_right_cycle[0]=cfg_string[STR_SYS_STARTUP_LEFT];
641 left_right_cycle[1]=cfg_string[STR_SYS_STARTUP_RIGHT];
642 left_right_cycle[2]=NULL;
645 void setup_list_window(win,list,gadget,count)
646 struct NewWindow *win;
647 struct DOpusListView *list;
648 struct Gadget *gadget;
649 int count;
651 struct Screen *screen;
653 screen=Window->WScreen;
654 list->x=screen->WBorLeft+6;
655 list->y=screen->WBorTop+screen->Font->ta_YSize+4;
656 win->Width=screen->WBorLeft+screen->WBorRight+list->w+28;
657 win->Height=screen->WBorTop+screen->WBorBottom+screen->Font->ta_YSize+list->h+22;
658 win->Screen=screen;
659 win->LeftEdge=Window->LeftEdge+((Window->Width-win->Width)/2);
660 win->TopEdge=Window->TopEdge+((Window->Height-win->Height)/2);
662 if (gadget) {
663 int gspace,goffset,a;
665 gspace=(win->Width-screen->WBorLeft-screen->WBorRight)/count;
666 goffset=((gspace-gadget->Width)/2)+screen->WBorLeft;
668 for (a=0;a<count && gadget;a++,goffset+=gspace) {
669 gadget->LeftEdge=goffset;
670 gadget->TopEdge=win->Height-screen->WBorBottom-gadget->Height-2;
671 gadget=gadget->NextGadget;