Logo ROOT  
Reference Guide
No Matches
Go to the documentation of this file.
1// @(#)root/gui:$Id$
2// Author: Fons Rademakers 12/01/98
5 * Copyright (C) 1995-2021, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
12#ifndef ROOT_TGListBox
13#define ROOT_TGListBox
17// //
18// TGListBox, TGLBContainer, TGLBEntry and TGTextLBEntry //
19// //
20// A listbox is a box, possibly with scrollbar, containing entries. //
21// Currently entries are simple text strings (TGTextLBEntry). //
22// A TGListBox looks a lot like a TGCanvas. It has a TGViewPort //
23// containing a TGLBContainer which contains the entries and it also //
24// has a vertical scrollbar which becomes visible if there are more //
25// items than fit in the visible part of the container. //
26// //
27// The TGListBox is user callable. The other classes are service //
28// classes of the listbox. //
29// //
30// Selecting an item in the listbox will generate the event: //
31// kC_COMMAND, kCM_LISTBOX, listbox id, item id. //
32// //
35#include "TGFrame.h"
36#include "TGCanvas.h"
37#include "TGScrollBar.h"
39class TGListBox;
40class TList;
43// //
44// TGLBEntry //
45// //
46// Basic listbox entries. Listbox entries are created by a TGListBox //
47// and not by the user. //
48// //
51class TGLBEntry : public TGFrame {
54 Int_t fEntryId; // message id of listbox entry
55 Pixel_t fBkcolor; // entry background color
56 Bool_t fActive; // true if entry is active
58 virtual void DoRedraw() { }
61 TGLBEntry(const TGWindow *p = 0, Int_t id = -1, UInt_t options = kHorizontalFrame,
62 Pixel_t back = GetWhitePixel());
64 virtual void Activate(Bool_t a);
65 virtual void Toggle();
66 virtual void Update(TGLBEntry *) { } // this is needed on TGComboBoxes :(
67 Int_t EntryId() const { return fEntryId; }
68 Bool_t IsActive() const { return fActive; }
71 ClassDef(TGLBEntry,0) // Basic listbox entry
76// //
77// TGTextLBEntry //
78// //
79// Text string listbox entries. //
80// //
83class TGTextLBEntry : public TGLBEntry {
86 TGString *fText; // entry text string
87 UInt_t fTWidth; // text width
88 UInt_t fTHeight; // text height
89 Bool_t fTextChanged; // true if text has been changed
90 GContext_t fNormGC; // text drawing graphics context
91 FontStruct_t fFontStruct; // font used to draw string
93 virtual void DoRedraw();
95 static const TGFont *fgDefaultFont;
99 TGTextLBEntry(const TGTextLBEntry &) = delete;
104 static const TGGC &GetDefaultGC();
106 TGTextLBEntry(const TGWindow *p = nullptr, TGString *s = nullptr, Int_t id = -1,
107 GContext_t norm = GetDefaultGC()(),
109 UInt_t options = kHorizontalFrame,
110 Pixel_t back = GetWhitePixel());
111 virtual ~TGTextLBEntry();
113 virtual TGDimension GetDefaultSize() const { return TGDimension(fTWidth, fTHeight+1); }
114 const TGString *GetText() const { return fText; }
115 void SetText(TGString *new_text);
116 virtual const char *GetTitle() const { return fText->Data(); }
117 virtual void SetTitle(const char *text) { *fText = text; }
119 virtual void DrawCopy(Handle_t id, Int_t x, Int_t y);
120 virtual void Update(TGLBEntry *e)
121 { SetText(new TGString(((TGTextLBEntry *)e)->GetText())); }
123 GContext_t GetNormGC() const { return fNormGC; }
126 virtual void SavePrimitive(std::ostream &out, Option_t * = "");
128 ClassDef(TGTextLBEntry,0) // Text listbox entry
133// //
134// TGLineLBEntry //
135// //
136// Line style & width listbox entry. //
137// Line example and width number //
138// //
144 TGLineLBEntry(const TGLineLBEntry&) = delete;
148 UInt_t fLineWidth; // line width
149 Style_t fLineStyle; // line style
150 UInt_t fLineLength; // line length
151 TGGC *fLineGC; // line graphics context
153 virtual void DoRedraw();
156 TGLineLBEntry(const TGWindow *p = nullptr, Int_t id = -1, const char *str = nullptr,
157 UInt_t w = 0, Style_t s = 0,
158 UInt_t options = kHorizontalFrame,
159 Pixel_t back = GetWhitePixel());
160 virtual ~TGLineLBEntry();
163 { return TGDimension(fTWidth, fTHeight+1); }
164 virtual Int_t GetLineWidth() const { return fLineWidth; }
165 virtual void SetLineWidth(Int_t width);
166 Style_t GetLineStyle() const { return fLineStyle; }
167 virtual void SetLineStyle(Style_t style);
168 TGGC *GetLineGC() const { return fLineGC; }
169 virtual void Update(TGLBEntry *e);
170 virtual void DrawCopy(Handle_t id, Int_t x, Int_t y);
172 ClassDef(TGLineLBEntry, 0) // Line width listbox entry
176// //
177// TGIconLBEntry //
178// //
179// Icon + text listbox entry. //
180// //
186 TGIconLBEntry(const TGIconLBEntry&) = delete;
190 const TGPicture *fPicture; // icon
192 virtual void DoRedraw();
195 TGIconLBEntry(const TGWindow *p = nullptr, Int_t id = -1, const char *str = nullptr,
196 const TGPicture *pic = nullptr,
197 UInt_t w = 0, Style_t s = 0,
198 UInt_t options = kHorizontalFrame,
199 Pixel_t back = GetWhitePixel());
200 virtual ~TGIconLBEntry();
203 { return TGDimension(fTWidth, fTHeight+1); }
204 const TGPicture *GetPicture() const { return fPicture; }
205 virtual void SetPicture(const TGPicture *pic = nullptr);
207 virtual void Update(TGLBEntry *e);
208 virtual void DrawCopy(Handle_t id, Int_t x, Int_t y);
210 ClassDef(TGIconLBEntry, 0) // Icon + text listbox entry
214// //
215// TGLBContainer //
216// //
217// A Composite frame that contains a list of TGLBEnties. //
218// A TGLBContainer is created by the TGListBox and not by the user. //
219// //
224friend class TGListBox;
227 TGLBContainer(const TGLBContainer&) = delete;
231 TGLBEntry *fLastActive; // last active listbox entry in single selection listbox
232 TGListBox *fListBox; // list box which contains this container
233 Bool_t fMultiSelect; // true if multi selection is switched on
234 Int_t fChangeStatus; // defines the changes (select or unselect) while the mouse
235 // moves over a multi selectable list box
237 virtual void OnAutoScroll();
238 virtual void DoRedraw();
241 TGLBContainer(const TGWindow *p = nullptr, UInt_t w = 1, UInt_t h = 1,
242 UInt_t options = kSunkenFrame,
244 virtual ~TGLBContainer();
246 virtual void AddEntry(TGLBEntry *lbe, TGLayoutHints *lhints);
247 virtual void AddEntrySort(TGLBEntry *lbe, TGLayoutHints *lhints);
248 virtual void InsertEntry(TGLBEntry *lbe, TGLayoutHints *lhints, Int_t afterID);
249 virtual void RemoveEntry(Int_t id);
250 virtual void RemoveEntries(Int_t from_ID, Int_t to_ID);
251 virtual void RemoveAll();
253 virtual void ActivateItem(TGFrameElement *el);
254 virtual void Associate(const TGWindow *w) { fMsgWindow = w; }
255 virtual void SetListBox(TGListBox *lb) { fListBox = lb; }
256 TGListBox *GetListBox() const { return fListBox; }
257 virtual Bool_t HandleButton(Event_t *event);
258 virtual Bool_t HandleDoubleClick(Event_t *event);
259 virtual Bool_t HandleMotion(Event_t *event);
260 virtual Int_t GetSelected() const;
261 virtual Bool_t GetSelection(Int_t id);
262 virtual Int_t GetPos(Int_t id);
264 virtual void GetSelectedEntries(TList *selected);
265 virtual TGLBEntry *Select(Int_t id, Bool_t sel);
266 virtual TGLBEntry *Select(Int_t id);
268 virtual TGVScrollBar *GetVScrollbar() const;
269 virtual void SetVsbPosition(Int_t newPos);
270 virtual void Layout();
271 virtual UInt_t GetDefaultWidth() const { return fWidth; }
273 virtual void SetMultipleSelections(Bool_t multi);
274 virtual Bool_t GetMultipleSelections() const { return fMultiSelect; }
276 ClassDef(TGLBContainer,0) // Listbox container
281// //
282// TGListBox //
283// //
284// A TGListBox widget. //
285// //
288class TGListBox : public TGCompositeFrame, public TGWidget {
291 TGListBox(const TGListBox&) = delete;
292 TGListBox operator=(const TGListBox&) = delete;
295 UInt_t fItemVsize; // maximum height of single entry
296 Bool_t fIntegralHeight; // true if height should be multiple of fItemVsize
297 TGLBContainer *fLbc; // listbox container
298 TGViewPort *fVport; // listbox viewport (see TGCanvas.h)
299 TGVScrollBar *fVScrollbar; // vertical scrollbar
303 virtual void InitListBox();
306 TGListBox(const TGWindow *p = nullptr, Int_t id = -1,
308 Pixel_t back = GetWhitePixel());
309 virtual ~TGListBox();
311 virtual void AddEntry(TGString *s, Int_t id);
312 virtual void AddEntry(const char *s, Int_t id);
313 virtual void AddEntry(TGLBEntry *lbe, TGLayoutHints *lhints);
314 virtual void AddEntrySort(TGString *s, Int_t id);
315 virtual void AddEntrySort(const char *s, Int_t id);
316 virtual void AddEntrySort(TGLBEntry *lbe, TGLayoutHints *lhints);
317 virtual void InsertEntry(TGString *s, Int_t id, Int_t afterID);
318 virtual void InsertEntry(const char *s , Int_t id, Int_t afterID);
319 virtual void InsertEntry(TGLBEntry *lbe, TGLayoutHints *lhints, Int_t afterID);
320 virtual void NewEntry(const char *s = "Entry"); //*MENU*
321 virtual void RemoveEntry(Int_t id = -1); //*MENU*
322 virtual void RemoveAll(); //*MENU*
323 virtual void RemoveEntries(Int_t from_ID, Int_t to_ID);
324 virtual void ChangeBackground(Pixel_t back);
325 virtual void SetTopEntry(Int_t id = -1);
326 virtual void SetMultipleSelections(Bool_t multi = kTRUE)
327 { fLbc->SetMultipleSelections(multi); } //*TOGGLE* *GETTER=GetMultipleSelections
329 { return fLbc->GetMultipleSelections(); }
330 virtual Int_t GetNumberOfEntries() const
331 { return fLbc->GetList()->GetSize(); }
332 virtual TGLBEntry *GetEntry(Int_t id) const;
333 virtual TGLBEntry *FindEntry(const char *s) const;
334 virtual TGFrame *GetContainer() const { return fVport->GetContainer(); }
335 virtual TGViewPort *GetViewPort() const { return fVport; }
336 virtual TGScrollBar *GetScrollBar() const { return fVScrollbar; }
337 virtual TGVScrollBar *GetVScrollbar() const { return fVScrollbar; }
339 virtual void DrawBorder();
340 virtual void Resize(UInt_t w, UInt_t h);
341 virtual void Resize(TGDimension size) { Resize(size.fWidth, size.fHeight); }
342 virtual void MoveResize(Int_t x, Int_t y, UInt_t w, UInt_t h);
343 virtual void Layout();
345 virtual void SortByName(Bool_t ascend = kTRUE); //*MENU*icon=bld_sortup.png*
346 virtual void IntegralHeight(Bool_t mode) { fIntegralHeight = mode; }
347 virtual TGDimension GetDefaultSize() const;
349 virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2);
351 virtual TGLBEntry *Select(Int_t id, Bool_t sel = kTRUE)
352 { return fLbc->Select(id, sel); }
353 virtual Int_t GetSelected() const;
354 virtual Bool_t GetSelection(Int_t id) { return fLbc->GetSelection(id); }
355 virtual TGLBEntry *GetSelectedEntry() const { return fLbc->GetSelectedEntry(); }
356 virtual void GetSelectedEntries(TList *selected);
357 UInt_t GetItemVsize() const { return fItemVsize; }
359 virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
361 virtual void Selected(Int_t widgetId, Int_t id); //*SIGNAL*
362 virtual void Selected(Int_t id) { Emit("Selected(Int_t)", id); } //*SIGNAL*
363 virtual void Selected(const char *txt) { Emit("Selected(char*)", txt); } //*SIGNAL
364 virtual void DoubleClicked(Int_t widgetId, Int_t id); //*SIGNAL*
365 virtual void DoubleClicked(Int_t id) { Emit("DoubleClicked(Int_t)", id); } //*SIGNAL*
366 virtual void DoubleClicked(const char *txt) { Emit("DoubleClicked(char*)", txt); } //*SIGNAL
367 virtual void SelectionChanged() { Emit("SelectionChanged()"); } //*SIGNAL*
369 ClassDef(TGListBox,0) // Listbox widget
ULong_t Handle_t
Generic resource handle.
Definition GuiTypes.h:26
@ kSunkenFrame
Definition GuiTypes.h:383
@ kDoubleBorder
Definition GuiTypes.h:385
@ kHorizontalFrame
Definition GuiTypes.h:382
Handle_t GContext_t
Graphics context handle.
Definition GuiTypes.h:38
Handle_t FontStruct_t
Pointer to font structure.
Definition GuiTypes.h:39
ULong_t Pixel_t
Pixel value.
Definition GuiTypes.h:40
#define f(i)
Definition RSha256.hxx:104
#define a(i)
Definition RSha256.hxx:99
#define h(i)
Definition RSha256.hxx:106
#define e(i)
Definition RSha256.hxx:103
int Int_t
Definition RtypesCore.h:45
unsigned int UInt_t
Definition RtypesCore.h:46
long Long_t
Definition RtypesCore.h:54
bool Bool_t
Definition RtypesCore.h:63
short Style_t
Definition RtypesCore.h:80
const Bool_t kTRUE
Definition RtypesCore.h:91
const char Option_t
Definition RtypesCore.h:66
#define ClassDef(name, id)
Definition Rtypes.h:325
include TDocParser_001 C image html pict1_TDocParser_001 png width
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
virtual TList * GetList() const
Definition TGFrame.h:346
const TGWindow * fMsgWindow
Definition TGCanvas.h:52
UInt_t fHeight
Definition TGDimension.h:30
UInt_t fWidth
Definition TGDimension.h:29
static Pixel_t GetWhitePixel()
Get white pixel value.
Definition TGFrame.cxx:694
virtual void SetBackgroundColor(Pixel_t back)
Set background color (override from TGWindow base class).
Definition TGFrame.cxx:297
static Pixel_t GetDefaultFrameBackground()
Get default frame background.
Definition TGFrame.cxx:668
UInt_t fWidth
Definition TGFrame.h:111
Definition TGGC.h:31
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.
virtual TGDimension GetDefaultSize() const
std::cout << fWidth << "x" << fHeight << std::endl;
Definition TGListBox.h:202
const TGPicture * GetPicture() const
Definition TGListBox.h:204
TGIconLBEntry(const TGIconLBEntry &)=delete
virtual void Update(TGLBEntry *e)
Update icon & text listbox entry.
TGIconLBEntry operator=(const TGIconLBEntry &)=delete
const TGPicture * fPicture
Definition TGListBox.h:190
virtual void DrawCopy(Handle_t id, Int_t x, Int_t y)
Draw copy on window/pixmap.
virtual void RemoveAll()
Remove all entries in this container.
TGLBContainer(const TGLBContainer &)=delete
Bool_t fMultiSelect
Definition TGListBox.h:233
virtual Bool_t GetSelection(Int_t id)
Returns kTrue if entry id is selected.
virtual void Layout()
Layout container.
virtual void SetListBox(TGListBox *lb)
Definition TGListBox.h:255
virtual void OnAutoScroll()
Autoscroll while close to & beyond The Wall.
Int_t fChangeStatus
Definition TGListBox.h:234
virtual Int_t GetSelected() const
Returns id of selected entry.
virtual void ActivateItem(TGFrameElement *el)
Activate item.
TGListBox * GetListBox() const
Definition TGListBox.h:256
virtual Bool_t GetMultipleSelections() const
Definition TGListBox.h:274
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
Definition TGListBox.h:231
virtual UInt_t GetDefaultWidth() const
Definition TGListBox.h:271
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)
Definition TGListBox.h:254
TGListBox * fListBox
Definition TGListBox.h:232
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()
virtual void SetMultipleSelections(Bool_t multi)
Enables and disables multiple selections of entries.
TGLBContainer operator=(const TGLBContainer &)=delete
TGLBEntry * GetSelectedEntry() const
Definition TGListBox.h:263
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
Definition TGListBox.h:55
virtual void SetBackgroundColor(Pixel_t col)
Set background color (override from TGWindow base class).
Definition TGListBox.h:69
Int_t fEntryId
Definition TGListBox.h:54
virtual void Activate(Bool_t a)
Toggle active state of listbox entry.
Definition TGListBox.cxx:79
virtual void Update(TGLBEntry *)
Definition TGListBox.h:66
virtual void Toggle()
Toggle active state of listbox entry.
Definition TGListBox.cxx:89
Bool_t IsActive() const
Definition TGListBox.h:68
Int_t EntryId() const
Definition TGListBox.h:67
Bool_t fActive
Definition TGListBox.h:56
virtual void DoRedraw()
Redraw the frame.
Definition TGListBox.h:58
Style_t GetLineStyle() const
Definition TGListBox.h:166
Style_t fLineStyle
Definition TGListBox.h:149
TGGC * fLineGC
Definition TGListBox.h:151
virtual void DoRedraw()
Redraw line style listbox entry.
UInt_t fLineLength
Definition TGListBox.h:150
UInt_t fLineWidth
Definition TGListBox.h:148
virtual Int_t GetLineWidth() const
Definition TGListBox.h:164
virtual TGDimension GetDefaultSize() const
std::cout << fWidth << "x" << fHeight << std::endl;
Definition TGListBox.h:162
TGLineLBEntry operator=(const TGLineLBEntry &)=delete
TGGC * GetLineGC() const
Definition TGListBox.h:168
virtual ~TGLineLBEntry()
Delete line style listbox entry.
virtual void SetLineWidth(Int_t width)
Set or change line witdh 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.
virtual void IntegralHeight(Bool_t mode)
Definition TGListBox.h:346
virtual void InitListBox()
Initiate the internal classes of a list box.
Bool_t fIntegralHeight
Definition TGListBox.h:296
virtual void AddEntrySort(TGString *s, Int_t id)
Add entry with specified string and id to listbox sorted by increasing id.
virtual void DoubleClicked(Int_t id)
Definition TGListBox.h:365
TGListBox(const TGListBox &)=delete
virtual ~TGListBox()
Delete a listbox widget.
virtual Bool_t GetSelection(Int_t id)
Definition TGListBox.h:354
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
Definition TGListBox.h:337
TGViewPort * fVport
Definition TGListBox.h:298
UInt_t fItemVsize
Definition TGListBox.h:295
virtual TGLBEntry * Select(Int_t id, Bool_t sel=kTRUE)
Definition TGListBox.h:351
virtual Int_t GetNumberOfEntries() const
Definition TGListBox.h:330
TGLBContainer * fLbc
Definition TGListBox.h:297
virtual TGDimension GetDefaultSize() const
Return default size of listbox widget.
virtual void DoubleClicked(const char *txt)
Definition TGListBox.h:366
virtual void DrawBorder()
Draw borders of the list box widget.
virtual TGLBEntry * GetSelectedEntry() const
Definition TGListBox.h:355
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 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()
Definition TGListBox.h:367
virtual Bool_t GetMultipleSelections() const
Definition TGListBox.h:328
void SetContainer(TGFrame *f)
Definition TGListBox.h:301
virtual TGScrollBar * GetScrollBar() const
Definition TGListBox.h:336
TGVScrollBar * fVScrollbar
Definition TGListBox.h:299
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 void Selected(Int_t id)
Definition TGListBox.h:362
UInt_t GetItemVsize() const
Definition TGListBox.h:357
virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)
Process messages generated by the listbox container and forward messages to the listbox message handl...
virtual TGViewPort * GetViewPort() const
Definition TGListBox.h:335
virtual void SetMultipleSelections(Bool_t multi=kTRUE)
Definition TGListBox.h:326
TGListBox operator=(const TGListBox &)=delete
virtual TGFrame * GetContainer() const
Definition TGListBox.h:334
virtual void Resize(TGDimension size)
Resize the frame.
Definition TGListBox.h:341
virtual void SetLayoutManager(TGLayoutManager *)
Set the layout manager for the composite frame.
Definition TGListBox.h:344
virtual void Selected(const char *txt)
Definition TGListBox.h:363
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.
UInt_t fTWidth
Definition TGListBox.h:87
Bool_t fTextChanged
Definition TGListBox.h:89
const TGString * GetText() const
Definition TGListBox.h:114
GContext_t fNormGC
Definition TGListBox.h:90
virtual TGDimension GetDefaultSize() const
std::cout << fWidth << "x" << fHeight << std::endl;
Definition TGListBox.h:113
FontStruct_t GetFontStruct() const
Definition TGListBox.h:124
static const TGFont * fgDefaultFont
Definition TGListBox.h:95
UInt_t fTHeight
Definition TGListBox.h:88
TGString * fText
Definition TGListBox.h:86
virtual void SetTitle(const char *text)
Definition TGListBox.h:117
virtual void SavePrimitive(std::ostream &out, Option_t *="")
Save a list box entry widget as a C++ statement(s) on output stream out.
GContext_t GetNormGC() const
Definition TGListBox.h:123
FontStruct_t fFontStruct
Definition TGListBox.h:91
virtual const char * GetTitle() const
Returns title of object.
Definition TGListBox.h:116
TGTextLBEntry & operator=(const TGTextLBEntry &)=delete
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)
Definition TGListBox.h:120
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
Definition TGListBox.h:96
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
Definition TGCanvas.h:183
void SetContainer(TGFrame *f)
Add container frame to the viewport.
Definition TGCanvas.cxx:149
A doubly linked list.
Definition TList.h:44
void Emit(const char *signal, const T &arg)
Activate signal with single parameter.
Definition TQObject.h:164
const char * Data() const
Definition TString.h:369
TText * text
Double_t y[n]
Definition legend1.C:17
Double_t x[n]
Definition legend1.C:17
Event structure.
Definition GuiTypes.h:174
TCanvas * style()
Definition style.C:1