home *** CD-ROM | disk | FTP | other *** search
/ Media Share 13 / mediashare_13.zip / mediashare_13 / ZIPPED / PROGRAM / DFLT18.ZIP / CONFIG.C < prev    next >
Text File  |  1994-01-25  |  19KB  |  534 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.     {BLACK, LIGHTGRAY},  /* 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.     /* ----------- EDITOR ------------ */
  132.    {{LIGHTGRAY, BLUE},  /* STD_COLOR    */
  133.     {BLACK, LIGHTGRAY},  /* SELECT_COLOR */
  134.     {LIGHTGRAY, BLUE},  /* FRAME_COLOR  */
  135.     {BLACK, LIGHTGRAY}},/* HILITE_COLOR */
  136.  
  137.     /* ---------- TITLEBAR ------------ */
  138.    {{BLACK, CYAN},      /* STD_COLOR    */
  139.     {BLACK, CYAN},      /* SELECT_COLOR */
  140.     {BLACK, CYAN},      /* FRAME_COLOR  */
  141.     {WHITE, CYAN}},     /* HILITE_COLOR */
  142.  
  143.     /* ------------ DUMMY ------------- */
  144.    {{GREEN, LIGHTGRAY}, /* STD_COLOR    */
  145.     {GREEN, LIGHTGRAY}, /* SELECT_COLOR */
  146.     {GREEN, LIGHTGRAY}, /* FRAME_COLOR  */
  147.     {GREEN, LIGHTGRAY}} /* HILITE_COLOR */
  148. };
  149.  
  150. /* ----- default colors for mono video system ----- */
  151. unsigned char bw[CLASSCOUNT] [4] [2] = {
  152.     /* ------------ NORMAL ------------ */
  153.    {{LIGHTGRAY, BLACK}, /* STD_COLOR    */
  154.     {LIGHTGRAY, BLACK}, /* SELECT_COLOR */
  155.     {LIGHTGRAY, BLACK}, /* FRAME_COLOR  */
  156.     {LIGHTGRAY, BLACK}},/* HILITE_COLOR */
  157.  
  158.     /* ---------- APPLICATION --------- */
  159.    {{LIGHTGRAY, BLACK}, /* STD_COLOR    */
  160.     {LIGHTGRAY, BLACK}, /* SELECT_COLOR */
  161.     {LIGHTGRAY, BLACK}, /* FRAME_COLOR  */
  162.     {LIGHTGRAY, BLACK}},/* HILITE_COLOR */
  163.  
  164.     /* ------------ TEXTBOX ----------- */
  165.    {{BLACK, LIGHTGRAY}, /* STD_COLOR    */
  166.     {LIGHTGRAY, BLACK}, /* SELECT_COLOR */
  167.     {BLACK, LIGHTGRAY}, /* FRAME_COLOR  */
  168.     {BLACK, LIGHTGRAY}},/* HILITE_COLOR */
  169.  
  170.     /* ------------ LISTBOX ----------- */
  171.    {{LIGHTGRAY, BLACK}, /* STD_COLOR    */
  172.     {BLACK, LIGHTGRAY}, /* SELECT_COLOR */
  173.     {LIGHTGRAY, BLACK}, /* FRAME_COLOR  */
  174.     {BLACK, LIGHTGRAY}},/* HILITE_COLOR */
  175.  
  176.     /* ----------- EDITBOX ------------ */
  177.    {{LIGHTGRAY, BLACK}, /* STD_COLOR    */
  178.     {BLACK, LIGHTGRAY}, /* SELECT_COLOR */
  179.     {LIGHTGRAY, BLACK}, /* FRAME_COLOR  */
  180.     {BLACK, LIGHTGRAY}},/* HILITE_COLOR */
  181.  
  182.     /* ---------- MENUBAR ------------- */
  183.    {{LIGHTGRAY, BLACK}, /* STD_COLOR    */
  184.     {BLACK, LIGHTGRAY}, /* SELECT_COLOR */
  185.     {BLACK, LIGHTGRAY}, /* FRAME_COLOR  */
  186.     {DARKGRAY, WHITE}}, /* HILITE_COLOR
  187.                            Inactive, Shortcut (both FG) */
  188.  
  189.     /* ---------- POPDOWNMENU --------- */
  190.    {{LIGHTGRAY, BLACK}, /* STD_COLOR    */
  191.     {BLACK, LIGHTGRAY}, /* SELECT_COLOR */
  192.     {LIGHTGRAY, BLACK}, /* FRAME_COLOR  */
  193.     {DARKGRAY, WHITE}}, /* HILITE_COLOR
  194.                            Inactive ,Shortcut (both FG) */
  195.  
  196. #ifdef INCLUDE_PICTUREBOX
  197.     /* ------------ PICTUREBOX ----------- */
  198.    {{BLACK, LIGHTGRAY}, /* STD_COLOR    */
  199.     {LIGHTGRAY, BLACK}, /* SELECT_COLOR */
  200.     {BLACK, LIGHTGRAY}, /* FRAME_COLOR  */
  201.     {BLACK, LIGHTGRAY}},/* HILITE_COLOR */
  202. #endif
  203.  
  204.     /* ------------- DIALOG ----------- */
  205.    {{LIGHTGRAY, BLACK},  /* STD_COLOR    */
  206.     {BLACK, LIGHTGRAY},  /* SELECT_COLOR */
  207.     {LIGHTGRAY, BLACK},  /* FRAME_COLOR  */
  208.     {LIGHTGRAY, BLACK}}, /* HILITE_COLOR */
  209.  
  210.     /* ------------ BOX --------------- */
  211.    {{LIGHTGRAY, BLACK},  /* STD_COLOR    */
  212.     {LIGHTGRAY, BLACK},  /* SELECT_COLOR */
  213.     {LIGHTGRAY, BLACK},  /* FRAME_COLOR  */
  214.     {LIGHTGRAY, BLACK}}, /* HILITE_COLOR */
  215.  
  216.     /* ------------ BUTTON ------------ */
  217.    {{BLACK, LIGHTGRAY}, /* STD_COLOR    */
  218.     {WHITE, LIGHTGRAY}, /* SELECT_COLOR */
  219.     {BLACK, LIGHTGRAY}, /* FRAME_COLOR  */
  220.     {DARKGRAY, WHITE}}, /* HILITE_COLOR
  221.                            Inactive ,Shortcut (both FG) */
  222.     /* ------------ COMBOBOX ----------- */
  223.    {{BLACK, LIGHTGRAY}, /* STD_COLOR    */
  224.     {LIGHTGRAY, BLACK}, /* SELECT_COLOR */
  225.     {BLACK, LIGHTGRAY}, /* FRAME_COLOR  */
  226.     {BLACK, LIGHTGRAY}},/* HILITE_COLOR */
  227.  
  228.     /* ------------- TEXT ----------- */
  229.    {{0xff, 0xff},  /* STD_COLOR    */
  230.     {0xff, 0xff},  /* SELECT_COLOR */
  231.     {0xff, 0xff},  /* FRAME_COLOR  */
  232.     {0xff, 0xff}}, /* HILITE_COLOR */
  233.  
  234.     /* ------------- RADIOBUTTON ----------- */
  235.    {{LIGHTGRAY, BLACK},  /* STD_COLOR    */
  236.     {BLACK, LIGHTGRAY},  /* SELECT_COLOR */
  237.     {LIGHTGRAY, BLACK},  /* FRAME_COLOR  */
  238.     {LIGHTGRAY, BLACK}}, /* HILITE_COLOR */
  239.  
  240.     /* ------------- CHECKBOX ----------- */
  241.    {{LIGHTGRAY, BLACK},  /* STD_COLOR    */
  242.     {BLACK, LIGHTGRAY},  /* SELECT_COLOR */
  243.     {LIGHTGRAY, BLACK},  /* FRAME_COLOR  */
  244.     {LIGHTGRAY, BLACK}}, /* HILITE_COLOR */
  245.  
  246.     /* ------------ SPINBUTTON ----------- */
  247.    {{BLACK, LIGHTGRAY}, /* STD_COLOR    */
  248.     {BLACK, LIGHTGRAY}, /* SELECT_COLOR */
  249.     {BLACK, LIGHTGRAY}, /* FRAME_COLOR  */
  250.     {BLACK, LIGHTGRAY}},/* HILITE_COLOR */
  251.  
  252.     /* ----------- ERRORBOX ----------- */
  253.    {{LIGHTGRAY, BLACK}, /* STD_COLOR    */
  254.     {LIGHTGRAY, BLACK}, /* SELECT_COLOR */
  255.     {LIGHTGRAY, BLACK}, /* FRAME_COLOR  */
  256.     {LIGHTGRAY, BLACK}},/* HILITE_COLOR */
  257.  
  258.     /* ----------- MESSAGEBOX --------- */
  259.    {{LIGHTGRAY, BLACK}, /* STD_COLOR    */
  260.     {LIGHTGRAY, BLACK}, /* SELECT_COLOR */
  261.     {LIGHTGRAY, BLACK}, /* FRAME_COLOR  */
  262.     {LIGHTGRAY, BLACK}},/* HILITE_COLOR */
  263.  
  264.     /* ----------- HELPBOX ------------ */
  265.    {{LIGHTGRAY, BLACK}, /* STD_COLOR    */
  266.     {WHITE, BLACK},     /* SELECT_COLOR */
  267.     {LIGHTGRAY, BLACK}, /* FRAME_COLOR  */
  268.     {WHITE, LIGHTGRAY}},/* HILITE_COLOR */
  269.  
  270.     /* ---------- STATUSBAR ------------- */
  271.    {{BLACK, LIGHTGRAY}, /* STD_COLOR    */
  272.     {BLACK, LIGHTGRAY}, /* SELECT_COLOR */
  273.     {BLACK, LIGHTGRAY}, /* FRAME_COLOR  */
  274.     {BLACK, LIGHTGRAY}},/* HILITE_COLOR */
  275.  
  276.     /* ----------- EDITOR ------------ */
  277.    {{BLACK, LIGHTGRAY}, /* STD_COLOR    */
  278.     {LIGHTGRAY, BLACK}, /* SELECT_COLOR */
  279.     {BLACK, LIGHTGRAY}, /* FRAME_COLOR  */
  280.     {LIGHTGRAY, BLACK}},/* HILITE_COLOR */
  281.  
  282.     /* ---------- TITLEBAR ------------ */
  283.    {{BLACK, LIGHTGRAY}, /* STD_COLOR    */
  284.     {BLACK, LIGHTGRAY}, /* SELECT_COLOR */
  285.     {BLACK, LIGHTGRAY}, /* FRAME_COLOR  */
  286.     {BLACK, LIGHTGRAY}},/* HILITE_COLOR */
  287.  
  288.     /* ------------ DUMMY ------------- */
  289.    {{BLACK, LIGHTGRAY}, /* STD_COLOR    */
  290.     {BLACK, LIGHTGRAY}, /* SELECT_COLOR */
  291.     {BLACK, LIGHTGRAY}, /* FRAME_COLOR  */
  292.     {BLACK, LIGHTGRAY}} /* HILITE_COLOR */
  293. };
  294. /* ----- default colors for reverse mono video ----- */
  295. unsigned char reverse[CLASSCOUNT] [4] [2] = {
  296.     /* ------------ NORMAL ------------ */
  297.    {{BLACK, LIGHTGRAY}, /* STD_COLOR    */
  298.     {BLACK, LIGHTGRAY}, /* SELECT_COLOR */
  299.     {BLACK, LIGHTGRAY}, /* FRAME_COLOR  */
  300.     {BLACK, LIGHTGRAY}},/* HILITE_COLOR */
  301.  
  302.     /* ---------- APPLICATION --------- */
  303.    {{BLACK, LIGHTGRAY}, /* STD_COLOR    */
  304.     {BLACK, LIGHTGRAY}, /* SELECT_COLOR */
  305.     {BLACK, LIGHTGRAY}, /* FRAME_COLOR  */
  306.     {BLACK, LIGHTGRAY}},/* HILITE_COLOR */
  307.  
  308.     /* ------------ TEXTBOX ----------- */
  309.    {{BLACK, LIGHTGRAY}, /* STD_COLOR    */
  310.     {LIGHTGRAY, BLACK}, /* SELECT_COLOR */
  311.     {BLACK, LIGHTGRAY}, /* FRAME_COLOR  */
  312.     {BLACK, LIGHTGRAY}},/* HILITE_COLOR */
  313.  
  314.     /* ------------ LISTBOX ----------- */
  315.    {{BLACK, LIGHTGRAY}, /* STD_COLOR    */
  316.     {LIGHTGRAY, BLACK}, /* SELECT_COLOR */
  317.     {BLACK, LIGHTGRAY}, /* FRAME_COLOR  */
  318.     {BLACK, LIGHTGRAY}},/* HILITE_COLOR */
  319.  
  320.     /* ----------- EDITBOX ------------ */
  321.    {{BLACK, LIGHTGRAY}, /* STD_COLOR    */
  322.     {LIGHTGRAY, BLACK}, /* SELECT_COLOR */
  323.     {BLACK, LIGHTGRAY}, /* FRAME_COLOR  */
  324.     {BLACK, LIGHTGRAY}},/* HILITE_COLOR */
  325.  
  326.     /* ---------- MENUBAR ------------- */
  327.    {{BLACK, LIGHTGRAY}, /* STD_COLOR    */
  328.     {LIGHTGRAY, BLACK}, /* SELECT_COLOR */
  329.     {LIGHTGRAY, BLACK}, /* FRAME_COLOR  */
  330.     {DARKGRAY, WHITE}}, /* HILITE_COLOR
  331.                            Inactive, Shortcut (both FG) */
  332.  
  333.     /* ---------- POPDOWNMENU --------- */
  334.    {{LIGHTGRAY, BLACK}, /* STD_COLOR    */
  335.     {BLACK, LIGHTGRAY}, /* SELECT_COLOR */
  336.     {LIGHTGRAY, BLACK}, /* FRAME_COLOR  */
  337.     {DARKGRAY, WHITE}}, /* HILITE_COLOR
  338.                            Inactive ,Shortcut (both FG) */
  339.  
  340. #ifdef INCLUDE_PICTUREBOX
  341.     /* ------------ PICTUREBOX ----------- */
  342.    {{BLACK, LIGHTGRAY}, /* STD_COLOR    */
  343.     {LIGHTGRAY, BLACK}, /* SELECT_COLOR */
  344.     {BLACK, LIGHTGRAY}, /* FRAME_COLOR  */
  345.     {BLACK, LIGHTGRAY}},/* HILITE_COLOR */
  346. #endif
  347.  
  348.     /* ------------- DIALOG ----------- */
  349.    {{BLACK, LIGHTGRAY},  /* STD_COLOR    */
  350.     {LIGHTGRAY, BLACK},  /* SELECT_COLOR */
  351.     {BLACK, LIGHTGRAY},  /* FRAME_COLOR  */
  352.     {BLACK, LIGHTGRAY}}, /* HILITE_COLOR */
  353.  
  354.     /* ------------ BOX --------------- */
  355.    {{BLACK, LIGHTGRAY},  /* STD_COLOR    */
  356.     {BLACK, LIGHTGRAY},  /* SELECT_COLOR */
  357.     {BLACK, LIGHTGRAY},  /* FRAME_COLOR  */
  358.     {BLACK, LIGHTGRAY}}, /* HILITE_COLOR */
  359.  
  360.     /* ------------ BUTTON ------------ */
  361.    {{LIGHTGRAY, BLACK}, /* STD_COLOR    */
  362.     {WHITE, BLACK},     /* SELECT_COLOR */
  363.     {LIGHTGRAY, BLACK}, /* FRAME_COLOR  */
  364.     {DARKGRAY, WHITE}}, /* HILITE_COLOR
  365.                            Inactive ,Shortcut (both FG) */
  366.     /* ------------ COMBOBOX ----------- */
  367.    {{BLACK, LIGHTGRAY}, /* STD_COLOR    */
  368.     {LIGHTGRAY, BLACK}, /* SELECT_COLOR */
  369.     {LIGHTGRAY, BLACK}, /* FRAME_COLOR  */
  370.     {BLACK, LIGHTGRAY}},/* HILITE_COLOR */
  371.  
  372.     /* ------------- TEXT ----------- */
  373.    {{0xff, 0xff},  /* STD_COLOR    */
  374.     {0xff, 0xff},  /* SELECT_COLOR */
  375.     {0xff, 0xff},  /* FRAME_COLOR  */
  376.     {0xff, 0xff}}, /* HILITE_COLOR */
  377.  
  378.     /* ------------- RADIOBUTTON ----------- */
  379.    {{BLACK, LIGHTGRAY},  /* STD_COLOR    */
  380.     {LIGHTGRAY, BLACK},  /* SELECT_COLOR */
  381.     {BLACK, LIGHTGRAY},  /* FRAME_COLOR  */
  382.     {BLACK, LIGHTGRAY}}, /* HILITE_COLOR */
  383.  
  384.     /* ------------- CHECKBOX ----------- */
  385.    {{BLACK, LIGHTGRAY},  /* STD_COLOR    */
  386.     {LIGHTGRAY, BLACK},  /* SELECT_COLOR */
  387.     {BLACK, LIGHTGRAY},  /* FRAME_COLOR  */
  388.     {BLACK, LIGHTGRAY}}, /* HILITE_COLOR */
  389.  
  390.     /* ------------ SPINBUTTON ----------- */
  391.    {{LIGHTGRAY, BLACK}, /* STD_COLOR    */
  392.     {LIGHTGRAY, BLACK}, /* SELECT_COLOR */
  393.     {LIGHTGRAY, BLACK}, /* FRAME_COLOR  */
  394.     {BLACK, LIGHTGRAY}},/* HILITE_COLOR */
  395.  
  396.     /* ----------- ERRORBOX ----------- */
  397.    {{BLACK, LIGHTGRAY},      /* STD_COLOR    */
  398.     {BLACK, LIGHTGRAY},      /* SELECT_COLOR */
  399.     {BLACK, LIGHTGRAY},      /* FRAME_COLOR  */
  400.     {BLACK, LIGHTGRAY}},     /* HILITE_COLOR */
  401.  
  402.     /* ----------- MESSAGEBOX --------- */
  403.    {{BLACK, LIGHTGRAY}, /* STD_COLOR    */
  404.     {BLACK, LIGHTGRAY}, /* SELECT_COLOR */
  405.     {BLACK, LIGHTGRAY}, /* FRAME_COLOR  */
  406.     {BLACK, LIGHTGRAY}},/* HILITE_COLOR */
  407.  
  408.     /* ----------- HELPBOX ------------ */
  409.    {{BLACK, LIGHTGRAY}, /* STD_COLOR    */
  410.     {LIGHTGRAY, BLACK}, /* SELECT_COLOR */
  411.     {BLACK, LIGHTGRAY}, /* FRAME_COLOR  */
  412.     {WHITE, LIGHTGRAY}},/* HILITE_COLOR */
  413.  
  414.     /* ---------- STATUSBAR ------------- */
  415.    {{LIGHTGRAY, BLACK},      /* STD_COLOR    */
  416.     {LIGHTGRAY, BLACK},      /* SELECT_COLOR */
  417.     {LIGHTGRAY, BLACK},      /* FRAME_COLOR  */
  418.     {LIGHTGRAY, BLACK}},     /* HILITE_COLOR */
  419.  
  420.     /* ----------- EDITOR ------------ */
  421.    {{LIGHTGRAY, BLACK}, /* STD_COLOR    */
  422.     {BLACK, LIGHTGRAY}, /* SELECT_COLOR */
  423.     {LIGHTGRAY, BLACK}, /* FRAME_COLOR  */
  424.     {BLACK, LIGHTGRAY}},/* HILITE_COLOR */
  425.  
  426.     /* ---------- TITLEBAR ------------ */
  427.    {{LIGHTGRAY, BLACK},      /* STD_COLOR    */
  428.     {LIGHTGRAY, BLACK},      /* SELECT_COLOR */
  429.     {LIGHTGRAY, BLACK},      /* FRAME_COLOR  */
  430.     {LIGHTGRAY, BLACK}},     /* HILITE_COLOR */
  431.  
  432.     /* ------------ DUMMY ------------- */
  433.    {{LIGHTGRAY, BLACK}, /* STD_COLOR    */
  434.     {LIGHTGRAY, BLACK}, /* SELECT_COLOR */
  435.     {LIGHTGRAY, BLACK}, /* FRAME_COLOR  */
  436.     {LIGHTGRAY, BLACK}} /* HILITE_COLOR */
  437. };
  438.  
  439. /* ------ default configuration values ------- */
  440. CONFIG cfg = {
  441.     VERSION,
  442.     0,               /* Color                       */
  443.     FALSE,             /* Snowy CGA                   */
  444.     TRUE,            /* Editor Insert Mode          */
  445.     4,               /* Editor tab stops            */
  446.     TRUE,            /* Editor word wrap            */
  447. #ifdef INCLUDE_WINDOWOPTIONS
  448.     TRUE,            /* Application Border          */
  449.     TRUE,            /* Application Title           */
  450.     TRUE,            /* Status Bar                  */
  451.     TRUE,            /* Textured application window */
  452. #endif
  453.     25,              /* Number of screen lines      */
  454.     "Lpt1",             /* Printer Port                */
  455.     66,              /* Lines per printer page      */
  456.     80,                 /* characters per printer line */
  457.     6,                 /* Left printer margin            */
  458.     70,                 /* Right printer margin        */
  459.     3,                 /* Top printer margin            */
  460.     55                 /* Bottom printer margin        */
  461. };
  462.  
  463. void BuildFileName(char *path, char *ext)
  464. {
  465.     extern char **Argv;
  466.     char *cp;
  467.  
  468.     strcpy(path, Argv[0]);
  469.     cp = strrchr(path, '\\');
  470.     if (cp == NULL)
  471.         cp = path;
  472.     else 
  473.         cp++;
  474.     strcpy(cp, DFlatApplication);
  475.     strcat(cp, ext);
  476. }
  477.  
  478. FILE *OpenConfig(char *mode)
  479. {
  480.     char path[64];
  481.     BuildFileName(path, ".cfg");
  482.     return fopen(path, mode);
  483. }
  484.  
  485. /* ------ load a configuration file from disk ------- */
  486. BOOL LoadConfig(void)
  487. {
  488.     static BOOL ConfigLoaded = FALSE;
  489.     if (ConfigLoaded == FALSE)    {
  490.         FILE *fp = OpenConfig("rb");
  491.         if (fp != NULL)    {
  492.             fread(cfg.version, sizeof cfg.version+1, 1, fp);
  493.             if (strcmp(cfg.version, VERSION) == 0)    {
  494.                 fseek(fp, 0L, SEEK_SET);
  495.                 fread(&cfg, sizeof(CONFIG), 1, fp);
  496.                     fclose(fp);
  497.             }
  498.             else    {
  499.                 char path[64];
  500.                 BuildFileName(path, ".cfg");
  501.                 fclose(fp);
  502.                 unlink(path);
  503.                 strcpy(cfg.version, VERSION);
  504.             }
  505.             ConfigLoaded = TRUE;
  506.         }
  507.     }
  508.     return ConfigLoaded;
  509. }
  510.  
  511. /* ------ save a configuration file to disk ------- */
  512. void SaveConfig(void)
  513. {
  514.     FILE *fp = OpenConfig("wb");
  515.     if (fp != NULL)    {
  516.         fwrite(&cfg, sizeof(CONFIG), 1, fp);
  517.         fclose(fp);
  518.     }
  519. }
  520.  
  521. /* --------- set window colors --------- */
  522. void SetStandardColor(WINDOW wnd)
  523. {
  524.     foreground = WndForeground(wnd);
  525.     background = WndBackground(wnd);
  526. }
  527.  
  528. void SetReverseColor(WINDOW wnd)
  529. {
  530.     foreground = SelectForeground(wnd);
  531.     background = SelectBackground(wnd);
  532. }
  533. 
  534.