home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1998 May / Pcwk5b98.iso / Borland / Cplus45 / BC45 / OWLINC.PAK / MESSAGEB.H < prev    next >
C/C++ Source or Header  |  1995-08-29  |  2KB  |  69 lines

  1. //----------------------------------------------------------------------------
  2. // ObjectWindows
  3. // (C) Copyright 1992, 1994 by Borland International, All Rights Reserved
  4. //
  5. //   Class TMessageBar.
  6. //----------------------------------------------------------------------------
  7. #if !defined(OWL_MESSAGEB_H)
  8. #define OWL_MESSAGEB_H
  9.  
  10. #if !defined(OWL_GADGETWI_H)
  11. # include <owl/gadgetwi.h>
  12. #endif
  13.  
  14. const int IDW_STATUSBAR     = 32040;  // Window ID used to locate status bars
  15.  
  16. //
  17. //  class TMessageBar
  18. //  ----- -----------
  19. //
  20. //  implements a message bar with one text gadget as wide as the window and no
  21. //  border. positions itself at the bottom of the window and uses the default
  22. //  decoration bar font
  23. //
  24. //  the message bar optionally draws a highlight line at the top
  25. //
  26. class _OWLCLASS TMessageBar : public TGadgetWindow {
  27.   public:
  28.     TMessageBar(TWindow*   parent = 0,
  29.                 TFont*     font = new TGadgetWindowFont,
  30.                 TModule*   module = 0);
  31.    ~TMessageBar();
  32.  
  33.     //
  34.     // set the text for the text message gadget (the first gadget)
  35.     //
  36.     void    SetText(const char* text);
  37.  
  38.     //
  39.     // set (or clear if 0) menu/command item hint text displayed in/on bar
  40.     //
  41.     virtual void    SetHintText(const char* text);
  42.  
  43.   protected:
  44.     bool   HighlightLine;  // does this bar have a upper highlight line?
  45.     char*  HintText;       // current command hint being displayed, if any
  46.  
  47.     //
  48.     // compensate for highlight line
  49.     //
  50.     void   GetInnerRect(TRect& rect);
  51.     void   GetDesiredSize(TSize& rect);
  52.  
  53.     //
  54.     // draw highlight line, then HintText if any, or gadgets
  55.     //
  56.     void  PaintGadgets(TDC& dc, bool erase, TRect& rect);
  57.  
  58.   private:
  59.     //
  60.     // hidden to prevent accidental copying or assignment
  61.     //
  62.     TMessageBar(const TMessageBar&);
  63.     TMessageBar& operator =(const TMessageBar&);
  64.  
  65.   DECLARE_CASTABLE;
  66. };
  67.  
  68. #endif  // OWL_MESSAGEB_H
  69.