66 const char *p =
Data();
68 const char *chunk = p;
69 int tw, th, len =
Length();
77 int max_ascent, max_descent;
78 gVirtualX->GetFontProperties(font, max_ascent, max_descent);
79 th = max_ascent + max_descent + 1;
84 if (chunk)
gVirtualX->DrawString(
id, gc,
x,
y, chunk, strlen(chunk));
87 tw =
gVirtualX->TextWidth(font, chunk, p-chunk);
93 gVirtualX->DrawString(
id, gc,
x,
y, chunk, prev-chunk-1);
107 const char *p =
Data();
108 const char *prev = p;
109 const char *chunk = p;
110 int tw, nlines, len =
Length();
115 if (tw <= (
int)w)
return nlines;
120 tw =
gVirtualX->TextWidth(font, chunk, p-chunk);
151 for (p = dup; *p; p++) {
155 for (
char *tmp = p; *tmp; tmp++)
162 for (; *p; p++) p[0] = p[1];
187 const char *p =
Data();
188 const char *prev = p;
189 const char *chunk = p;
190 int tw, th, len =
Length();
199 int max_ascent, max_descent;
200 gVirtualX->GetFontProperties(font, max_ascent, max_descent);
201 th = max_ascent + max_descent + 1;
208 gVirtualX->DrawString(
id, gc,
x,
y, chunk, strlen(chunk));
214 tw =
gVirtualX->TextWidth(font, chunk, p-chunk);
220 gVirtualX->DrawString(
id, gc,
x,
y, chunk, prev-chunk-1);
Handle_t Drawable_t
Drawable handle.
Handle_t GContext_t
Graphics context handle.
Handle_t FontStruct_t
Pointer to font structure.
int Int_t
Signed integer 4 bytes (int).
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int).
char * StrDup(const char *str)
Duplicate the string str.
TGHotString(const char *s)
Create a hot string.
void Draw(Drawable_t id, GContext_t gc, Int_t x, Int_t y) override
Draw a hot string and underline the hot character.
Int_t fOff1
variable used during drawing (cache)
char fHotChar
hot character
void DrawHotChar(Drawable_t id, GContext_t gc, Int_t x, Int_t y)
Draw the underline under the hot character.
void DrawWrapped(Drawable_t id, GContext_t gc, Int_t x, Int_t y, UInt_t w, FontStruct_t font) override
Draw a hot string in a column with width w.
GContext_t fLastGC
context used during last drawing
Int_t fHotPos
position of hot character
Int_t fOff2
variable used during drawing (cache)
virtual void Draw(Drawable_t id, GContext_t gc, Int_t x, Int_t y)
Draw string.
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 string in a column with width w.
TString(const char *a1, Ssiz_t n1, const char *a2, Ssiz_t n2)
Special constructor to initialize with the concatenation of a1 and a2.
const char * Data() const
TString & Append(const char *cs)
Graphics context structure.
Mask_t fMask
bit mask specifying which fields are valid
FontH_t fFont
default text font for text operations