home *** CD-ROM | disk | FTP | other *** search
/ back2roots/padua / padua.7z / padua / ftp.vapor.com / microdot-1 / md1_src_02.lzx / bedwin.c < prev    next >
C/C++ Source or Header  |  2014-05-19  |  26KB  |  898 lines

  1. #include "microdot.h"
  2.  
  3. #include "ogre.h"
  4. #include "ogre_protos.h"
  5.  
  6. #define BID_MAKEICONS 1
  7. #define BID_BINEX 2
  8. #define BID_BINEXSEL 12
  9. #define BID_TXTEX 3
  10. #define BID_TXTEXSEL 13
  11. #define BID_BINPFAD 4
  12. #define BID_BINPFADSEL 5
  13. #define BID_TXTPFAD 6
  14. #define BID_TXTPFADSEL 7
  15.  
  16. #define BID_DLT 14
  17. #define BID_DLTSEL 15
  18.  
  19. #define BID_ESCCLRNEW 8
  20. #define BID_ESCCLRONLYREAD 19
  21. #define BID_OK 9
  22. #define BID_CANCEL 10
  23. #define BID_TEXT 11
  24.  
  25. #define BID_AUTOCLRNEW 20
  26.  
  27. #define BID_BRETTTREE 16
  28. #define BID_IX 17
  29. #define BID_MAKELOG 18
  30.  
  31.  
  32. void dobedprefs( void )
  33. {
  34.     struct ogwin *ogw;
  35.     struct Window *iw;
  36.     struct IntuiMessage *im;
  37.     int Done = FALSE;
  38.  
  39.     ogw = ogreInitWindow( scr, 0, 0, "Bedienung I" );
  40.  
  41.     ogreAddGroup( ogw, 0, OGFRAME_OUTLINE, " Piktogramme " );
  42.     ogreAddCheckbox( ogw, 0, 'p', "_Piktogramme erzeugen?", BID_MAKEICONS, ! ( prefs.flags & MDF_NOICONS ) );
  43.     ogreAddText( ogw, 0, "", BID_TEXT, "Standardprogramme", 25, 0 );
  44.     ogreAddString( ogw, 1, 'b', "fⁿr ausgelagerte _BinΣrnachrichten:", BID_BINEX, prefs.binex_defaulttool, 30, 128 );
  45.     ogreAddButton( ogw, 1 | OGGP_KEEPSIZE, 'B', "?", BID_BINEXSEL );
  46.     ogreAddString( ogw, 2, 't', "fⁿr ausgelagerte _Textnachrichten:", BID_TXTEX, prefs.txtex_defaulttool, 30, 128 );
  47.     ogreAddButton( ogw, 2 | OGGP_KEEPSIZE, 'T', "?", BID_TXTEXSEL );
  48.     ogreAddString( ogw, 3, 'd', "fⁿr _downgeloadete Dateien:", BID_DLT, prefs.dl_defaulttool, 30, 128 );
  49.     ogreAddButton( ogw, 3 | OGGP_KEEPSIZE, 'D', "?", BID_DLTSEL );
  50.  
  51.     ogreAddGroup( ogw, 1, OGFRAME_OUTLINE, " Sonstiges " );
  52.  
  53.     ogreAddCheckbox( ogw, 0, 'i', "auch Brettl_iste als Baum darstellen?", BID_BRETTTREE, prefs.showboardtree );
  54.     ogreAddCheckbox( ogw, 1, 'f', "Log_file erzeugen?", BID_MAKELOG, prefs.do_logfile );
  55.  
  56.     ogreAddString( ogw, 2, 's', "Au_slagerpfad fⁿr BinΣrnachrichten:", BID_BINPFAD, prefs.binex_pfad, 30, 128 );
  57.     ogreAddButton( ogw, 2 | OGGP_KEEPSIZE, 'S', "?", BID_BINPFADSEL );
  58.     ogreAddString( ogw, 3, 'l', "Aus_lagerpfad fⁿr Textnachrichten:", BID_TXTPFAD, prefs.txtex_pfad, 30, 128 );
  59.     ogreAddButton( ogw, 3 | OGGP_KEEPSIZE, 'L', "?", BID_TXTPFADSEL );
  60.  
  61.     ogreAddGroup( ogw, 2, OGFRAME_NONE, NULL );
  62.     ogreAddButton( ogw, 0 | OGB_ONENTER, 'o', "_OK", BID_OK );
  63.     ogreAddButton( ogw, 0, 0x5f, "Hilfe", OGID_HELP );
  64.     ogreAddButton( ogw, 0 | OGB_ONESC, 'a', "_Abbruch", BID_CANCEL );
  65.  
  66.     iw = ogreOpenWindow( ogw );
  67.     if( !iw )
  68.         return;
  69.  
  70.     while( !Done )
  71.     {
  72.         ogreEnable( ogw, ogreValue( ogw, BID_MAKEICONS ), BID_BINEX, BID_BINEXSEL, BID_TXTEX, BID_TXTEXSEL, BID_DLT, BID_DLTSEL, 0 );
  73.  
  74.         im = ogreWaitIM( ogw );
  75.  
  76.         if( im->Class == IDCMP_GADGETHELP)
  77.             showguidenum( "bedwin_gads", im->Code );
  78.         else if( im->Class == IDCMP_GADGETUP )
  79.         {
  80.             switch( im->Code )
  81.             {
  82.                 case BID_OK:
  83.                     Done = 2;
  84.                     break;
  85.                 case BID_CANCEL:
  86.                     Done = 1;
  87.                     break;
  88.  
  89.                 case BID_BINEXSEL:
  90.                     newdofrselfile( ogw, BID_BINEX, "Standardprogramm fⁿr BinΣrnachrichten auswΣhlen:" );
  91.                     break;
  92.  
  93.                 case BID_TXTEXSEL:
  94.                     newdofrselfile( ogw, BID_TXTEX, "Standardprogramm fⁿr Textnachrichten auswΣhlen:" );
  95.                     break;
  96.  
  97.                 case BID_DLTSEL:
  98.                     newdofrselfile( ogw, BID_DLT, "Standardprogramm fⁿr downgeloadete Dateien:" );
  99.                     break;
  100.  
  101.                 case BID_BINPFADSEL:
  102.                     newdofrseldir( ogw, BID_BINPFAD, "Auslagerpfad fⁿr BinΣrnachrichten auswΣhlen:" );
  103.                     break;
  104.  
  105.                 case BID_TXTPFADSEL:
  106.                     newdofrseldir( ogw, BID_TXTPFAD, "Auslagerpfad fⁿr Textnachrichten auswΣhlen:" );
  107.                     break;
  108.  
  109.             }
  110.         }
  111.         ogreIMReply( ogw, im );
  112.     }
  113.  
  114.     if( Done == 2 )
  115.     {
  116.         if( ogreValue( ogw, BID_MAKEICONS ) )
  117.             prefs.flags &= ~ MDF_NOICONS;
  118.         else
  119.             prefs.flags |= MDF_NOICONS;
  120.  
  121.         strcpy( prefs.binex_defaulttool, ogreStringValue( ogw, BID_BINEX ) );
  122.         strcpy( prefs.txtex_defaulttool, ogreStringValue( ogw, BID_TXTEX ) );
  123.         strcpy( prefs.dl_defaulttool, ogreStringValue( ogw, BID_DLT ) );
  124.  
  125.         strcpy( prefs.binex_pfad, ogreStringValue( ogw, BID_BINPFAD ) );
  126.         strcpy( prefs.txtex_pfad, ogreStringValue( ogw, BID_TXTPFAD ) );
  127.  
  128.         rtChangeReqAttr( fr[ FR_EXCLUDE ], RTFI_Dir, prefs.txtex_pfad, TAG_DONE );
  129.         rtChangeReqAttr( fr[ FR_EXCLUDE_BIN ], RTFI_Dir, prefs.binex_pfad, TAG_DONE );
  130.  
  131.         prefs.showboardtree = ogreValue( ogw, BID_BRETTTREE );
  132.         prefs.do_logfile    = ogreValue( ogw, BID_MAKELOG );
  133.     }
  134.  
  135.     ogreExitWindow( ogw );
  136. }
  137.  
  138. #define BI_OK 2
  139. #define BI_CANCEL 3
  140.  
  141. #define BI_TXTPEN 4
  142. #define BI_TXTBAK 5
  143. #define BI_TXTBOLD 11
  144.  
  145. #define BI_MARKPEN 7
  146. #define BI_MARKBAK 8
  147. #define BI_MARKBOLD 12
  148.  
  149. #define BI_SELPEN 9
  150. #define BI_SELBAK 10
  151. #define BI_SELBOLD 13
  152.  
  153. #define BI_READPEN 14
  154. #define BI_READBAK 15
  155. #define BI_READBOLD 16
  156.  
  157. #define BI_QUOTEPEN 17
  158. #define BI_QUOTEBAK 18
  159. #define BI_QUOTEBOLD 19
  160.  
  161. #define BI_HEADPEN 20
  162. #define BI_HEADBAK 21
  163. #define BI_HEADBOLD 22
  164.  
  165. #define BI_MARKSELPEN 23
  166. #define BI_MARKSELBAK 24
  167. #define BI_MARKSELBOLD 25
  168.  
  169. #define BI_QUOTEPEN2 40
  170. #define BI_QUOTEPEN3 41
  171. #define BI_QUOTEPEN4 42
  172. #define BI_QUOTEPEN5 43
  173. #define BI_QUOTEPEN6 44
  174. #define BI_QUOTEPEN7 45
  175.  
  176. #define BI_COLACT 80
  177. #define BI_COLSEL 81
  178.  
  179. #define BI_RESET 82
  180.  
  181. /* Read RGB32 into Prefs */
  182. extern void getcolors( struct Screen * );
  183.  
  184. void dobed2prefs( void )
  185. {
  186.     struct ogwin *ogw;
  187.     struct Window *iw;
  188.     struct IntuiMessage *im;
  189.     int Done = FALSE;
  190.  
  191.     ogw = ogreInitWindow( scr, 0, 0, "Farben..." );
  192.  
  193.     ogreAddGroup( ogw, 0, OGFRAME_OUTLINE, " Bildschirmfarben " );
  194.     ogreAddCheckbox( ogw, 0, 'w', "_Workbench-Farben?", BI_COLACT, !prefs.usecustomcolors );
  195.     ogreAddButton( ogw, 0, 'f', "_Farben einstellen", BI_COLSEL );
  196.  
  197.     ogreAddGroup( ogw, 1, OGFRAME_OUTLINE, " Listenfarben " );
  198.  
  199.     ogreAddPensel( ogw, 0, 't', "     _Text", BI_TXTPEN, prefs.pens[ PEN_TEXT ], 14 );
  200.     ogreAddPensel( ogw, 0, 0, "HG", BI_TXTBAK, prefs.pens[ PEN_TEXTBAK ], 14 );
  201.     ogreAddCheckbox( ogw, 0, 0, "Fett", BI_TXTBOLD, prefs.pens[ PEN_TEXTBOLD ] );
  202.  
  203.     ogreAddPensel( ogw, 1, 'l', " aktuel_le", BI_SELPEN, prefs.pens[ PEN_SEL ], 14 );
  204.     ogreAddPensel( ogw, 1, 0, "HG", BI_SELBAK, prefs.pens[ PEN_SELBAK ], 14 );
  205.     ogreAddCheckbox( ogw, 1, 0, "Fett", BI_SELBOLD, prefs.pens[ PEN_SELBOLD ] );
  206.  
  207.     ogreAddPensel( ogw, 2, 'm', "_markierte", BI_MARKPEN, prefs.pens[ PEN_MARK ], 14 );
  208.     ogreAddPensel( ogw, 2, 0, "HG", BI_MARKBAK, prefs.pens[ PEN_MARKBAK ], 14 );
  209.     ogreAddCheckbox( ogw, 2, 0, "Fett", BI_MARKBOLD, prefs.pens[ PEN_MARKBOLD ] );
  210.  
  211.     ogreAddPensel( ogw, 3, 'i', "   Be_ides", BI_MARKSELPEN, prefs.pens[ PEN_MARKSEL ], 14 );
  212.     ogreAddPensel( ogw, 3, 0, "HG", BI_MARKSELBAK, prefs.pens[ PEN_MARKSELBAK ], 14 );
  213.     ogreAddCheckbox( ogw, 3, 0, "Fett", BI_MARKSELBOLD, prefs.pens[ PEN_MARKSELBOLD ] );
  214.  
  215.     ogreAddGroup( ogw, 2, OGFRAME_OUTLINE, " Anzeigerfarben " );
  216.  
  217.     ogreAddPensel( ogw, 0, 'x', "     Te_xt", BI_READPEN, prefs.pens[ PEN_READ ], 14 );
  218.     ogreAddPensel( ogw, 0, 0, "HG", BI_READBAK, prefs.pens[ PEN_READBAK ], 14 );
  219.     ogreAddCheckbox( ogw, 0, 0, "Fett", BI_READBOLD, prefs.pens[ PEN_READBOLD ] );
  220.  
  221.     ogreAddPensel( ogw, 1, 'p', "     Ko_pf", BI_HEADPEN, prefs.pens[ PEN_HEAD ], 14 );
  222.     ogreAddPensel( ogw, 1, 0, "HG", BI_HEADBAK, prefs.pens[ PEN_HEADBAK ], 14 );
  223.     ogreAddCheckbox( ogw, 1, 0, "Fett", BI_HEADBOLD, prefs.pens[ PEN_HEADBOLD ] );
  224.  
  225.     ogreAddPensel( ogw, 2, 'q', "   _Quotes", BI_QUOTEPEN, prefs.quotepens[ 0 ], 14 );
  226.     ogreAddPensel( ogw, 2, 0, "HG", BI_QUOTEBAK, prefs.pens[ PEN_QUOTEBAK ], 14 );
  227.     ogreAddCheckbox( ogw, 2, 0, "Fett", BI_QUOTEBOLD, prefs.pens[ PEN_QUOTEBOLD ] );
  228.     ogreAddPensel( ogw, 3, 0, "Weitere Quotes:", BI_QUOTEPEN2, prefs.quotepens[ 1 ], 12 );
  229.     ogreAddPensel( ogw, 3, 0, "", BI_QUOTEPEN3, prefs.quotepens[ 2 ], 12 );
  230.     ogreAddPensel( ogw, 3, 0, "", BI_QUOTEPEN4, prefs.quotepens[ 3 ], 12 );
  231.  
  232.     ogreAddPensel( ogw, 4, 0, "Weitere Quotes:", BI_QUOTEPEN5, prefs.quotepens[ 4 ], 12 );
  233.     ogreAddPensel( ogw, 4, 0, "", BI_QUOTEPEN6, prefs.quotepens[ 5 ], 12 );
  234.     ogreAddPensel( ogw, 4, 0, "", BI_QUOTEPEN7, prefs.quotepens[ 6 ], 12 );
  235.  
  236.     ogreAddGroup( ogw, 3, OGFRAME_NONE, NULL );
  237.     ogreAddButton( ogw, 0 | OGB_ONENTER, 'o', "_OK", BI_OK );
  238.     ogreAddButton( ogw, 0, 0x5f, "Hilfe", OGID_HELP );
  239.     ogreAddButton( ogw, 0 | OGB_ONESC, 'a', "_Abbruch", BI_CANCEL );
  240.  
  241.     iw = ogreOpenWindow( ogw );
  242.     if( !iw )
  243.         return;
  244.  
  245.     ogreEnable( ogw, !wbwindow, BI_COLACT, 0 );
  246.  
  247.     while( !Done )
  248.     {
  249.         ogreEnable( ogw, ( !ogreValue( ogw, BI_COLACT ) ) && ( !wbwindow ), BI_COLSEL, 0 );
  250.  
  251.         im = ogreWaitIM( ogw );
  252.  
  253.         if( im->Class == IDCMP_GADGETHELP )
  254.             showguidenum( "colwin_gads", im->Code );
  255.         else if( im->Class == IDCMP_GADGETUP )
  256.         {
  257.             switch( im->Code )
  258.             {
  259.                 case BI_OK:
  260.                     Done = 2;
  261.                     break;
  262.  
  263.                 case BI_CANCEL:
  264.                     Done = 1;
  265.                     break;
  266.  
  267.                 case BI_COLSEL:
  268.                     rtPaletteRequest( "Farben einstellen:", NULL, TAG_DONE );
  269.                     break;
  270.  
  271.                 case BI_COLACT:
  272.                     if( wbwindow )
  273.                         break;
  274.                     if( !ogreValue( ogw, BI_COLACT ) )
  275.                         setcolors( scr );
  276.                     else
  277.                         setwbcolors( scr );
  278.                     break;
  279.  
  280.                 case BI_RESET:
  281.                     if( !wbwindow )
  282.                         setwbcolors( scr );
  283.                     break;
  284.  
  285.             }
  286.         }
  287.         ogreIMReply( ogw, im );
  288.     }
  289.  
  290.     if( Done == 2 )
  291.     {
  292.         prefs.usecustomcolors = !ogreValue( ogw, BI_COLACT );
  293.         if( prefs.usecustomcolors && !wbwindow )
  294.             getcolors( scr );
  295.  
  296.         prefs.pens[ PEN_TEXT ]á= ogreValue( ogw, BI_TXTPEN );
  297.         prefs.pens[ PEN_TEXTBAK ]á= ogreValue( ogw, BI_TXTBAK );
  298.         prefs.pens[ PEN_TEXTBOLD ]á= ogreValue( ogw, BI_TXTBOLD );
  299.  
  300.         prefs.pens[ PEN_SEL ]á= ogreValue( ogw, BI_SELPEN );
  301.         prefs.pens[ PEN_SELBAK ]á= ogreValue( ogw, BI_SELBAK );
  302.         prefs.pens[ PEN_SELBOLD ]á= ogreValue( ogw, BI_SELBOLD );
  303.  
  304.         prefs.pens[ PEN_MARKSEL ]á= ogreValue( ogw, BI_MARKSELPEN );
  305.         prefs.pens[ PEN_MARKSELBAK ]á= ogreValue( ogw, BI_MARKSELBAK );
  306.         prefs.pens[ PEN_MARKSELBOLD ]á= ogreValue( ogw, BI_MARKSELBOLD );
  307.  
  308.         prefs.pens[ PEN_MARK ]á= ogreValue( ogw, BI_MARKPEN );
  309.         prefs.pens[ PEN_MARKBAK ]á= ogreValue( ogw, BI_MARKBAK );
  310.         prefs.pens[ PEN_MARKBOLD ]á= ogreValue( ogw, BI_MARKBOLD );
  311.  
  312.         prefs.pens[ PEN_READ ]á= ogreValue( ogw, BI_READPEN );
  313.         prefs.pens[ PEN_READBAK ]á= ogreValue( ogw, BI_READBAK );
  314.         prefs.pens[ PEN_READBOLD ]á= ogreValue( ogw, BI_READBOLD );
  315.  
  316.         prefs.pens[ PEN_QUOTEBAK ]á= ogreValue( ogw, BI_QUOTEBAK );
  317.         prefs.pens[ PEN_QUOTEBOLD ]á= ogreValue( ogw, BI_QUOTEBOLD );
  318.  
  319.         prefs.pens[ PEN_HEAD ]á= ogreValue( ogw, BI_HEADPEN );
  320.         prefs.pens[ PEN_HEADBAK ]á= ogreValue( ogw, BI_HEADBAK );
  321.         prefs.pens[ PEN_HEADBOLD ]á= ogreValue( ogw, BI_HEADBOLD );
  322.  
  323.         prefs.quotepens[ 0 ]á= ogreValue( ogw, BI_QUOTEPEN );
  324.         prefs.quotepens[ 1 ]á= ogreValue( ogw, BI_QUOTEPEN2 );
  325.         prefs.quotepens[ 2 ]á= ogreValue( ogw, BI_QUOTEPEN3 );
  326.         prefs.quotepens[ 3 ]á= ogreValue( ogw, BI_QUOTEPEN4 );
  327.         prefs.quotepens[ 4 ]á= ogreValue( ogw, BI_QUOTEPEN5 );
  328.         prefs.quotepens[ 5 ]á= ogreValue( ogw, BI_QUOTEPEN6 );
  329.         prefs.quotepens[ 6 ]á= ogreValue( ogw, BI_QUOTEPEN7 );
  330.  
  331.         calcmaxpen();
  332.     }
  333.  
  334.     ogreExitWindow( ogw );
  335. }
  336.  
  337. #define EX_OK 1
  338. #define EX_CANCEL 2
  339.  
  340. #define EX_ED 3
  341. #define EX_ED_WB 4
  342. #define EX_ED_STACK 5
  343.  
  344. #define EX_VIEW 6
  345. #define EX_VIEW_WB 7
  346. #define EX_VIEW_STACK 8
  347.  
  348. #define EX_DATA 9
  349. #define EX_DATASEL 10
  350. #define EX_TRANS 11
  351. #define EX_TRANSSEL 12
  352.  
  353. #define EX_CON 13
  354.  
  355. #define EX_DOPACK 14
  356. #define EX_SELXPK 15
  357. #define EX_XPKTXT 16
  358. #define EX_NOIXCACHE 17
  359.  
  360. extern struct Library *XpkBase;
  361. static char *packopts[]á= { "Aus", "Intern Schnell", "Intern Mittel", "Intern Optimal", "XPK", "XPK+Passwort", NULL };
  362.  
  363. void doexternprefs( void )
  364. {
  365.     struct ogwin *ogw;
  366.     struct Window *iw;
  367.     struct IntuiMessage *im;
  368.     int Done = FALSE;
  369.     char *p, *p2;
  370.  
  371.     ogw = ogreInitWindow( scr, 0, 0, "Externe Programme & Pfade" );
  372.     ogreAddGroup( ogw, 0, OGFRAME_OUTLINE, " Externe Programme " );
  373.     ogreAddString( ogw, 0, 'e', "       _Editor:", EX_ED, prefs.editor, 26, 128 );
  374.     ogreAddCheckbox( ogw, 0, 'w', "_WB?", EX_ED_WB, prefs.editor_wb );
  375.     ogreAddInteger( ogw, 0, 's', "_Stack", EX_ED_STACK,  prefs.editor_stack, 4096, MAXINT, 8, 16 );
  376.  
  377.     ogreAddString( ogw, 1, 'i', "B_inΣranzeiger:", EX_VIEW, prefs.binviewer, 26, 128 );
  378.     ogreAddCheckbox( ogw, 1, 'b', "W_B?", EX_VIEW_WB, prefs.viewer_wb );
  379.     ogreAddInteger( ogw, 1, 'c', "Sta_ck", EX_VIEW_STACK,  prefs.viewer_stack, 4096, MAXINT, 8, 16 );
  380.  
  381.     ogreAddGroup( ogw, 1 | OGGP_EXPANDSTRING, OGFRAME_OUTLINE, " Datenbank " );
  382.     ogreAddString( ogw, 0, 'd', "   _Daten-Verzeichnis:", EX_DATA, prefs.datadir, 26, 128 );
  383.     ogreAddButton( ogw, 0 | OGGP_KEEPSIZE, 'D', "?", EX_DATASEL );
  384.     ogreAddString( ogw, 1, 't', "_Transfer-Verzeichnis:", EX_TRANS, prefs.transferdir, 26, 128 );
  385.     ogreAddButton( ogw, 1 | OGGP_KEEPSIZE, 'T', "?", EX_TRANSSEL );
  386.  
  387.     ogreAddCycle( ogw, 2, 'p', "Datenbank _Packen", EX_DOPACK, packopts, 10, prefs.do_packmsg );
  388.     ogreAddText( ogw, 3, "_XPK-Parameter", EX_XPKTXT, "", 40, TRUE );
  389.     ogreAddButton( ogw, 3 | OGGP_KEEPSIZE, 'x', "?", EX_SELXPK );
  390.     ogreAddCheckbox( ogw, 4, 'x', "Kein Index-Cache?", EX_NOIXCACHE, prefs.noixcache );
  391.  
  392.     ogreAddGroup( ogw, 2 | OGGP_EXPANDSTRING, OGFRAME_OUTLINE, " Konsolenfenster " );
  393.     ogreAddString( ogw, 0, 'k', "_Konsole:", EX_CON, prefs.console_window, 26, 80 );
  394.  
  395.     ogreAddGroup( ogw, 3, OGFRAME_NONE, NULL );
  396.     ogreAddButton( ogw, 0 | OGB_ONENTER, 'o', "_OK", EX_OK );
  397.     ogreAddButton( ogw, 0, 0x5f, "Hilfe", OGID_HELP );
  398.     ogreAddButton( ogw, 0 | OGB_ONESC, 'a', "_Abbruch", EX_CANCEL );
  399.  
  400.     ogreEnable( ogw, isv37, EX_VIEW_STACK, EX_ED_STACK, 0 );
  401.     ogreEnable( ogw, isv39, EX_NOIXCACHE, 0 );
  402.  
  403.     iw = ogreOpenWindow( ogw );
  404.     if( !iw )
  405.         return;
  406.  
  407.     ogreSetStringValue( ogw, EX_XPKTXT, xpkinfostring() );
  408.  
  409.     while( !Done )
  410.     {
  411.         ogreEnable( ogw, ogreValue( ogw, EX_DOPACK ) >= PACKMODE_XPK, EX_SELXPK, EX_XPKTXT, 0 );
  412.  
  413.         im = ogreWaitIM( ogw );
  414.  
  415.         if( im->Class == IDCMP_GADGETHELP )
  416.             showguidenum( "externwin_gads", im->Code );
  417.         else if( im->Class == IDCMP_GADGETUP )
  418.         {
  419.             switch( im->Code )
  420.             {
  421.                 case EX_OK:
  422.                     p = ogreStringValue( ogw, EX_DATA );
  423.                     p2 = ogreStringValue( ogw, EX_TRANS );
  424.                     if( ( !strchr( p, ':' ) ) || ( !strchr( p2, ':') ) )
  425.                     {
  426.                         askreq( "Fehler: Daten- und Transferpfad\nmⁿssen absolut angegeben werden!", "Abbruch" );
  427.                         break;
  428.                     }
  429.                     Done = 2;
  430.                     break;
  431.                 case EX_CANCEL:
  432.                     Done = 1;
  433.                     break;
  434.  
  435.                 case EX_SELXPK:
  436.                     ogreLockWindow( ogw );
  437.                     selectxpk();
  438.                     ogreUnlockWindow( ogw );
  439.                     ogreSetStringValue( ogw, EX_XPKTXT, xpkinfostring() );
  440.                     break;
  441.  
  442.                 case EX_DATASEL:
  443.                     newdofrseldir( ogw, EX_DATA, "Verzeichnis fⁿr Daten auswΣhlen:" );
  444.                     break;
  445.  
  446.                 case EX_TRANSSEL:
  447.                     newdofrseldir( ogw, EX_TRANS, "Verzeichnis fⁿr ▄bertragung auswΣhlen:" );
  448.                     break;
  449.  
  450.                 case EX_DOPACK:
  451.                     if( !registerinfo.serie )
  452.                     {
  453.                         askreq( "Diese Funktion ist nur in der registrierten\nVersion von MicroDot verfⁿgbar.", "Abbruch" );
  454.                         ogreSetValue( ogw, EX_DOPACK, 0 );
  455.                     }
  456.                     break;
  457.             }
  458.         }
  459.         ogreIMReply( ogw, im );
  460.     }
  461.  
  462.     if( Done == 2 )
  463.     {
  464.         prefs.editor_wb = ogreValue( ogw, EX_ED_WB );
  465.         prefs.editor_stack = ogreValue( ogw, EX_ED_STACK );
  466.         ogreCopyStringValue( ogw, EX_ED, prefs.editor );
  467.  
  468.         prefs.do_packmsg = ogreValue( ogw, EX_DOPACK );
  469.  
  470.         if( ( !XpkBase ) && ( prefs.do_packmsg >= PACKMODE_XPK ) )
  471.         {
  472.             prefs.do_packmsg = 0;
  473.             xpknotinstalled();
  474.         }
  475.  
  476.         prefs.viewer_wb = ogreValue( ogw, EX_VIEW_WB );
  477.         prefs.viewer_stack = ogreValue( ogw, EX_VIEW_STACK );
  478.         prefs.noixcache = ogreValue( ogw, EX_NOIXCACHE );
  479.         ogreCopyStringValue( ogw, EX_VIEW, prefs.binviewer );
  480.  
  481.         ogreCopyStringValue( ogw, EX_DATA, prefs.datadir );
  482.         ogreCopyStringValue( ogw, EX_TRANS, prefs.transferdir );
  483.         ogreCopyStringValue( ogw, EX_CON, prefs.console_window );
  484.  
  485.         makedospath( prefs.datadir );
  486.         makedospath( prefs.transferdir );
  487.  
  488.     }
  489.  
  490.     ogreExitWindow( ogw );
  491.  
  492.  
  493. }
  494.  
  495. #define MI_OK 1
  496. #define MI_CANCEL 2
  497. #define MI_MAPSNAME 3
  498. #define MI_MAPSOUT 4
  499. #define MI_MAPSADD 5
  500. #define MI_MAPSDEL 6
  501. #define MI_MAPSLIST 7
  502. #define MI_MAPSLISTVERBOSE 8
  503. #define MI_MAPSCLPM 9
  504. #define MI_MAPSHELP 13
  505. #define MI_LISTID 10
  506. #define MI_LISTOFFS 11
  507. #define MI_LISTBOFFS 12
  508. #define MI_STD 14
  509. #define MI_PREFIX 15
  510. #define MI_ADDPREFIX 16
  511. #define MI_DELPREFIX 17
  512.  
  513. static char *maps_options[] = {
  514.     "Konfiguriert",
  515.     "Connectline 4.x/5.x",
  516.     "Fastcall",
  517.     "JokerSystem 2.x",
  518.     "Zerberus 5.x",
  519.     "InfiMail",
  520.     "Anubis OMaps",
  521.     "ZConnect-MAPS",
  522.     NULL
  523. };
  524.  
  525. void domapsprefs( void )
  526. {
  527.     struct ogwin *ogw;
  528.     struct Window *iw;
  529.     struct IntuiMessage *im;
  530.     int Done = FALSE;
  531.     char prefix[á512 ], *p;
  532.  
  533.     strcpy( prefix, prefs.maps_msgprefix );
  534.     for( p = prefix; *p; p++ )
  535.     {
  536.         if( *p == 10 )
  537.         {
  538.             strins( p, "\\" );
  539.             p[á1 ]á= 'n';
  540.         }
  541.     }
  542.  
  543.     ogw = ogreInitWindow( scr, WFLG_RMBTRAP, IDCMP_MENUPICK, "MAPS-Konfiguration" );
  544.  
  545.     ogreAddGroup( ogw, 0, OGFRAME_NONE, NULL );
  546.     ogreAddString( ogw, 0, 'm', "Username von _MAPS:", MI_MAPSNAME, prefs.mapsname, 30, 40 );
  547.     ogreAddString( ogw, 1,   0, "Absender von MAPS-Nachrichten:", MI_MAPSOUT, prefs.mapsoutname, 30, 40 );
  548.     ogreAddString( ogw, 2,   0, "Betreff fⁿr 'Bretter bestellen':", MI_MAPSADD, prefs.maps_add, 30, 40 );
  549.     ogreAddString( ogw, 3,   0, "Betreff fⁿr 'Bretter abbestellen':", MI_MAPSDEL, prefs.maps_del, 30, 40 );
  550.     ogreAddString( ogw, 4,   0, "Betreff fⁿr 'kurze Brettliste':", MI_MAPSLIST, prefs.maps_list, 30, 40 );
  551.     ogreAddString( ogw, 5,   0, "Betreff fⁿr 'ausfⁿhrliche Brettliste':", MI_MAPSLISTVERBOSE, prefs.maps_list_verbose, 30, 40 );
  552.     ogreAddString( ogw, 6,   0, "Betreff fⁿr 'Hilfe anfordern':", MI_MAPSHELP, prefs.maps_help, 30, 40 );
  553.     ogreAddString( ogw, 7,   0, "Betreff fⁿr 'Postfach l÷schen':", MI_MAPSCLPM, prefs.maps_clearpm, 30, 40 );
  554.     ogreAddString( ogw, 8,   0, "Betreff der Brettliste von MAPS:", MI_LISTID, prefs.maps_listid, 30, 40 );
  555.     ogreAddString( ogw, 9,   0, "Nachrichtenbody-Prefix:", MI_PREFIX, prefix, 30, 255 );
  556.     ogreAddInteger( ogw,  10, 0, "Spalte Namen in Liste:", MI_LISTBOFFS, prefs.maps_list_boffs, 0, 255, 15, 4 );
  557.     ogreAddInteger( ogw, 10, 0, " Spalte Betreff:", MI_LISTOFFS, prefs.maps_list_offs, 0, 255, 15, 4 );
  558.     ogreAddString( ogw, 11,   0, "  Brettnamenprefix fⁿr ADD:", MI_ADDPREFIX, prefs.maps_addprefix, 15, 20 );
  559.     ogreAddString( ogw, 11,   0, "fⁿr DEL:", MI_DELPREFIX, prefs.maps_delprefix, 15, 20 );
  560.  
  561.     ogreAddCycle( ogw, 12, 's', "_Standard-MAPS-Typ:", MI_STD,
  562.         maps_options, 20, prefs.std_maps_type
  563.     );
  564.  
  565.     ogreAddGroup( ogw, 1, OGFRAME_NONE, NULL );
  566.  
  567.     ogreAddButton( ogw, 0 | OGB_ONENTER, 'o', "_OK", MI_OK );
  568.     ogreAddButton( ogw, 0, 0x5f, "Hilfe", OGID_HELP );
  569.     ogreAddButton( ogw, 0 | OGB_ONESC, 'a', "_Abbruch", MI_CANCEL );
  570.  
  571.     iw = ogreOpenWindow( ogw );
  572.     if( !iw )
  573.         return;
  574.  
  575.     while( !Done )
  576.     {
  577.  
  578.         ogreEnable( ogw, !ogreValue( ogw, MI_STD ),
  579.             3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 15, 16, 17, 0
  580.         );
  581.  
  582.         im = ogreWaitIM( ogw );
  583.  
  584.         if( im->Class == IDCMP_GADGETHELP)
  585.             showguidenum( "mapswin_gads", im->Code );
  586.         else if( im->Class == IDCMP_GADGETUP )
  587.         {
  588.             switch( im->Code )
  589.             {
  590.                 case MI_OK:
  591.                     Done = 2;
  592.                     break;
  593.                 case MI_CANCEL:
  594.                     Done = 1;
  595.                     break;
  596.  
  597.             }
  598.         }
  599.         ogreIMReply( ogw, im );
  600.     }
  601.  
  602.     if( Done == 2 )
  603.     {
  604.  
  605.         prefs.std_maps_type = ogreValue( ogw, MI_STD );
  606.  
  607.         if( prefs.std_maps_type )
  608.             presetmapsprefs( prefs.std_maps_type );
  609.         else
  610.         {
  611.             prefs.maps_list_boffs = ogreValue( ogw, MI_LISTBOFFS  );
  612.             prefs.maps_list_offs = ogreValue( ogw, MI_LISTOFFS  );
  613.             ogreCopyStringValue( ogw, MI_MAPSNAME, prefs.mapsname );
  614.             ogreCopyStringValue( ogw, MI_MAPSOUT, prefs.mapsoutname );
  615.             ogreCopyStringValue( ogw, MI_MAPSADD, prefs.maps_add );
  616.             ogreCopyStringValue( ogw, MI_MAPSDEL, prefs.maps_del );
  617.             ogreCopyStringValue( ogw, MI_MAPSLIST, prefs.maps_list );
  618.             ogreCopyStringValue( ogw, MI_MAPSLISTVERBOSE, prefs.maps_list_verbose );
  619.             ogreCopyStringValue( ogw, MI_MAPSCLPM, prefs.maps_clearpm );
  620.             ogreCopyStringValue( ogw, MI_MAPSHELP, prefs.maps_help );
  621.             ogreCopyStringValue( ogw, MI_LISTID, prefs.maps_listid );
  622.             ogreCopyStringValue( ogw, MI_PREFIX, prefix );
  623.             ogreCopyStringValue( ogw, MI_ADDPREFIX, prefs.maps_addprefix );
  624.             ogreCopyStringValue( ogw, MI_DELPREFIX, prefs.maps_delprefix );
  625.  
  626.             while( p = strstr( prefix, "\\n" ) )
  627.             {
  628.                 strcpy( p, p + 1 );
  629.                 *p = 10;
  630.             }
  631.             strcpy( prefs.maps_msgprefix, prefix );
  632.             if( prefs.maps_msgprefix[á0 ]á&& prefs.maps_msgprefix[ástrlen( prefs.maps_msgprefix ) - 1 ]á!= '\n'á)
  633.                 strcat( prefs.maps_msgprefix, "\n" );
  634.         }
  635.     }
  636.  
  637.     ogreExitWindow( ogw );
  638.  
  639. }
  640.  
  641. static char *reqpos_opt[]á= {
  642.     "relativ zum Mauspfeil",
  643.     "Fensterzentriert",
  644.     "Bildschirmzentriert",
  645.     "Oben links im Fenster",
  646.     "Oben links im Bildschirm",
  647.     NULL
  648. };
  649.  
  650. #define BW_OK 1
  651. #define BW_CANCEL 2
  652.  
  653. #define BW_SCROLLJUMP 3
  654. #define BW_AUTOLF 4
  655.  
  656. #define BW_READERTABSIZE 5
  657.  
  658. #define BW_REQPOS 6
  659.  
  660. #define BW_ESCCLRNEW 7
  661. #define BW_ESCCLRONLYREAD 8
  662. #define BW_AUTOCLRNEW 9
  663. #define BW_NEXTNEWBOARD 10
  664. #define BW_HOLDOWNMAILS 11
  665. #define BW_HARDDEL 12
  666. #define BW_OWNMAILSNEW 13
  667. #define BW_NEXTNEWBOARDASK 14
  668. #define BW_SORTINWINSMALL 15
  669.  
  670. void dobed3prefs( void )
  671. {
  672.     struct ogwin *ogw;
  673.     struct Window *iw;
  674.     struct IntuiMessage *im;
  675.     int Done = FALSE;
  676.     static char *nextnewopts[] = {á"Stopp am Brettende", "Brettⁿbergreifend", "▄bergreifend mit Nachfrage", NULL };
  677.     int nextnew;
  678.  
  679.     ogw = ogreInitWindow( scr, 0, 0, "Bedienung II" );
  680.  
  681.     nextnew = ( prefs.flags2 & MDF2_NEXTNEWBOARD ) ? 1 : 0;
  682.     if( nextnew && ( prefs.flags2 & MDF2_NEXTNEWBOARDASK ) )
  683.         nextnew = 2;
  684.  
  685.     ogreAddGroup( ogw, 0, OGFRAME_OUTLINE, " Listerverhalten " );
  686.     ogreAddCheckbox( ogw, 0, 'l', "_Lister-Sprung?", BW_SCROLLJUMP, ( prefs.flags2 & MDF2_SCROLLJUMP ) );
  687.     ogreAddCheckbox( ogw, 0, 'z', "_Zeilen-Sprung?", BW_AUTOLF, ( prefs.flags2 & MDF2_AUTOLF ) );
  688.     ogreAddCheckbox( ogw, 0, 'd', "'_DEL' l÷scht 'Halten'?",
  689.         BW_HARDDEL, prefs.flags2 & MDF2_HARDDEL );
  690.  
  691.     ogreAddCheckbox( ogw, 1, 'n', "_NEU-Flags bei \"Brett verlassen\" automatisch l÷schen?",
  692.         BW_ESCCLRNEW, prefs.flags2 & MDF2_ESCCLRNEW );
  693.     ogreAddCheckbox( ogw, 2, 'g', "nur von _gelesenen Nachrichten NEU-Flags l÷schen?",
  694.         BW_ESCCLRONLYREAD, prefs.flags2 & MDF2_ESCCLRONLYREAD );
  695.     ogreAddCheckbox( ogw, 3, 'h', "NEU-Flags von allen berⁿ_hrten Nachrichten l÷schen?",
  696.         BW_AUTOCLRNEW, prefs.flags2 & MDF2_AUTOCLRNEW );
  697.     ogreAddCheckbox( ogw, 4, 'e', "'_eigene Nachrichten auf 'Halten'?",
  698.         BW_HOLDOWNMAILS, prefs.flags2 & MDF2_HOLDOWNMAILS );
  699.     ogreAddCheckbox( ogw, 5, 'b', "'eigene Nachrichten als 'Neu' _behandeln?",
  700.         BW_OWNMAILSNEW, prefs.flags2 & MDF2_OWNMAILSNEW );
  701.     ogreAddCycle( ogw, 6, 'c', "'NΣ_chste Neue':", BW_NEXTNEWBOARD, nextnewopts, 26, nextnew );
  702.  
  703.     ogreAddGroup( ogw, 1, OGFRAME_OUTLINE, " Verschiedenes " );
  704.     ogreAddCycle( ogw, 0, 'p', "Requester_position:", BW_REQPOS, reqpos_opt, 26, prefs.reqpos );
  705.     ogreAddInteger( ogw, 1, 't', "Reader-_Tabulatorweite", BW_READERTABSIZE,  prefs.reader_tabsize, 1, 16, 4, 4 );
  706.     ogreAddCheckbox( ogw, 2, 'f', "Sortin-_Fenster klein?",
  707.         BW_SORTINWINSMALL, prefs.sortinwin_small
  708.     );
  709.  
  710.     ogreAddGroup( ogw, 2, OGFRAME_NONE, NULL );
  711.     ogreAddButton( ogw, 0 | OGB_ONENTER, 'o', "_OK", BW_OK );
  712.     ogreAddHelp( ogw, 0 );
  713.     ogreAddButton( ogw, 0 | OGB_ONESC, 'a', "_Abbruch", BW_CANCEL );
  714.  
  715.     iw = ogreOpenWindow( ogw );
  716.     if( !iw )
  717.         return;
  718.  
  719.     while( !Done )
  720.     {
  721.         im = ogreWaitIM( ogw );
  722.  
  723.         if( im->Class == IDCMP_GADGETHELP)
  724.             showguidenum( "bed3win_gads", im->Code );
  725.         else if( im->Class == IDCMP_GADGETUP )
  726.         {
  727.             switch( im->Code )
  728.             {
  729.                 case BW_OK:
  730.                     Done = 2;
  731.                     break;
  732.                 case BW_CANCEL:
  733.                     Done = 1;
  734.                     break;
  735.  
  736.             }
  737.         }
  738.         ogreIMReply( ogw, im );
  739.     }
  740.  
  741.     if( Done == 2 )
  742.     {
  743.         if( ogreValue( ogw, BW_SCROLLJUMP ) )
  744.             prefs.flags2 |= MDF2_SCROLLJUMP;
  745.         else
  746.             prefs.flags2 &= ~MDF2_SCROLLJUMP;
  747.  
  748.         if( ogreValue( ogw, BW_AUTOLF ) )
  749.             prefs.flags2 |= MDF2_AUTOLF;
  750.         else
  751.             prefs.flags2 &= ~MDF2_AUTOLF;
  752.  
  753.         if( ogreValue( ogw, BW_ESCCLRNEW ) )
  754.             prefs.flags2 |= MDF2_ESCCLRNEW;
  755.         else
  756.             prefs.flags2 &= ~ MDF2_ESCCLRNEW;
  757.  
  758.         if( ogreValue( ogw, BW_ESCCLRONLYREAD ) )
  759.             prefs.flags2 |= MDF2_ESCCLRONLYREAD;
  760.         else
  761.             prefs.flags2 &= ~ MDF2_ESCCLRONLYREAD;
  762.  
  763.         if( ogreValue( ogw, BW_AUTOCLRNEW ) )
  764.             prefs.flags2 |= MDF2_AUTOCLRNEW;
  765.         else
  766.             prefs.flags2 &= ~ MDF2_AUTOCLRNEW;
  767.  
  768.         nextnew = ogreValue( ogw, BW_NEXTNEWBOARD );
  769.         switch( nextnew )
  770.         {
  771.             case 0:
  772.                 prefs.flags2 &= ~ ( MDF2_NEXTNEWBOARD | MDF2_NEXTNEWBOARDASK );
  773.                 break;
  774.  
  775.             case 1:
  776.                 prefs.flags2 &= ~ MDF2_NEXTNEWBOARDASK;
  777.                 prefs.flags2 |= MDF2_NEXTNEWBOARD;
  778.                 break;
  779.  
  780.             case 2:
  781.                 prefs.flags2 |= ( MDF2_NEXTNEWBOARDASK | MDF2_NEXTNEWBOARD );
  782.                 break;
  783.         }
  784.  
  785.         if( ogreValue( ogw, BW_HOLDOWNMAILS ) )
  786.             prefs.flags2 |= MDF2_HOLDOWNMAILS;
  787.         else
  788.             prefs.flags2 &= ~ MDF2_HOLDOWNMAILS;
  789.  
  790.         if( ogreValue( ogw, BW_HARDDEL ) )
  791.             prefs.flags2 |= MDF2_HARDDEL;
  792.         else
  793.             prefs.flags2 &= ~ MDF2_HARDDEL;
  794.  
  795.  
  796.         if( ogreValue( ogw, BW_OWNMAILSNEW ) )
  797.             prefs.flags2 |= MDF2_OWNMAILSNEW;
  798.         else
  799.             prefs.flags2 &= ~ MDF2_OWNMAILSNEW;
  800.  
  801.         prefs.reader_tabsize = ogreValue( ogw, BW_READERTABSIZE );
  802.         prefs.sortinwin_small = ogreValue( ogw, BW_SORTINWINSMALL );
  803.         rinfo->ReqPos = prefs.reqpos = ogreValue( ogw, BW_REQPOS );
  804.     }
  805.  
  806.     ogreExitWindow( ogw );
  807. }
  808.  
  809. #define LC_OK 1
  810.  
  811. #define LC_NB 10
  812. #define LC_PO 20
  813. #define LC_OO 30
  814. #define LC_PQ 40
  815. #define LC_OQ 50
  816. #define LC_CO 60
  817.  
  818. static char *ofile[] = {
  819.     "md_orig.priv",
  820.     "md_orig.pub",
  821.     "md_qh.priv",
  822.     "md_qh.pub",
  823.     "microdot.cookies"
  824. };
  825.  
  826. void dolanguagecfg( void )
  827. {
  828.     struct ogwin *ogw;
  829.     struct Window *iw;
  830.     struct IntuiMessage *im;
  831.     int Done = FALSE;
  832.     int c, d;
  833.     char name[á64 ];
  834.  
  835.     ogw = ogreInitWindow( scr, 0, 0, "Sprachen" );
  836.  
  837.     ogreAddGroup( ogw, 0, OGFRAME_NONE, NULL );
  838.  
  839.     for( c = 0; c < 7; c++ )
  840.     {
  841.         ogreAddString( ogw, c, 0, "Sprache:", LC_NB + c, &prefs.langnames[ác * 30 ], 10, 30 );
  842.         ogreAddButton( ogw, c, 0, "╓.Origin", LC_OO + c );
  843.         ogreAddButton( ogw, c, 0, "P.Origin", LC_PO + c );
  844.         ogreAddButton( ogw, c, 0, "╓.QHeader", LC_OQ + c );
  845.         ogreAddButton( ogw, c, 0, "P.QHeader", LC_PQ + c );
  846.         ogreAddButton( ogw, c, 0, "Cookies", LC_CO + c );
  847.     }
  848.  
  849.     ogreAddGroup( ogw, 1, OGFRAME_NONE, NULL );
  850.     ogreAddButton( ogw, 0 | OGB_ONENTER, 'o', "_OK", LC_OK );
  851.     ogreAddHelp( ogw, 0 );
  852.  
  853.     iw = ogreOpenWindow( ogw );
  854.     if( !iw )
  855.         return;
  856.  
  857.     while( !Done )
  858.     {
  859.         im = ogreWaitIM( ogw );
  860.  
  861.         if( im->Class == IDCMP_GADGETHELP)
  862.             showguidenum( "langwin_gads", im->Code );
  863.         else if( im->Class == IDCMP_GADGETUP )
  864.         {
  865.             if( im->Code == LC_OK )
  866.             {
  867.                 Done = 2;
  868.                 break;
  869.             }
  870.             else
  871.             {
  872.                 c = im->Code - 20;
  873.                 if( c >= 0 )
  874.                 {
  875.                     ogreLockWindow( ogw );
  876.                     d = c % 10;
  877.                     c = c / 10;
  878.  
  879.                     if( d )
  880.                         sprintf( name, "%s.%ld", ofile[ c ], d );
  881.                     else
  882.                         sprintf( name, "%s", ofile[ c ] );
  883.                     pushhomedir();
  884.                     calleditor( name );
  885.                     popdir();
  886.                     ogreUnlockWindow( ogw );
  887.                 }
  888.             }
  889.         }
  890.         ogreIMReply( ogw, im );
  891.     }
  892.  
  893.     for( c = 0; c < 7; c++ )
  894.         ogreCopyStringValue( ogw, LC_NB + c, &prefs.langnames[ác * 30 ] );
  895.  
  896.     ogreExitWindow( ogw );
  897. }
  898.