Changed "*4" in "*sizeof(APTR)" for x86_64.
[AROS-Contrib.git] / dopus / Config / main9.c
blobd97bc9a85276a8ea4718456ffb8b6da1241a2d61
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 == MAKE_ID('P','X','2','0')) || (id == MAKE_ID('P','P','1','1')) || (id == MAKE_ID('P','P','2','0'))) // FIXME: endiannes?
58 #ifndef __AROS__
59 struct PPBase *PPBase;
60 char *pptemp;
61 #endif
63 Close(in);
64 #ifndef __AROS__
65 if (PPBase = OpenLibrary("powerpacker.library",0))
67 if (!(ppLoadData(helpfilename,DECR_NONE,MEMF_CLEAR,&pptemp,&helpsize,NULL)))
69 if (helpbuffer=LAllocRemember(&helpkey,helpsize+1,MEMF_CLEAR))
70 CopyMem(pptemp,helpbuffer,helpsize);
71 FreeMem(pptemp,helpsize);
73 CloseLibrary(PPBase);
75 #endif
77 else
79 Seek(in,0,OFFSET_BEGINNING);
80 if (helpbuffer=LAllocRemember(&helpkey,helpsize+1,MEMF_CLEAR)) Read(in,helpbuffer,helpsize);
81 Close(in);
86 void makehelpname(path)
87 char *path;
89 int a,b;
91 if (path==(char *)-1) {
92 b=strlen(currenthelpname)-2;
93 for (a=b;a>=0;a--) {
94 if (currenthelpname[a]=='/') {
95 currenthelpname[a]=0;
96 break;
100 else TackOn(currenthelpname,path,256);
103 void doconfighelp()
105 int a,test=1;
107 if (!helpbuffer) return;
108 for (a=0;a<helpsize;a++) {
109 if (helpbuffer[a]==0) {
110 if (test==-1) {
111 busy();
112 dohelpmsg(&helpbuffer[a+1]);
113 unbusy();
114 return;
116 if (test) test=0;
117 else test=1;
119 else if (test==1) {
120 D(bug("doconfighelp: LStrCmpI(\"%s\",\"%s\")\n",&helpbuffer[a],currenthelpname));
121 if (LStrCmpI(&helpbuffer[a],currenthelpname)==0) test=-1;
122 else ++test;
127 void dohelpmsg(text)
128 char *text;
130 struct Window *wind;
131 char **helpbuf,*buf;
132 int size,lines,a,b,pos;
133 struct DOpusListView *view;
134 ULONG class;
135 UWORD gadgetid;
136 struct DOpusRemember *key=NULL;
138 D(bug("dohelpmsg: %s\n",text));
139 size=strlen(text);
140 if (!(buf=LAllocRemember(&key,size+1,MEMF_CLEAR))) return;
141 for (a=0,lines=0;a<size;a++) {
142 if (text[a]=='\n') {
143 buf[a]=0;
144 ++lines;
146 else buf[a]=text[a];
148 if (!(helpbuf=LAllocRemember(&key,(lines+2)*sizeof(APTR),MEMF_CLEAR))) {
149 LFreeRemember(&key);
150 return;
152 for (a=0,b=0,pos=0;a<size;a++) {
153 if (pos==0) {
154 helpbuf[(b++)]=&buf[a];
155 if (b>lines) break;
157 if (buf[a]==0) pos=0;
158 else ++pos;
161 setup_list_window(&requestwin,&helplist,&helpcancelgad,1);
163 requestwin.Title=currenthelpname;
164 if (wind=openwindow(&requestwin)) {
165 setuplist(&helplist,-1,-1);
166 helplist.items=helpbuf;
167 helplist.flags|=DLVF_DUMB;
168 helplist.topitem=0;
169 helplist.window=wind;
170 if (AddListView(&helplist,1)) {
171 SetAPen(wind->RPort,screen_pens[1].pen);
172 AddGadgets(wind,
173 &helpcancelgad,
174 editfuncgads,
176 screen_pens[config->gadgettopcol].pen,screen_pens[config->gadgetbotcol].pen,1);
177 FOREVER {
178 Wait(1<<wind->UserPort->mp_SigBit);
179 while (IMsg=(struct IntuiMessage *)GetMsg(wind->UserPort)) {
180 if ((view=ListViewIDCMP(&helplist,IMsg))==(struct DOpusListView *)-1) {
181 class=IMsg->Class;
182 if (class==IDCMP_GADGETUP)
183 gadgetid=((struct Gadget *)IMsg->IAddress)->GadgetID;
184 ReplyMsg((struct Message *)IMsg);
185 if (class==IDCMP_GADGETUP && gadgetid==0) goto endhelp;
189 endhelp:
190 RemoveListView(&helplist,1);
192 CloseWindow(wind);
194 LFreeRemember(&key);
198 struct clipboard_data {
199 long form;
200 long length;
201 long docp;
202 long size;
205 void load_clips()
207 struct Clip clip,*curclip=NULL,*newclip;
208 struct clipboard_data cdata;
209 char *funcbuf;
211 if (!clip_io ||
212 (OpenDevice("clipboard.device",0,(struct IORequest *)clip_io,0))) return;
214 clip_io->io_Error=0;
215 clip_io->io_ClipID=0;
217 clip_io->io_Command=CMD_READ;
218 clip_io->io_Data=(char *)&cdata;
219 clip_io->io_Length=sizeof(struct clipboard_data);
220 clip_io->io_Offset=0;
222 if (!(DoIO((struct IORequest *)clip_io)) &&
223 cdata.form=='FORM' && cdata.docp=='DOCP') {
225 FOREVER {
226 clip_io->io_Command=CMD_READ;
227 clip_io->io_Data=(char *)&clip;
228 clip_io->io_Length=sizeof(struct Clip);
229 if (DoIO((struct IORequest *)clip_io) ||
230 clip_io->io_Actual<sizeof(struct Clip)) break;
231 if (clip.func.function &&
232 (funcbuf=LAllocRemember(&clipkey,(int)clip.func.function,0))) {
233 clip_io->io_Command=CMD_READ;
234 clip_io->io_Data=funcbuf;
235 clip_io->io_Length=(int)clip.func.function;
236 if (DoIO((struct IORequest *)clip_io) ||
237 clip_io->io_Actual<(int)clip.func.function) break;
239 else funcbuf=NULL;
240 clip.func.function=funcbuf;
241 if (newclip=LAllocRemember(&clipkey,sizeof(struct Clip),0)) {
242 CopyMem((char *)&clip,(char *)newclip,sizeof(struct Clip));
243 if (curclip) curclip->next=newclip;
244 else firstclip=newclip;
245 curclip=newclip;
246 ++clipcount;
251 CloseDevice((struct IORequest *)clip_io);
254 void save_clips()
256 int size=0;
257 struct Clip *clip;
258 struct clipboard_data cdata;
259 char *function;
261 if (!clip_io ||
262 (OpenDevice("clipboard.device",0,(struct IORequest *)clip_io,0))) return;
264 clip=firstclip;
265 while (clip) {
266 size+=sizeof(struct Clip);
267 if (clip->func.function) size+=strlen(clip->func.function)+1;
268 clip=clip->next;
271 cdata.form='FORM';
272 cdata.length=size+8;
273 cdata.docp='DOCP';
274 cdata.size=size;
276 clip_io->io_Error=0;
277 clip_io->io_ClipID=0;
279 clip_io->io_Data=(char *)&cdata;
280 clip_io->io_Length=sizeof(struct clipboard_data);
281 clip_io->io_Command=CMD_WRITE;
282 clip_io->io_Offset=0;
284 if (!(DoIO((struct IORequest *)clip_io))) {
285 clip=firstclip;
286 while (clip) {
287 if ((function=clip->func.function))
288 clip->func.function=(char *)strlen(function)+1;
290 clip_io->io_Data=(char *)clip;
291 clip_io->io_Length=sizeof(struct Clip);
292 clip_io->io_Command=CMD_WRITE;
293 if (DoIO((struct IORequest *)clip_io)) break;
294 if (function) {
295 clip_io->io_Data=function;
296 clip_io->io_Length=(int)clip->func.function;
297 clip_io->io_Command=CMD_WRITE;
298 if (DoIO((struct IORequest *)clip_io)) break;
300 clip=clip->next;
304 clip_io->io_Command=CMD_UPDATE;
305 DoIO((struct IORequest *)clip_io);
307 CloseDevice((struct IORequest *)clip_io);
311 void load_clips()
313 struct Clip clip,*curclip=NULL,*newclip;
314 char *funcbuf;
315 BPTR file;
317 if (!(file=Open("t:configopus.clip",MODE_OLDFILE))) return;
319 FOREVER {
320 if ((Read(file,(char *)&clip,sizeof(struct Clip)))<sizeof(struct Clip))
321 break;
322 if (clip.func.function &&
323 (funcbuf=LAllocRemember(&clipkey,(long)clip.func.function,0))) {
324 if ((Read(file,funcbuf,(long)clip.func.function))<(long)clip.func.function)
325 break;
327 else funcbuf=NULL;
328 clip.func.function=funcbuf;
329 if (newclip=LAllocRemember(&clipkey,sizeof(struct Clip),0)) {
330 CopyMem((char *)&clip,(char *)newclip,sizeof(struct Clip));
331 if (curclip) curclip->next=newclip;
332 else firstclip=newclip;
333 curclip=newclip;
334 ++clipcount;
338 Close(file);
341 void save_clips()
343 BPTR file;
344 struct Clip *clip;
345 char *function;
347 if (!(file=Open("t:configopus.clip",MODE_NEWFILE))) return;
349 clip=firstclip;
350 while (clip) {
351 if ((function=clip->func.function))
352 clip->func.function=(char *)strlen(function)+1;
353 if ((Write(file,(char *)clip,sizeof(struct Clip)))<sizeof(struct Clip))
354 break;
355 if (function &&
356 ((Write(file,(char *)function,(long)clip->func.function))<(long)clip->func.function))
357 break;
358 clip=clip->next;
361 Close(file);
364 int readfile(name,buf,size)
365 char *name,**buf;
366 int *size;
368 BPTR in;
370 if (CheckExist(name,size)>=0 || !(in=Open(name,MODE_OLDFILE))) return(-1);
371 if (!(*buf=AllocMem(*size,MEMF_CLEAR))) {
372 Close(in);
373 return(-2);
375 Read(in,*buf,*size);
376 Close(in);
377 return(0);
380 void init_strings()
382 int a;
384 insertbankrmb.txt[0].text=cfg_string[STR_NEW_BANK];
385 insertbankrmb.txt[1].text=cfg_string[STR_INSERT_BANK];
386 nextbankrmb.txt[0].text=cfg_string[STR_NEXT_BANK];
387 nextbankrmb.txt[1].text=cfg_string[STR_LAST_BANK];
388 formatclearrmb.txt[0].text=cfg_string[STR_CLEAR];
389 formatclearrmb.txt[1].text=cfg_string[STR_CLEAR_LAST];
390 sampleclearrmb.txt[0].text=cfg_string[STR_EDIT_SAMPLE];
391 sampleclearrmb.txt[1].text=cfg_string[STR_CLEAR];
393 newtext.IText=cfg_string[STR_MENU_DEFAULT];
394 opentext.IText=cfg_string[STR_MENU_OPEN];
395 savetext.IText=cfg_string[STR_MENU_SAVE];
396 saveastext.IText=cfg_string[STR_MENU_SAVE_AS];
397 cuttext.IText=cfg_string[STR_MENU_CUT];
398 copytext.IText=cfg_string[STR_MENU_COPY];
399 pastetext.IText=cfg_string[STR_MENU_PASTE];
400 erasetext.IText=cfg_string[STR_MENU_ERASE];
401 clearcliptext.IText=cfg_string[STR_MENU_CLEARCLIPS];
402 newclasstext.IText=cfg_string[STR_MENU_NEW];
403 editclasstext.IText=cfg_string[STR_MENU_EDIT];
404 duplicateclasstext.IText=cfg_string[STR_MENU_DUPLICATE];
405 deleteclasstext.IText=cfg_string[STR_MENU_DELETE];
406 clearclasstext.IText=cfg_string[STR_CLEAR];
408 for (a=0;a<5;a++) {
409 gadrowstext[a].FrontPen=0;
410 gadrowstext[a].DrawMode=JAM1;
411 gadrowstext[a].LeftEdge=1;
412 gadrowstext[a].TopEdge=1;
413 gadrowstext[a].ITextFont=NULL;
414 gadrowstext[a].IText=cfg_string[STR_GADGETROWS_NONE+a];
415 gadrowstext[a].NextText=NULL;
418 paintmodetext.IText=cfg_string[STR_NEAT_PAINT_MODE];
420 projectmenu.MenuName=cfg_string[STR_MENUNAME_CONFIGURE];
421 gadrowsmenu.MenuName=cfg_string[STR_MENUNAME_GADGETROWS];
422 editmenu.MenuName=cfg_string[STR_EDIT_MENU];
423 classmenu.MenuName=cfg_string[STR_MENUNAME_CLASSES];
424 neatstuffmenu.MenuName=cfg_string[STR_MENUNAME_NEATSTUFF];
426 for (a=0;a<3;a++) fileclasstype[a]=cfg_string[STR_FILECLASS_DEFINE+a];
427 fileclasstype[3]=cfg_string[STR_FILECLASS_DUPLICATE];
429 for (a=0;a<9;a++) fontplacenames[a]=cfg_string[STR_FONTPLACE_CLOCK+a];
430 fontplacenames[a++]=cfg_string[STR_FONTPLACE_SCREEN];
431 fontplacenames[a++]=cfg_string[STR_FONTPLACE_STATUS];
432 fontplacenames[a++]=cfg_string[STR_FONTPLACE_TEXTVIEWER];
433 fontplacenames[a]=NULL;
435 palettelist.title=cfg_string[STR_PALETTE_PRESETS];
436 iconlistview.title=cfg_string[STR_ICONLIST_TITLE];
438 for (a=0;a<6;a++) formatnames[a]=cfg_string[STR_FORMAT_NAME+a];
439 if (network) {
440 formatnames[6]=cfg_string[STR_FORMAT_OWNER];
441 formatnames[7]=cfg_string[STR_FORMAT_GROUP];
442 formatnames[8]=cfg_string[STR_FORMAT_GROUPBITS];
443 formatnames[9]=NULL;
445 else formatnames[6]=NULL;
447 for (a=0;a<3;a++) icontypes[a]=cfg_string[STR_ICONS_DRAWER+a];
449 for (a=0;a<8;a++) mainmenugads[a]=cfg_string[STR_MAINMENU_GADGETS+a];
450 mainmenugads[8]="";
451 mainmenugads[9]="";
452 mainmenugads[10]=cfg_string[STR_MENU_SAVE];
453 mainmenugads[11]=cfg_string[STR_USE];
454 mainmenugads[12]=cfg_string[STR_CANCEL];
455 mainmenugads[13]=NULL;
457 listviewgads[0]=cfg_string[STR_OKAY];
458 listviewgads[1]=cfg_string[STR_CANCEL];
459 listviewgads[2]=NULL;
461 listviewgads2[0]=cfg_string[STR_OKAY];
462 listviewgads2[1]=cfg_string[STR_ALL];
463 listviewgads2[2]=cfg_string[STR_CANCEL];
464 listviewgads2[3]=NULL;
466 operationgads[0]=cfg_string[STR_MENU_COPY];
467 for (a=0;a<7;a++) operationgads[a+1]=cfg_string[STR_OPERATION_DATEFORMAT+a];
468 for (a=8;a<11;a++) operationgads[a]="";
469 operationgads[11]=cfg_string[STR_OKAY];
470 operationgads[12]=cfg_string[STR_CANCEL];
471 operationgads[13]=NULL;
473 for (a=0;a<3;a++) systemgads[a]=cfg_string[STR_SYSTEM_AMIGADOS+a];
474 systemgads[3]=cfg_string[STR_HOTKEY];
475 for (a=3;a<8;a++) systemgads[a+1]=cfg_string[STR_SYSTEM_AMIGADOS+a];
476 systemgads[9]="";
477 systemgads[10]="";
478 systemgads[11]=cfg_string[STR_OKAY];
479 systemgads[12]=cfg_string[STR_CANCEL];
480 systemgads[13]=NULL;
482 gadgetgads[0]=cfg_string[STR_NEXT_BANK];
483 gadgetgads[1]=cfg_string[STR_NEW_BANK];
484 for (a=0;a<6;a++) gadgetgads[a+2]=cfg_string[STR_GADGET_COPYBANK+a];
485 gadgetgads[8]=cfg_string[STR_OKAY];
486 gadgetgads[9]=cfg_string[STR_CANCEL];
487 gadgetgads[10]=NULL;
489 for (a=0;a<16;a++) gadflaglist[a]=cfg_string[STR_FLAG_AUTOICONIFY+a];
490 gadflaglist[16]=NULL;
492 editfuncgads[0]=cfg_string[STR_OKAY];
493 for (a=1;a<4;a++) editfuncgads[a]="";
494 editfuncgads[4]=cfg_string[STR_CANCEL];
495 editfuncgads[5]=NULL;
497 for (a=0;a<5;a++) editfuncgads2[a]=cfg_string[STR_EDIT_NAME+a];
498 editfuncgads2[5]=cfg_string[STR_OPERATION_DELETE];
499 for (a=5;a<8;a++) editfuncgads2[a+1]=cfg_string[STR_EDIT_NAME+a];
500 for (a=9;a<12;a++) editfuncgads2[a]=(char *)-1;
501 editfuncgads2[12]="{}";
502 editfuncgads2[13]=cfg_string[STR_EDIT_ACTION];
503 editfuncgads2[14]=cfg_string[STR_EDIT_CLASS];
504 editfuncgads2[15]=NULL;
506 editclassgads[0]=cfg_string[STR_EDITCLASS_FILECLASS];
507 editclassgads[1]=cfg_string[STR_EDITCLASS_CLASSID];
508 editclassgads[2]=cfg_string[STR_EDIT_NEWENTRY];
509 editclassgads[3]=cfg_string[STR_EDIT_DUPLICATE];
510 editclassgads[4]=cfg_string[STR_EDIT_SWAP];
511 editclassgads[5]=cfg_string[STR_OPERATION_DELETE];
512 editclassgads[6]=(char *)-1;
513 editclassgads[7]=(char *)-1;
514 editclassgads[8]=cfg_string[STR_EDITCLASS_FILEVIEWER];
515 editclassgads[9]=NULL;
517 for (a=0;a<8;a++) menugadgets[a]=cfg_string[STR_MENU_COPYMENU+a];
518 menugadgets[8]=cfg_string[STR_OKAY];
519 menugadgets[9]=cfg_string[STR_CANCEL];
520 menugadgets[10]=NULL;
522 drivegadgets[0]=cfg_string[STR_DRIVES_GETDRIVES];
523 for (a=0;a<3;a++) drivegadgets[a+1]=cfg_string[STR_GADGET_COPYBANK+a];
524 for (a=0;a<5;a++) drivegadgets[a+4]=cfg_string[STR_DRIVES_SORTBANK+a];
525 drivegadgets[8]=cfg_string[STR_OKAY];
526 drivegadgets[9]=cfg_string[STR_CANCEL];
527 drivegadgets[10]=NULL;
529 drivegadgets2[0]=cfg_string[STR_EDIT_NAME];
530 drivegadgets2[1]=cfg_string[STR_EDIT_SAMPLE];
531 drivegadgets2[2]="";
532 drivegadgets2[3]="";
533 drivegadgets2[4]=NULL;
535 hotkeysgadgets[0]=cfg_string[STR_HOTKEYS_NEWHOTKEY];
536 hotkeysgadgets[1]="";
537 hotkeysgadgets[2]=cfg_string[STR_OPERATION_DELETE];
538 hotkeysgadgets[3]="";
539 hotkeysgadgets[4]=cfg_string[STR_EDIT_DUPLICATE];
540 hotkeysgadgets[5]=cfg_string[STR_OKAY];
541 hotkeysgadgets[6]="";
542 hotkeysgadgets[7]=cfg_string[STR_EDIT_SWAP];
543 hotkeysgadgets[8]="";
544 hotkeysgadgets[9]=cfg_string[STR_CANCEL];
545 hotkeysgadgets[10]=NULL;
547 screengadgets[0]=cfg_string[STR_COLOR_ARROWS];
548 for (a=0;a<2;a++) screengadgets[a+1]=cfg_string[STR_SCREEN_COLORS+a];
549 screengadgets[3]=cfg_string[STR_SCREEN_GENERAL];
550 screengadgets[4]=cfg_string[STR_SCREEN_PALETTE];
551 screengadgets[5]=cfg_string[STR_SCREEN_SCREENMODE];
552 screengadgets[6]=cfg_string[STR_SCREEN_SLIDERS];
553 for (a=7;a<11;a++) screengadgets[a]="";
554 screengadgets[11]=cfg_string[STR_OKAY];
555 screengadgets[12]=cfg_string[STR_CANCEL];
556 screengadgets[13]=NULL;
558 for (a=0;a<3;a++) palettegadgets[a]=(char *)-1;
559 for (a=0;a<3;a++) palettegadgets[a+3]=cfg_string[STR_PALETTE_RED+a];
560 palettegadgets[6]=NULL;
562 for (a=0;a<15;a++) coloursgadgets[a]=cfg_string[STR_COLOR_STATUS+a];
563 coloursgadgets[15]=NULL;
565 for (a=0;a<4;a++) screenmodegadgets[a]=cfg_string[STR_SCREENMODE_WIDTH+a];
566 screenmodegadgets[4]=cfg_string[STR_SCREENMODE_DEFAULT];
567 screenmodegadgets[5]=cfg_string[STR_SCREENMODE_HALFHEIGHT];
568 screenmodegadgets[6]=NULL;
570 formatgadgets[0]=cfg_string[STR_LISTFORMAT_TITLE];
571 formatgadgets[1]=cfg_string[STR_SIZE_KMGMODE];
572 formatgadgets[2]=cfg_string[STR_LISTFORMAT_RESET]; //HUX was 1
573 formatgadgets[3]=cfg_string[STR_CLEAR]; //HUX was 2
574 formatgadgets[4]=(char *)-1; //HUX was 3
575 formatgadgets[5]=cfg_string[STR_LISTFORMAT_REVERSE]; //HUX was 4
576 formatgadgets[6]=cfg_string[STR_FORMAT_NAME]; //HUX was 5
577 formatgadgets[7]=cfg_string[STR_FORMAT_COMMENT]; //HUX was 6
578 formatgadgets[8]=cfg_string[STR_FORMAT_TYPE]; //HUX was 7
579 formatgadgets[9]=cfg_string[STR_FORMAT_OWNER]; //HUX was 8
580 formatgadgets[10]=cfg_string[STR_FORMAT_GROUP]; //HUX was 9
582 hotkeygadgets[0]=cfg_string[STR_EDIT_SAMPLE];
583 hotkeygadgets[1]=cfg_string[STR_USE_MMB];
584 hotkeygadgets[2]=NULL;
586 for (a=0;a<3;a++) arrowgadtxt[a]=cfg_string[STR_ARROWS_INSIDE+a];
587 arrowgadtxt[3]=NULL;
589 for (a=0;a<3;a++) arrowtypetxt[a]=cfg_string[STR_ARROWTYPE_UPDOWN+a];
591 filetypeactiongadgets[0]=cfg_string[STR_NEW];
592 filetypeactiongadgets[1]="";
593 filetypeactiongadgets[2]=cfg_string[STR_EDIT_SWAP];
594 filetypeactiongadgets[3]="";
595 filetypeactiongadgets[4]=cfg_string[STR_OPERATION_DELETE];
596 filetypeactiongadgets[5]=cfg_string[STR_OKAY];
597 for (a=6;a<9;a++) filetypeactiongadgets[a]="";
598 filetypeactiongadgets[9]=cfg_string[STR_CANCEL];
599 filetypeactiongadgets[10]=NULL;
601 editlists[1].title=cfg_string[STR_EDITLIST_TITLE1];
602 editlists[2].title=cfg_string[STR_EDITLIST_TITLE2];
603 filetypeactionlist.title=cfg_string[STR_FILETYPEACTIONLIST_TITLE];
604 hotkeyslist.title=cfg_string[STR_HOTKEYSLIST_TITLE];
605 screenmodeview.title=cfg_string[STR_SCREENMODELIST_TITLE];
606 modulelist.title=cfg_string[STR_MODULE_LIST_TITLE];
607 // languagelist.title=cfg_string[STR_LANGUAGE_LIST_TITLE];
609 windownames[0]=cfg_string[STR_LEFT_WINDOW];
610 windownames[1]=cfg_string[STR_RIGHT_WINDOW];
612 for (a=0;a<3;a++) separatenames[a]=cfg_string[STR_SEP_MIX_FILES+a];
614 for (a=0;a<94;a++) commandlist[a]=cfg_string[func_list_items[a]];
615 commandlist[94]=NULL;
617 for (a=0;a<16;a++) arglist[a]=cfg_string[STR_COMMANDSEQ_DESTINATION+a];
618 arglist[16]=cfg_string[STR_COMMANDSEQ_VARIABLE];
619 arglist[17]=NULL;
621 for (a=0;a<11;a++) classopslist[a]=cfg_string[STR_CLASSOPS_AND+a];
622 classopslist[11]=cfg_string[STR_CLASSOPS_MATCHI];
623 classopslist[12]=NULL;
625 for (a=0;a<4;a++) palettenames[a]=cfg_string[STR_PALETTE_RESET+a];
626 for (a=0;a<9;a++) palettenames[a+4]=cfg_string[STR_PALETTE_TINT+a];
627 palettenames[13]=NULL;
629 for (a=0;a<3;a++)
630 lsprintf(functypelist[a]," %-11s %s",
631 cfg_string[STR_FTYPE_ACTION],cfg_string[STR_FTYPE_CLICKMCLICK+a]);
632 for (a=0;a<10;a++)
633 lsprintf(functypelist[a+3]," %-11s %s",
634 cfg_string[STR_FTYPE_COMMAND],ftype_funcs[a]);
636 fileview_types[0]=cfg_string[STR_FILEVIEW_HEX];
637 fileview_types[1]=cfg_string[STR_FILEVIEW_DEC];
639 for (a=0;a<5;a++) functypestr[a]=cfg_string[STR_FUNCTION_COMMAND+a];
640 functypestr[5]="----";
642 left_right_cycle[0]=cfg_string[STR_SYS_STARTUP_LEFT];
643 left_right_cycle[1]=cfg_string[STR_SYS_STARTUP_RIGHT];
644 left_right_cycle[2]=NULL;
647 void setup_list_window(win,list,gadget,count)
648 struct NewWindow *win;
649 struct DOpusListView *list;
650 struct Gadget *gadget;
651 int count;
653 struct Screen *screen;
655 screen=Window->WScreen;
656 list->x=screen->WBorLeft+6;
657 list->y=screen->WBorTop+screen->Font->ta_YSize+4;
658 win->Width=screen->WBorLeft+screen->WBorRight+list->w+28;
659 win->Height=screen->WBorTop+screen->WBorBottom+screen->Font->ta_YSize+list->h+22;
660 win->Screen=screen;
661 win->LeftEdge=Window->LeftEdge+((Window->Width-win->Width)/2);
662 win->TopEdge=Window->TopEdge+((Window->Height-win->Height)/2);
664 if (gadget) {
665 int gspace,goffset,a;
667 gspace=(win->Width-screen->WBorLeft-screen->WBorRight)/count;
668 goffset=((gspace-gadget->Width)/2)+screen->WBorLeft;
670 for (a=0;a<count && gadget;a++,goffset+=gspace) {
671 gadget->LeftEdge=goffset;
672 gadget->TopEdge=win->Height-screen->WBorBottom-gadget->Height-2;
673 gadget=gadget->NextGadget;