home *** CD-ROM | disk | FTP | other *** search
/ High Voltage Shareware / high1.zip / high1 / DIR41 / DFPP02.ZIP / LABEL.CPP < prev    next >
C/C++ Source or Header  |  1993-08-13  |  667b  |  39 lines

  1. // ------------- label.cpp
  2.  
  3. #include <ctype.h>
  4. #include "label.h"
  5.  
  6. Label::Label(char *txt, int lf, int tp, int wd, DFWindow *par)
  7.                     : TextBox(lf, tp, 1, wd ? wd : strlen(txt), par)
  8. {
  9.     SetText(txt);
  10.     char *ac = strchr(txt, SHORTCUTCHAR);
  11.     if (ac != 0)
  12.         Control::LatestShortcut = tolower(*(ac+1));
  13.     Disable();
  14. }
  15.  
  16. void Label::CloseWindow()
  17. {
  18.     TextBox::CloseWindow();
  19. }
  20.  
  21. // -------- set the fg/bg colors for the window 
  22. void Label::SetColors()
  23. {
  24.     if (Parent() != 0)    {
  25.         SetColor(Parent()->Colors());
  26.         shortcutfg = RED;
  27.     }
  28. }
  29.  
  30. void Label::Paint()
  31. {
  32.     if (visible)
  33.         WriteShortcutLine(0, colors.fg, colors.bg);
  34. }
  35.  
  36.  
  37.  
  38.  
  39.