75 int max_ascent, max_descent;
111 int max_ascent, max_descent;
185 int max_ascent, max_descent;
188 fTHeight = max_ascent + max_descent;
215 fList = fMain->GetList();
225 UInt_t tabh = fMain->GetTabHeight(), bw = fMain->GetBorderWidth();
226 UInt_t w = fMain->GetWidth();
231 fMain->GetContainer()->MoveResize(0, tabh, w, h - tabh);
241 if (i == fMain->GetCurrent()) {
249 UInt_t nw = (w - (bw << 1));
250 if (nw > 32768) nw = 1;
251 UInt_t nh = (h - tabh - (bw << 1));
252 if (nh > 32768) nh = 1;
285 if (size.fWidth < size_te.
fWidth) size.fWidth = size_te.
fWidth;
287 size.fWidth += fMain->GetBorderWidth() << 1;
288 size.fHeight += fMain->GetTabHeight() + (fMain->GetBorderWidth() << 1);
311 int max_ascent, max_descent;
313 fTabh = max_ascent + max_descent + 6;
410 if (count == tabIndex) {
519 count = count / 2 - 1;
520 if (tabIndex > count)
548 if (*(tab->
GetText()) == name) {
565 if (tabIndex < 0)
return 0;
575 if (el && count == tabIndex)
614 if (tabIndex < 0)
return 0;
624 if (count == tabIndex)
646 if (name == *(tab->
GetText())) {
741 parFont.
Form(
"%s::GetDefaultFontStruct()",IsA()->
GetName());
742 parGC.
Form(
"%s::GetDefaultGC()()",IsA()->
GetName());
748 parFont.
Form(
"ufont->GetFontStruct()");
754 parGC.
Form(
"uGC->GetGC()");
760 out << std::endl <<
" // tab widget" << std::endl;
770 out <<
");" << std::endl;
772 out <<
"," << parGC.
Data() <<
");" << std::endl;
775 out <<
"," << parGC.
Data() <<
"," << parFont.
Data() <<
");" << std::endl;
783 if (option && strstr(option,
"keep_names"))
784 out <<
" " <<
GetName() <<
"->SetName(\"" <<
GetName() <<
"\");" << std::endl;
791 out << std::endl <<
" // container of " << quote
793 out <<
" TGCompositeFrame *" << cf->
GetName() <<
";" << std::endl;
796 << quote <<
");" << std::endl;
806 out <<
" " << cf->
GetName() <<
"->SetLayoutManager(";
808 out <<
");" << std::endl;
811 out <<
" " <<
GetName() <<
"->SetEnabled(" << i <<
", kFALSE);" << std::endl;
817 out <<
" TGTabElement *tab" << i <<
" = " 818 <<
GetName() <<
"->GetTabTab(" << i <<
");" << std::endl;
819 out <<
" tab" << i <<
"->ShowClose(kTRUE);" << std::endl;
823 out <<
" TGTabElement *tab" << i <<
" = " 824 <<
GetName() <<
"->GetTabTab(" << i <<
");" << std::endl;
825 out <<
" tab" << i <<
"->ChangeBackground(ucolor);" << std::endl;
829 out << std::endl <<
" " <<
GetName() <<
"->SetTab(" <<
GetCurrent() <<
");" << std::endl;
831 <<
"->GetDefaultSize());" << std::endl;
839 out <<
"new TGTabLayout(" << fMain->GetName() <<
")";
virtual TGDimension GetDefaultSize() const
std::cout << fWidth << "x" << fHeight << std::endl;
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
virtual void ShowClose(Bool_t on=kTRUE)
Show/hide close icon on the tab element, then apply layout to compute correct elements size...
virtual void NewTab(const char *text="tab")
Create new tab. Used in context menu.
TGLayoutManager * fLayoutManager
virtual void Delete(Option_t *option="")
Remove all objects from the list AND delete all heap based objects.
TGTabElement * GetCurrentTab() const
virtual UInt_t GetOptions() const
virtual void MoveResize(Int_t x, Int_t y, UInt_t w=0, UInt_t h=0)
Move and/or resize the frame.
TGCompositeFrame * GetTabContainer(Int_t tabIndex) const
Return container of tab with index tabIndex.
const TGPicture * fClosePicD
static const TGGC & GetHilightGC()
Get highlight color graphics context.
static const TGGC & GetDefaultGC()
Return default graphics context in use.
static FontStruct_t GetDefaultFontStruct()
Return default font structure in use.
virtual void SetLayoutManager(TGLayoutManager *l)
Set the layout manager for the composite frame.
virtual ~TGTabElement()
Delete tab element.
TGTabLayout(const TGTabLayout &)
virtual Bool_t HandleButton(Event_t *event)
Handle button event in the tab widget.
TGCompositeFrame * fContainer
virtual void SavePrimitive(std::ostream &out, Option_t *="")
Save the used font as a C++ statement(s) on output stream out.
virtual void RemoveFrame(TGFrame *f)
Remove frame from composite frame.
virtual void SetText(const char *text="tab")
Set text to current tab.
virtual TGLayoutManager * GetLayoutManager() const
Return layout manager.
void Draw(Option_t *="")
Default Draw method for all objects.
virtual void LowerWindow()
void SetText(TGString *text)
Set new tab text.
static const TGFont * fgDefaultFont
virtual void Selected(Int_t id)
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString...
static Pixel_t GetDefaultFrameBackground()
Get default frame background.
void ProcessLine(TString cmd, Long_t msg, Long_t parm1, Long_t parm2)
Execute string "cmd" via the interpreter.
TGCompositeFrame(const TGCompositeFrame &)
int main(int argc, char **argv)
virtual void SendMessage(const TGWindow *w, Long_t msg, Long_t parm1, Long_t parm2)
Send message (i.e.
TGTabElement(const TGTabElement &)
virtual TList * GetList() const
const TGPicture * fClosePic
void ChangeTab(Int_t tabIndex, Bool_t emit=kTRUE)
Make tabIdx the current tab.
const Mask_t kButtonPressMask
virtual void CloseTab(Int_t id)
virtual void SavePrimitiveSubframes(std::ostream &out, Option_t *option="")
Auxilary protected method used to save subframes.
virtual TGCompositeFrame * AddTab(TGString *text)
Add a tab to the tab widget.
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
virtual const char * GetName() const
Return unique name, used in SavePrimitive methods.
virtual TGDimension GetDefaultSize() const
Get default size of tab widget.
virtual Bool_t SetTab(Int_t tabIndex, Bool_t emit=kTRUE)
Brings the composite frame with the index tabIndex to the front and generate the following event if t...
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
virtual UInt_t GetDefaultWidth() const
virtual Pixel_t GetBackground() const
virtual void RemoveTab(Int_t tabIndex=-1, Bool_t storeRemoved=kTRUE)
Remove container and tab of tab with index tabIndex.
static const TGGC & GetBlackGC()
Get black graphics context.
const char * GetString() const
void SavePrimitive(std::ostream &out, Option_t *option="")
Save graphics context info as a C++ statement(s) on output stream out.
virtual void SetEditDisabled(UInt_t on=1)
Set edit disable flag for this frame and subframes.
virtual void Layout()
Layout the tab widget.
virtual void RaiseWindow()
const TGPicture * GetPicture(const char *name)
Get picture from the picture pool.
virtual void SetActive(Bool_t on=kTRUE)
FontStruct_t GetFontStruct() const
virtual TGDimension GetDefaultSize() const
Return default size of tab element.
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
const TGString * GetText() const
virtual void DrawBorder()
Draw little tab element.
virtual TGLayoutManager * GetLayoutManager() const
virtual void UnmapWindow()
virtual void Removed(Int_t id)
virtual void Add(TObject *obj)
Short_t Max(Short_t a, Short_t b)
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a primitive as a C++ statement(s) on output stream "out".
TGTabElement * GetTabTab(Int_t tabIndex) const
Return the tab element of tab with index tabIndex.
void NeedRedraw(TGWindow *w, Bool_t force=kFALSE)
Set redraw flags.
const char * GetString() const
void SaveUserColor(std::ostream &out, Option_t *)
Save a user color in a C++ macro file - used in SavePrimitive().
TString GetOptionString() const
Returns a frame option string - used in SavePrimitive().
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a tab widget as a C++ statement(s) on output stream out.
virtual ~TGTab()
Delete tab widget.
virtual void Cleanup()
Cleanup and delete all objects contained in this composite frame.
Int_t GetNumberOfTabs() const
Return number of tabs.
const Mask_t kAnyModifier
virtual void SetEnabled(Bool_t on=kTRUE)
static const TGGC & GetShadowGC()
Get shadow color graphics context.
virtual void DestroyWindow()
virtual void Draw(Drawable_t id, GContext_t gc, Int_t x, Int_t y)
Draw string.
virtual void SetEnabled(Int_t tabIndex, Bool_t on=kTRUE)
Enable or disable tab.
static const TGGC * fgDefaultGC
const char * Data() const
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a primitive as a C++ statement(s) on output stream "out".