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)((fWidth - 2.0*fBorderWidth ) *(fPos - fMin) / (fMax - fMin)) + fBorderWidth;
273 
274  Int_t pospix = fPosPix;
275 
276  if (fFillType == kSolidFill)
277  gVirtualX->FillRectangle(fId, fBarColorGC(), fBorderWidth,
279  (fBorderWidth << 1));
280  else {
281  Int_t blocksize = kBlockSize;
282  Int_t delta = kBlockSpace;
283  Int_t pos = fBorderWidth;
284  while (pos < fPosPix) {
285  if (pos + blocksize > Int_t(fWidth)-fBorderWidth)
286  blocksize = fWidth-fBorderWidth-pos;
287  gVirtualX->FillRectangle(fId, fBarColorGC(), pos,
288  fBorderWidth, blocksize, fBarWidth -
289  (fBorderWidth << 1));
290  if (fDrawBar && fShowPos)
291  gVirtualX->ClearArea(fId, pos+blocksize, fBorderWidth,
292  delta, fBarWidth - (fBorderWidth << 1));
293 
294  pos += blocksize + delta;
295  }
296  pospix = pos - delta;
297  }
298 
299  if (fShowPos) {
300  TString buf;
301  if (fPercent)
302  buf = TString::Format("%d%%", Int_t((fPos-fMin)/(fMax-fMin)*100.));
303  else
304  buf = TString::Format(fFormat.Data(), fPos);
305 
306  Int_t x, y, max_ascent, max_descent;
307  UInt_t twidth = gVirtualX->TextWidth(fFontStruct, buf.Data(), buf.Length());
308  gVirtualX->GetFontProperties(fFontStruct, max_ascent, max_descent);
309  UInt_t theight = max_ascent + max_descent;
310 
311  x = (Int_t)((fWidth - twidth)*0.5);
312  y = (Int_t)((fHeight - theight)*0.5);
313 
314  if (fDrawBar && fPosPix < Int_t(x+twidth))
315  gVirtualX->ClearArea(fId, pospix, fBorderWidth,
316  fWidth - pospix - fBorderWidth,
317  fBarWidth - (fBorderWidth << 1));
318 
319  gVirtualX->DrawString(fId, fNormGC, x, y + max_ascent, buf.Data(), buf.Length());
320  }
321 
322  fDrawBar = kFALSE;
323 }
324 
325 ////////////////////////////////////////////////////////////////////////////////
326 /// cconstructor
327 
329  Pixel_t back, Pixel_t barcolor, GContext_t norm,
330  FontStruct_t font,UInt_t options) :
331  TGProgressBar(p, w, h, back, barcolor, norm, font, options)
332 {
333  fBarWidth = w;
335 }
336 
337 ////////////////////////////////////////////////////////////////////////////////
338 /// Simple constructor allow you to create either a standard progress
339 /// bar, or a more fancy progress bar (fancy means: double sized border,
340 /// white background and a bit wider to allow for text to be printed
341 /// in the bar.
342 
344  : TGProgressBar(p, type == kStandard ? kProgressBarStandardWidth :
345  kProgressBarTextWidth, h, type == kStandard ? GetDefaultFrameBackground() :
346  fgWhitePixel, fgDefaultSelectedBackground, GetDefaultGC()(),
347  GetDefaultFontStruct(),
348  type == kStandard ? kSunkenFrame : kDoubleBorder | kSunkenFrame)
349 {
350  fBarType = type;
352  fDrawBar = kFALSE;
354 }
355 
356 ////////////////////////////////////////////////////////////////////////////////
357 /// Draw vertical progress bar.
358 
360 {
361  if (!fDrawBar) {
362  // calls TGProgressBar::DrawBorder()
364  }
365 
366  fPosPix = (Int_t)((fHeight - 2.0f*fBorderWidth) *(fPos - fMin) / (fMax - fMin)) + fBorderWidth;
367 
368  if (fFillType == kSolidFill)
369  gVirtualX->FillRectangle(fId, fBarColorGC(), fBorderWidth,
372  else {
373  Int_t blocksize = kBlockSize;
374  Int_t delta = kBlockSpace;
375  Int_t pos = fBorderWidth;
376  while (pos < fPosPix) {
377  if (pos + blocksize > Int_t(fHeight)-fBorderWidth)
378  blocksize = fHeight-fBorderWidth-pos;
379  gVirtualX->FillRectangle(fId, fBarColorGC(), fBorderWidth,
380  fHeight - pos - blocksize, fBarWidth - (fBorderWidth << 1),
381  blocksize);
382  pos += blocksize + delta;
383  }
384  }
385 
386  if (fShowPos) {
387  // not text shown for vertical progress bars
388  }
389 
390  fDrawBar = kFALSE;
391 }
392 
393 ////////////////////////////////////////////////////////////////////////////////
394 /// Save progress bar parameters as a C++ statement(s) on output stream out.
395 
396 void TGProgressBar::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
397 {
398  const char *barcolor;
399  char quote = '"';
400  switch (fBarType) {
401  case kFancy:
403  out << " " << GetName() << "->ChangeOptions(" << GetOptionString()
404  << ");" << std::endl;
405  if (GetBackground() != GetWhitePixel()) {
406  SaveUserColor(out, option);
407  out << " " << GetName() << "->SetBackgroundColor(ucolor);" << std::endl;
408  }
409  break;
410 
411  case kStandard:
413  out << " " << GetName() << "->ChangeOptions(" << GetOptionString()
414  << ");" << std::endl;
416  SaveUserColor(out, option);
417  out << " " << GetName() << "->SetBackgroundColor(ucolor);" << std::endl;
418  }
419  break;
420  }
421 
424  out << " " << GetName() <<"->SetBarColor(" << quote << barcolor << quote
425  << ");" << std::endl;
426  }
427 
428  if (fMin != 0 && fMax != 100)
429  out << " " << GetName() << "->SetRange(" << fMin << "," << fMax << ");" << std::endl;
430 
431  out <<" "<< GetName() <<"->SetPosition("<< fPos <<");"<< std::endl;
432 
433 }
434 
435 ////////////////////////////////////////////////////////////////////////////////
436 /// Save a vertical progress bar as a C++ statement(s) on output stream out.
437 
438 void TGVProgressBar::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
439 {
440 
441  out << " TGVProgressBar *";
442  out << GetName() << " = new TGVProgressBar(" << fParent->GetName();
443 
444  if ((fBarType == kFancy) && (fBarWidth == kProgressBarTextWidth)) {
445  out << ",TGProgressBar::kFancy";
446  } else if ((fBarType == kStandard) && (fBarWidth == kProgressBarStandardWidth)){
447  out << ",TGProgressBar::kStandard";
448  }
449 
450  out << "," << GetHeight() <<");" << std::endl;
451 
452  if (option && strstr(option, "keep_names"))
453  out << " " << GetName() << "->SetName(\"" << GetName() << "\");" << std::endl;
454 
455  if (GetFillType() == kBlockFill)
456  out << " " << GetName() <<"->SetFillType(TGProgressBar::kBlockFill);"<< std::endl;
457 
458  TGProgressBar::SavePrimitive(out, option);
459 }
460 
461 ////////////////////////////////////////////////////////////////////////////////
462 /// Save a horizontal progress bar as a C++ statement(s) on output stream out
463 
464 void TGHProgressBar::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
465 {
466  char quote = '"';
467 
468  out <<" TGHProgressBar *";
469  out << GetName() <<" = new TGHProgressBar("<< fParent->GetName();
470 
471  if ((fBarType == kFancy) && (fBarWidth == kProgressBarTextWidth)) {
472  out << ",TGProgressBar::kFancy";
473  } else if ((fBarType == kStandard) && (fBarWidth == kProgressBarStandardWidth)){
474  out << ",TGProgressBar::kStandard";
475  }
476 
477  if (option && strstr(option, "keep_names"))
478  out << " " << GetName() << "->SetName(\"" << GetName() << "\");" << std::endl;
479 
480  out << "," << GetWidth() << ");" << std::endl;
481 
482  if (GetFillType() == kBlockFill)
483  out << " " << GetName() <<"->SetFillType(TGProgressBar::kBlockFill);"<< std::endl;
484 
485  if (GetShowPos()) {
486  out << " " << GetName() <<"->ShowPosition(kTRUE,";
487  if (UsePercent()) {
488  out << "kTRUE,";
489  } else {
490  out << "kFALSE,";
491  }
492  out << quote << GetFormat() << quote << ");"<< std::endl;
493 
494  } else if (UsePercent() && !GetFillType()) {
495  out << " " << GetName() <<"->ShowPosition();" << std::endl;
496  }
497  TGProgressBar::SavePrimitive(out, option);
498 }
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:45
TGFrame::GetHeight
UInt_t GetHeight() const
Definition: TGFrame.h:249
TGProgressBar::GetDefaultFontStruct
static FontStruct_t GetDefaultFontStruct()
Return default font structure in use.
Definition: TGProgressBar.cxx:187
TGWindow
Definition: TGWindow.h:31
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
Option_t
const char Option_t
Definition: RtypesCore.h:66
TGProgressBar::kBlockSize
@ kBlockSize
Definition: TGProgressBar.h:37
TGProgressBar::kProgressBarStandardWidth
@ kProgressBarStandardWidth
Definition: TGProgressBar.h:36
TGProgressBar::fgDefaultFont
static const TGFont * fgDefaultFont
Definition: TGProgressBar.h:57
gVirtualX
#define gVirtualX
Definition: TVirtualX.h:338
TString::Data
const char * Data() const
Definition: TString.h:369
Pixel_t
ULong_t Pixel_t
Pixel value.
Definition: GuiTypes.h:40
ClassImp
#define ClassImp(name)
Definition: Rtypes.h:364
TGProgressBar::kSolidFill
@ kSolidFill
Definition: TGProgressBar.h:35
TGFrame::fWidth
UInt_t fWidth
Definition: TGFrame.h:111
FontStruct_t
Handle_t FontStruct_t
Pointer to font structure.
Definition: GuiTypes.h:39
TObject::Error
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition: TObject.cxx:890
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:438
TGProgressBar::kProgressBarTextWidth
@ kProgressBarTextWidth
Definition: TGProgressBar.h:36
TGProgressBar::fPercent
Bool_t fPercent
Definition: TGProgressBar.h:49
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:42
kFillSolid
@ kFillSolid
Definition: GuiTypes.h:51
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:78
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:35
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:35
TGFrame::GetBackground
virtual Pixel_t GetBackground() const
Definition: TGFrame.h:216
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:2331
TString
Basic string class.
Definition: TString.h:136
TGFrame
Definition: TGFrame.h:104
TGProgressBar::fBarType
EBarType fBarType
Definition: TGProgressBar.h:46
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:396
kOwnBackground
@ kOwnBackground
Definition: GuiTypes.h:391
bool
TGFrame::GetWidth
UInt_t GetWidth() const
Definition: TGFrame.h:248
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:221
GContext_t
Handle_t GContext_t
Graphics context handle.
Definition: GuiTypes.h:38
TGProgressBar::fgDefaultGC
static TGGC * fgDefaultGC
Definition: TGProgressBar.h:58
gClient
#define gClient
Definition: TGClient.h:166
TGProgressBar::UsePercent
Bool_t UsePercent() const
Definition: TGProgressBar.h:80
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:396
kSunkenFrame
@ kSunkenFrame
Definition: GuiTypes.h:383
TGHProgressBar
Definition: TGProgressBar.h:106
TGProgressBar::kStandard
@ kStandard
Definition: TGProgressBar.h:34
TGProgressBar::SetFillType
void SetFillType(EFillType type)
Set fill type.
Definition: TGProgressBar.cxx:136
TGProgressBar::fFormat
TString fFormat
Definition: TGProgressBar.h:47
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
TGProgressBar::kFancy
@ kFancy
Definition: TGProgressBar.h:34
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:41
TGFrame::fBorderWidth
Int_t fBorderWidth
Definition: TGFrame.h:117
TGProgressBar::GetFillType
EFillType GetFillType() const
Definition: TGProgressBar.h:75
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:359
TGProgressBar::fShowPos
Bool_t fShowPos
Definition: TGProgressBar.h:48
TGProgressBar::fFontStruct
FontStruct_t fFontStruct
Definition: TGProgressBar.h:53
TGHProgressBar::DoRedraw
virtual void DoRedraw()
Draw horizontal progress bar.
Definition: TGProgressBar.cxx:265
unsigned int
TGProgressBar.h
TGProgressBar::kBlockSpace
@ kBlockSpace
Definition: TGProgressBar.h:37
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:52
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:43
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:464
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:40
TGProgressBar::fBarColorGC
TGGC fBarColorGC
Definition: TGProgressBar.h:51
TGProgressBar::fDrawBar
Bool_t fDrawBar
Definition: TGProgressBar.h:50
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:44
TGProgressBar::GetShowPos
Bool_t GetShowPos() const
Definition: TGProgressBar.h:77
TGFrame::fHeight
UInt_t fHeight
Definition: TGFrame.h:112
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:328
type
int type
Definition: TGX11.cxx:121
TGFont
Definition: TGFont.h:149
TGWindow::fEditDisabled
UInt_t fEditDisabled
Definition: TGWindow.h:40
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:34
int
TGFrame::DoRedraw
virtual void DoRedraw()
Redraw the frame.
Definition: TGFrame.cxx:415