home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / epmsmp.zip / COLOREXT.E < prev    next >
Text File  |  1992-08-27  |  1KB  |  37 lines

  1. ; Different colors for different file extensions
  2.  
  3. ; This is just a small piece of E code that I find extremely useful.
  4. ; Everything between the dotted lines goes into a file called MySelect.E.
  5. ; This file is automatically (try)included when etpm-ing epm.
  6. ;
  7. ; To use - Put everything into MySelect.E, and ETPM EPM.
  8. ; You WOULD like to change the colors and add more extensions.
  9. ; This is done by changing the SetExtColor lines below the definit.
  10. ; You may use all the colors defined in Colors.E.
  11.  
  12. ; Amir Kolsky
  13.  
  14. compile if not defined(Yellow)
  15.   include    'colors.e' -- Mnemonic color names & default colors defined here.
  16. compile endif
  17.  
  18. defproc SetExtColor(aid, ext, clr)
  19.   do_array 2, aid, ext, clr
  20.  
  21. definit
  22.   do_array 1, aId, "Extension Color"
  23.   SetExtColor(aId, 'C', Black + YellowB)
  24.   SetExtColor(aId, 'RC', Blue + YellowB)
  25.   SetExtColor(aId, 'H', Black + Light_GreyB)
  26.   SetExtColor(aId, 'E', Blue + Light_GreyB)
  27.  
  28. defselect
  29.   do_array 6, aId, "Extension Color"
  30.   display -2
  31.   do_array 3, aId, filetype(), Clr
  32.   display 2
  33.   if (Clr = '') then
  34.     Clr = Black + WhiteB
  35.   endif
  36.   .textcolor = clr
  37.