70 Error(
"SetRange",
"max must be > min");
241 kProgressBarTextWidth,
type == kStandard ? GetDefaultFrameBackground() :
242 fgWhitePixel, fgDefaultSelectedBackground, GetDefaultGC()(),
243 GetDefaultFontStruct(),
297 pos += blocksize + delta;
299 pospix = pos - delta;
309 Int_t x,
y, max_ascent, max_descent;
312 UInt_t theight = max_ascent + max_descent;
348 kProgressBarTextWidth,
h,
type == kStandard ? GetDefaultFrameBackground() :
349 fgWhitePixel, fgDefaultSelectedBackground, GetDefaultGC()(),
350 GetDefaultFontStruct(),
387 pos += blocksize + delta;
403 const char *barcolor;
409 <<
");" << std::endl;
412 out <<
" " <<
GetName() <<
"->SetBackgroundColor(ucolor);" << std::endl;
419 <<
");" << std::endl;
422 out <<
" " <<
GetName() <<
"->SetBackgroundColor(ucolor);" << std::endl;
429 out <<
" " <<
GetName() <<
"->SetBarColor(" << quote << barcolor << quote
430 <<
");" << std::endl;
434 out <<
" " <<
GetName() <<
"->SetRange(" <<
fMin <<
"," <<
fMax <<
");" << std::endl;
436 out <<
" "<<
GetName() <<
"->SetPosition("<<
fPos <<
");"<< std::endl;
446 out <<
" TGVProgressBar *";
450 out <<
",TGProgressBar::kFancy";
452 out <<
",TGProgressBar::kStandard";
455 out <<
"," <<
GetHeight() <<
");" << std::endl;
457 if (option && strstr(option,
"keep_names"))
458 out <<
" " <<
GetName() <<
"->SetName(\"" <<
GetName() <<
"\");" << std::endl;
461 out <<
" " <<
GetName() <<
"->SetFillType(TGProgressBar::kBlockFill);"<< std::endl;
473 out <<
" TGHProgressBar *";
477 out <<
",TGProgressBar::kFancy";
479 out <<
",TGProgressBar::kStandard";
482 if (option && strstr(option,
"keep_names"))
483 out <<
" " <<
GetName() <<
"->SetName(\"" <<
GetName() <<
"\");" << std::endl;
485 out <<
"," <<
GetWidth() <<
");" << std::endl;
488 out <<
" " <<
GetName() <<
"->SetFillType(TGProgressBar::kBlockFill);"<< std::endl;
491 out <<
" " <<
GetName() <<
"->ShowPosition(kTRUE,";
497 out << quote <<
GetFormat() << quote <<
");"<< std::endl;
500 out <<
" " <<
GetName() <<
"->ShowPosition();" << std::endl;
static const char * PixelAsHexString(ULong_t pixel)
Convert machine dependent pixel value (obtained via RGB2Pixel or via Number2Pixel() or via TColor::Ge...
Bool_t GetColorByName(const char *name, Pixel_t &pixel) const
Get a color by name.
void NeedRedraw(TGWindow *w, Bool_t force=kFALSE)
Set redraw flags.
FontStruct_t GetFontStruct() const
static Pixel_t GetDefaultSelectedBackground()
Get default selected frame background.
virtual void DoRedraw()
Redraw the frame.
static Pixel_t GetWhitePixel()
Get white pixel value.
static Pixel_t GetDefaultFrameBackground()
Get default frame background.
virtual UInt_t GetOptions() const
TString GetOptionString() const
Returns a frame option string - used in SavePrimitive().
virtual Pixel_t GetBackground() const
void SaveUserColor(std::ostream &out, Option_t *)
Save a user color in a C++ macro file - used in SavePrimitive().
void SetFillStyle(Int_t v)
Set fill style (kFillSolid, kFillTiled, kFillStippled, kFillOpaeueStippled).
Pixel_t GetForeground() const
void SetForeground(Pixel_t v)
Set foreground color.
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.
virtual void DoRedraw()
Draw horizontal progress bar.
void ShowPosition(Bool_t set=kTRUE, Bool_t percent=kTRUE, const char *format="%.2f")
Show postion text, either in percent or formatted according format.
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a horizontal progress bar as a C++ statement(s) on output stream out.
static const TGFont * fgDefaultFont
void Increment(Float_t inc)
Increment progress position.
static TGGC * fgDefaultGC
virtual void DoRedraw()=0
Redraw the frame.
static const TGGC & GetDefaultGC()
Return default graphics context in use.
Bool_t UsePercent() const
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.
virtual void SetForegroundColor(Pixel_t pixel)
Change text color drawing.
void SetPosition(Float_t pos)
Set progress position between [min,max].
Bool_t GetShowPos() const
TString GetFormat() const
static FontStruct_t GetDefaultFontStruct()
Return default font structure in use.
virtual void Format(const char *format="%.2f")
Set format for displaying a value.
void SetFillType(EFillType type)
Set fill type.
virtual void SetBarColor(Pixel_t color)
Set progress bar color.
void SetBarType(EBarType type)
Set bar type.
@ kProgressBarStandardWidth
void SetRange(Float_t min, Float_t max)
Set min and max of progress bar.
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save progress bar parameters as a C++ statement(s) on output stream out.
EFillType GetFillType() const
virtual void Reset()
Reset progress bar (i.e. set pos to 0).
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
virtual void DoRedraw()
Draw vertical progress bar.
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a vertical progress bar as a C++ statement(s) on output stream out.
virtual const char * GetName() const
Return unique name, used in SavePrimitive methods.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
const char * Data() const
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.