143 int max_ascent, max_descent;
147 fTHeight = max_ascent + max_descent;
166 int max_ascent, max_descent;
202 int max_ascent, max_descent;
205 fTHeight = max_ascent + max_descent;
239 GetDefaultFontStruct(), options, back)
248 memcpy(gcv.
fDashes,
"\x5\x5", 3);
253 int max_ascent, max_descent;
258 max_ascent, max_descent);
259 fTHeight = max_ascent + max_descent;
292 static const char* dashed =
"\x3\x3";
293 static const char* dotted=
"\x1\x2";
294 static const char* dasheddotted =
"\x3\x4\x1\x4";
295 static const char* ls05 =
"\x5\x3\x1\x3";
296 static const char* ls06 =
"\x5\x3\x1\x3\x1\x3\x1\x3";
297 static const char* ls07 =
"\x5\x5";
298 static const char* ls08 =
"\x5\x3\x1\x3\x1\x3";
299 static const char* ls09 =
"\x20\x5";
300 static const char* ls10 =
"\x20\x10\x1\x10";
303 if (linestyle <= 1) {
383 GetDefaultFontStruct(), options, back)
385 int max_ascent, max_descent;
395 max_ascent, max_descent);
396 fTHeight = max_ascent + max_descent;
449 if (pic) ((
TGPicture *)pic)->AddReference();
470 const char *
t1 =
f1->GetText()->Data();
473 if ((d1 = atof(
t1)) && (d2 = atof(t2))) {
476 return strcmp(
t1, t2);
555 if (
e->EntryId() == afterID)
break;
558 if (!el && afterID != -1) {
591 if (
e->EntryId() > lbe->
EntryId())
break;
624 if (
e->EntryId() ==
id) {
652 if ((
e->EntryId() >= from_ID) && (
e->EntryId() <= to_ID)) {
715 if (
f->EntryId() ==
id) {
750 if (
f->EntryId() ==
id)
751 return f->IsActive();
820 int xf0, yf0, xff, yff;
841 if (newpos < 0) newpos = 0;
863 xff = xf0 +
f->GetWidth();
864 yff = yf0 +
f->GetHeight();
867 (
x > xf0) && (
x < xff) && (
y > yf0) && (
y < yff);
893 xff = xf0 +
f->GetWidth();
894 yff = yf0 +
f->GetHeight();
897 (
x > xf0) && (
x < xff) && (
y > yf0) && (
y < yff) && !
f->IsActive();
951 int xf0, yf0, xff, yff;
956 if ((now-was) < 50)
return kFALSE;
983 xff = xf0 +
f->GetWidth();
984 yff = yf0 +
f->GetHeight();
986 (
x > xf0) && (
x < xff) && (
y > yf0) && (
y < yff);
1005 xff = xf0 +
f->GetWidth();
1006 yff = yf0 +
f->GetHeight();
1009 (
x > xf0) && (
x < xff) && (
y > yf0) && (
y < yff) && !
f->IsActive();
1047 if (vb &&
y > 0 &&
y < 10) {
1050 if (newpos < 0) newpos = 0;
1066 yff = yf0 +
f->GetHeight();
1067 if ((
y + pos.
fY > yf0) && (
y + pos.
fY < yff)) {
1103 if (
f->EntryId() ==
id)
1185 if (
gClient->GetStyle() > 1)
break;
1379 if (lbe->
EntryId() ==
id)
return lbe;
1473 if ((
Int_t) cw < 0) {
1474 Warning(
"Layout",
"width would become too small, setting to 10");
1485 container->
Resize(cw, tch);
1616 Emit(
"Selected(Int_t,Int_t)", args);
1629 Emit(
"DoubleClicked(Int_t,Int_t)", args);
1654 out << std::endl <<
" // list box" << std::endl;
1656 out<<
" TGListBox *";
1662 out <<
");" << std::endl;
1664 out <<
"," <<
fWidgetId <<
");" << std::endl;
1672 if (option && strstr(option,
"keep_names"))
1673 out <<
" " <<
GetName() <<
"->SetName(\"" <<
GetName() <<
"\");" << std::endl;
1681 out <<
" " <<
GetName() <<
"->AddEntry(";
1683 out <<
");"<< std::endl;
1686 <<
");" << std::endl;
1698 out << quote << content << quote <<
"," <<
EntryId();
const Mask_t kGCLineStyle
const Mask_t kGCLineWidth
const Mask_t kButtonMotionMask
const Mask_t kButtonPressMask
const Mask_t kGCFillStyle
const Mask_t kPointerMotionMask
Handle_t GContext_t
Graphics context handle.
const Mask_t kButtonReleaseMask
Handle_t FontStruct_t
Pointer to font structure.
ULong_t Pixel_t
Pixel value.
Handle_t Window_t
Window handle.
ULongptr_t Handle_t
Generic resource handle.
include TDocParser_001 C image html pict1_TDocParser_001 png width
void Warning(const char *location, const char *msgfmt,...)
Use this function in warning situations.
R__EXTERN TSystem * gSystem
Bool_t IsEditable() const
TGGC * GetGC(GCValues_t *values, Bool_t rw=kFALSE)
Get graphics context from the gc pool.
void FreeGC(const TGGC *gc)
Free a graphics context.
const TGResourcePool * GetResourcePool() const
void FreePicture(const TGPicture *pic)
Free picture resource.
The base class for composite widgets (menu bars, list boxes, etc.).
TGLayoutManager * fLayoutManager
layout manager
virtual TList * GetList() const
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
virtual void Cleanup()
Cleanup and delete all objects contained in this composite frame.
virtual Int_t MustCleanup() const
Bool_t fMapSubwindows
kTRUE - map subwindows
TList * fList
container of frame elements
virtual void SetEditDisabled(UInt_t on=1)
Set edit disable flag for this frame and subframes.
static TGLayoutHints * fgDefaultHints
virtual void ActivateItem(TGFrameElement *el)
Activate item.
TTimer * fScrollTimer
autoscroll timer
virtual void ClearViewPort()
Clear view port and redraw full content.
const TGWindow * fMsgWindow
window handling container messages
Bool_t fScrolling
kTRUE - when scrolling is ON
virtual void DoRedraw()
Redraw content of container in the viewport region.
virtual TGDimension GetPageDimension() const
Returns page dimension.
virtual void Layout()
Layout container entries.
TGViewPort * fViewPort
container viewport
virtual Bool_t HandleDoubleClick(Event_t *event)
Handle double click mouse event.
virtual void DoubleClicked(TGFrame *f, Int_t btn)
Emit DoubleClicked() signal.
virtual TGPosition GetPagePosition() const
Returns page position.
TGFrameElement * fLastActiveEl
last active item
Encapsulate fonts used in the GUI system.
FontStruct_t GetFontStruct() const
A subclasses of TGWindow, and is used as base class for some simple widgets (buttons,...
void AddInput(UInt_t emask)
Add events specified in the emask to the events the frame should handle.
virtual void DoRedraw()
Redraw the frame.
static const TGGC & GetBlackGC()
Get black graphics context.
UInt_t fOptions
frame options
void RemoveInput(UInt_t emask)
Remove events specified in emask from the events the frame should handle.
static Pixel_t GetWhitePixel()
Get white pixel value.
UInt_t fHeight
frame height
virtual UInt_t GetDefaultWidth() const
virtual UInt_t GetDefaultHeight() const
virtual void DrawBorder()
Draw frame border.
Int_t fBorderWidth
frame border width
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a frame widget as a C++ statement(s) on output stream out.
static Pixel_t fgDefaultSelectedBackground
virtual void Activate(Bool_t)
virtual Pixel_t GetForeground() const
Return frame foreground color.
static const TGGC & GetHilightGC()
Get highlight color graphics context.
virtual UInt_t GetOptions() const
TString GetOptionString() const
Returns a frame option string - used in SavePrimitive().
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.
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
virtual void MoveResize(Int_t x, Int_t y, UInt_t w=0, UInt_t h=0)
Move and/or resize the frame.
virtual void SetWidth(UInt_t w)
virtual void MapWindow()
map window
static Pixel_t fgWhitePixel
void SaveUserColor(std::ostream &out, Option_t *)
Save a user color in a C++ macro file - used in SavePrimitive().
virtual void SetHeight(UInt_t h)
Pixel_t fBackground
frame background color
static const TGGC & GetBckgndGC()
Get background color graphics context.
virtual void UnmapWindow()
unmap window
Encapsulate a graphics context used in the low level graphics.
void SetLineWidth(Int_t v)
Set line width.
void SetCapStyle(Int_t v)
Set cap style (kCapNotLast, kCapButt, kCapRound, kCapProjecting).
void SetDashList(const char v[], Int_t len)
Set dash pattern. First use SetDashOffset() if not 0.
void SetLineStyle(Int_t v)
Set line style (kLineSolid, kLineOnOffDash, kLineDoubleDash).
virtual void DoRedraw()
Redraw icon & text listbox entry.
virtual void SetPicture(const TGPicture *pic=nullptr)
Change the icon of listbox entry containing icon & text.
virtual ~TGIconLBEntry()
Delete icon & text listbox entry.
TGIconLBEntry(const TGIconLBEntry &)=delete
virtual void Update(TGLBEntry *e)
Update icon & text listbox entry.
const TGPicture * fPicture
virtual void DrawCopy(Handle_t id, Int_t x, Int_t y)
Draw copy on window/pixmap.
A Composite frame that contains a list of TGLBEnties.
virtual void RemoveAll()
Remove all entries in this container.
TGLBContainer(const TGLBContainer &)=delete
Bool_t fMultiSelect
true if multi selection is switched on
virtual Bool_t GetSelection(Int_t id)
Returns kTrue if entry id is selected.
virtual void Layout()
Layout container.
virtual void SetListBox(TGListBox *lb)
virtual void OnAutoScroll()
Autoscroll while close to & beyond The Wall.
Int_t fChangeStatus
defines the changes (select or unselect) while the mouse moves over a multi selectable list box
virtual Int_t GetSelected() const
Returns id of selected entry.
virtual void ActivateItem(TGFrameElement *el)
Activate item.
virtual Bool_t GetMultipleSelections() const
virtual ~TGLBContainer()
Delete the listbox container.
virtual Bool_t HandleMotion(Event_t *event)
Handle mouse motion event in listbox container.
virtual TGLBEntry * Select(Int_t id, Bool_t sel)
Select / deselect the entry with the specified id.
TGLBEntry * fLastActive
last active listbox entry in single selection listbox
virtual void RemoveEntries(Int_t from_ID, Int_t to_ID)
Remove entries from from_ID to to_ID (including).
virtual void Associate(const TGWindow *w)
TGListBox * fListBox
list box which contains this container
virtual void AddEntry(TGLBEntry *lbe, TGLayoutHints *lhints)
Add listbox entry with hints to container.
virtual TGVScrollBar * GetVScrollbar() const
Return a pointer to vertical scroll bar.
virtual Int_t GetPos(Int_t id)
Returns the position in the list box of the entry id.
virtual void AddEntrySort(TGLBEntry *lbe, TGLayoutHints *lhints)
Insert listbox entry before the list box entry with a higher id.
virtual void InsertEntry(TGLBEntry *lbe, TGLayoutHints *lhints, Int_t afterID)
Insert listbox entry after specified entry with id afterID.
virtual void SetVsbPosition(Int_t newPos)
Set new vertical scroll bar position.
virtual void RemoveEntry(Int_t id)
Remove the entry with specified id from the listbox container.
virtual void GetSelectedEntries(TList *selected)
Adds all selected entries (TGLBEntry) of the list box into the list selected.
virtual void DoRedraw()
redraw
virtual void SetMultipleSelections(Bool_t multi)
Enables and disables multiple selections of entries.
virtual Bool_t HandleButton(Event_t *event)
Handle mouse button event in the listbox container.
virtual Bool_t HandleDoubleClick(Event_t *event)
Handle double click mouse event in the listbox container.
Pixel_t fBkcolor
entry background color
virtual void SetBackgroundColor(Pixel_t col)
Set background color (override from TGWindow base class).
Int_t fEntryId
message id of listbox entry
virtual void Activate(Bool_t a)
Toggle active state of listbox entry.
virtual void Toggle()
Toggle active state of listbox entry.
Bool_t fActive
true if entry is active
virtual void DoRedraw()
Redraw the frame.
TGLBEntry(const TGWindow *p=0, Int_t id=-1, UInt_t options=kHorizontalFrame, Pixel_t back=GetWhitePixel())
Base class entry constructor.
TGLBFrameElement(TGFrame *f, TGLayoutHints *l)
Int_t Compare(const TObject *obj) const
Compare abstract method.
virtual ~TGLBFrameElement()
Bool_t IsSortable() const
This class describes layout hints used by the layout classes.
Line style and width listbox entries.
Style_t fLineStyle
line style
TGGC * fLineGC
line graphics context
virtual void DoRedraw()
Redraw line style listbox entry.
UInt_t fLineLength
line length
UInt_t fLineWidth
line width
virtual ~TGLineLBEntry()
Delete line style listbox entry.
virtual void SetLineWidth(Int_t width)
Set or change line width in an entry.
virtual void DrawCopy(Handle_t id, Int_t x, Int_t y)
Draw copy on window/pixmap.
virtual void SetLineStyle(Style_t style)
Set the line style corresponding to the TPad line styles.
TGLineLBEntry(const TGLineLBEntry &)=delete
virtual void Update(TGLBEntry *e)
Update line style listbox entry.
A listbox is a box, possibly with scrollbar, containing entries.
virtual void InitListBox()
Initiate the internal classes of a list box.
Bool_t fIntegralHeight
true if height should be multiple of fItemVsize
virtual void AddEntrySort(TGString *s, Int_t id)
Add entry with specified string and id to listbox sorted by increasing id.
TGListBox(const TGListBox &)=delete
virtual ~TGListBox()
Delete a listbox widget.
virtual void SortByName(Bool_t ascend=kTRUE)
Sort entries by name.
virtual void Resize(UInt_t w, UInt_t h)
Resize the listbox widget.
virtual TGVScrollBar * GetVScrollbar() const
TGViewPort * fVport
listbox viewport (see TGCanvas.h)
UInt_t fItemVsize
maximum height of single entry
virtual Int_t GetNumberOfEntries() const
TGLBContainer * fLbc
listbox container
virtual TGDimension GetDefaultSize() const
Return default size of listbox widget.
virtual void DrawBorder()
Draw borders of the list box widget.
virtual TGLBEntry * GetSelectedEntry() const
virtual void RemoveEntry(Int_t id=-1)
remove entry with id.
virtual void NewEntry(const char *s="Entry")
method used to add entry via context menu
virtual Int_t GetSelected() const
Return id of selected listbox item.
virtual void SetTopEntry(Int_t id=-1)
Scroll the entry with id to the top of the listbox.
virtual void AddEntry(TGString *s, Int_t id)
Add entry with specified string and id to listbox.
virtual Bool_t ProcessMessage(Longptr_t msg, Longptr_t parm1, Longptr_t parm2)
Process messages generated by the listbox container and forward messages to the listbox message handl...
virtual void DoubleClicked(Int_t widgetId, Int_t id)
Emit DoubleClicked signal with list box id and entry id.
virtual void InsertEntry(TGString *s, Int_t id, Int_t afterID)
Insert entry with specified string and id behind the entry with afterID.
virtual void MoveResize(Int_t x, Int_t y, UInt_t w, UInt_t h)
Move and resize the listbox widget.
virtual void RemoveAll()
Remove all entries.
virtual void SelectionChanged()
virtual Bool_t GetMultipleSelections() const
void SetContainer(TGFrame *f)
TGVScrollBar * fVScrollbar
vertical scrollbar
virtual void ChangeBackground(Pixel_t back)
Change background to all entries.
virtual TGLBEntry * GetEntry(Int_t id) const
Returns list box entry with specified id.
virtual TGViewPort * GetViewPort() const
virtual TGFrame * GetContainer() const
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a list box widget as a C++ statement(s) on output stream out.
virtual void Layout()
Layout the listbox components.
virtual void GetSelectedEntries(TList *selected)
Adds all selected entries (TGLBEntry) of the list box into the list selected.
virtual void RemoveEntries(Int_t from_ID, Int_t to_ID)
Remove a range of entries defined by from_ID and to_ID.
virtual TGLBEntry * FindEntry(const char *s) const
Find entry by name.
virtual void Selected(Int_t widgetId, Int_t id)
Emit Selected signal with list box id and entry id.
TGClient * fClient
Connection to display server.
Handle_t fId
X11/Win32 Window identifier.
The TGPicture class implements pictures and icons used in the different GUI elements and widgets.
void Draw(Option_t *="")
Default Draw method for all objects.
Pixel_t GetBlackColor() const
Pixel_t GetSelectedFgndColor() const
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.
Text string listbox entries.
Bool_t fTextChanged
true if text has been changed
const TGString * GetText() const
GContext_t fNormGC
text drawing graphics context
static const TGFont * fgDefaultFont
UInt_t fTHeight
text height
TGString * fText
entry text string
virtual void SavePrimitive(std::ostream &out, Option_t *="")
Save a list box entry widget as a C++ statement(s) on output stream out.
FontStruct_t fFontStruct
font used to draw string
virtual const char * GetTitle() const
Returns title of object.
static FontStruct_t GetDefaultFontStruct()
Return default font structure in use for a text listbox entry.
virtual ~TGTextLBEntry()
Delete text listbox entry.
virtual void Update(TGLBEntry *e)
static const TGGC & GetDefaultGC()
Return default graphics context in use for a text listbox entry.
TGTextLBEntry(const TGTextLBEntry &)=delete
virtual void DoRedraw()
Redraw text listbox entry.
static TGGC * fgDefaultGC
virtual void DrawCopy(Handle_t id, Int_t x, Int_t y)
Draw text listbox entry on window/pixmap.
void SetText(TGString *new_text)
Set or change text in text entry.
TGFrame * GetContainer() const
virtual void SetVPos(Int_t ypos)
Moves content of container frame in vertical direction.
ROOT GUI Window base class.
virtual void SetWindowName(const char *name=0)
Set window name.
virtual const char * GetName() const
Return unique name, used in SavePrimitive methods.
virtual void SetEditDisabled(UInt_t on=kEditDisable)
const TGWindow * fParent
Parent window.
@ 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
@ kEditDisableKeyEnable
window can handle keyboard events
virtual void DestroyWindow()
destroy window
const TGWindow * GetParent() const
virtual Bool_t IsMapped()
Returns kTRUE if window is mapped on screen, kFALSE otherwise.
UInt_t fEditDisabled
flags used for "guibuilding"
virtual void Add(TObject *obj)
virtual TObject * After(const TObject *obj) const
Returns the object after object obj.
virtual TObject * Remove(TObject *obj)
Remove object from the list.
virtual void AddFirst(TObject *obj)
Add object at the beginning of the list.
virtual void AddAfter(const TObject *after, TObject *obj)
Insert object after object after in the list.
virtual void AddBefore(const TObject *before, TObject *obj)
Insert object before object before in the list.
virtual TObject * First() const
Return the first object in the list. Returns 0 when list is empty.
virtual void Sort(Bool_t order=kSortAscending)
Sort linked list.
Mother of all ROOT objects.
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
virtual const char * GetTitle() const
Returns title of object.
void Emit(const char *signal, const T &arg)
Activate signal with single parameter.
const char * Data() const
TString & ReplaceAll(const TString &s1, const TString &s2)
virtual TTime Now()
Get current time in milliseconds since 0:00 Jan 1 1995.
virtual void AddTimer(TTimer *t)
Add timer to list of system timers.
virtual TTimer * RemoveTimer(TTimer *t)
Remove timer from list of system timers.
void Reset()
Reset the timer.
Short_t Max(Short_t a, Short_t b)
Double_t Ceil(Double_t x)
EGEventType fType
of event (see EGEventType)
UInt_t fState
key or button mask
Int_t fYRoot
coordinates relative to root
UInt_t fCode
key or button code
Graphics context structure.
Int_t fDashOffset
patterned/dashed line information
Int_t fLineWidth
line width
Mask_t fMask
bit mask specifying which fields are valid
Int_t fLineStyle
kLineSolid, kLineOnOffDash, kLineDoubleDash
Char_t fDashes[8]
dash pattern list (dash length per byte)
Int_t fFillStyle
kFillSolid, kFillTiled, kFillStippled, kFillOpaeueStippled
Int_t fDashLen
number of dashes in fDashes