112 int max_ascent, max_descent;
114 int ht = max_ascent + max_descent;
131 for (
int i = 0; i <
fNpart; i++) {
147 if (partidx < 0 || partidx >=
fNpart) {
148 Error(
"SetText",
"partidx out of range (0,%d)",
fNpart-1);
160 if ((partidx >= 0) && (partidx <
fNpart))
169 if (partidx < 0 || partidx >=
fNpart) {
170 Error(
"GetText",
"partidx out of range (0,%d)",
fNpart-1);
185 for (i = 0; i <
fNpart; i++) {
193 for (i = 0; i <
fNpart; i++) {
244 for (
int i = 0; i <
fNpart; i++)
255 Warning(
"SetParts",
"must be at least one part");
259 Error(
"SetParts",
"to many parts (limit is 15)");
264 for (i = 0; i <
fNpart; i++)
277 for (i = 0; i < npart; i++) {
283 Error(
"SetParts",
"sum of part > 100");
286 fParts[npart-1] += 100 - tot;
296 Warning(
"SetParts",
"must be at least one part");
300 Error(
"SetParts",
"to many parts (limit is 40)");
305 for (i = 0; i <
fNpart; i++)
319 for (i = 0; i < npart; i++) {
326 fParts[npart-1] += 100 - tot;
368 for (
int i = 0; i <
fNpart; i++) {
382 out <<
" // status bar" << std::endl;
384 out <<
" TGStatusBar *";
390 out <<
");" << std::endl;
398 out <<
" " <<
GetName() <<
"->SetName(\"" <<
GetName() <<
"\");" << std::endl;
400 int i;
char quote =
'"';
403 out <<
" Int_t parts" <<
GetName()+5 <<
"[] = {" <<
fParts[0];
405 for (i=1; i<
fNpart; i++) {
408 out <<
"};" << std::endl;
411 <<
"," <<
fNpart <<
");" <<std::endl;
413 for (i=0; i<
fNpart; i++) {
415 out <<
" " <<
GetName() <<
"->SetText(" << quote
417 << quote <<
"," << i <<
");" << std::endl;
421 <<
" = " <<
GetName() <<
"->GetBarPart(" << i <<
");" << std::endl;
431 out <<
");" << std::endl;
ULong_t Pixel_t
Pixel value.
Handle_t FontStruct_t
Pointer to font structure.
void Error(const char *location, const char *msgfmt,...)
Use this function in case an error occurred.
void Warning(const char *location, const char *msgfmt,...)
Use this function in warning situations.
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char text
void NeedRedraw(TGWindow *w, Bool_t force=kFALSE)
Set redraw flags.
The base class for composite widgets (menu bars, list boxes, etc.).
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=nullptr)
Add frame to the composite frame using the specified layout hints.
virtual TList * GetList() const
Int_t MustCleanup() const override
UInt_t GetDefaultHeight() const override
TList * fList
container of frame elements
Encapsulate fonts used in the GUI system.
FontStruct_t GetFontStruct() const
FontH_t GetFontHandle() const
void MoveResize(Int_t x, Int_t y, UInt_t w=0, UInt_t h=0) override
Move and/or resize the frame.
void Resize(UInt_t w=0, UInt_t h=0) override
Resize the frame.
UInt_t fHeight
frame height
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save a frame widget as a C++ statement(s) on output stream out.
Int_t fBorderWidth
frame border width
void DoRedraw() override
Redraw the frame.
void MapWindow() override
map window
static const TGGC & GetHilightGC()
Get highlight color graphics context.
static Pixel_t GetDefaultFrameBackground()
Get default frame background.
virtual UInt_t GetOptions() const
TString GetOptionString() const
Returns a frame option string - used in SavePrimitive().
static const TGGC & GetShadowGC()
Get shadow color graphics context.
void SaveUserColor(std::ostream &out, Option_t *)
Save a user color in a C++ macro file - used in SavePrimitive().
Pixel_t fBackground
frame background color
static const TGGC & GetBckgndGC()
Get background color graphics context.
Encapsulate a graphics context used in the low level graphics.
void SetFont(FontH_t v)
Set font.
A composite frame that layout their children in horizontal way.
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save layout hints as a C++ statement(s) on output stream out.
TGClient * fClient
Connection to display server.
Handle_t fId
X11/Win32 Window identifier.
const TGString * GetText() const
~TGStatusBarPart() override
void DoRedraw() override
Draw string in statusbar part frame.
void SetText(TGString *text)
Set text in this part of the statusbar.
TGStatusBarPart(const TGWindow *p, Int_t h, Int_t y, ULong_t back=GetDefaultFrameBackground())
Create statusbar part frame.
Provides a StatusBar widget.
static FontStruct_t GetDefaultFontStruct()
Return default font structure in use.
Int_t * fParts
size of parts (in percent of total width)
static const TGGC & GetDefaultGC()
Return default graphics context in use.
const char * GetText(Int_t partidx=0) const
return text in the part partidx
Int_t * fXt
x position for each part
~TGStatusBar() override
Delete status bar widget.
void DrawBorder() override
Draw the status bar border (including cute 3d corner).
void DoRedraw() override
Redraw status bar.
static const TGFont * fgDefaultFont
Int_t fYt
y drawing position (depending on font)
TGDimension GetDefaultSize() const override
Return default size.
TGCompositeFrame * GetBarPart(Int_t npart) const
Returns bar part.
virtual void SetText(TGString *text, Int_t partidx=0)
Set text in partition partidx in status bar.
Int_t fNpart
number of parts
static TGGC * fgDefaultGC
virtual void SetParts(Int_t npart)
Divide the status bar in npart equal sized parts.
Bool_t f3DCorner
draw 3D corner (drawn by default)
TGStatusBar(const TGStatusBar &)=delete
friend class TGStatusBarPart
TGStatusBarPart ** fStatusPart
frames containing statusbar text
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save a status bar widget as a C++ statement(s) on output stream out.
TGString wraps a TString and adds some graphics routines like drawing, size of string on screen depen...
const char * GetString() const
virtual void Draw(Drawable_t id, GContext_t gc, Int_t x, Int_t y)
Draw string.
ROOT GUI Window base class.
const TGWindow * fParent
Parent window.
@ kEditDisableGrab
window grab cannot be edited
virtual void DestroyWindow()
destroy window
const char * GetName() const override
Return unique name, used in SavePrimitive methods.
UInt_t fEditDisabled
flags used for "guibuilding"
void Delete(Option_t *option="") override
Remove all objects from the list AND delete all heap based objects.
const char * Data() const
Short_t Max(Short_t a, Short_t b)
Returns the largest of a and b.