home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c082_122 / 3.ddi / OWLINC.ZIP / STATIC.H < prev    next >
Encoding:
C/C++ Source or Header  |  1992-06-10  |  2.2 KB  |  82 lines

  1. // ObjectWindows - (C) Copyright 1992 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. #pragma option -Vo-
  11. #if     defined(__BCOPT__) && !defined(_ALLOW_po)
  12. #pragma option -po-
  13. #endif
  14.  
  15.   /* TStatic */
  16.  
  17. _CLASSDEF(TStatic)
  18.  
  19. class _EXPORT TStatic : public TControl
  20. {
  21. public:
  22.     WORD TextLen;
  23.  
  24.     TStatic(PTWindowsObject AParent, int AnId, LPSTR ATitle, int X,
  25.             int Y, int W, int H, WORD ATextLen, PTModule AModule = NULL);
  26.     TStatic(PTWindowsObject AParent, int ResourceId, WORD ATextLen,
  27.             PTModule AModule = NULL);
  28.  
  29.     /* Returns the length of the control's text. */
  30.     int GetTextLen()
  31.         { return GetWindowTextLength(HWindow); }
  32.  
  33.     /* Fills the passed string with the text of the associated text
  34.        control.  Returns the number of characters copied. */
  35.     int GetText(LPSTR ATextString, int MaxChars)
  36.         { return GetWindowText(HWindow, ATextString, MaxChars); }
  37.  
  38.     /* Sets the contents of the associated static text control to
  39.        the passed string. */
  40.     void SetText(LPSTR ATextString)
  41.         { SetWindowText(HWindow, ATextString); }
  42.  
  43.     /* Clears the text of the associated static text control. */
  44.     void Clear()
  45.         { SetText(""); }
  46.  
  47.     virtual WORD Transfer(Pvoid DataPtr, WORD TransferFlag);
  48.  
  49.     virtual Pchar nameOf() const
  50.         { return "TStatic"; }
  51.  
  52.     static PTStreamable build();
  53.  
  54. protected:
  55.     virtual LPSTR GetClassName()
  56.         { return "STATIC"; }
  57.  
  58.     TStatic(StreamableInit) : TControl(streamableInit) {};
  59.     virtual void write (Ropstream os);
  60.     virtual Pvoid read (Ripstream is);
  61. private:
  62.     virtual const Pchar streamableName() const
  63.         { return "TStatic"; }
  64. };
  65.  
  66. inline Ripstream operator >> ( Ripstream is, RTStatic cl )
  67.     { return is >> (RTStreamable)cl; }
  68. inline Ripstream operator >> ( Ripstream is, RPTStatic cl )
  69.     { return is >> (RPvoid)cl; }
  70.  
  71. inline Ropstream operator << ( Ropstream os, RTStatic cl )
  72.     { return os << (RTStreamable)cl; }
  73. inline Ropstream operator << ( Ropstream os, PTStatic cl )
  74.     { return os << (PTStreamable)cl; }
  75.  
  76. #pragma option -Vo.
  77. #if     defined(__BCOPT__) && !defined(_ALLOW_po)
  78. #pragma option -po.
  79. #endif
  80.  
  81. #endif
  82.