home *** CD-ROM | disk | FTP | other *** search
/ Shareware Supreme Volume 6 #1 / swsii.zip / swsii / 215 / DDJ9206.ZIP / DFLT12.ZIP / CONFIG.C < prev    next >
Text File  |  1992-02-27  |  18KB  |  509 lines

  1. /* ------------- config.c ------------- */
  2.  
  3. #include "dflat.h"
  4.  
  5. /* ----- default colors for color video system ----- */
  6. unsigned char color[CLASSCOUNT] [4] [2] = {
  7.     /* ------------ NORMAL ------------ */
  8.    {{LIGHTGRAY, BLACK}, /* STD_COLOR    */
  9.     {LIGHTGRAY, BLACK}, /* SELECT_COLOR */
  10.     {LIGHTGRAY, BLACK}, /* FRAME_COLOR  */
  11.     {LIGHTGRAY, BLACK}},/* HILITE_COLOR */
  12.  
  13.     /* ---------- APPLICATION --------- */
  14.    {{LIGHTGRAY, BLUE},  /* STD_COLOR    */
  15.     {LIGHTGRAY, BLUE},  /* SELECT_COLOR */
  16.     {LIGHTGRAY, BLUE},  /* FRAME_COLOR  */
  17.     {LIGHTGRAY, BLUE}}, /* HILITE_COLOR */
  18.  
  19.     /* ------------ TEXTBOX ----------- */
  20.    {{BLACK, LIGHTGRAY}, /* STD_COLOR    */
  21.     {LIGHTGRAY, BLACK}, /* SELECT_COLOR */
  22.     {BLACK, LIGHTGRAY}, /* FRAME_COLOR  */
  23.     {BLACK, LIGHTGRAY}},/* HILITE_COLOR */
  24.  
  25.     /* ------------ LISTBOX ----------- */
  26.    {{BLACK, LIGHTGRAY}, /* STD_COLOR    */
  27.     {LIGHTGRAY, BLACK}, /* SELECT_COLOR */
  28.     {LIGHTGRAY, BLUE},  /* FRAME_COLOR  */
  29.     {BLACK, LIGHTGRAY}},/* HILITE_COLOR */
  30.  
  31.     /* ----------- EDITBOX ------------ */
  32.    {{BLACK, LIGHTGRAY}, /* STD_COLOR    */
  33.     {LIGHTGRAY, BLACK}, /* SELECT_COLOR */
  34.     {LIGHTGRAY, BLUE},  /* FRAME_COLOR  */
  35.     {BLACK, LIGHTGRAY}},/* HILITE_COLOR */
  36.  
  37.     /* ---------- MENUBAR ------------- */
  38.    {{BLACK, LIGHTGRAY}, /* STD_COLOR    */
  39.     {BLACK, CYAN},      /* SELECT_COLOR */
  40.     {BLACK, LIGHTGRAY}, /* FRAME_COLOR  */
  41.     {DARKGRAY, RED}},   /* HILITE_COLOR
  42.                           Inactive, Shortcut (both FG) */
  43.  
  44.     /* ---------- POPDOWNMENU --------- */
  45.    {{BLACK, CYAN},      /* STD_COLOR    */
  46.     {BLACK, LIGHTGRAY}, /* SELECT_COLOR */
  47.     {BLACK, CYAN},      /* FRAME_COLOR  */
  48.     {DARKGRAY, RED}},   /* HILITE_COLOR
  49.                            Inactive ,Shortcut (both FG) */
  50.  
  51. #ifdef INCLUDE_PICTUREBOX
  52.     /* ------------ PICTUREBOX ----------- */
  53.    {{BLACK, LIGHTGRAY}, /* STD_COLOR    */
  54.     {LIGHTGRAY, BLACK}, /* SELECT_COLOR */
  55.     {BLACK, LIGHTGRAY}, /* FRAME_COLOR  */
  56.     {BLACK, LIGHTGRAY}},/* HILITE_COLOR */
  57. #endif
  58.  
  59.     /* ------------- DIALOG ----------- */
  60.    {{LIGHTGRAY, BLUE},  /* STD_COLOR    */
  61.     {BLACK, LIGHTGRAY}, /* SELECT_COLOR */
  62.     {LIGHTGRAY, BLUE},  /* FRAME_COLOR  */
  63.     {LIGHTGRAY, BLUE}}, /* HILITE_COLOR */
  64.  
  65.     /* ------------ BOX --------------- */
  66.    {{LIGHTGRAY, BLUE},  /* STD_COLOR    */
  67.     {LIGHTGRAY, BLUE},  /* SELECT_COLOR */
  68.     {LIGHTGRAY, BLUE},  /* FRAME_COLOR  */
  69.     {LIGHTGRAY, BLUE}}, /* HILITE_COLOR */
  70.  
  71.     /* ------------ BUTTON ------------ */
  72.    {{BLACK, CYAN},      /* STD_COLOR    */
  73.     {WHITE, CYAN},      /* SELECT_COLOR */
  74.     {BLACK, CYAN},      /* FRAME_COLOR  */
  75.     {DARKGRAY, RED}},   /* HILITE_COLOR
  76.                            Inactive ,Shortcut (both FG) */
  77.     /* ------------ COMBOBOX ----------- */
  78.    {{BLACK, LIGHTGRAY}, /* STD_COLOR    */
  79.     {LIGHTGRAY, BLACK}, /* SELECT_COLOR */
  80.     {LIGHTGRAY, BLACK},  /* FRAME_COLOR  */
  81.     {BLACK, LIGHTGRAY}},/* HILITE_COLOR */
  82.  
  83.     /* ------------- TEXT ----------- */
  84.    {{0xff, 0xff},  /* STD_COLOR    */
  85.     {0xff, 0xff},  /* SELECT_COLOR */
  86.     {0xff, 0xff},  /* FRAME_COLOR  */
  87.     {0xff, 0xff}}, /* HILITE_COLOR */
  88.  
  89.     /* ------------- RADIOBUTTON ----------- */
  90.    {{LIGHTGRAY, BLUE},  /* STD_COLOR    */
  91.     {BLACK, LIGHTGRAY}, /* SELECT_COLOR */
  92.     {LIGHTGRAY, BLUE},  /* FRAME_COLOR  */
  93.     {LIGHTGRAY, BLUE}}, /* HILITE_COLOR */
  94.  
  95.     /* ------------- CHECKBOX ----------- */
  96.    {{LIGHTGRAY, BLUE},  /* STD_COLOR    */
  97.     {BLACK, LIGHTGRAY}, /* SELECT_COLOR */
  98.     {LIGHTGRAY, BLUE},  /* FRAME_COLOR  */
  99.     {LIGHTGRAY, BLUE}}, /* HILITE_COLOR */
  100.  
  101.     /* ------------ SPINBUTTON ----------- */
  102.    {{BLACK, LIGHTGRAY}, /* STD_COLOR    */
  103.     {BLACK, LIGHTGRAY}, /* SELECT_COLOR */
  104.     {LIGHTGRAY, BLACK}, /* FRAME_COLOR  */
  105.     {BLACK, LIGHTGRAY}},/* HILITE_COLOR */
  106.  
  107.     /* ----------- ERRORBOX ----------- */
  108.    {{YELLOW, RED},      /* STD_COLOR    */
  109.     {YELLOW, RED},      /* SELECT_COLOR */
  110.     {YELLOW, RED},      /* FRAME_COLOR  */
  111.     {YELLOW, RED}},     /* HILITE_COLOR */
  112.  
  113.     /* ----------- MESSAGEBOX --------- */
  114.    {{BLACK, LIGHTGRAY}, /* STD_COLOR    */
  115.     {BLACK, LIGHTGRAY}, /* SELECT_COLOR */
  116.     {BLACK, LIGHTGRAY}, /* FRAME_COLOR  */
  117.     {BLACK, LIGHTGRAY}},/* HILITE_COLOR */
  118.  
  119.     /* ----------- HELPBOX ------------ */
  120.    {{BLACK, LIGHTGRAY}, /* STD_COLOR    */
  121.     {LIGHTGRAY, BLUE},  /* SELECT_COLOR */
  122.     {BLACK, LIGHTGRAY}, /* FRAME_COLOR  */
  123.     {WHITE, LIGHTGRAY}},/* HILITE_COLOR */
  124.  
  125.     /* ---------- STATUSBAR ------------- */
  126.    {{BLACK, CYAN},      /* STD_COLOR    */
  127.     {BLACK, CYAN},      /* SELECT_COLOR */
  128.     {BLACK, CYAN},      /* FRAME_COLOR  */
  129.     {BLACK, CYAN}},     /* HILITE_COLOR */
  130.  
  131.     /* ---------- TITLEBAR ------------ */
  132.    {{BLACK, CYAN},      /* STD_COLOR    */
  133.     {BLACK, CYAN},      /* SELECT_COLOR */
  134.     {BLACK, CYAN},      /* FRAME_COLOR  */
  135.     {WHITE, CYAN}},     /* HILITE_COLOR */
  136.  
  137.     /* ------------ DUMMY ------------- */
  138.    {{GREEN, LIGHTGRAY}, /* STD_COLOR    */
  139.     {GREEN, LIGHTGRAY}, /* SELECT_COLOR */
  140.     {GREEN, LIGHTGRAY}, /* FRAME_COLOR  */
  141.     {GREEN, LIGHTGRAY}} /* HILITE_COLOR */
  142. };
  143.  
  144. /* ----- default colors for mono video system ----- */
  145. unsigned char bw[CLASSCOUNT] [4] [2] = {
  146.     /* ------------ NORMAL ------------ */
  147.    {{LIGHTGRAY, BLACK}, /* STD_COLOR    */
  148.     {LIGHTGRAY, BLACK}, /* SELECT_COLOR */
  149.     {LIGHTGRAY, BLACK}, /* FRAME_COLOR  */
  150.     {LIGHTGRAY, BLACK}},/* HILITE_COLOR */
  151.  
  152.     /* ---------- APPLICATION --------- */
  153.    {{LIGHTGRAY, BLACK}, /* STD_COLOR    */
  154.     {LIGHTGRAY, BLACK}, /* SELECT_COLOR */
  155.     {LIGHTGRAY, BLACK}, /* FRAME_COLOR  */
  156.     {LIGHTGRAY, BLACK}},/* HILITE_COLOR */
  157.  
  158.     /* ------------ TEXTBOX ----------- */
  159.    {{BLACK, LIGHTGRAY}, /* STD_COLOR    */
  160.     {LIGHTGRAY, BLACK}, /* SELECT_COLOR */
  161.     {BLACK, LIGHTGRAY}, /* FRAME_COLOR  */
  162.     {BLACK, LIGHTGRAY}},/* HILITE_COLOR */
  163.  
  164.     /* ------------ LISTBOX ----------- */
  165.    {{LIGHTGRAY, BLACK}, /* STD_COLOR    */
  166.     {BLACK, LIGHTGRAY}, /* SELECT_COLOR */
  167.     {LIGHTGRAY, BLACK}, /* FRAME_COLOR  */
  168.     {BLACK, LIGHTGRAY}},/* HILITE_COLOR */
  169.  
  170.     /* ----------- EDITBOX ------------ */
  171.    {{LIGHTGRAY, BLACK}, /* STD_COLOR    */
  172.     {BLACK, LIGHTGRAY}, /* SELECT_COLOR */
  173.     {LIGHTGRAY, BLACK}, /* FRAME_COLOR  */
  174.     {BLACK, LIGHTGRAY}},/* HILITE_COLOR */
  175.  
  176.     /* ---------- MENUBAR ------------- */
  177.    {{LIGHTGRAY, BLACK}, /* STD_COLOR    */
  178.     {BLACK, LIGHTGRAY}, /* SELECT_COLOR */
  179.     {BLACK, LIGHTGRAY}, /* FRAME_COLOR  */
  180.     {DARKGRAY, WHITE}}, /* HILITE_COLOR
  181.                            Inactive, Shortcut (both FG) */
  182.  
  183.     /* ---------- POPDOWNMENU --------- */
  184.    {{LIGHTGRAY, BLACK}, /* STD_COLOR    */
  185.     {BLACK, LIGHTGRAY}, /* SELECT_COLOR */
  186.     {LIGHTGRAY, BLACK}, /* FRAME_COLOR  */
  187.     {DARKGRAY, WHITE}}, /* HILITE_COLOR
  188.                            Inactive ,Shortcut (both FG) */
  189.  
  190. #ifdef INCLUDE_PICTUREBOX
  191.     /* ------------ PICTUREBOX ----------- */
  192.    {{BLACK, LIGHTGRAY}, /* STD_COLOR    */
  193.     {LIGHTGRAY, BLACK}, /* SELECT_COLOR */
  194.     {BLACK, LIGHTGRAY}, /* FRAME_COLOR  */
  195.     {BLACK, LIGHTGRAY}},/* HILITE_COLOR */
  196. #endif
  197.  
  198.     /* ------------- DIALOG ----------- */
  199.    {{LIGHTGRAY, BLACK},  /* STD_COLOR    */
  200.     {BLACK, LIGHTGRAY},  /* SELECT_COLOR */
  201.     {LIGHTGRAY, BLACK},  /* FRAME_COLOR  */
  202.     {LIGHTGRAY, BLACK}}, /* HILITE_COLOR */
  203.  
  204.     /* ------------ BOX --------------- */
  205.    {{LIGHTGRAY, BLACK},  /* STD_COLOR    */
  206.     {LIGHTGRAY, BLACK},  /* SELECT_COLOR */
  207.     {LIGHTGRAY, BLACK},  /* FRAME_COLOR  */
  208.     {LIGHTGRAY, BLACK}}, /* HILITE_COLOR */
  209.  
  210.     /* ------------ BUTTON ------------ */
  211.    {{BLACK, LIGHTGRAY}, /* STD_COLOR    */
  212.     {WHITE, LIGHTGRAY}, /* SELECT_COLOR */
  213.     {BLACK, LIGHTGRAY}, /* FRAME_COLOR  */
  214.     {DARKGRAY, WHITE}}, /* HILITE_COLOR
  215.                            Inactive ,Shortcut (both FG) */
  216.     /* ------------ COMBOBOX ----------- */
  217.    {{BLACK, LIGHTGRAY}, /* STD_COLOR    */
  218.     {LIGHTGRAY, BLACK}, /* SELECT_COLOR */
  219.     {BLACK, LIGHTGRAY}, /* FRAME_COLOR  */
  220.     {BLACK, LIGHTGRAY}},/* HILITE_COLOR */
  221.  
  222.     /* ------------- TEXT ----------- */
  223.    {{0xff, 0xff},  /* STD_COLOR    */
  224.     {0xff, 0xff},  /* SELECT_COLOR */
  225.     {0xff, 0xff},  /* FRAME_COLOR  */
  226.     {0xff, 0xff}}, /* HILITE_COLOR */
  227.  
  228.     /* ------------- RADIOBUTTON ----------- */
  229.    {{LIGHTGRAY, BLACK},  /* STD_COLOR    */
  230.     {BLACK, LIGHTGRAY},  /* SELECT_COLOR */
  231.     {LIGHTGRAY, BLACK},  /* FRAME_COLOR  */
  232.     {LIGHTGRAY, BLACK}}, /* HILITE_COLOR */
  233.  
  234.     /* ------------- CHECKBOX ----------- */
  235.    {{LIGHTGRAY, BLACK},  /* STD_COLOR    */
  236.     {BLACK, LIGHTGRAY},  /* SELECT_COLOR */
  237.     {LIGHTGRAY, BLACK},  /* FRAME_COLOR  */
  238.     {LIGHTGRAY, BLACK}}, /* HILITE_COLOR */
  239.  
  240.     /* ------------ SPINBUTTON ----------- */
  241.    {{BLACK, LIGHTGRAY}, /* STD_COLOR    */
  242.     {BLACK, LIGHTGRAY}, /* SELECT_COLOR */
  243.     {BLACK, LIGHTGRAY}, /* FRAME_COLOR  */
  244.     {BLACK, LIGHTGRAY}},/* HILITE_COLOR */
  245.  
  246.     /* ----------- ERRORBOX ----------- */
  247.    {{LIGHTGRAY, BLACK}, /* STD_COLOR    */
  248.     {LIGHTGRAY, BLACK}, /* SELECT_COLOR */
  249.     {LIGHTGRAY, BLACK}, /* FRAME_COLOR  */
  250.     {LIGHTGRAY, BLACK}},/* HILITE_COLOR */
  251.  
  252.     /* ----------- MESSAGEBOX --------- */
  253.    {{LIGHTGRAY, BLACK}, /* STD_COLOR    */
  254.     {LIGHTGRAY, BLACK}, /* SELECT_COLOR */
  255.     {LIGHTGRAY, BLACK}, /* FRAME_COLOR  */
  256.     {LIGHTGRAY, BLACK}},/* HILITE_COLOR */
  257.  
  258.     /* ----------- HELPBOX ------------ */
  259.    {{LIGHTGRAY, BLACK}, /* STD_COLOR    */
  260.     {WHITE, BLACK},     /* SELECT_COLOR */
  261.     {LIGHTGRAY, BLACK}, /* FRAME_COLOR  */
  262.     {WHITE, LIGHTGRAY}},/* HILITE_COLOR */
  263.  
  264.     /* ---------- STATUSBAR ------------- */
  265.    {{BLACK, LIGHTGRAY}, /* STD_COLOR    */
  266.     {BLACK, LIGHTGRAY}, /* SELECT_COLOR */
  267.     {BLACK, LIGHTGRAY}, /* FRAME_COLOR  */
  268.     {BLACK, LIGHTGRAY}},/* HILITE_COLOR */
  269.  
  270.     /* ---------- TITLEBAR ------------ */
  271.    {{BLACK, LIGHTGRAY}, /* STD_COLOR    */
  272.     {BLACK, LIGHTGRAY}, /* SELECT_COLOR */
  273.     {BLACK, LIGHTGRAY}, /* FRAME_COLOR  */
  274.     {BLACK, LIGHTGRAY}},/* HILITE_COLOR */
  275.  
  276.     /* ------------ DUMMY ------------- */
  277.    {{BLACK, LIGHTGRAY}, /* STD_COLOR    */
  278.     {BLACK, LIGHTGRAY}, /* SELECT_COLOR */
  279.     {BLACK, LIGHTGRAY}, /* FRAME_COLOR  */
  280.     {BLACK, LIGHTGRAY}} /* HILITE_COLOR */
  281. };
  282. /* ----- default colors for reverse mono video ----- */
  283. unsigned char reverse[CLASSCOUNT] [4] [2] = {
  284.     /* ------------ NORMAL ------------ */
  285.    {{BLACK, LIGHTGRAY}, /* STD_COLOR    */
  286.     {BLACK, LIGHTGRAY}, /* SELECT_COLOR */
  287.     {BLACK, LIGHTGRAY}, /* FRAME_COLOR  */
  288.     {BLACK, LIGHTGRAY}},/* HILITE_COLOR */
  289.  
  290.     /* ---------- APPLICATION --------- */
  291.    {{BLACK, LIGHTGRAY}, /* STD_COLOR    */
  292.     {BLACK, LIGHTGRAY}, /* SELECT_COLOR */
  293.     {BLACK, LIGHTGRAY}, /* FRAME_COLOR  */
  294.     {BLACK, LIGHTGRAY}},/* HILITE_COLOR */
  295.  
  296.     /* ------------ TEXTBOX ----------- */
  297.    {{BLACK, LIGHTGRAY}, /* STD_COLOR    */
  298.     {LIGHTGRAY, BLACK}, /* SELECT_COLOR */
  299.     {BLACK, LIGHTGRAY}, /* FRAME_COLOR  */
  300.     {BLACK, LIGHTGRAY}},/* HILITE_COLOR */
  301.  
  302.     /* ------------ LISTBOX ----------- */
  303.    {{BLACK, LIGHTGRAY}, /* STD_COLOR    */
  304.     {LIGHTGRAY, BLACK}, /* SELECT_COLOR */
  305.     {BLACK, LIGHTGRAY}, /* FRAME_COLOR  */
  306.     {BLACK, LIGHTGRAY}},/* HILITE_COLOR */
  307.  
  308.     /* ----------- EDITBOX ------------ */
  309.    {{BLACK, LIGHTGRAY}, /* STD_COLOR    */
  310.     {LIGHTGRAY, BLACK}, /* SELECT_COLOR */
  311.     {BLACK, LIGHTGRAY}, /* FRAME_COLOR  */
  312.     {BLACK, LIGHTGRAY}},/* HILITE_COLOR */
  313.  
  314.     /* ---------- MENUBAR ------------- */
  315.    {{BLACK, LIGHTGRAY}, /* STD_COLOR    */
  316.     {LIGHTGRAY, BLACK}, /* SELECT_COLOR */
  317.     {LIGHTGRAY, BLACK}, /* FRAME_COLOR  */
  318.     {DARKGRAY, WHITE}}, /* HILITE_COLOR
  319.                            Inactive, Shortcut (both FG) */
  320.  
  321.     /* ---------- POPDOWNMENU --------- */
  322.    {{LIGHTGRAY, BLACK}, /* STD_COLOR    */
  323.     {BLACK, LIGHTGRAY}, /* SELECT_COLOR */
  324.     {LIGHTGRAY, BLACK}, /* FRAME_COLOR  */
  325.     {DARKGRAY, WHITE}}, /* HILITE_COLOR
  326.                            Inactive ,Shortcut (both FG) */
  327.  
  328. #ifdef INCLUDE_PICTUREBOX
  329.     /* ------------ PICTUREBOX ----------- */
  330.    {{BLACK, LIGHTGRAY}, /* STD_COLOR    */
  331.     {LIGHTGRAY, BLACK}, /* SELECT_COLOR */
  332.     {BLACK, LIGHTGRAY}, /* FRAME_COLOR  */
  333.     {BLACK, LIGHTGRAY}},/* HILITE_COLOR */
  334. #endif
  335.  
  336.     /* ------------- DIALOG ----------- */
  337.    {{BLACK, LIGHTGRAY},  /* STD_COLOR    */
  338.     {LIGHTGRAY, BLACK},  /* SELECT_COLOR */
  339.     {BLACK, LIGHTGRAY},  /* FRAME_COLOR  */
  340.     {BLACK, LIGHTGRAY}}, /* HILITE_COLOR */
  341.  
  342.     /* ------------ BOX --------------- */
  343.    {{BLACK, LIGHTGRAY},  /* STD_COLOR    */
  344.     {BLACK, LIGHTGRAY},  /* SELECT_COLOR */
  345.     {BLACK, LIGHTGRAY},  /* FRAME_COLOR  */
  346.     {BLACK, LIGHTGRAY}}, /* HILITE_COLOR */
  347.  
  348.     /* ------------ BUTTON ------------ */
  349.    {{LIGHTGRAY, BLACK}, /* STD_COLOR    */
  350.     {WHITE, BLACK},     /* SELECT_COLOR */
  351.     {LIGHTGRAY, BLACK}, /* FRAME_COLOR  */
  352.     {DARKGRAY, WHITE}}, /* HILITE_COLOR
  353.                            Inactive ,Shortcut (both FG) */
  354.     /* ------------ COMBOBOX ----------- */
  355.    {{BLACK, LIGHTGRAY}, /* STD_COLOR    */
  356.     {LIGHTGRAY, BLACK}, /* SELECT_COLOR */
  357.     {LIGHTGRAY, BLACK}, /* FRAME_COLOR  */
  358.     {BLACK, LIGHTGRAY}},/* HILITE_COLOR */
  359.  
  360.     /* ------------- TEXT ----------- */
  361.    {{0xff, 0xff},  /* STD_COLOR    */
  362.     {0xff, 0xff},  /* SELECT_COLOR */
  363.     {0xff, 0xff},  /* FRAME_COLOR  */
  364.     {0xff, 0xff}}, /* HILITE_COLOR */
  365.  
  366.     /* ------------- RADIOBUTTON ----------- */
  367.    {{BLACK, LIGHTGRAY},  /* STD_COLOR    */
  368.     {LIGHTGRAY, BLACK},  /* SELECT_COLOR */
  369.     {BLACK, LIGHTGRAY},  /* FRAME_COLOR  */
  370.     {BLACK, LIGHTGRAY}}, /* HILITE_COLOR */
  371.  
  372.     /* ------------- CHECKBOX ----------- */
  373.    {{BLACK, LIGHTGRAY},  /* STD_COLOR    */
  374.     {LIGHTGRAY, BLACK},  /* SELECT_COLOR */
  375.     {BLACK, LIGHTGRAY},  /* FRAME_COLOR  */
  376.     {BLACK, LIGHTGRAY}}, /* HILITE_COLOR */
  377.  
  378.     /* ------------ SPINBUTTON ----------- */
  379.    {{LIGHTGRAY, BLACK}, /* STD_COLOR    */
  380.     {LIGHTGRAY, BLACK}, /* SELECT_COLOR */
  381.     {LIGHTGRAY, BLACK}, /* FRAME_COLOR  */
  382.     {BLACK, LIGHTGRAY}},/* HILITE_COLOR */
  383.  
  384.     /* ----------- ERRORBOX ----------- */
  385.    {{BLACK, LIGHTGRAY},      /* STD_COLOR    */
  386.     {BLACK, LIGHTGRAY},      /* SELECT_COLOR */
  387.     {BLACK, LIGHTGRAY},      /* FRAME_COLOR  */
  388.     {BLACK, LIGHTGRAY}},     /* HILITE_COLOR */
  389.  
  390.     /* ----------- MESSAGEBOX --------- */
  391.    {{BLACK, LIGHTGRAY}, /* STD_COLOR    */
  392.     {BLACK, LIGHTGRAY}, /* SELECT_COLOR */
  393.     {BLACK, LIGHTGRAY}, /* FRAME_COLOR  */
  394.     {BLACK, LIGHTGRAY}},/* HILITE_COLOR */
  395.  
  396.     /* ----------- HELPBOX ------------ */
  397.    {{BLACK, LIGHTGRAY}, /* STD_COLOR    */
  398.     {LIGHTGRAY, BLACK}, /* SELECT_COLOR */
  399.     {BLACK, LIGHTGRAY}, /* FRAME_COLOR  */
  400.     {WHITE, LIGHTGRAY}},/* HILITE_COLOR */
  401.  
  402.     /* ---------- STATUSBAR ------------- */
  403.    {{LIGHTGRAY, BLACK},      /* STD_COLOR    */
  404.     {LIGHTGRAY, BLACK},      /* SELECT_COLOR */
  405.     {LIGHTGRAY, BLACK},      /* FRAME_COLOR  */
  406.     {LIGHTGRAY, BLACK}},     /* HILITE_COLOR */
  407.  
  408.     /* ---------- TITLEBAR ------------ */
  409.    {{LIGHTGRAY, BLACK},      /* STD_COLOR    */
  410.     {LIGHTGRAY, BLACK},      /* SELECT_COLOR */
  411.     {LIGHTGRAY, BLACK},      /* FRAME_COLOR  */
  412.     {LIGHTGRAY, BLACK}},     /* HILITE_COLOR */
  413.  
  414.     /* ------------ DUMMY ------------- */
  415.    {{LIGHTGRAY, BLACK}, /* STD_COLOR    */
  416.     {LIGHTGRAY, BLACK}, /* SELECT_COLOR */
  417.     {LIGHTGRAY, BLACK}, /* FRAME_COLOR  */
  418.     {LIGHTGRAY, BLACK}} /* HILITE_COLOR */
  419. };
  420.  
  421. /* ------ default configuration values ------- */
  422. CONFIG cfg = {
  423.     VERSION,
  424.     0,               /* Color                       */
  425.     TRUE,            /* Editor Insert Mode          */
  426.     4,               /* Editor tab stops            */
  427.     TRUE,            /* Editor word wrap            */
  428. #ifdef INCLUDE_WINDOWOPTIONS
  429.     TRUE,            /* Application Border          */
  430.     TRUE,            /* Application Title           */
  431.     TRUE,            /* Status Bar                  */
  432.     TRUE,            /* Textured application window */
  433. #endif
  434.     25,              /* Number of screen lines      */
  435.     "Lpt1",             /* Printer Port                */
  436.     66,              /* Lines per printer page      */
  437.     80,                 /* characters per printer line */
  438.     6,                 /* Left printer margin            */
  439.     70,                 /* Right printer margin        */
  440.     3,                 /* Top printer margin            */
  441.     55                 /* Bottom printer margin        */
  442. };
  443.  
  444. void BuildFileName(char *path, char *ext)
  445. {
  446.     extern char **Argv;
  447.     char *cp;
  448.  
  449.     strcpy(path, Argv[0]);
  450.     cp = strrchr(path, '\\');
  451.     if (cp == NULL)
  452.         cp = path;
  453.     else 
  454.         cp++;
  455.     strcpy(cp, DFlatApplication);
  456.     strcat(cp, ext);
  457. }
  458.  
  459. FILE *OpenConfig(char *mode)
  460. {
  461.     char path[64];
  462.     BuildFileName(path, ".cfg");
  463.     return fopen(path, mode);
  464. }
  465.  
  466. /* ------ load a configuration file from disk ------- */
  467. BOOL LoadConfig(void)
  468. {
  469.     static BOOL ConfigLoaded = FALSE;
  470.     if (ConfigLoaded == FALSE)    {
  471.         FILE *fp = OpenConfig("rb");
  472.         if (fp != NULL)    {
  473.             fread(cfg.version, sizeof cfg.version+1, 1, fp);
  474.             if (strcmp(cfg.version, VERSION) == 0)    {
  475.                 fseek(fp, 0L, SEEK_SET);
  476.                 fread(&cfg, sizeof(CONFIG), 1, fp);
  477.             }
  478.             else
  479.                 strcpy(cfg.version, VERSION);
  480.             fclose(fp);
  481.             ConfigLoaded = TRUE;
  482.         }
  483.     }
  484.     return ConfigLoaded;
  485. }
  486.  
  487. /* ------ save a configuration file to disk ------- */
  488. void SaveConfig(void)
  489. {
  490.     FILE *fp = OpenConfig("wb");
  491.     if (fp != NULL)    {
  492.         fwrite(&cfg, sizeof(CONFIG), 1, fp);
  493.         fclose(fp);
  494.     }
  495. }
  496.  
  497. /* --------- set window colors --------- */
  498. void SetStandardColor(WINDOW wnd)
  499. {
  500.     foreground = WndForeground(wnd);
  501.     background = WndBackground(wnd);
  502. }
  503.  
  504. void SetReverseColor(WINDOW wnd)
  505. {
  506.     foreground = SelectForeground(wnd);
  507.     background = SelectBackground(wnd);
  508. }
  509.