111 int max_ascent, max_descent;
113 int ht = max_ascent + max_descent;
130 for (
int i = 0; i <
fNpart; i++) {
146 if (partidx < 0 || partidx >=
fNpart) {
147 Error(
"SetText",
"partidx out of range (0,%d)",
fNpart-1);
159 if ((partidx >= 0) && (partidx <
fNpart))
168 if (partidx < 0 || partidx >=
fNpart) {
169 Error(
"GetText",
"partidx out of range (0,%d)",
fNpart-1);
184 for (i = 0; i <
fNpart; i++) {
192 for (i = 0; i <
fNpart; i++) {
243 for (
int i = 0; i <
fNpart; i++)
254 Warning(
"SetParts",
"must be at least one part");
258 Error(
"SetParts",
"to many parts (limit is 15)");
263 for (i = 0; i <
fNpart; i++)
276 for (i = 0; i < npart; i++) {
282 Error(
"SetParts",
"sum of part > 100");
285 fParts[npart-1] += 100 - tot;
295 Warning(
"SetParts",
"must be at least one part");
299 Error(
"SetParts",
"to many parts (limit is 40)");
304 for (i = 0; i <
fNpart; i++)
318 for (i = 0; i < npart; i++) {
325 fParts[npart-1] += 100 - tot;
367 for (
int i = 0; i <
fNpart; i++) {
380 out <<
"\n // status bar\n";
382 out <<
" TGStatusBar *" <<
GetName() <<
" = new TGStatusBar(" <<
fParent->GetName() <<
"," <<
GetWidth() <<
","
385 if (option && strstr(option,
"keep_names"))
386 out <<
" " <<
GetName() <<
"->SetName(\"" <<
GetName() <<
"\");\n";
389 out <<
" " <<
GetName() <<
"->SetParts((Int_t []) {";
391 out << (i == 0 ?
"" :
", ") <<
fParts[i];
392 out <<
"}, " <<
fNpart <<
");\n";
396 out <<
" " <<
GetName() <<
"->SetText(\""
401 out <<
" TGCompositeFrame *" <<
fStatusPart[i]->GetName() <<
" = " <<
GetName() <<
"->GetBarPart(" << i
406 el->fFrame->SavePrimitive(out, option);
407 out <<
" " <<
fStatusPart[i]->GetName() <<
"->AddFrame(" << el->fFrame->GetName();
408 el->fLayout->SavePrimitive(out, option);
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.
const char Option_t
Option string (const char).
Error("WriteTObject","The current directory (%s) is not associated with a file. The object (%s) has not been written.", GetName(), objname)
void Warning(const char *location, const char *msgfmt,...)
Use this function in warning situations.
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
TGCompositeFrame(const TGCompositeFrame &)=delete
TList * fList
container of frame elements
Encapsulate fonts used in the GUI system.
void Resize(UInt_t w=0, UInt_t h=0) override
Resize the frame.
UInt_t fHeight
frame height
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.
static const TGGC & GetShadowGC()
Get shadow color graphics context.
TString SaveCtorArgs(std::ostream &out, UInt_t dflt_options=kChildFrame, Bool_t check_white_pixel=kFALSE)
Return options and custom color as constructor args Used in the SavePrimitive methods,...
static const TGGC & GetBckgndGC()
Get background color graphics context.
Encapsulate a graphics context used in the low level graphics.
TGHorizontalFrame(const TGWindow *p=nullptr, UInt_t w=1, UInt_t h=1, UInt_t options=kChildFrame, Pixel_t back=GetDefaultFrameBackground())
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.
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...
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"
TString & ReplaceSpecialCppChars()
Find special characters which are typically used in printf() calls and replace them by appropriate es...