31 const TGFont *TGProgressBar::fgDefaultFont = 0;
32 TGGC *TGProgressBar::fgDefaultGC = 0;
51 fFillType = kSolidFill;
58 fBarColorGC.SetForeground(barcolor);
59 fBarWidth = kProgressBarStandardWidth;
69 Error(
"SetRange",
"max must be > min");
239 :
TGProgressBar(p, w, type == kStandard ? kProgressBarStandardWidth :
240 kProgressBarTextWidth, type == kStandard ? GetDefaultFrameBackground() :
241 fgWhitePixel, fgDefaultSelectedBackground, GetDefaultGC()(),
242 GetDefaultFontStruct(),
296 pos += blocksize + delta;
298 pospix = pos - delta;
308 Int_t x,
y, max_ascent, max_descent;
311 UInt_t theight = max_ascent + max_descent;
313 x = (
fWidth - twidth) >> 1;
346 :
TGProgressBar(p, type == kStandard ? kProgressBarStandardWidth :
347 kProgressBarTextWidth, h, type == kStandard ? GetDefaultFrameBackground() :
348 fgWhitePixel, fgDefaultSelectedBackground, GetDefaultGC()(),
349 GetDefaultFontStruct(),
386 pos += blocksize + delta;
402 const char *barcolor;
408 <<
");" << std::endl;
411 out <<
" " <<
GetName() <<
"->SetBackgroundColor(ucolor);" << std::endl;
418 <<
");" << std::endl;
421 out <<
" " <<
GetName() <<
"->SetBackgroundColor(ucolor);" << std::endl;
428 out <<
" " <<
GetName() <<
"->SetBarColor(" << quote << barcolor << quote
429 <<
");" << std::endl;
433 out <<
" " <<
GetName() <<
"->SetRange(" <<
fMin <<
"," <<
fMax <<
");" << std::endl;
435 out <<
" "<<
GetName() <<
"->SetPosition("<<
fPos <<
");"<< std::endl;
445 out <<
" TGVProgressBar *";
449 out <<
",TGProgressBar::kFancy";
451 out <<
",TGProgressBar::kStandard";
454 out <<
"," <<
GetHeight() <<
");" << std::endl;
456 if (option && strstr(option,
"keep_names"))
457 out <<
" " <<
GetName() <<
"->SetName(\"" <<
GetName() <<
"\");" << std::endl;
460 out <<
" " <<
GetName() <<
"->SetFillType(TGProgressBar::kBlockFill);"<< std::endl;
472 out <<
" TGHProgressBar *";
476 out <<
",TGProgressBar::kFancy";
478 out <<
",TGProgressBar::kStandard";
481 if (option && strstr(option,
"keep_names"))
482 out <<
" " <<
GetName() <<
"->SetName(\"" <<
GetName() <<
"\");" << std::endl;
484 out <<
"," <<
GetWidth() <<
");" << std::endl;
487 out <<
" " <<
GetName() <<
"->SetFillType(TGProgressBar::kBlockFill);"<< std::endl;
490 out <<
" " <<
GetName() <<
"->ShowPosition(kTRUE,";
496 out << quote <<
GetFormat() << quote <<
");"<< std::endl;
499 out <<
" " <<
GetName() <<
"->ShowPosition();" << std::endl;
static const TGGC & GetDefaultGC()
Return default graphics context in use.
virtual const char * GetName() const
Return unique name, used in SavePrimitive methods.
EFillType GetFillType() const
static Vc_ALWAYS_INLINE int_v min(const int_v &x, const int_v &y)
void Increment(Float_t inc)
Increment progress position.
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a vertical progress bar as a C++ statement(s) on output stream out.
static FontStruct_t GetDefaultFontStruct()
Return default font structure in use.
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
void SetForeground(Pixel_t v)
Set foreground color.
static Pixel_t GetWhitePixel()
Get white pixel value.
static const TGFont * fgDefaultFont
virtual void DoRedraw()=0
Redraw the frame.
static std::string format(double x, double y, int digits, int width)
Bool_t GetColorByName(const char *name, Pixel_t &pixel) const
Get a color by name.
virtual void SetBarColor(Pixel_t color)
Set progress bar color.
static const char * PixelAsHexString(ULong_t pixel)
Convert machine dependent pixel value (obtained via RGB2Pixel or via Number2Pixel() or via TColor::Ge...
const char * Data() const
virtual void DoRedraw()
Redraw the frame.
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString...
static Pixel_t GetDefaultFrameBackground()
Get default frame background.
virtual UInt_t GetOptions() const
virtual void Format(const char *format="%.2f")
Set format for displaying a value.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
virtual void DoRedraw()
Draw horizontal progress bar.
virtual void SetForegroundColor(Pixel_t pixel)
Change text color drawing.
Bool_t UsePercent() const
void SetBarType(EBarType type)
Set bar type.
Pixel_t GetForeground() const
void ShowPosition(Bool_t set=kTRUE, Bool_t percent=kTRUE, const char *format="%.2f")
Show postion text, either in percent or formatted according format.
Bool_t GetShowPos() const
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a horizontal progress bar as a C++ statement(s) on output stream out.
void SetRange(Float_t min, Float_t max)
Set min and max of progress bar.
void SetPosition(Float_t pos)
Set progress position between [min,max].
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.
static Vc_ALWAYS_INLINE int_v max(const int_v &x, const int_v &y)
virtual void Reset()
Reset progress bar (i.e. set pos to 0).
virtual Pixel_t GetBackground() const
FontStruct_t GetFontStruct() const
static TGGC * fgDefaultGC
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save progress bar parameters as a C++ statement(s) on output stream out.
void NeedRedraw(TGWindow *w, Bool_t force=kFALSE)
Set redraw flags.
void SaveUserColor(std::ostream &out, Option_t *)
Save a user color in a C++ macro file - used in SavePrimitive().
virtual void DoRedraw()
Draw vertical progress bar.
ClassImp(TGProgressBar) ClassImp(TGHProgressBar) ClassImp(TGVProgressBar) TGProgressBar
Create progress bar.
TString GetFormat() const
double norm(double *x, double *p)
TString GetOptionString() const
Returns a frame option string - used in SavePrimitive().
void SetFillType(EFillType type)
Set fill type.
static Pixel_t GetDefaultSelectedBackground()
Get default selected frame background.