80 int max_ascent, max_descent;
117 int max_ascent, max_descent;
143 if (
main->IsScrollingEnabled())
147 if (
main->GetTabTab(
c)->IsEnabled()) {
155 if (
main->GetTabTab(
c)->IsEnabled()) {
170 if (
main->GetTabTab(
main->GetCurrent()) ==
this) {
215 int max_ascent, max_descent;
218 fTHeight = max_ascent + max_descent;
236 main->GetLayoutManager()->Layout();
261 fMain->GetContainer()->MoveResize(0, tabh, w,
h - tabh);
271 if (i ==
fMain->GetCurrent()) {
279 UInt_t nw = (w - (bw << 1));
280 if (nw > 32768) nw = 1;
281 UInt_t nh = (
h - tabh - (bw << 1));
282 if (nh > 32768) nh = 1;
317 size.fWidth +=
fMain->GetBorderWidth() << 1;
318 size.fHeight +=
fMain->GetTabHeight() + (
fMain->GetBorderWidth() << 1);
343 int max_ascent, max_descent;
345 fTabh = max_ascent + max_descent + 6;
442 if (count == tabIndex) {
567 count = count / 2 - 1;
568 if (tabIndex > count)
613 if (tabIndex < 0)
return 0;
623 if (el && count == tabIndex)
662 if (tabIndex < 0)
return 0;
672 if (count == tabIndex)
794 parFont.
Form(
"ufont->GetFontStruct()");
800 parGC.
Form(
"uGC->GetGC()");
806 out <<
"\n // tab widget\n";
811 out <<
"," << parGC <<
"," << parFont << extra_args;
816 if (option && strstr(option,
"keep_names"))
817 out <<
" " <<
GetName() <<
"->SetName(\"" <<
GetName() <<
"\");\n";
824 out <<
" TGCompositeFrame *" << cf->GetName() <<
" = " <<
GetName() <<
"->AddTab(\""
826 auto lm = cf->GetLayoutManager();
830 out <<
" " << cf->GetName() <<
"->SetLayoutManager(";
831 lm->SavePrimitive(out, option);
835 out <<
" " <<
GetName() <<
"->SetEnabled(" << i <<
", kFALSE);\n";
838 cf->SavePrimitiveSubframes(out, option);
841 out <<
" TGTabElement *tab" << i <<
" = " <<
GetName() <<
"->GetTabTab(" << i <<
");\n";
842 out <<
" tab" << i <<
"->ShowClose(kTRUE);\n";
846 out <<
" TGTabElement *tab" << i <<
" = " <<
GetName() <<
"->GetTabTab(" << i <<
");\n";
847 out <<
" tab" << i <<
"->ChangeBackground(ucolor);\n";
851 out <<
" " <<
GetName() <<
"->Resize(" <<
GetName() <<
"->GetDefaultSize());\n";
859 out <<
"new TGTabLayout(" <<
fMain->GetName() <<
")";
const Mask_t kButtonPressMask
const Mask_t kAnyModifier
const Mask_t kPointerMotionMask
Handle_t GContext_t
Graphics context handle.
Handle_t FontStruct_t
Pointer to font structure.
ULong_t Pixel_t
Pixel value.
Handle_t Window_t
Window handle.
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
int Int_t
Signed integer 4 bytes (int).
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int).
bool Bool_t
Boolean (0=false, 1=true) (bool).
const char Option_t
Option string (const char).
TGLayoutManager * fLayoutManager
layout manager
virtual void SetLayoutManager(TGLayoutManager *l)
Set the layout manager for the composite frame.
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=nullptr)
Add frame to the composite frame using the specified layout hints.
virtual void Cleanup()
Cleanup and delete all objects contained in this composite frame.
TGCompositeFrame(const TGCompositeFrame &)=delete
TList * fList
container of frame elements
virtual void RemoveFrame(TGFrame *f)
Remove frame from composite frame.
void SetEditDisabled(UInt_t on=1) override
Set edit disable flag for this frame and subframes.
Encapsulate fonts used in the GUI system.
void SavePrimitive(std::ostream &out, Option_t *="") override
Save the used font as a C++ statement(s) on output stream out.
virtual TGDimension GetDefaultSize() const
std::cout << fWidth << "x" << fHeight << std::endl;
void MoveResize(Int_t x, Int_t y, UInt_t w=0, UInt_t h=0) override
Move and/or resize the frame.
static const TGGC & GetBlackGC()
Get black graphics context.
void Resize(UInt_t w=0, UInt_t h=0) override
Resize the frame.
TGFrame(const TGFrame &)=delete
UInt_t fHeight
frame height
virtual UInt_t GetDefaultWidth() const
Int_t fBorderWidth
frame border width
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
void UnmapWindow() override
unmap window
virtual void SendMessage(const TGWindow *w, Longptr_t msg, Longptr_t parm1, Longptr_t parm2)
Send message (i.e.
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,...
virtual Pixel_t GetBackground() const
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 SavePrimitive(std::ostream &out, Option_t *option="") override
Save graphics context info as a C++ statement(s) on output stream out.
TClass * IsA() const override
TGClient * fClient
Connection to display server.
Handle_t fId
X11/Win32 Window identifier.
TGString wraps a TString and adds some graphics routines like drawing, size of string on screen depen...
Service classes of the tab widget.
TGDimension GetDefaultSize() const override
Return default size of tab element.
Bool_t fActive
true if active (in front)
Bool_t fShowClose
show or hide close icon
TGString * fText
text on tab
void SetText(TGString *text)
Set new tab text.
Bool_t HandleButton(Event_t *event) override
Handle button event in the tab widget.
GContext_t fNormGC
graphics context for drawing tab
virtual void SetEnabled(Bool_t on=kTRUE)
~TGTabElement() override
Delete tab element.
Bool_t fEnabled
enabled or disabled
const char * GetString() const
UInt_t fTHeight
height of tab text
FontStruct_t fFontStruct
font used for tab
const TGPicture * fClosePic
"close tab" icon
UInt_t fTWidth
width of tab text
const TGString * GetText() const
TGTabElement(const TGTabElement &)=delete
virtual void SetActive(Bool_t on=kTRUE)
const TGPicture * fClosePicD
"close tab" icon (disabled)
virtual void ShowClose(Bool_t on=kTRUE)
Show/hide close icon on the tab element, then apply layout to compute correct elements size.
void DrawBorder() override
Draw little tab element.
Service classes of the tab widget.
void Layout() override
Layout the tab widget.
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save a primitive as a C++ statement(s) on output stream "out".
TGTabLayout(const TGTabLayout &)=delete
TGDimension GetDefaultSize() const override
Get default size of tab widget.
A tab widget contains a set of composite frames each with a little tab with a name (like a set of fol...
static FontStruct_t GetDefaultFontStruct()
Return default font structure in use.
virtual void NewTab(const char *text="tab")
Create new tab. Used in context menu.
TGCompositeFrame * fContainer
main container
virtual void SetEnabled(Int_t tabIndex, Bool_t on=kTRUE)
Enable or disable tab.
virtual void SetText(const char *text="tab")
Set text to current tab.
TClass * IsA() const override
FontStruct_t fFontStruct
font
static const TGGC & GetDefaultGC()
Return default graphics context in use.
virtual void Removed(Int_t id)
TGTabElement * GetTabTab(Int_t tabIndex) const
Return the tab element of tab with index tabIndex.
Int_t fCurrent
index of current tab
~TGTab() override
Delete tab widget.
GContext_t fNormGC
drawing context
Int_t GetNumberOfTabs() const
Return number of tabs.
static const TGGC * fgDefaultGC
Bool_t fScrolling
true if tab scrolling enabled
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...
virtual void SetScrollingEnabled(Bool_t on=kTRUE)
Enable or disable tab scrolling.
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save a tab widget as a C++ statement(s) on output stream out.
TList * fRemoved
list of removed tabs
virtual void RemoveTab(Int_t tabIndex=-1, Bool_t storeRemoved=kTRUE)
Remove container and tab of tab with index tabIndex.
virtual void Selected(Int_t id)
void ChangeTab(Int_t tabIndex, Bool_t emit=kTRUE)
Make tabIdx the current tab.
TGCompositeFrame * GetTabContainer(Int_t tabIndex) const
Return container of tab with index tabIndex.
virtual TGCompositeFrame * AddTab(TGString *text)
Add a tab to the tab widget.
Bool_t IsScrollingEnabled() const
Returns true if tab scrolling is enabled.
TGTab(const TGTab &)=delete
TGTabElement * GetCurrentTab() const
TGLayoutManager * GetLayoutManager() const override
Return layout manager.
static const TGFont * fgDefaultFont
const TGWindow * fParent
Parent window.
@ kEditDisableResize
window size cannot be edited
@ kEditDisableLayout
window layout cannot be edited
@ kEditDisableBtnEnable
window can handle mouse button events
@ kEditDisableGrab
window grab cannot be edited
@ kEditDisable
disable edit of this window
virtual void LowerWindow()
lower window
virtual void DestroyWindow()
destroy window
virtual void RaiseWindow()
raise window
const char * GetName() const override
Return unique name, used in SavePrimitive methods.
UInt_t fEditDisabled
flags used for "guibuilding"
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
int main(int argc, char **argv)
EGEventType fType
of event (see EGEventType)
Int_t fY
pointer x, y coordinates in event window
Window_t fWindow
window reported event is relative to
UInt_t fCode
key or button code