Logo ROOT  
Reference Guide
TGLabel.cxx
Go to the documentation of this file.
1 // @(#)root/gui:$Id$
2 // Author: Fons Rademakers 06/01/98
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 /**************************************************************************
12 
13  This source is based on Xclass95, a Win95-looking GUI toolkit.
14  Copyright (C) 1996, 1997 David Barth, Ricky Ralston, Hector Peraza.
15 
16  Xclass95 is free software; you can redistribute it and/or
17  modify it under the terms of the GNU Library General Public
18  License as published by the Free Software Foundation; either
19  version 2 of the License, or (at your option) any later version.
20 
21 **************************************************************************/
22 
23 //////////////////////////////////////////////////////////////////////////
24 // //
25 // TGLabel //
26 // //
27 // This class handles GUI labels. //
28 // //
29 //////////////////////////////////////////////////////////////////////////
30 
31 #include "TGLabel.h"
32 #include "TGString.h"
33 #include "TGWidget.h"
34 #include "TGResourcePool.h"
35 #include "TColor.h"
36 #include "TClass.h"
37 #include "TVirtualX.h"
38 
39 #include <iostream>
40 
41 
42 const TGFont *TGLabel::fgDefaultFont = nullptr;
43 const TGGC *TGLabel::fgDefaultGC = nullptr;
44 
46 
47 ////////////////////////////////////////////////////////////////////////////////
48 /// Create a label GUI object. TGLabel will become the owner of the
49 /// text and will delete it in its dtor.
50 
52  FontStruct_t font, UInt_t options, ULong_t back) :
53  TGFrame(p, 1, 1, options, back)
54 {
55  fText = text;
59  fDisabled = kFALSE;
60  f3DStyle = 0;
61  fWrapLength = -1;
62  fTFlags = 0;
63  fMLeft = fMRight = fMTop = fMBottom = 0;
64 
65  if (!norm) {
66  norm = GetDefaultGC().GetGC();
67  }
68  fNormGC = norm;
69 
70  if (!font) {
71  font = fgDefaultFont->GetFontStruct();
72  }
73 
74  fFont = fClient->GetFontPool()->GetFont(font);
77  &fTWidth, &fTHeight);
78 
81  wattr.fBitGravity = 5; // center
82  wattr.fWinGravity = 1;
83  gVirtualX->ChangeWindowAttributes(fId, &wattr);
84 
85  Resize();
86  SetWindowName();
87 }
88 
89 ////////////////////////////////////////////////////////////////////////////////
90 /// Create a label GUI object.
91 
92 TGLabel::TGLabel(const TGWindow *p, const char *text, GContext_t norm,
93  FontStruct_t font, UInt_t options, ULong_t back) :
94  TGFrame(p, 1, 1, options, back)
95 {
96  fText = new TGString(!text && !p ? GetName() : text);
100  fDisabled = kFALSE;
101  f3DStyle = 0;
102  fWrapLength = -1;
103  fTFlags = 0;
104  fMLeft = fMRight = fMTop = fMBottom = 0;
105 
106  if (!norm) {
107  norm = GetDefaultGC().GetGC();
108  }
109  fNormGC = norm;
110 
111  if (!font) {
112  font = fgDefaultFont->GetFontStruct();
113  }
114 
115  fFont = fClient->GetFontPool()->GetFont(font);
118  &fTWidth, &fTHeight);
119 
120  SetWindowAttributes_t wattr;
122  wattr.fBitGravity = 5; // center
123  wattr.fWinGravity = 1;
124  gVirtualX->ChangeWindowAttributes(fId, &wattr);
125 
126  Resize();
127  SetWindowName();
128 }
129 
130 ////////////////////////////////////////////////////////////////////////////////
131 /// Delete label.
132 
134 {
135  if (fText) {
136  delete fText;
137  }
138 
139  if (fHasOwnFont) {
140  TGGCPool *pool = fClient->GetGCPool();
141  TGGC *gc = pool->FindGC(fNormGC);
142  if (gc) pool->FreeGC(gc);
143  }
144 
145  if (fFont != fgDefaultFont) {
147  }
148 
149  delete fTLayout;
150 }
151 
152 ////////////////////////////////////////////////////////////////////////////////
153 /// Layout label.
154 
156 {
157  delete fTLayout;
160  &fTWidth, &fTHeight);
161  fClient->NeedRedraw(this);
162 }
163 
164 ////////////////////////////////////////////////////////////////////////////////
165 /// Return default size.
166 
168 {
171  return TGDimension(w, h);
172 }
173 
174 ////////////////////////////////////////////////////////////////////////////////
175 /// Set new text in label. After calling this method one needs to call
176 /// the parents frame's Layout() method to force updating of the label size.
177 /// The new_text is adopted by the TGLabel and will be properly deleted.
178 
179 void TGLabel::SetText(TGString *new_text)
180 {
181  if (fText) delete fText;
182  fText = new_text;
184 
185  Layout();
186 }
187 
188 ////////////////////////////////////////////////////////////////////////////////
189 /// Draw text at position (x, y).
190 
192 {
193  fTLayout->DrawText(fId, gc, x, y, 0, -1);
194  //fTLayout->UnderlineChar(fId, gc, x, y, fText->GetHotPos());
195 }
196 
197 ////////////////////////////////////////////////////////////////////////////////
198 /// Redraw label widget.
199 
201 {
202  int x, y;
203 
206 
207  if (fTMode & kTextLeft) {
208  x = fMLeft;
209  } else if (fTMode & kTextRight) {
210  x = fWidth - fTWidth - fMRight;
211  } else {
212  x = (fWidth - fTWidth + fMLeft - fMRight) >> 1;
213  }
214 
215  if (fTMode & kTextTop) {
216  y = 0;
217  } else if (fTMode & kTextBottom) {
218  y = fHeight - fTHeight;
219  } else {
220  y = (fHeight - fTHeight) >> 1;
221  }
222 
223 
224  if (!fDisabled) {
226  TGGC *gc = pool->FindGC(fNormGC);
227 
228  if (!gc) {
229  fNormGC = GetDefaultGC().GetGC();
230  gc = pool->FindGC(fNormGC);
231  }
232  if (!gc) return;
233 
234  switch (f3DStyle) {
235  case kRaisedFrame:
236  case kSunkenFrame:
237  {
238  Pixel_t forecolor = gc->GetForeground();
240  Pixel_t sh = forecolor;
241 
242  if (f3DStyle == kRaisedFrame) {
243  Pixel_t t = hi;
244  hi = sh;
245  sh = t;
246  }
247 
248  gc->SetForeground(hi);
249  DrawText(gc->GetGC(), x+1, y+1);
250  gc->SetForeground(sh);
251  DrawText(gc->GetGC(), x, y);
252  gc->SetForeground(forecolor);
253  }
254  break;
255 
256  default:
257  DrawText(fNormGC, x, y);
258  break;
259  }
260  } else { // disabled
261  FontH_t fontH;
262 
264  fontH = gVirtualX->GetFontHandle(fFont->GetFontStruct());
265  } else {
266  fontH = gVirtualX->GetFontHandle(GetDefaultFontStruct());
267  }
268  static TGGC *gc1 = 0;
269  static TGGC *gc2 = 0;
270 
271  if (!gc1) {
273  gc1 = new TGGC(*gc1); // copy
274  }
275  gc1->SetFont(fontH);
276  DrawText(gc1->GetGC(), x + 1, y + 1);
277 
278  if (!gc2) {
280  gc2 = new TGGC(*gc2); // copy
281  }
282  gc2->SetFont(fontH);
283  DrawText(gc2->GetGC(), x, y);
284  }
285 }
286 
287 ////////////////////////////////////////////////////////////////////////////////
288 /// Changes text font.
289 /// If global is true font is changed globally - otherwise locally.
290 
291 void TGLabel::SetTextFont(FontStruct_t fontStruct, Bool_t global)
292 {
293  TGFont *font = fClient->GetFontPool()->GetFont(fontStruct);
294 
295  if (!font) {
296  //error
297  return;
298  }
299 
300  SetTextFont(font, global);
301 }
302 
303 ////////////////////////////////////////////////////////////////////////////////
304 /// Changes text font specified by name.
305 /// If global is true font is changed globally - otherwise locally.
306 
307 void TGLabel::SetTextFont(const char *fontName, Bool_t global)
308 {
309  TGFont *font = fClient->GetFont(fontName);
310 
311  if (!font) {
312  // error
313  return;
314  }
315 
316  SetTextFont(font, global);
317 }
318 
319 ////////////////////////////////////////////////////////////////////////////////
320 /// Changes text font specified by pointer to TGFont object.
321 /// If global is true font is changed globally - otherwise locally.
322 
323 void TGLabel::SetTextFont(TGFont *font, Bool_t global)
324 {
325  if (!font) {
326  //error
327  return;
328  }
329 
330  TGFont *oldfont = fFont;
331  fFont = fClient->GetFont(font); // increase usage count
332  if (!fFont) {
333  fFont = oldfont;
334  return;
335  }
336 
338  TGGC *gc = pool->FindGC(fNormGC);
339 
340  if (!global) {
341  if (gc == &GetDefaultGC() ) { // create new GC
342  gc = pool->GetGC((GCValues_t*)gc->GetAttributes(), kTRUE); // copy ctor.
343  }
344  fHasOwnFont = kTRUE;
345  }
346  if (oldfont != fgDefaultFont) {
347  fClient->FreeFont(oldfont);
348  }
349  if (gc) {
350  gc->SetFont(fFont->GetFontHandle());
351  fNormGC = gc->GetGC();
352  }
354  Layout();
355 }
356 
357 ////////////////////////////////////////////////////////////////////////////////
358 /// Changes text color.
359 /// If global is true color is changed globally - otherwise locally.
360 
362 {
364  TGGC *gc = pool->FindGC(fNormGC);
365 
366  if (!global) {
367  if (gc == &GetDefaultGC() ) {
368  gc = pool->GetGC((GCValues_t*)gc->GetAttributes(), kTRUE); // copy
369  }
370  fHasOwnFont = kTRUE;
371  }
372  if (gc) {
373  gc->SetForeground(color);
374  fNormGC = gc->GetGC();
375  }
376  fClient->NeedRedraw(this);
377 }
378 
379 ////////////////////////////////////////////////////////////////////////////////
380 /// Changes text color.
381 /// If global is true color is changed globally - otherwise locally.
382 
383 void TGLabel::SetTextColor(TColor *color, Bool_t global)
384 {
385  if (color) {
386  SetTextColor(color->GetPixel(), global);
387  }
388 }
389 
390 ////////////////////////////////////////////////////////////////////////////////
391 /// Set text justification. Mode is an OR of the bits:
392 /// kTextTop, kTextBottom, kTextLeft, kTextRight, kTextCenterX and
393 /// kTextCenterY.
394 
396 {
398  fTMode = mode;
399 
400  SetWindowAttributes_t wattr;
402  wattr.fWinGravity = 1;
403 
404  switch (mode) {
405  case kTextTop | kTextLeft:
406  wattr.fBitGravity = 1; //NorthWestGravity
407  break;
408  case kTextTop | kTextCenterX:
409  case kTextTop:
410  wattr.fBitGravity = 2; //NorthGravity
411  break;
412  case kTextTop | kTextRight:
413  wattr.fBitGravity = 3; //NorthEastGravity
414  break;
415  case kTextLeft | kTextCenterY:
416  case kTextLeft:
417  wattr.fBitGravity = 4; //WestGravity
418  break;
419  case kTextCenterY | kTextCenterX:
420  wattr.fBitGravity = 5; //CenterGravity
421  break;
422  case kTextRight | kTextCenterY:
423  case kTextRight:
424  wattr.fBitGravity = 6; //EastGravity
425  break;
426  case kTextBottom | kTextLeft:
427  wattr.fBitGravity = 7; //SouthWestGravity
428  break;
429  case kTextBottom | kTextCenterX:
430  case kTextBottom:
431  wattr.fBitGravity = 8; //SouthGravity
432  break;
433  case kTextBottom | kTextRight:
434  wattr.fBitGravity = 9; //SouthEastGravity
435  break;
436  default:
437  wattr.fBitGravity = 5; //CenterGravity
438  break;
439  }
440 
441  gVirtualX->ChangeWindowAttributes(fId, &wattr);
442 
443  Layout();
444 }
445 
446 ////////////////////////////////////////////////////////////////////////////////
447 /// Returns kTRUE if text attributes are unique.
448 /// Returns kFALSE if text attributes are shared (global).
449 
451 {
452  return fHasOwnFont;
453 }
454 
455 ////////////////////////////////////////////////////////////////////////////////
456 /// Save a label widget as a C++ statement(s) on output stream out.
457 
458 void TGLabel::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
459 {
460  char quote = '"';
461 
462  // font + GC
463  option = GetName()+5; // unique digit id of the name
464  TString parGC, parFont;
465  parFont.Form("%s::GetDefaultFontStruct()",IsA()->GetName());
466  parGC.Form("%s::GetDefaultGC()()",IsA()->GetName());
467 
468  if ((GetDefaultFontStruct() != fFont->GetFontStruct()) || (GetDefaultGC()() != fNormGC)) {
470  if (ufont) {
471  ufont->SavePrimitive(out, option);
472  parFont.Form("ufont->GetFontStruct()");
473  }
474 
476  if (userGC) {
477  userGC->SavePrimitive(out, option);
478  parGC.Form("uGC->GetGC()");
479  }
480  }
481 
482  if (fBackground != GetDefaultFrameBackground()) SaveUserColor(out, option);
483 
484  TString label = GetText()->GetString();
485  label.ReplaceAll("\"","\\\"");
486  label.ReplaceAll("\n","\\n");
487 
488  out << " TGLabel *";
489  out << GetName() << " = new TGLabel("<< fParent->GetName()
490  << "," << quote << label << quote;
492  if (!GetOptions()) {
494  if (fNormGC == GetDefaultGC()()) {
495  out <<");" << std::endl;
496  } else {
497  out << "," << parGC.Data() << ");" << std::endl;
498  }
499  } else {
500  out << "," << parGC.Data() << "," << parFont.Data() << ");" << std::endl;
501  }
502  } else {
503  out << "," << parGC.Data() << "," << parFont.Data() << "," << GetOptionString() <<");" << std::endl;
504  }
505  } else {
506  out << "," << parGC.Data() << "," << parFont.Data() << "," << GetOptionString() << ",ucolor);" << std::endl;
507  }
508  if (option && strstr(option, "keep_names"))
509  out << " " << GetName() << "->SetName(\"" << GetName() << "\");" << std::endl;
510 
511  if (fDisabled)
512  out << " " << GetName() << "->Disable();" << std::endl;
513 
514  out << " " << GetName() << "->SetTextJustify(" << GetTextJustify() << ");" << std::endl;
515  out << " " << GetName() << "->SetMargins(" << fMLeft << "," << fMRight << ",";
516  out << fMTop << "," << fMBottom << ");" << std::endl;
517  out << " " << GetName() << "->SetWrapLength(" << fWrapLength << ");" << std::endl;
518 
519 }
520 
521 ////////////////////////////////////////////////////////////////////////////////
522 /// Static returning label default font struct.
523 
525 {
526  if (!fgDefaultFont) {
527  fgDefaultFont = gClient->GetResourcePool()->GetDefaultFont();
528  }
529  return fgDefaultFont->GetFontStruct();
530 }
531 
532 ////////////////////////////////////////////////////////////////////////////////
533 /// Static returning label default graphics context.
534 
536 {
537  if (!fgDefaultGC) {
538  fgDefaultGC = gClient->GetResourcePool()->GetFrameGC();
539  }
540  return *fgDefaultGC;
541 }
TGWindow::SetWindowName
virtual void SetWindowName(const char *name=0)
Set window name.
Definition: TGWindow.cxx:128
TGTextLayout::DrawText
void DrawText(Drawable_t dst, GContext_t gc, Int_t x, Int_t y, Int_t firstChar, Int_t lastChar) const
Use the information in the TGTextLayout object to display a multi-line, justified string of text.
Definition: TGFont.cxx:910
TGClient::FreeFont
void FreeFont(const TGFont *font)
Free a font.
Definition: TGClient.cxx:365
SetWindowAttributes_t::fBitGravity
Int_t fBitGravity
Definition: GuiTypes.h:98
TGFontPool::GetFont
TGFont * GetFont(const char *font, Bool_t fixedDefault=kTRUE)
Get the specified font.
Definition: TGFont.cxx:1545
TGWindow
Definition: TGWindow.h:31
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:91
kFixedWidth
@ kFixedWidth
Definition: GuiTypes.h:387
kTextTop
@ kTextTop
Definition: TGWidget.h:37
TGGC::GetGC
GContext_t GetGC() const
Definition: TGGC.h:50
TGGC::GetForeground
Pixel_t GetForeground() const
Definition: TGGC.h:82
TGDimension
Definition: TGDimension.h:27
TGGC::GetAttributes
const GCValues_t * GetAttributes() const
Definition: TGGC.h:78
Option_t
const char Option_t
Definition: RtypesCore.h:66
TGResourcePool::GetGCPool
TGGCPool * GetGCPool() const
Definition: TGResourcePool.h:101
TGClient::GetFontPool
TGFontPool * GetFontPool() const
Definition: TGClient.h:145
TGClient::GetGCPool
TGGCPool * GetGCPool() const
Definition: TGClient.h:140
gVirtualX
#define gVirtualX
Definition: TVirtualX.h:338
TString::Data
const char * Data() const
Definition: TString.h:369
TGLabel::SavePrimitive
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a label widget as a C++ statement(s) on output stream out.
Definition: TGLabel.cxx:458
Pixel_t
ULong_t Pixel_t
Definition: GuiTypes.h:39
FontH_t
Handle_t FontH_t
Definition: GuiTypes.h:34
TGLabel::fText
TGString * fText
Definition: TGLabel.h:35
ClassImp
#define ClassImp(name)
Definition: Rtypes.h:364
TColor::GetPixel
ULong_t GetPixel() const
Return pixel value corresponding to this color.
Definition: TColor.cxx:1434
TGFrame::fWidth
UInt_t fWidth
Definition: TGFrame.h:112
TGGC::SavePrimitive
void SavePrimitive(std::ostream &out, Option_t *option="")
Save graphics context info as a C++ statement(s) on output stream out.
Definition: TGGC.cxx:626
TGFontPool::FreeFont
void FreeFont(const TGFont *font)
Free font. If ref count is 0 delete font.
Definition: TGFont.cxx:1705
FontStruct_t
Handle_t FontStruct_t
Definition: GuiTypes.h:38
TGLabel
Definition: TGLabel.h:32
GCValues_t
Definition: GuiTypes.h:223
TGResourcePool::GetFontPool
TGFontPool * GetFontPool() const
Definition: TGResourcePool.h:102
kTextCenterX
@ kTextCenterX
Definition: TGWidget.h:36
x
Double_t x[n]
Definition: legend1.C:17
TClass.h
TColor.h
TGLabel::GetDefaultFontStruct
static FontStruct_t GetDefaultFontStruct()
Static returning label default font struct.
Definition: TGLabel.cxx:524
TGFrame::GetDefaultFrameBackground
static Pixel_t GetDefaultFrameBackground()
Get default frame background.
Definition: TGFrame.cxx:668
TVirtualX.h
kTextCenterY
@ kTextCenterY
Definition: TGWidget.h:39
TGClient::GetResourcePool
const TGResourcePool * GetResourcePool() const
Definition: TGClient.h:133
TGFont::ComputeTextLayout
TGTextLayout * ComputeTextLayout(const char *string, Int_t numChars, Int_t wrapLength, Int_t justify, Int_t flags, UInt_t *width, UInt_t *height) const
Computes the amount of screen space needed to display a multi-line, justified string of text.
Definition: TGFont.cxx:651
TString
Basic string class.
Definition: TString.h:136
TGFrame
Definition: TGFrame.h:105
TGLabel::fMBottom
Int_t fMBottom
Definition: TGLabel.h:41
SetWindowAttributes_t::fMask
Mask_t fMask
Definition: GuiTypes.h:109
text
TText * text
Definition: entrylist_figure1.C:10
TGGCPool::GetGC
TGGC * GetGC(GCValues_t *values, Bool_t rw=kFALSE)
Get the best matching graphics context depending on values.
Definition: TGGC.cxx:986
TGLabel::SetText
virtual void SetText(TGString *newText)
Set new text in label.
Definition: TGLabel.cxx:179
bool
TString::ReplaceAll
TString & ReplaceAll(const TString &s1, const TString &s2)
Definition: TString.h:692
TGGCPool::FreeGC
void FreeGC(const TGGC *gc)
Delete graphics context if it is not used anymore.
Definition: TGGC.cxx:917
TGLabel::fgDefaultFont
static const TGFont * fgDefaultFont
Definition: TGLabel.h:56
TGLabel::DoRedraw
virtual void DoRedraw()
Redraw label widget.
Definition: TGLabel.cxx:200
TGFrame::GetOptionString
TString GetOptionString() const
Returns a frame option string - used in SavePrimitive().
Definition: TGFrame.cxx:2465
kWABitGravity
const Mask_t kWABitGravity
Definition: GuiTypes.h:143
TGFrame::GetOptions
virtual UInt_t GetOptions() const
Definition: TGFrame.h:222
GContext_t
Handle_t GContext_t
Definition: GuiTypes.h:37
TGLabel::fTLayout
TGTextLayout * fTLayout
Definition: TGLabel.h:49
gClient
#define gClient
Definition: TGClient.h:166
kTextLeft
@ kTextLeft
Definition: TGWidget.h:34
TGFontPool::FindFont
TGFont * FindFont(FontStruct_t font) const
Find font based on its font struct. Returns 0 if font is not found.
Definition: TGFont.cxx:1731
hi
float type_of_call hi(const int &, const int &)
TGString::GetLength
Int_t GetLength() const
Definition: TGString.h:39
TGLabel::fMLeft
Int_t fMLeft
Definition: TGLabel.h:38
TString::Form
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
Definition: TString.cxx:2289
TGFrame::GetHilightGC
static const TGGC & GetHilightGC()
Get highlight color graphics context.
Definition: TGFrame.cxx:740
TGLabel::DrawText
virtual void DrawText(GContext_t gc, Int_t x, Int_t y)
Draw text at position (x, y).
Definition: TGLabel.cxx:191
kSunkenFrame
@ kSunkenFrame
Definition: GuiTypes.h:383
kFixedHeight
@ kFixedHeight
Definition: GuiTypes.h:389
TGLabel::GetTextJustify
Int_t GetTextJustify() const
Definition: TGLabel.h:90
TColor
The color creation and management class.
Definition: TColor.h:19
TGLabel::fNormGC
GContext_t fNormGC
Definition: TGLabel.h:47
SetWindowAttributes_t::fWinGravity
Int_t fWinGravity
Definition: GuiTypes.h:99
h
#define h(i)
Definition: RSha256.hxx:106
TGWindow::GetName
virtual const char * GetName() const
Return unique name, used in SavePrimitive methods.
Definition: TGWindow.cxx:335
TGGC
Definition: TGGC.h:31
TGFrame::Resize
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
Definition: TGFrame.cxx:590
TGObject::fId
Handle_t fId
Definition: TGObject.h:36
TGLabel::~TGLabel
virtual ~TGLabel()
Delete label.
Definition: TGLabel.cxx:133
TGLabel::fHasOwnFont
Bool_t fHasOwnFont
Definition: TGLabel.h:50
kWAWinGravity
const Mask_t kWAWinGravity
Definition: GuiTypes.h:144
kFALSE
const Bool_t kFALSE
Definition: RtypesCore.h:92
TGFont::GetFontHandle
FontH_t GetFontHandle() const
Definition: TGFont.h:192
TGFrame::SaveUserColor
void SaveUserColor(std::ostream &out, Option_t *)
Save a user color in a C++ macro file - used in SavePrimitive().
Definition: TGFrame.cxx:2438
TGLabel::fTWidth
UInt_t fTWidth
Definition: TGLabel.h:36
y
Double_t y[n]
Definition: legend1.C:17
ULong_t
unsigned long ULong_t
Definition: RtypesCore.h:55
kTextBottom
@ kTextBottom
Definition: TGWidget.h:38
TGWidget.h
kRaisedFrame
@ kRaisedFrame
Definition: GuiTypes.h:384
TGString.h
unsigned int
TGLabel::SetTextFont
virtual void SetTextFont(TGFont *font, Bool_t global=kFALSE)
Changes text font specified by pointer to TGFont object.
Definition: TGLabel.cxx:323
TGLabel::fTMode
Int_t fTMode
Definition: TGLabel.h:42
TGLabel.h
TGLabel::fTFlags
Int_t fTFlags
Definition: TGLabel.h:45
TGClient::NeedRedraw
void NeedRedraw(TGWindow *w, Bool_t force=kFALSE)
Set redraw flags.
Definition: TGClient.cxx:373
TGLabel::GetDefaultSize
virtual TGDimension GetDefaultSize() const
Return default size.
Definition: TGLabel.cxx:167
TGLabel::SetTextColor
virtual void SetTextColor(Pixel_t color, Bool_t global=kFALSE)
Changes text color.
Definition: TGLabel.cxx:361
TGLabel::GetText
const TGString * GetText() const
Definition: TGLabel.h:82
TGObject::fClient
TGClient * fClient
Definition: TGObject.h:37
TGGCPool
Definition: TGGC.h:112
TGGC::SetForeground
void SetForeground(Pixel_t v)
Set foreground color.
Definition: TGGC.cxx:277
TGLabel::TGLabel
TGLabel(const TGLabel &)
TGLabel::GetDefaultGC
static const TGGC & GetDefaultGC()
Static returning label default graphics context.
Definition: TGLabel.cxx:535
TGLabel::fgDefaultGC
static const TGGC * fgDefaultGC
Definition: TGLabel.h:57
TGFrame::GetWhitePixel
static Pixel_t GetWhitePixel()
Get white pixel value.
Definition: TGFrame.cxx:694
TGClient::GetFont
TGFont * GetFont(const char *font, Bool_t fixedDefault=kTRUE)
Get a font from the font pool.
Definition: TGClient.cxx:349
TGFrame::GetShadowGC
static const TGGC & GetShadowGC()
Get shadow color graphics context.
Definition: TGFrame.cxx:750
TGString::GetString
const char * GetString() const
Definition: TGString.h:40
TGLabel::fTextChanged
Bool_t fTextChanged
Definition: TGLabel.h:46
TGFont::SavePrimitive
virtual void SavePrimitive(std::ostream &out, Option_t *="")
Save the used font as a C++ statement(s) on output stream out.
Definition: TGFont.cxx:1871
TGLabel::HasOwnFont
Bool_t HasOwnFont() const
Returns kTRUE if text attributes are unique.
Definition: TGLabel.cxx:450
TGResourcePool.h
TGGCPool::FindGC
TGGC * FindGC(const TGGC *gc)
Find graphics context. Returns 0 in case gc is not found.
Definition: TGGC.cxx:950
TGFont::GetFontStruct
FontStruct_t GetFontStruct() const
Definition: TGFont.h:193
TGLabel::f3DStyle
Int_t f3DStyle
Definition: TGLabel.h:43
kTextRight
@ kTextRight
Definition: TGWidget.h:35
TGFrame::fHeight
UInt_t fHeight
Definition: TGFrame.h:113
TGFrame::fBackground
Pixel_t fBackground
Definition: TGFrame.h:120
TGLabel::fMTop
Int_t fMTop
Definition: TGLabel.h:40
TGFont
Definition: TGFont.h:149
TGLabel::fFont
TGFont * fFont
Definition: TGLabel.h:48
TGLabel::fWrapLength
Int_t fWrapLength
Definition: TGLabel.h:44
TGString
Definition: TGString.h:30
TGLabel::SetTextJustify
void SetTextJustify(Int_t tmode)
Set text justification.
Definition: TGLabel.cxx:395
TGGC::SetFont
void SetFont(FontH_t v)
Set font.
Definition: TGGC.cxx:410
TGLabel::fDisabled
Bool_t fDisabled
Definition: TGLabel.h:51
TGWindow::fParent
const TGWindow * fParent
Definition: TGWindow.h:36
TGLabel::Layout
virtual void Layout()
Layout label.
Definition: TGLabel.cxx:155
TGLabel::fTHeight
UInt_t fTHeight
Definition: TGLabel.h:37
int
SetWindowAttributes_t
Definition: GuiTypes.h:92
TGLabel::fMRight
Int_t fMRight
Definition: TGLabel.h:39
TGFrame::DoRedraw
virtual void DoRedraw()
Redraw the frame.
Definition: TGFrame.cxx:415