home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / df3os2.zip / LABEL.CPP < prev    next >
C/C++ Source or Header  |  1993-09-24  |  755b  |  40 lines

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