home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / Think Class Libraries / CDictionary 1.0 / CStaticString.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-11-30  |  1.8 KB  |  60 lines  |  [TEXT/KAHL]

  1. /******************************************************************************
  2. CStaticString.h
  3.  
  4.     Subclass of CPane that draws a Pascal string. Has less
  5.     overhead than CStaticText since it doesn't require a TEHandle. On
  6.     the other hand, it doesn't do word wrap or justification. Basically
  7.     good for simple labels.
  8.         
  9.     by Dan Podwall - you may do anything you please with this code except
  10.     charge for it, with the exception of normal network download charges.
  11.         
  12. ******************************************************************************/
  13.  
  14. #define _H_CStaticString
  15.  
  16. #include "CPane.h"
  17. #include "defs.h"
  18.  
  19. struct CStaticString : CPane {
  20.  
  21.     /* instance variables */
  22.     
  23.     Str255        itsString;
  24.     FontInfo    theFontInfo;
  25.     Boolean        eraseBehind;
  26.     Boolean        useWinFont;
  27.     Int16        itsStyle;
  28.     
  29.     /* public methods */
  30.     
  31.     virtual void IStaticString(CView *anEnclosure, CBureaucrat *aSupervisor,
  32.                     Int16 aWidth, Int16 aHeight, Int16 aHEncl, Int16 aVEncl,
  33.                     SizingOption aHSizing, SizingOption aVSizing, StringPtr initString);
  34.         virtual void IViewTemp(CView *anEnclosure, CBureaucrat *aSupervisor,
  35.                         Ptr viewData);            
  36.     virtual void IStaticStringX(void);
  37.     virtual    void Draw(Rect *area);                
  38.     virtual void SetStaticString( StringPtr theString);
  39.     virtual void GetStaticString( StringPtr theString);
  40.     virtual void SetIndString( Int16 resID, Int16 index);
  41.     virtual void SetFontNum( Int16 theFontNum);
  42.     virtual void SetFontName( StringPtr theFontName);
  43.     virtual void SetTextSize( Int16 theSize);
  44.     virtual void SetTextStyle( Int16 theStyle);
  45.     virtual void SetTextMode( Int16 theMode);
  46.     virtual void SetEraseBehind( Int16 doIt);
  47.                     
  48.     /* private methods */
  49.     virtual void CalcFontInfo( void);
  50.     virtual void AdjustSize( void);
  51. };
  52.  
  53. typedef struct tStaticStringTemp
  54. {
  55.     PaneTemp    theViewTemp;
  56.     Int16        eraseBehind;
  57.     Int16        useWinFont;
  58.     Int16        fontStyle;
  59.     Int16        theStrID;
  60. } tStaticStringTemp;