home *** CD-ROM | disk | FTP | other *** search
/ Piper's Pit BBS/FTP: ibm 0040 - 0049 / ibm0040-0049 / ibm0040.tar / ibm0040 / BCPPOWL1.ZIP / OWLINC.ZIP / STATIC.H < prev    next >
Encoding:
C/C++ Source or Header  |  1991-08-28  |  2.0 KB  |  72 lines

  1. // ObjectWindows - (C) Copyright 1991 by Borland International
  2.  
  3. #ifndef __STATIC_H
  4. #define __STATIC_H
  5.  
  6. #ifndef __CONTROL_H
  7. #include <control.h>
  8. #endif
  9.  
  10.   /* TStatic */
  11.  
  12. _CLASSDEF(TStatic)
  13.  
  14. class _EXPORT TStatic : public TControl
  15. {
  16. public:
  17.     WORD TextLen;
  18.  
  19.     TStatic(PTWindowsObject AParent, int AnId, LPSTR ATitle, int X,
  20.             int Y, int W, int H, WORD ATextLen, PTModule AModule = NULL);
  21.     TStatic(PTWindowsObject AParent, int ResourceId, WORD ATextLen, 
  22.             PTModule AModule = NULL);
  23.  
  24.     /* Returns the length of the control's text. */
  25.     int GetTextLen()
  26.         { return GetWindowTextLength(HWindow); }
  27.  
  28.     /* Fills the passed string with the text of the associated text
  29.        control.  Returns the number of characters copied. */
  30.     int GetText(LPSTR ATextString, int MaxChars)
  31.         { return GetWindowText(HWindow, ATextString, MaxChars); }
  32.  
  33.     /* Sets the contents of the associated static text control to
  34.        the passed string. */
  35.     void SetText(LPSTR ATextString)
  36.         { SetWindowText(HWindow, ATextString); }
  37.  
  38.     /* Clears the text of the associated static text control. */
  39.     void Clear()
  40.         { SetText(""); }
  41.  
  42.     virtual WORD Transfer(Pvoid DataPtr, WORD TransferFlag);
  43.  
  44.     virtual Pchar nameOf() const
  45.         { return "TStatic"; }
  46.  
  47.     static PTStreamable build();
  48.  
  49. protected:
  50.     virtual LPSTR GetClassName() 
  51.         { return "STATIC"; }
  52.  
  53.     TStatic(StreamableInit) : TControl(streamableInit) {};
  54.     virtual void write (Ropstream os);
  55.     virtual Pvoid read (Ripstream is);
  56. private:
  57.     virtual const Pchar streamableName() const
  58.         { return "TStatic"; }
  59. };
  60.    
  61. inline Ripstream operator >> ( Ripstream is, RTStatic cl )
  62.     { return is >> (RTStreamable)cl; }
  63. inline Ripstream operator >> ( Ripstream is, RPTStatic cl )
  64.     { return is >> (RPvoid)cl; }
  65.  
  66. inline Ropstream operator << ( Ropstream os, RTStatic cl )
  67.     { return os << (RTStreamable)cl; }
  68. inline Ropstream operator << ( Ropstream os, PTStatic cl )
  69.     { return os << (PTStreamable)cl; }
  70.  
  71. #endif
  72.