home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c083 / 19.ddi / OWLINC.PAK / STATIC.H < prev    next >
Encoding:
C/C++ Source or Header  |  1993-12-02  |  2.2 KB  |  83 lines

  1. //----------------------------------------------------------------------------
  2. // ObjectWindows - (C) Copyright 1991, 1993 by Borland International
  3. //   include\owl\static.h
  4. //   Defines class TStatic.  This defines the basic behavior of static
  5. //   controls
  6. //----------------------------------------------------------------------------
  7. #if !defined(__OWL_STATIC_H)
  8. #define __OWL_STATIC_H
  9.  
  10. #if !defined(__OWL_CONTROL_H)
  11.   #include <owl\control.h>
  12. #endif
  13.  
  14. //
  15. //  class TStatic
  16. //  ----- -------
  17. //
  18. class _OWLCLASS TStatic : public TControl {
  19.   public:
  20.     UINT  TextLen;
  21.  
  22.     TStatic(TWindow*        parent,
  23.             int             id,
  24.             const char far* title,
  25.             int x, int y, int w, int h,
  26.             UINT            textLen = 0,
  27.             TModule*        module = 0);
  28.  
  29.     TStatic(TWindow*   parent,
  30.             int        resourceId,
  31.             UINT       textLen = 0,
  32.             TModule*   module = 0);
  33.  
  34.     //
  35.     // returns the length of the control's text
  36.     //
  37.     int   GetTextLen() {return ::GetWindowTextLength(HWindow);}
  38.  
  39.     //
  40.     // fills the passed string with the text of the associated text
  41.     // control.  returns the number of characters copied
  42.     //
  43.     int   GetText(char far* str, int maxChars)
  44.             {return ::GetWindowText(HWindow, str, maxChars);}
  45.  
  46.     //
  47.     // sets the contents of the associated static text control to
  48.     // the passed string
  49.     //
  50.     void  SetText(const char far* str) {::SetWindowText(HWindow, str);}
  51.  
  52.     //
  53.     // clears the text of the associated static text control
  54.     //
  55.     virtual void Clear();
  56.  
  57.     //
  58.     // Override TWindow virtual member functions
  59.     //
  60.     UINT  Transfer(void* buffer, TTransferDirection direction);
  61.  
  62.   protected:
  63.     //
  64.     // Override TWindow virtual member functions
  65.     //
  66.     char far* GetClassName();
  67.  
  68.     // Make sure that control is re-painted when resized
  69.     void EvSize(UINT sizeType, TSize& size);
  70.  
  71.   private:
  72.     //
  73.     // hidden to prevent accidental copying or assignment
  74.     //
  75.     TStatic(const TStatic&);
  76.     TStatic& operator =(const TStatic&);
  77.  
  78.   DECLARE_STREAMABLE(_OWLCLASS, TStatic, 1);
  79.   DECLARE_RESPONSE_TABLE(TStatic);
  80. };
  81.  
  82. #endif  // __OWL_STATIC_H
  83.