37 const TGFont *TGStatusBar::fgDefaultFont = 0;
38 TGGC *TGStatusBar::fgDefaultGC = 0;
73 void TGStatusBarPart::SetText(
TGString *text)
75 if (fStatusInfo)
delete fStatusInfo;
83 void TGStatusBarPart::DoRedraw()
110 int max_ascent, max_descent;
112 int ht = max_ascent + max_descent;
129 for (
int i = 0; i <
fNpart; i++) {
145 if (partidx < 0 || partidx >=
fNpart) {
146 Error(
"SetText",
"partidx out of range (0,%d)",
fNpart-1);
166 if (partidx < 0 || partidx >=
fNpart) {
167 Error(
"GetText",
"partidx out of range (0,%d)",
fNpart-1);
182 for (i = 0; i <
fNpart; i++) {
190 for (i = 0; i <
fNpart; i++) {
241 for (
int i = 0; i <
fNpart; i++)
252 Warning(
"SetParts",
"must be at least one part");
256 Error(
"SetParts",
"to many parts (limit is 15)");
261 for (i = 0; i <
fNpart; i++)
274 for (i = 0; i < npart; i++) {
280 Error(
"SetParts",
"sum of part > 100");
283 fParts[npart-1] += 100 - tot;
293 Warning(
"SetParts",
"must be at least one part");
297 Error(
"SetParts",
"to many parts (limit is 40)");
302 for (i = 0; i <
fNpart; i++)
316 for (i = 0; i < npart; i++) {
323 fParts[npart-1] += 100 - tot;
365 for (
int i = 0; i <
fNpart; i++) {
379 out <<
" // status bar" << std::endl;
381 out <<
" TGStatusBar *";
387 out <<
");" << std::endl;
394 if (option && strstr(option,
"keep_names"))
395 out <<
" " <<
GetName() <<
"->SetName(\"" <<
GetName() <<
"\");" << std::endl;
397 int i;
char quote =
'"';
400 out <<
" Int_t parts" <<
GetName()+5 <<
"[] = {" <<
fParts[0];
402 for (i=1; i<
fNpart; i++) {
403 out <<
"," << fParts[i];
405 out <<
"};" << std::endl;
408 <<
"," << fNpart <<
");" <<std::endl;
410 for (i=0; i<
fNpart; i++) {
412 out <<
" " <<
GetName() <<
"->SetText(" << quote
414 << quote <<
"," << i <<
");" << std::endl;
417 out <<
" TGCompositeFrame *" <<
fStatusPart[i]->GetName()
418 <<
" = " <<
GetName() <<
"->GetBarPart(" << i <<
");" << std::endl;
425 out <<
" " <<
fStatusPart[i]->GetName() <<
"->AddFrame("
428 out <<
");" << std::endl;
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
virtual const char * GetName() const
Return unique name, used in SavePrimitive methods.
virtual void Delete(Option_t *option="")
Remove all objects from the list AND delete all heap based objects.
ClassImp(TSeqCollection) Int_t TSeqCollection TIter next(this)
Return index of object in collection.
static const TGGC & GetHilightGC()
Get highlight color graphics context.
FontH_t GetFontHandle() const
static const TGGC & GetDefaultGC()
Return default graphics context in use.
virtual TList * GetList() const
friend class TGStatusBarPart
const char * Data() const
virtual void DoRedraw()
Redraw the frame.
TGDimension GetDefaultSize() const
Return default size.
static Pixel_t GetDefaultFrameBackground()
Get default frame background.
virtual UInt_t GetOptions() const
virtual void SetText(TGString *text, Int_t partidx=0)
Set text in partition partidx in status bar.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
TGStatusBarPart ** fStatusPart
virtual Int_t MustCleanup() const
void SetFont(FontH_t v)
Set font.
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a frame widget as a C++ statement(s) on output stream out.
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a primitive as a C++ statement(s) on output stream "out".
virtual UInt_t GetDefaultHeight() const
static TGGC * fgDefaultGC
ClassImp(TGStatusBar) TGStatusBar
Create a status bar widget.
const char * GetText(Int_t partidx=0) const
return text in the part partidx
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a status bar widget as a C++ statement(s) on output stream out.
virtual void DrawBorder()
Draw the status bar border (including cute 3d corner).
virtual ~TGStatusBar()
Delete status bar widget.
static const TGFont * fgDefaultFont
FontStruct_t GetFontStruct() const
Short_t Max(Short_t a, Short_t b)
void NeedRedraw(TGWindow *w, Bool_t force=kFALSE)
Set redraw flags.
virtual void SetParts(Int_t npart)
Divide the status bar in npart equal sized parts.
void SaveUserColor(std::ostream &out, Option_t *)
Save a user color in a C++ macro file - used in SavePrimitive().
virtual void DoRedraw()
Redraw status bar.
static FontStruct_t GetDefaultFontStruct()
Return default font structure in use.
TString GetOptionString() const
Returns a frame option string - used in SavePrimitive().
static const TGGC & GetShadowGC()
Get shadow color graphics context.
static const TGGC & GetBckgndGC()
Get background color graphics context.
TGCompositeFrame * GetBarPart(Int_t npart) const
Returns bar part.
virtual void DestroyWindow()
virtual void Draw(Drawable_t id, GContext_t gc, Int_t x, Int_t y)
Draw string.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.