Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/root/TGString.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // @(#)root/gui:$Id$
0002 // Author: Fons Rademakers   05/01/98
0003 
0004 /*************************************************************************
0005  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
0006  * All rights reserved.                                                  *
0007  *                                                                       *
0008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
0009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
0010  *************************************************************************/
0011 
0012 #ifndef ROOT_TGString
0013 #define ROOT_TGString
0014 
0015 
0016 #include "TString.h"
0017 #include "GuiTypes.h"
0018 
0019 
0020 class TGString : public TString {
0021 
0022 public:
0023    TGString() : TString() { }
0024    TGString(const char *s) : TString(s) { }
0025    TGString(Int_t number) : TString() { *this += number; }
0026    TGString(const TGString *s);
0027    ~TGString() override {}
0028 
0029    Int_t GetLength() const { return Length(); }
0030    const char  *GetString() const { return Data(); }
0031    virtual void SetString(const char *s) { *this = s; }
0032 
0033    virtual void Draw(Drawable_t id, GContext_t gc, Int_t x, Int_t y);
0034    virtual void DrawWrapped(Drawable_t id, GContext_t gc,
0035                             Int_t x, Int_t y, UInt_t w, FontStruct_t font);
0036    virtual Int_t GetLines(FontStruct_t font, UInt_t w);
0037 
0038    ClassDefOverride(TGString,0)  // Graphics string
0039 };
0040 
0041 
0042 class TGHotString : public TGString {
0043 
0044 protected:
0045    char        fHotChar;      ///< hot character
0046    Int_t       fHotPos;       ///< position of hot character
0047 
0048    GContext_t  fLastGC;       ///< context used during last drawing
0049    Int_t       fOff1;         ///< variable used during drawing (cache)
0050    Int_t       fOff2;         ///< variable used during drawing (cache)
0051 
0052    void DrawHotChar(Drawable_t id, GContext_t gc, Int_t x, Int_t y);
0053 
0054 public:
0055    TGHotString(const char *s);
0056 
0057    Int_t GetHotChar() const { return fHotChar; }
0058    Int_t GetHotPos() const { return fHotPos; }
0059    void Draw(Drawable_t id, GContext_t gc, Int_t x, Int_t y) override;
0060    void DrawWrapped(Drawable_t id, GContext_t gc,
0061                     Int_t x, Int_t y, UInt_t w, FontStruct_t font) override;
0062 
0063    ClassDefOverride(TGHotString,0)  // Graphics string with hot character
0064 };
0065 
0066 #endif