63 const char *p =
Data();
65 const char *chunk = p;
66 int tw, th, len =
Length();
70 gVirtualX->DrawString(
id, gc, x, y, p, len);
74 int max_ascent, max_descent;
75 gVirtualX->GetFontProperties(font, max_ascent, max_descent);
76 th = max_ascent + max_descent + 1;
81 if (chunk)
gVirtualX->DrawString(
id, gc, x, y, chunk, strlen(chunk));
84 tw =
gVirtualX->TextWidth(font, chunk, p-chunk);
90 gVirtualX->DrawString(
id, gc, x, y, chunk, prev-chunk-1);
104 const char *p =
Data();
105 const char *prev = p;
106 const char *chunk = p;
107 int tw, nlines, len =
Length();
112 if (tw <= (
int)w)
return nlines;
117 tw =
gVirtualX->TextWidth(font, chunk, p-chunk);
148 for (p = dup; *p; p++) {
152 for (
char *tmp = p; *tmp; tmp++)
159 for (; *p; p++) p[0] = p[1];
184 const char *p =
Data();
185 const char *prev = p;
186 const char *chunk = p;
187 int tw, th, len =
Length();
191 gVirtualX->DrawString(
id, gc, x, y, p, len);
196 int max_ascent, max_descent;
197 gVirtualX->GetFontProperties(font, max_ascent, max_descent);
198 th = max_ascent + max_descent + 1;
205 gVirtualX->DrawString(
id, gc, x, y, chunk, strlen(chunk));
211 tw =
gVirtualX->TextWidth(font, chunk, p-chunk);
217 gVirtualX->DrawString(
id, gc, x, y, chunk, prev-chunk-1);
virtual Int_t GetLines(FontStruct_t font, UInt_t w)
Get number of lines of width w the string would take using a certain font.
virtual void DrawWrapped(Drawable_t id, GContext_t gc, Int_t x, Int_t y, UInt_t w, FontStruct_t font)
Draw a hot string in a column with width w.
TGHotString(const char *s)
Create a hot string.
const char * Data() const
TString & Append(const char *cs)
std::vector< std::vector< double > > Data
virtual void Draw(Drawable_t id, GContext_t gc, Int_t x, Int_t y)
Draw a hot string and underline the hot character.
char * StrDup(const char *str)
Duplicate the string str.
virtual void DrawWrapped(Drawable_t id, GContext_t gc, Int_t x, Int_t y, UInt_t w, FontStruct_t font)
Draw a string in a column with width w.
ClassImp(TGString) ClassImp(TGHotString) TGString
cconstructor
void DrawHotChar(Drawable_t id, GContext_t gc, Int_t x, Int_t y)
Draw the underline under the hot character.
virtual void Draw(Drawable_t id, GContext_t gc, Int_t x, Int_t y)
Draw string.