Logo ROOT  
Reference Guide
TGProgressBar.cxx
Go to the documentation of this file.
1 // @(#)root/gui:$Id$
2 // Author: Fons Rademakers 10/10/2000
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 // //
14 // TGProgressBar, TGHProgressBar and TGVProgressBar //
15 // //
16 // The classes in this file implement progress bars. Progress bars can //
17 // be used to show progress of tasks taking more then a few seconds. //
18 // TGProgressBar is an abstract base class, use either TGHProgressBar //
19 // or TGVProgressBar. TGHProgressBar can in addition show the position //
20 // as text in the bar. //
21 // //
22 //////////////////////////////////////////////////////////////////////////
23 
24 #include "TGProgressBar.h"
25 #include "TGResourcePool.h"
26 #include "TColor.h"
27 #include "TVirtualX.h"
28 
29 #include <iostream>
30 
31 const TGFont *TGProgressBar::fgDefaultFont = nullptr;
33 
34 
38 
39 ////////////////////////////////////////////////////////////////////////////////
40 /// Create progress bar.
41 
43  ULong_t back, ULong_t barcolor, GContext_t norm,
44  FontStruct_t font, UInt_t options) :
45  TGFrame(p, w, h, options | kOwnBackground, back)
46 {
47  fMin = 0;
48  fMax = 100;
49  fPos = 0;
50  fPosPix = 0;
53  fShowPos = kFALSE;
54  fPercent = kTRUE;
55  fNormGC = norm;
56  fFontStruct = font;
58  fBarColorGC.SetForeground(barcolor);
60  fDrawBar = kFALSE;
61 }
62 
63 ////////////////////////////////////////////////////////////////////////////////
64 /// Set min and max of progress bar.
65 
67 {
68  if (min >= max) {
69  Error("SetRange", "max must be > min");
70  return;
71  }
72 
73  Bool_t draw = kFALSE;
74  if (fPos > fMin) {
75  // already in progress... rescale
76  if (fPos < min) fPos = min;
77  if (fPos > max) fPos = max;
78  draw = kTRUE;
79  } else
80  fPos = min;
81 
82  fMin = min;
83  fMax = max;
84 
85  if (draw)
86  DoRedraw();
87 }
88 
89 ////////////////////////////////////////////////////////////////////////////////
90 /// Set progress position between [min,max].
91 
93 {
94  if (pos < fMin) pos = fMin;
95  if (pos > fMax) pos = fMax;
96 
97  if (fPos == pos)
98  return;
99 
100  fPos = pos;
101 
102  //fClient->NeedRedraw(this);
103  fDrawBar = kTRUE;
104  DoRedraw();
105 }
106 
107 ////////////////////////////////////////////////////////////////////////////////
108 /// Increment progress position.
109 
111 {
112  if (fPos == fMax)
113  return;
114 
115  fPos += inc;
116  if (fPos > fMax) fPos = fMax;
117 
118  //fClient->NeedRedraw(this);
119  fDrawBar = kTRUE;
120  DoRedraw();
121 }
122 
123 ////////////////////////////////////////////////////////////////////////////////
124 /// Reset progress bar (i.e. set pos to 0).
125 
127 {
128  fPos = 0;
129 
130  fClient->NeedRedraw(this);
131 }
132 
133 ////////////////////////////////////////////////////////////////////////////////
134 /// Set fill type.
135 
137 {
138  fFillType = type;
139 
140  fClient->NeedRedraw(this);
141 }
142 
143 ////////////////////////////////////////////////////////////////////////////////
144 /// Set bar type.
145 
147 {
148  fBarType = type;
149 
150  fClient->NeedRedraw(this);
151 }
152 
153 ////////////////////////////////////////////////////////////////////////////////
154 /// Set progress bar color.
155 
157 {
158  fBarColorGC.SetForeground(color);
159 
160  fClient->NeedRedraw(this);
161 }
162 
163 ////////////////////////////////////////////////////////////////////////////////
164 /// Set progress bar color.
165 
166 void TGProgressBar::SetBarColor(const char *color)
167 {
168  ULong_t ic;
169  fClient->GetColorByName(color, ic);
171  fClient->NeedRedraw(this);
172 }
173 
174 ////////////////////////////////////////////////////////////////////////////////
175 /// Set format for displaying a value.
176 
177 void TGProgressBar::Format(const char *format)
178 {
179  fFormat = format;
180 
181  fClient->NeedRedraw(this);
182 }
183 
184 ////////////////////////////////////////////////////////////////////////////////
185 /// Return default font structure in use.
186 
188 {
189  if (!fgDefaultFont)
190  fgDefaultFont = gClient->GetResourcePool()->GetDefaultFont();
191  return fgDefaultFont->GetFontStruct();
192 }
193 
194 ////////////////////////////////////////////////////////////////////////////////
195 /// Return default graphics context in use.
196 
198 {
199  if (!fgDefaultGC)
200  fgDefaultGC = new TGGC(*gClient->GetResourcePool()->GetFrameGC());
201  return *fgDefaultGC;
202 }
203 
204 ////////////////////////////////////////////////////////////////////////////////
205 /// Change text color drawing.
206 
208 {
209  TGGC *gc = gClient->GetResourcePool()->GetGCPool()->FindGC(fNormGC);
210 
211  if (!gc) {
212  return;
213  }
214  gc->SetForeground(pixel);
215  fNormGC = gc->GetGC();
216 
217  fClient->NeedRedraw(this);
218 }
219 
220 ////////////////////////////////////////////////////////////////////////////////
221 /// Horizontal progress bar constructor.
222 
224  Pixel_t back, Pixel_t barcolor,
225  GContext_t norm, FontStruct_t font, UInt_t options) :
226  TGProgressBar(p, w, h, back, barcolor, norm, font, options)
227 {
228  fBarWidth = h;
230 }
231 
232 ////////////////////////////////////////////////////////////////////////////////
233 /// Simple constructor allow you to create either a standard progress
234 /// bar, or a more fancy progress bar (fancy means: double sized border,
235 /// white background and a bit wider to allow for text to be printed
236 /// in the bar.
237 
239  : TGProgressBar(p, w, type == kStandard ? kProgressBarStandardWidth :
240  kProgressBarTextWidth, type == kStandard ? GetDefaultFrameBackground() :
241  fgWhitePixel, fgDefaultSelectedBackground, GetDefaultGC()(),
242  GetDefaultFontStruct(),
243  type == kStandard ? kSunkenFrame : kDoubleBorder | kSunkenFrame)
244 {
245  fBarType = type;
248 }
249 
250 ////////////////////////////////////////////////////////////////////////////////
251 /// Show postion text, either in percent or formatted according format.
252 
253 void TGHProgressBar::ShowPosition(Bool_t set, Bool_t percent, const char *format)
254 {
255  fShowPos = set;
256  fPercent = percent;
257  fFormat = format;
258 
259  fClient->NeedRedraw(this);
260 }
261 
262 ////////////////////////////////////////////////////////////////////////////////
263 /// Draw horizontal progress bar.
264 
266 {
267  if (!fDrawBar) {
268  // calls TGProgressBar::DrawBorder()
270  }
271 
272  fPosPix = Int_t(((Float_t)fWidth - (fBorderWidth << 1)) *
273  (fPos - fMin) / (fMax - fMin) +
274  fBorderWidth);
275 
276  Int_t pospix = fPosPix;
277 
278  if (fFillType == kSolidFill)
279  gVirtualX->FillRectangle(fId, fBarColorGC(), fBorderWidth,
281  (fBorderWidth << 1));
282  else {
283  Int_t blocksize = kBlockSize;
284  Int_t delta = kBlockSpace;
285  Int_t pos = fBorderWidth;
286  while (pos < fPosPix) {
287  if (pos + blocksize > Int_t(fWidth)-fBorderWidth)
288  blocksize = fWidth-fBorderWidth-pos;
289  gVirtualX->FillRectangle(fId, fBarColorGC(), pos,
290  fBorderWidth, blocksize, fBarWidth -
291  (fBorderWidth << 1));
292  if (fDrawBar && fShowPos)
293  gVirtualX->ClearArea(fId, pos+blocksize, fBorderWidth,
294  delta, fBarWidth - (fBorderWidth << 1));
295 
296  pos += blocksize + delta;
297  }
298  pospix = pos - delta;
299  }
300 
301  if (fShowPos) {
302  TString buf;
303  if (fPercent)
304  buf = TString::Format("%d%%", Int_t((fPos-fMin)/(fMax-fMin)*100.));
305  else
306  buf = TString::Format(fFormat.Data(), fPos);
307 
308  Int_t x, y, max_ascent, max_descent;
309  UInt_t twidth = gVirtualX->TextWidth(fFontStruct, buf.Data(), buf.Length());
310  gVirtualX->GetFontProperties(fFontStruct, max_ascent, max_descent);
311  UInt_t theight = max_ascent + max_descent;
312 
313  x = (fWidth - twidth) >> 1;
314  y = (fHeight - theight) >> 1;
315 
316  if (fDrawBar && fPosPix < Int_t(x+twidth))
317  gVirtualX->ClearArea(fId, pospix, fBorderWidth,
318  fWidth - pospix - fBorderWidth,
319  fBarWidth - (fBorderWidth << 1));
320 
321  gVirtualX->DrawString(fId, fNormGC, x, y + max_ascent, buf.Data(), buf.Length());
322  }
323 
324  fDrawBar = kFALSE;
325 }
326 
327 ////////////////////////////////////////////////////////////////////////////////
328 /// cconstructor
329 
331  Pixel_t back, Pixel_t barcolor, GContext_t norm,
332  FontStruct_t font,UInt_t options) :
333  TGProgressBar(p, w, h, back, barcolor, norm, font, options)
334 {
335  fBarWidth = w;
337 }
338 
339 ////////////////////////////////////////////////////////////////////////////////
340 /// Simple constructor allow you to create either a standard progress
341 /// bar, or a more fancy progress bar (fancy means: double sized border,
342 /// white background and a bit wider to allow for text to be printed
343 /// in the bar.
344 
346  : TGProgressBar(p, type == kStandard ? kProgressBarStandardWidth :
347  kProgressBarTextWidth, h, type == kStandard ? GetDefaultFrameBackground() :
348  fgWhitePixel, fgDefaultSelectedBackground, GetDefaultGC()(),
349  GetDefaultFontStruct(),
350  type == kStandard ? kSunkenFrame : kDoubleBorder | kSunkenFrame)
351 {
352  fBarType = type;
354  fDrawBar = kFALSE;
356 }
357 
358 ////////////////////////////////////////////////////////////////////////////////
359 /// Draw vertical progress bar.
360 
362 {
363  if (!fDrawBar) {
364  // calls TGProgressBar::DrawBorder()
366  }
367 
368  fPosPix = Int_t(((Float_t)fHeight - (fBorderWidth << 1)) *
369  (fPos - fMin) / (fMax - fMin) +
370  fBorderWidth);
371 
372  if (fFillType == kSolidFill)
373  gVirtualX->FillRectangle(fId, fBarColorGC(), fBorderWidth,
376  else {
377  Int_t blocksize = kBlockSize;
378  Int_t delta = kBlockSpace;
379  Int_t pos = fBorderWidth;
380  while (pos < fPosPix) {
381  if (pos + blocksize > Int_t(fHeight)-fBorderWidth)
382  blocksize = fHeight-fBorderWidth-pos;
383  gVirtualX->FillRectangle(fId, fBarColorGC(), fBorderWidth,
384  fHeight - pos - blocksize, fBarWidth - (fBorderWidth << 1),
385  blocksize);
386  pos += blocksize + delta;
387  }
388  }
389 
390  if (fShowPos) {
391  // not text shown for vertical progress bars
392  }
393 
394  fDrawBar = kFALSE;
395 }
396 
397 ////////////////////////////////////////////////////////////////////////////////
398 /// Save progress bar parameters as a C++ statement(s) on output stream out.
399 
400 void TGProgressBar::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
401 {
402  const char *barcolor;
403  char quote = '"';
404  switch (fBarType) {
405  case kFancy:
407  out << " " << GetName() << "->ChangeOptions(" << GetOptionString()
408  << ");" << std::endl;
409  if (GetBackground() != GetWhitePixel()) {
410  SaveUserColor(out, option);
411  out << " " << GetName() << "->SetBackgroundColor(ucolor);" << std::endl;
412  }
413  break;
414 
415  case kStandard:
417  out << " " << GetName() << "->ChangeOptions(" << GetOptionString()
418  << ");" << std::endl;
420  SaveUserColor(out, option);
421  out << " " << GetName() << "->SetBackgroundColor(ucolor);" << std::endl;
422  }
423  break;
424  }
425 
428  out << " " << GetName() <<"->SetBarColor(" << quote << barcolor << quote
429  << ");" << std::endl;
430  }
431 
432  if (fMin != 0 && fMax != 100)
433  out << " " << GetName() << "->SetRange(" << fMin << "," << fMax << ");" << std::endl;
434 
435  out <<" "<< GetName() <<"->SetPosition("<< fPos <<");"<< std::endl;
436 
437 }
438 
439 ////////////////////////////////////////////////////////////////////////////////
440 /// Save a vertical progress bar as a C++ statement(s) on output stream out.
441 
442 void TGVProgressBar::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
443 {
444 
445  out << " TGVProgressBar *";
446  out << GetName() << " = new TGVProgressBar(" << fParent->GetName();
447 
448  if ((fBarType == kFancy) && (fBarWidth == kProgressBarTextWidth)) {
449  out << ",TGProgressBar::kFancy";
450  } else if ((fBarType == kStandard) && (fBarWidth == kProgressBarStandardWidth)){
451  out << ",TGProgressBar::kStandard";
452  }
453 
454  out << "," << GetHeight() <<");" << std::endl;
455 
456  if (option && strstr(option, "keep_names"))
457  out << " " << GetName() << "->SetName(\"" << GetName() << "\");" << std::endl;
458 
459  if (GetFillType() == kBlockFill)
460  out << " " << GetName() <<"->SetFillType(TGProgressBar::kBlockFill);"<< std::endl;
461 
462  TGProgressBar::SavePrimitive(out, option);
463 }
464 
465 ////////////////////////////////////////////////////////////////////////////////
466 /// Save a horizontal progress bar as a C++ statement(s) on output stream out
467 
468 void TGHProgressBar::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
469 {
470  char quote = '"';
471 
472  out <<" TGHProgressBar *";
473  out << GetName() <<" = new TGHProgressBar("<< fParent->GetName();
474 
475  if ((fBarType == kFancy) && (fBarWidth == kProgressBarTextWidth)) {
476  out << ",TGProgressBar::kFancy";
477  } else if ((fBarType == kStandard) && (fBarWidth == kProgressBarStandardWidth)){
478  out << ",TGProgressBar::kStandard";
479  }
480 
481  if (option && strstr(option, "keep_names"))
482  out << " " << GetName() << "->SetName(\"" << GetName() << "\");" << std::endl;
483 
484  out << "," << GetWidth() << ");" << std::endl;
485 
486  if (GetFillType() == kBlockFill)
487  out << " " << GetName() <<"->SetFillType(TGProgressBar::kBlockFill);"<< std::endl;
488 
489  if (GetShowPos()) {
490  out << " " << GetName() <<"->ShowPosition(kTRUE,";
491  if (UsePercent()) {
492  out << "kTRUE,";
493  } else {
494  out << "kFALSE,";
495  }
496  out << quote << GetFormat() << quote << ");"<< std::endl;
497 
498  } else if (UsePercent() && !GetFillType()) {
499  out << " " << GetName() <<"->ShowPosition();" << std::endl;
500  }
501  TGProgressBar::SavePrimitive(out, option);
502 }
TGHProgressBar::TGHProgressBar
TGHProgressBar(const TGWindow *p=0, UInt_t w=4, UInt_t h=kProgressBarTextWidth, Pixel_t back=GetWhitePixel(), Pixel_t barcolor=GetDefaultSelectedBackground(), GContext_t norm=GetDefaultGC()(), FontStruct_t font=GetDefaultFontStruct(), UInt_t options=kDoubleBorder|kSunkenFrame)
Horizontal progress bar constructor.
Definition: TGProgressBar.cxx:223
TGProgressBar::fFillType
EFillType fFillType
Definition: TGProgressBar.h:51
TGFrame::GetHeight
UInt_t GetHeight() const
Definition: TGFrame.h:250
TGProgressBar::GetDefaultFontStruct
static FontStruct_t GetDefaultFontStruct()
Return default font structure in use.
Definition: TGProgressBar.cxx:187
TGWindow
Definition: TGWindow.h:31
TGProgressBar::kBlockSize
@ kBlockSize
Definition: TGProgressBar.h:43
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:91
TGProgressBar::Reset
virtual void Reset()
Reset progress bar (i.e. set pos to 0).
Definition: TGProgressBar.cxx:126
TGProgressBar::SetPosition
void SetPosition(Float_t pos)
Set progress position between [min,max].
Definition: TGProgressBar.cxx:92
TGGC::GetGC
GContext_t GetGC() const
Definition: TGGC.h:50
TGGC::GetForeground
Pixel_t GetForeground() const
Definition: TGGC.h:82
TGProgressBar::fgDefaultFont
static const TGFont * fgDefaultFont
Definition: TGProgressBar.h:63
gVirtualX
#define gVirtualX
Definition: TVirtualX.h:338
TString::Data
const char * Data() const
Definition: TString.h:369
Pixel_t
ULong_t Pixel_t
Definition: GuiTypes.h:39
ClassImp
#define ClassImp(name)
Definition: Rtypes.h:364
TGProgressBar::kSolidFill
@ kSolidFill
Definition: TGProgressBar.h:41
TGFrame::fWidth
UInt_t fWidth
Definition: TGFrame.h:112
FontStruct_t
Handle_t FontStruct_t
Definition: GuiTypes.h:38
TObject::Error
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition: TObject.cxx:890
TGProgressBar::kBlockSpace
@ kBlockSpace
Definition: TGProgressBar.h:43
TGVProgressBar::SavePrimitive
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a vertical progress bar as a C++ statement(s) on output stream out.
Definition: TGProgressBar.cxx:442
TGProgressBar::fPercent
Bool_t fPercent
Definition: TGProgressBar.h:55
TGGC::SetFillStyle
void SetFillStyle(Int_t v)
Set fill style (kFillSolid, kFillTiled, kFillStippled, kFillOpaeueStippled).
Definition: TGGC.cxx:344
Float_t
float Float_t
Definition: RtypesCore.h:57
TGProgressBar::fPos
Float_t fPos
Definition: TGProgressBar.h:48
kFillSolid
@ kFillSolid
Definition: GuiTypes.h:50
Int_t
int Int_t
Definition: RtypesCore.h:45
TGVProgressBar
Definition: TGProgressBar.h:134
x
Double_t x[n]
Definition: legend1.C:17
TString::Length
Ssiz_t Length() const
Definition: TString.h:410
TGProgressBar::SetRange
void SetRange(Float_t min, Float_t max)
Set min and max of progress bar.
Definition: TGProgressBar.cxx:66
TGProgressBar::GetFormat
TString GetFormat() const
Definition: TGProgressBar.h:84
TGWindow::kEditDisableHeight
@ kEditDisableHeight
Definition: TGWindow.h:63
TColor.h
TGFrame::GetDefaultFrameBackground
static Pixel_t GetDefaultFrameBackground()
Get default frame background.
Definition: TGFrame.cxx:668
TVirtualX.h
TGProgressBar::kBlockFill
@ kBlockFill
Definition: TGProgressBar.h:41
TColor::PixelAsHexString
static const char * PixelAsHexString(ULong_t pixel)
Convert machine dependent pixel value (obtained via RGB2Pixel or via Number2Pixel() or via TColor::Ge...
Definition: TColor.cxx:2106
TGProgressBar::EFillType
EFillType
Definition: TGProgressBar.h:41
TGFrame::GetBackground
virtual Pixel_t GetBackground() const
Definition: TGFrame.h:217
TString::Format
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
Definition: TString.cxx:2311
TString
Definition: TString.h:136
TGFrame
Definition: TGFrame.h:105
TGProgressBar::fBarType
EBarType fBarType
Definition: TGProgressBar.h:52
kDoubleBorder
@ kDoubleBorder
Definition: GuiTypes.h:385
TGProgressBar::SavePrimitive
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save progress bar parameters as a C++ statement(s) on output stream out.
Definition: TGProgressBar.cxx:400
kOwnBackground
@ kOwnBackground
Definition: GuiTypes.h:391
bool
TGFrame::GetWidth
UInt_t GetWidth() const
Definition: TGFrame.h:249
TGFrame::GetOptionString
TString GetOptionString() const
Returns a frame option string - used in SavePrimitive().
Definition: TGFrame.cxx:2465
TGFrame::GetOptions
virtual UInt_t GetOptions() const
Definition: TGFrame.h:222
GContext_t
Handle_t GContext_t
Definition: GuiTypes.h:37
TGProgressBar::fgDefaultGC
static TGGC * fgDefaultGC
Definition: TGProgressBar.h:64
gClient
#define gClient
Definition: TGClient.h:166
TGProgressBar::UsePercent
Bool_t UsePercent() const
Definition: TGProgressBar.h:86
TGProgressBar::Format
virtual void Format(const char *format="%.2f")
Set format for displaying a value.
Definition: TGProgressBar.cxx:177
TGClient::GetColorByName
Bool_t GetColorByName(const char *name, Pixel_t &pixel) const
Get a color by name.
Definition: TGClient.cxx:395
Option_t
const typedef char Option_t
Definition: RtypesCore.h:66
kSunkenFrame
@ kSunkenFrame
Definition: GuiTypes.h:383
TGHProgressBar
Definition: TGProgressBar.h:106
TGProgressBar::kStandard
@ kStandard
Definition: TGProgressBar.h:46
TGProgressBar::SetFillType
void SetFillType(EFillType type)
Set fill type.
Definition: TGProgressBar.cxx:136
TGProgressBar::fFormat
TString fFormat
Definition: TGProgressBar.h:53
h
#define h(i)
Definition: RSha256.hxx:124
TGWindow::GetName
virtual const char * GetName() const
Return unique name, used in SavePrimitive methods.
Definition: TGWindow.cxx:317
TGGC
Definition: TGGC.h:31
TGProgressBar::kFancy
@ kFancy
Definition: TGProgressBar.h:46
TGProgressBar::GetDefaultGC
static const TGGC & GetDefaultGC()
Return default graphics context in use.
Definition: TGProgressBar.cxx:197
TGObject::fId
Handle_t fId
Definition: TGObject.h:36
kFALSE
const Bool_t kFALSE
Definition: RtypesCore.h:92
TGProgressBar::fMax
Float_t fMax
Definition: TGProgressBar.h:47
TGFrame::fBorderWidth
Int_t fBorderWidth
Definition: TGFrame.h:118
TGProgressBar::GetFillType
EFillType GetFillType() const
Definition: TGProgressBar.h:81
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
y
Double_t y[n]
Definition: legend1.C:17
ULong_t
unsigned long ULong_t
Definition: RtypesCore.h:55
TGVProgressBar::DoRedraw
virtual void DoRedraw()
Draw vertical progress bar.
Definition: TGProgressBar.cxx:361
TGProgressBar::fShowPos
Bool_t fShowPos
Definition: TGProgressBar.h:54
TGProgressBar::fFontStruct
FontStruct_t fFontStruct
Definition: TGProgressBar.h:59
TGProgressBar::kProgressBarStandardWidth
@ kProgressBarStandardWidth
Definition: TGProgressBar.h:42
TGHProgressBar::DoRedraw
virtual void DoRedraw()
Draw horizontal progress bar.
Definition: TGProgressBar.cxx:265
unsigned int
TGProgressBar.h
TGHProgressBar::ShowPosition
void ShowPosition(Bool_t set=kTRUE, Bool_t percent=kTRUE, const char *format="%.2f")
Show postion text, either in percent or formatted according format.
Definition: TGProgressBar.cxx:253
TGProgressBar::SetBarType
void SetBarType(EBarType type)
Set bar type.
Definition: TGProgressBar.cxx:146
TGProgressBar::fNormGC
GContext_t fNormGC
Definition: TGProgressBar.h:58
TGClient::NeedRedraw
void NeedRedraw(TGWindow *w, Bool_t force=kFALSE)
Set redraw flags.
Definition: TGClient.cxx:373
TGProgressBar::fPosPix
Int_t fPosPix
Definition: TGProgressBar.h:49
TGProgressBar
Definition: TGProgressBar.h:31
TGHProgressBar::SavePrimitive
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a horizontal progress bar as a C++ statement(s) on output stream out.
Definition: TGProgressBar.cxx:468
TGObject::fClient
TGClient * fClient
Definition: TGObject.h:37
TGProgressBar::TGProgressBar
TGProgressBar(const TGWindow *p, UInt_t w, UInt_t h, Pixel_t back=GetWhitePixel(), Pixel_t barcolor=GetDefaultSelectedBackground(), GContext_t norm=GetDefaultGC()(), FontStruct_t font=GetDefaultFontStruct(), UInt_t options=kDoubleBorder|kSunkenFrame)
Create progress bar.
Definition: TGProgressBar.cxx:42
TGGC::SetForeground
void SetForeground(Pixel_t v)
Set foreground color.
Definition: TGGC.cxx:277
TGProgressBar::fMin
Float_t fMin
Definition: TGProgressBar.h:46
TGProgressBar::fBarColorGC
TGGC fBarColorGC
Definition: TGProgressBar.h:57
TGProgressBar::fDrawBar
Bool_t fDrawBar
Definition: TGProgressBar.h:56
TGFrame::GetWhitePixel
static Pixel_t GetWhitePixel()
Get white pixel value.
Definition: TGFrame.cxx:694
TGFrame::GetDefaultSelectedBackground
static Pixel_t GetDefaultSelectedBackground()
Get default selected frame background.
Definition: TGFrame.cxx:681
TGWindow::kEditDisableWidth
@ kEditDisableWidth
Definition: TGWindow.h:64
TGResourcePool.h
TGFont::GetFontStruct
FontStruct_t GetFontStruct() const
Definition: TGFont.h:193
TGProgressBar::fBarWidth
Int_t fBarWidth
Definition: TGProgressBar.h:50
TGProgressBar::GetShowPos
Bool_t GetShowPos() const
Definition: TGProgressBar.h:83
TGFrame::fHeight
UInt_t fHeight
Definition: TGFrame.h:113
TGVProgressBar::TGVProgressBar
TGVProgressBar(const TGWindow *p=0, UInt_t w=kProgressBarTextWidth, UInt_t h=4, Pixel_t back=GetWhitePixel(), Pixel_t barcolor=GetDefaultSelectedBackground(), GContext_t norm=GetDefaultGC()(), FontStruct_t font=GetDefaultFontStruct(), UInt_t options=kDoubleBorder|kSunkenFrame)
cconstructor
Definition: TGProgressBar.cxx:330
type
int type
Definition: TGX11.cxx:121
TGFont
Definition: TGFont.h:149
TGWindow::fEditDisabled
UInt_t fEditDisabled
Definition: TGWindow.h:40
TGProgressBar::kProgressBarTextWidth
@ kProgressBarTextWidth
Definition: TGProgressBar.h:42
TGProgressBar::DoRedraw
virtual void DoRedraw()=0
Redraw the frame.
TGProgressBar::SetForegroundColor
virtual void SetForegroundColor(Pixel_t pixel)
Change text color drawing.
Definition: TGProgressBar.cxx:207
TGProgressBar::Increment
void Increment(Float_t inc)
Increment progress position.
Definition: TGProgressBar.cxx:110
TGProgressBar::SetBarColor
virtual void SetBarColor(Pixel_t color)
Set progress bar color.
Definition: TGProgressBar.cxx:156
TGWindow::fParent
const TGWindow * fParent
Definition: TGWindow.h:36
TGProgressBar::EBarType
EBarType
Definition: TGProgressBar.h:40
int
TGFrame::DoRedraw
virtual void DoRedraw()
Redraw the frame.
Definition: TGFrame.cxx:415