68 const char *p =
Data();
70 const char *chunk = p;
71 int tw, th, len =
Length();
79 int max_ascent, max_descent;
80 gVirtualX->GetFontProperties(font, max_ascent, max_descent);
81 th = max_ascent + max_descent + 1;
86 if (chunk)
gVirtualX->DrawString(
id, gc,
x,
y, chunk, strlen(chunk));
89 tw =
gVirtualX->TextWidth(font, chunk, p-chunk);
95 gVirtualX->DrawString(
id, gc,
x,
y, chunk, prev-chunk-1);
109 const char *p =
Data();
110 const char *prev = p;
111 const char *chunk = p;
112 int tw, nlines, len =
Length();
117 if (tw <= (
int)w)
return nlines;
122 tw =
gVirtualX->TextWidth(font, chunk, p-chunk);
153 for (p = dup; *p; p++) {
157 for (
char *tmp = p; *tmp; tmp++)
164 for (; *p; p++) p[0] = p[1];
189 const char *p =
Data();
190 const char *prev = p;
191 const char *chunk = p;
192 int tw, th, len =
Length();
201 int max_ascent, max_descent;
202 gVirtualX->GetFontProperties(font, max_ascent, max_descent);
203 th = max_ascent + max_descent + 1;
210 gVirtualX->DrawString(
id, gc,
x,
y, chunk, strlen(chunk));
216 tw =
gVirtualX->TextWidth(font, chunk, p-chunk);
222 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.
char * StrDup(const char *str)
Duplicate the string str.
TGHotString is a string with a "hot" character underlined.
TGHotString(const char *s)
Create a hot string.
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.
Int_t fOff1
variable used during drawing (cache)
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 fHotChar
hot character
void DrawHotChar(Drawable_t id, GContext_t gc, Int_t x, Int_t y)
Draw the underline under the hot character.
GContext_t fLastGC
context used during last drawing
Int_t fHotPos
position of hot character
Int_t fOff2
variable used during drawing (cache)
TGString wraps a TString and adds some graphics routines like drawing, size of string on screen depen...
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.
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