home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ool_main.zip / ool / include / xtext.h < prev    next >
Text File  |  1998-01-18  |  2KB  |  47 lines

  1. #ifndef __OOL_XTEXT_H__
  2. #define __OOL_XTEXT_H__
  3.  
  4. /*===========================================================================*/
  5. /* OOL ------------------- the Open Object Library ------------------- r 1.0 */
  6. /*===========================================================================*/
  7. /*                              class: XText                                 */
  8. /*                       derived from: XGraphicObject                        */
  9. /*                        last update: 12/96                                 */
  10. /*                      programmed by: Stefan von Brauk (sbrauk@gwdg.de)     */
  11. /*===========================================================================*/
  12.  
  13.  
  14.  
  15. #include "xgraphob.h"
  16. #include "stdlib.h"
  17. #include "xstring.h"
  18. class XRect;
  19. class XFont;
  20.  
  21. class _export_ XText:public XGraphicObject
  22. {
  23.    private:
  24.       XFont * font;
  25.       XString text;
  26.       SHORT style;
  27.       POINTL sh;
  28.       GRADIENTL an;
  29.       XPoint p2;
  30.    public:
  31.       XText( const XFont * font, const XRect * r, const char * text, const SHORT style = DT_LEFT);
  32.       XText( const XFont * font, const XPoint * p, const char * text);
  33.       void Draw( XGraphicDevice * dev);
  34.       LONG GetStyle( void ) const { return style; }
  35.       void GetText( XString * t) { *t=text; }
  36.       void GetTextBox(XGraphicDevice * dev, XRect * r);
  37.       void SetAngle( const SHORT dX, const SHORT dY ) { an.x = dX; an.y = dY; }
  38.       void SetFont( XFont * f) { font = f;}
  39.       void SetShear( const SHORT dX, const SHORT dY ) { sh.x = dX; sh.y = dY; }
  40.       void SetSize( const XRect * rect) { p.SetX(rect->GetX()); p.SetY(rect->GetY()); p2.SetX( rect->GetWidth() + rect->GetX()); p2.SetY( rect->GetY() + rect->GetHeight());}
  41.       void SetStyle( const LONG s) { style = s; }
  42.       void SetText( const char * t) { text = t; }
  43.       void SetupDevice( XGraphicDevice * dev );
  44. };
  45.  
  46. #endif
  47.