66 Error(
"SetRange",
"max must be > min");
166 fClient->GetColorByName(color, ic);
291 pos += blocksize + delta;
293 pospix = pos - delta;
303 Int_t x,
y, max_ascent, max_descent;
306 UInt_t theight = max_ascent + max_descent;
379 pos += blocksize + delta;
401 out <<
" " <<
GetName() <<
"->SetBackgroundColor(ucolor);\n";
410 out <<
" " <<
GetName() <<
"->SetBackgroundColor(ucolor);\n";
421 out <<
" " <<
GetName() <<
"->SetRange(" <<
fMin <<
"," <<
fMax <<
");\n";
423 out <<
" " <<
GetName() <<
"->SetPosition(" <<
fPos <<
");\n";
431 out <<
" TGVProgressBar *" <<
GetName() <<
" = new TGVProgressBar(" <<
fParent->GetName();
434 out <<
", TGProgressBar::kFancy";
436 out <<
", TGProgressBar::kStandard";
439 if (option && strstr(option,
"keep_names"))
440 out <<
" " <<
GetName() <<
"->SetName(\"" <<
GetName() <<
"\");\n";
443 out <<
" " <<
GetName() <<
"->SetFillType(TGProgressBar::kBlockFill);\n";
453 out <<
" TGHProgressBar *" <<
GetName() <<
" = new TGHProgressBar(" <<
fParent->GetName();
456 out <<
",TGProgressBar::kFancy";
458 out <<
",TGProgressBar::kStandard";
462 if (option && strstr(option,
"keep_names"))
463 out <<
" " <<
GetName() <<
"->SetName(\"" <<
GetName() <<
"\");\n";
466 out <<
" " <<
GetName() <<
"->SetFillType(TGProgressBar::kBlockFill);\n";
469 out <<
" " <<
GetName() <<
"->ShowPosition(kTRUE,";
478 out <<
" " <<
GetName() <<
"->ShowPosition();\n";
Handle_t GContext_t
Graphics context handle.
Handle_t FontStruct_t
Pointer to font structure.
ULong_t Pixel_t
Pixel value.
int Int_t
Signed integer 4 bytes (int).
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int).
unsigned long ULong_t
Unsigned long integer 4 bytes (unsigned long). Size depends on architecture.
bool Bool_t
Boolean (0=false, 1=true) (bool).
float Float_t
Float 4 bytes (float).
const char Option_t
Option string (const char).
static const char * PixelAsHexString(ULong_t pixel)
Encapsulate fonts used in the GUI system.
static Pixel_t GetDefaultSelectedBackground()
Get default selected frame background.
TGFrame(const TGFrame &)=delete
static Pixel_t GetWhitePixel()
Get white pixel value.
UInt_t fHeight
frame height
Int_t fBorderWidth
frame border width
static Pixel_t fgDefaultSelectedBackground
void DoRedraw() override
Redraw the frame.
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
static Pixel_t fgWhitePixel
void SaveUserColor(std::ostream &out, Option_t *)
Save a user color in a C++ macro file - used in SavePrimitive().
Encapsulate a graphics context used in the low level graphics.
void SetForeground(Pixel_t v)
Set foreground color.
void ShowPosition(Bool_t set=kTRUE, Bool_t percent=kTRUE, const char *format="%.2f")
Show postion text, either in percent or formatted according format.
void DoRedraw() override
Draw horizontal progress bar.
TGHProgressBar(const TGWindow *p=nullptr, 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.
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save a horizontal progress bar as a C++ statement(s) on output stream out.
TGClient * fClient
Connection to display server.
Handle_t fId
X11/Win32 Window identifier.
static const TGFont * fgDefaultFont
Bool_t fPercent
show position in percent (default true)
void Increment(Float_t inc)
Increment progress position.
TString fFormat
format used to show position not in percent
void SetForegroundColor(Pixel_t pixel) override
Change text color drawing.
static TGGC * fgDefaultGC
EBarType fBarType
OPTION={GetMethod="GetBarType";SetMethod="SetBarType";Items=(kStandard="Standard",...
static const TGGC & GetDefaultGC()
Return default graphics context in use.
Float_t fPos
logical position [fMin,fMax]
Bool_t UsePercent() const
Float_t fMax
logical maximum value (default 100)
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.
GContext_t fNormGC
text drawing graphics context
Int_t fBarWidth
progress bar width
FontStruct_t fFontStruct
font used to draw position text
void SetPosition(Float_t pos)
Set progress position between [min,max].
Bool_t fDrawBar
if true draw only bar in DoRedraw()
Bool_t GetShowPos() const
TString GetFormat() const
static FontStruct_t GetDefaultFontStruct()
Return default font structure in use.
Float_t fMin
logical minimum value (default 0)
TGGC fBarColorGC
progress bar drawing context
virtual void Format(const char *format="%.2f")
Set format for displaying a value.
void SetFillType(EFillType type)
Set fill type.
@ kProgressBarStandardWidth
virtual void SetBarColor(Pixel_t color)
Set progress bar color.
void SetBarType(EBarType type)
Set bar type.
void DoRedraw() override=0
Redraw the frame.
void SetRange(Float_t min, Float_t max)
Set min and max of progress bar.
EFillType GetFillType() const
Int_t fPosPix
position of progress bar in pixel coordinates
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save progress bar parameters as a C++ statement(s) on output stream out.
EFillType fFillType
OPTION={GetMethod="GetFillType";SetMethod="SetFillType";Items=(kSolidFill=Solid",kBlockFill="Block")}
Bool_t fShowPos
show position value (default false)
virtual void Reset()
Reset progress bar (i.e. set pos to 0).
void DoRedraw() override
Draw vertical progress bar.
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save a vertical progress bar as a C++ statement(s) on output stream out.
TGVProgressBar(const TGWindow *p=nullptr, 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)
Constructor.
const TGWindow * fParent
Parent window.
@ kEditDisableHeight
window height cannot be edited
@ kEditDisableWidth
window width cannot be edited
const char * GetName() const override
Return unique name, used in SavePrimitive methods.
UInt_t fEditDisabled
flags used for "guibuilding"
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.