Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TGListBox.h
Go to the documentation of this file.
1// @(#)root/gui:$Id$
2// Author: Fons Rademakers 12/01/98
3
4/*************************************************************************
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 *************************************************************************/
11
12#ifndef ROOT_TGListBox
13#define ROOT_TGListBox
14
15
16#include "TGFrame.h"
17#include "TGCanvas.h"
18#include "TGScrollBar.h"
19
20class TGListBox;
21class TList;
22
23
24class TGLBEntry : public TGFrame {
25
26protected:
27 Int_t fEntryId; ///< message id of listbox entry
28 Pixel_t fBkcolor; ///< entry background color
29 Bool_t fActive; ///< true if entry is active
30
31 virtual void DoRedraw() { }
32
33public:
34 TGLBEntry(const TGWindow *p = 0, Int_t id = -1, UInt_t options = kHorizontalFrame,
35 Pixel_t back = GetWhitePixel());
36
37 virtual void Activate(Bool_t a);
38 virtual void Toggle();
39 virtual void Update(TGLBEntry *) { } // this is needed on TGComboBoxes :(
40 Int_t EntryId() const { return fEntryId; }
41 Bool_t IsActive() const { return fActive; }
43
44 ClassDef(TGLBEntry,0) // Basic listbox entry
45};
46
47
48class TGTextLBEntry : public TGLBEntry {
49
50protected:
51 TGString *fText; ///< entry text string
52 UInt_t fTWidth; ///< text width
53 UInt_t fTHeight; ///< text height
54 Bool_t fTextChanged; ///< true if text has been changed
55 GContext_t fNormGC; ///< text drawing graphics context
56 FontStruct_t fFontStruct; ///< font used to draw string
57
58 virtual void DoRedraw();
59
60 static const TGFont *fgDefaultFont;
62
63private:
64 TGTextLBEntry(const TGTextLBEntry &) = delete;
66
67public:
69 static const TGGC &GetDefaultGC();
70
71 TGTextLBEntry(const TGWindow *p = nullptr, TGString *s = nullptr, Int_t id = -1,
72 GContext_t norm = GetDefaultGC()(),
74 UInt_t options = kHorizontalFrame,
75 Pixel_t back = GetWhitePixel());
76 virtual ~TGTextLBEntry();
77
78 virtual TGDimension GetDefaultSize() const { return TGDimension(fTWidth, fTHeight+1); }
79 const TGString *GetText() const { return fText; }
80 void SetText(TGString *new_text);
81 virtual const char *GetTitle() const { return fText->Data(); }
82 virtual void SetTitle(const char *text) { *fText = text; }
83
84 virtual void DrawCopy(Handle_t id, Int_t x, Int_t y);
85 virtual void Update(TGLBEntry *e)
86 { SetText(new TGString(((TGTextLBEntry *)e)->GetText())); }
87
88 GContext_t GetNormGC() const { return fNormGC; }
90
91 virtual void SavePrimitive(std::ostream &out, Option_t * = "");
92
93 ClassDef(TGTextLBEntry,0) // Text listbox entry
94};
95
96
98
99private:
100 TGLineLBEntry(const TGLineLBEntry&) = delete;
102
103protected:
104 UInt_t fLineWidth; ///< line width
105 Style_t fLineStyle; ///< line style
106 UInt_t fLineLength; ///< line length
107 TGGC *fLineGC; ///< line graphics context
108
109 virtual void DoRedraw();
110
111public:
112 TGLineLBEntry(const TGWindow *p = nullptr, Int_t id = -1, const char *str = nullptr,
113 UInt_t w = 0, Style_t s = 0,
114 UInt_t options = kHorizontalFrame,
115 Pixel_t back = GetWhitePixel());
116 virtual ~TGLineLBEntry();
117
119 { return TGDimension(fTWidth, fTHeight+1); }
120 virtual Int_t GetLineWidth() const { return fLineWidth; }
121 virtual void SetLineWidth(Int_t width);
122 Style_t GetLineStyle() const { return fLineStyle; }
123 virtual void SetLineStyle(Style_t style);
124 TGGC *GetLineGC() const { return fLineGC; }
125 virtual void Update(TGLBEntry *e);
126 virtual void DrawCopy(Handle_t id, Int_t x, Int_t y);
127
128 ClassDef(TGLineLBEntry, 0) // Line width listbox entry
129};
130
131
133
134private:
135 TGIconLBEntry(const TGIconLBEntry&) = delete;
137
138protected:
139 const TGPicture *fPicture; // icon
140
141 virtual void DoRedraw();
142
143public:
144 TGIconLBEntry(const TGWindow *p = nullptr, Int_t id = -1, const char *str = nullptr,
145 const TGPicture *pic = nullptr,
146 UInt_t w = 0, Style_t s = 0,
147 UInt_t options = kHorizontalFrame,
148 Pixel_t back = GetWhitePixel());
149 virtual ~TGIconLBEntry();
150
152 { return TGDimension(fTWidth, fTHeight+1); }
153 const TGPicture *GetPicture() const { return fPicture; }
154 virtual void SetPicture(const TGPicture *pic = nullptr);
155
156 virtual void Update(TGLBEntry *e);
157 virtual void DrawCopy(Handle_t id, Int_t x, Int_t y);
158
159 ClassDef(TGIconLBEntry, 0) // Icon + text listbox entry
160};
161
162
164
165friend class TGListBox;
166
167private:
168 TGLBContainer(const TGLBContainer&) = delete;
170
171protected:
172 TGLBEntry *fLastActive; ///< last active listbox entry in single selection listbox
173 TGListBox *fListBox; ///< list box which contains this container
174 Bool_t fMultiSelect; ///< true if multi selection is switched on
175 Int_t fChangeStatus; ///< defines the changes (select or unselect) while the mouse
176 ///< moves over a multi selectable list box
177
178 virtual void OnAutoScroll();
179 virtual void DoRedraw();
180
181public:
182 TGLBContainer(const TGWindow *p = nullptr, UInt_t w = 1, UInt_t h = 1,
183 UInt_t options = kSunkenFrame,
185 virtual ~TGLBContainer();
186
187 virtual void AddEntry(TGLBEntry *lbe, TGLayoutHints *lhints);
188 virtual void AddEntrySort(TGLBEntry *lbe, TGLayoutHints *lhints);
189 virtual void InsertEntry(TGLBEntry *lbe, TGLayoutHints *lhints, Int_t afterID);
190 virtual void RemoveEntry(Int_t id);
191 virtual void RemoveEntries(Int_t from_ID, Int_t to_ID);
192 virtual void RemoveAll();
193
194 virtual void ActivateItem(TGFrameElement *el);
195 virtual void Associate(const TGWindow *w) { fMsgWindow = w; }
196 virtual void SetListBox(TGListBox *lb) { fListBox = lb; }
197 TGListBox *GetListBox() const { return fListBox; }
201 virtual Int_t GetSelected() const;
202 virtual Bool_t GetSelection(Int_t id);
203 virtual Int_t GetPos(Int_t id);
205 virtual void GetSelectedEntries(TList *selected);
206 virtual TGLBEntry *Select(Int_t id, Bool_t sel);
207 virtual TGLBEntry *Select(Int_t id);
208
209 virtual TGVScrollBar *GetVScrollbar() const;
210 virtual void SetVsbPosition(Int_t newPos);
211 virtual void Layout();
212 virtual UInt_t GetDefaultWidth() const { return fWidth; }
213
214 virtual void SetMultipleSelections(Bool_t multi);
215 virtual Bool_t GetMultipleSelections() const { return fMultiSelect; }
216
217 ClassDef(TGLBContainer,0) // Listbox container
218};
219
220
221class TGListBox : public TGCompositeFrame, public TGWidget {
222
223private:
224 TGListBox(const TGListBox&) = delete;
225 TGListBox operator=(const TGListBox&) = delete;
226
227protected:
228 UInt_t fItemVsize; ///< maximum height of single entry
229 Bool_t fIntegralHeight; ///< true if height should be multiple of fItemVsize
230 TGLBContainer *fLbc; ///< listbox container
231 TGViewPort *fVport; ///< listbox viewport (see TGCanvas.h)
232 TGVScrollBar *fVScrollbar; ///< vertical scrollbar
233
235
236 virtual void InitListBox();
237
238public:
239 TGListBox(const TGWindow *p = nullptr, Int_t id = -1,
241 Pixel_t back = GetWhitePixel());
242 virtual ~TGListBox();
243
244 virtual void AddEntry(TGString *s, Int_t id);
245 virtual void AddEntry(const char *s, Int_t id);
246 virtual void AddEntry(TGLBEntry *lbe, TGLayoutHints *lhints);
247 virtual void AddEntrySort(TGString *s, Int_t id);
248 virtual void AddEntrySort(const char *s, Int_t id);
249 virtual void AddEntrySort(TGLBEntry *lbe, TGLayoutHints *lhints);
250 virtual void InsertEntry(TGString *s, Int_t id, Int_t afterID);
251 virtual void InsertEntry(const char *s , Int_t id, Int_t afterID);
252 virtual void InsertEntry(TGLBEntry *lbe, TGLayoutHints *lhints, Int_t afterID);
253 virtual void NewEntry(const char *s = "Entry"); //*MENU*
254 virtual void RemoveEntry(Int_t id = -1); //*MENU*
255 virtual void RemoveAll(); //*MENU*
256 virtual void RemoveEntries(Int_t from_ID, Int_t to_ID);
257 virtual void ChangeBackground(Pixel_t back);
258 virtual void SetTopEntry(Int_t id = -1);
259 virtual void SetMultipleSelections(Bool_t multi = kTRUE)
260 { fLbc->SetMultipleSelections(multi); } //*TOGGLE* *GETTER=GetMultipleSelections
262 { return fLbc->GetMultipleSelections(); }
263 virtual Int_t GetNumberOfEntries() const
264 { return fLbc->GetList()->GetSize(); }
265 virtual TGLBEntry *GetEntry(Int_t id) const;
266 virtual TGLBEntry *FindEntry(const char *s) const;
267 virtual TGFrame *GetContainer() const { return fVport->GetContainer(); }
268 virtual TGViewPort *GetViewPort() const { return fVport; }
269 virtual TGScrollBar *GetScrollBar() const { return fVScrollbar; }
270 virtual TGVScrollBar *GetVScrollbar() const { return fVScrollbar; }
271
272 virtual void DrawBorder();
273 virtual void Resize(UInt_t w, UInt_t h);
274 virtual void Resize(TGDimension size) { Resize(size.fWidth, size.fHeight); }
275 virtual void MoveResize(Int_t x, Int_t y, UInt_t w, UInt_t h);
276 virtual void Layout();
278 virtual void SortByName(Bool_t ascend = kTRUE); //*MENU*icon=bld_sortup.png*
279 virtual void IntegralHeight(Bool_t mode) { fIntegralHeight = mode; }
280 virtual TGDimension GetDefaultSize() const;
281
282 virtual Bool_t ProcessMessage(Longptr_t msg, Longptr_t parm1, Longptr_t parm2);
283
284 virtual TGLBEntry *Select(Int_t id, Bool_t sel = kTRUE)
285 { return fLbc->Select(id, sel); }
286 virtual Int_t GetSelected() const;
287 virtual Bool_t GetSelection(Int_t id) { return fLbc->GetSelection(id); }
288 virtual TGLBEntry *GetSelectedEntry() const { return fLbc->GetSelectedEntry(); }
289 virtual void GetSelectedEntries(TList *selected);
290 UInt_t GetItemVsize() const { return fItemVsize; }
291
292 virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
293
294 virtual void Selected(Int_t widgetId, Int_t id); //*SIGNAL*
295 virtual void Selected(Int_t id) { Emit("Selected(Int_t)", id); } //*SIGNAL*
296 virtual void Selected(const char *txt) { Emit("Selected(char*)", txt); } //*SIGNAL
297 virtual void DoubleClicked(Int_t widgetId, Int_t id); //*SIGNAL*
298 virtual void DoubleClicked(Int_t id) { Emit("DoubleClicked(Int_t)", id); } //*SIGNAL*
299 virtual void DoubleClicked(const char *txt) { Emit("DoubleClicked(char*)", txt); } //*SIGNAL
300 virtual void SelectionChanged() { Emit("SelectionChanged()"); } //*SIGNAL*
301
302 ClassDef(TGListBox,0) // Listbox widget
303};
304
305#endif
@ 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
ULongptr_t Handle_t
Generic resource handle.
Definition GuiTypes.h:26
#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
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
int Int_t
Definition RtypesCore.h:45
long Longptr_t
Definition RtypesCore.h:82
unsigned int UInt_t
Definition RtypesCore.h:46
bool Bool_t
Definition RtypesCore.h:63
short Style_t
Definition RtypesCore.h:89
const Bool_t kTRUE
Definition RtypesCore.h:100
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.
The base class for composite widgets (menu bars, list boxes, etc.).
Definition TGFrame.h:287
virtual TList * GetList() const
Definition TGFrame.h:310
Manages a content area.
Definition TGCanvas.h:31
const TGWindow * fMsgWindow
window handling container messages
Definition TGCanvas.h:42
Encapsulate fonts used in the GUI system.
Definition TGFont.h:140
A subclasses of TGWindow, and is used as base class for some simple widgets (buttons,...
Definition TGFrame.h:80
static Pixel_t GetWhitePixel()
Get white pixel value.
Definition TGFrame.cxx:709
virtual void SetBackgroundColor(Pixel_t back)
Set background color (override from TGWindow base class).
Definition TGFrame.cxx:312
static Pixel_t GetDefaultFrameBackground()
Get default frame background.
Definition TGFrame.cxx:683
UInt_t fWidth
frame width
Definition TGFrame.h:87
Encapsulate a graphics context used in the low level graphics.
Definition TGGC.h:22
Icon + text listbox entry.
Definition TGListBox.h:132
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:151
const TGPicture * GetPicture() const
Definition TGListBox.h:153
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:139
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.
Definition TGListBox.h:163
virtual void RemoveAll()
Remove all entries in this container.
TGLBContainer(const TGLBContainer &)=delete
Bool_t fMultiSelect
true if multi selection is switched on
Definition TGListBox.h:174
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:196
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
Definition TGListBox.h:175
virtual Int_t GetSelected() const
Returns id of selected entry.
virtual void ActivateItem(TGFrameElement *el)
Activate item.
TGListBox * GetListBox() const
Definition TGListBox.h:197
virtual Bool_t GetMultipleSelections() const
Definition TGListBox.h:215
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
Definition TGListBox.h:172
virtual UInt_t GetDefaultWidth() const
Definition TGListBox.h:212
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:195
TGListBox * fListBox
list box which contains this container
Definition TGListBox.h:173
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.
TGLBContainer operator=(const TGLBContainer &)=delete
TGLBEntry * GetSelectedEntry() const
Definition TGListBox.h:204
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.
Basic listbox entries.
Definition TGListBox.h:24
Pixel_t fBkcolor
entry background color
Definition TGListBox.h:28
virtual void SetBackgroundColor(Pixel_t col)
Set background color (override from TGWindow base class).
Definition TGListBox.h:42
Int_t fEntryId
message id of listbox entry
Definition TGListBox.h:27
virtual void Activate(Bool_t a)
Toggle active state of listbox entry.
virtual void Update(TGLBEntry *)
Definition TGListBox.h:39
virtual void Toggle()
Toggle active state of listbox entry.
Bool_t IsActive() const
Definition TGListBox.h:41
Int_t EntryId() const
Definition TGListBox.h:40
Bool_t fActive
true if entry is active
Definition TGListBox.h:29
virtual void DoRedraw()
Redraw the frame.
Definition TGListBox.h:31
This class describes layout hints used by the layout classes.
Definition TGLayout.h:50
Frame layout manager.
Definition TGLayout.h:135
Line style and width listbox entries.
Definition TGListBox.h:97
Style_t GetLineStyle() const
Definition TGListBox.h:122
Style_t fLineStyle
line style
Definition TGListBox.h:105
TGGC * fLineGC
line graphics context
Definition TGListBox.h:107
virtual void DoRedraw()
Redraw line style listbox entry.
UInt_t fLineLength
line length
Definition TGListBox.h:106
UInt_t fLineWidth
line width
Definition TGListBox.h:104
virtual Int_t GetLineWidth() const
Definition TGListBox.h:120
virtual TGDimension GetDefaultSize() const
std::cout << fWidth << "x" << fHeight << std::endl;
Definition TGListBox.h:118
TGLineLBEntry operator=(const TGLineLBEntry &)=delete
TGGC * GetLineGC() const
Definition TGListBox.h:124
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.
Definition TGListBox.h:221
virtual void IntegralHeight(Bool_t mode)
Definition TGListBox.h:279
virtual void InitListBox()
Initiate the internal classes of a list box.
Bool_t fIntegralHeight
true if height should be multiple of fItemVsize
Definition TGListBox.h:229
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:298
TGListBox(const TGListBox &)=delete
virtual ~TGListBox()
Delete a listbox widget.
virtual Bool_t GetSelection(Int_t id)
Definition TGListBox.h:287
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:270
TGViewPort * fVport
listbox viewport (see TGCanvas.h)
Definition TGListBox.h:231
UInt_t fItemVsize
maximum height of single entry
Definition TGListBox.h:228
virtual TGLBEntry * Select(Int_t id, Bool_t sel=kTRUE)
Definition TGListBox.h:284
virtual Int_t GetNumberOfEntries() const
Definition TGListBox.h:263
TGLBContainer * fLbc
listbox container
Definition TGListBox.h:230
virtual TGDimension GetDefaultSize() const
Return default size of listbox widget.
virtual void DoubleClicked(const char *txt)
Definition TGListBox.h:299
virtual void DrawBorder()
Draw borders of the list box widget.
virtual TGLBEntry * GetSelectedEntry() const
Definition TGListBox.h:288
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()
Definition TGListBox.h:300
virtual Bool_t GetMultipleSelections() const
Definition TGListBox.h:261
void SetContainer(TGFrame *f)
Definition TGListBox.h:234
virtual TGScrollBar * GetScrollBar() const
Definition TGListBox.h:269
TGVScrollBar * fVScrollbar
vertical scrollbar
Definition TGListBox.h:232
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:295
UInt_t GetItemVsize() const
Definition TGListBox.h:290
virtual TGViewPort * GetViewPort() const
Definition TGListBox.h:268
virtual void SetMultipleSelections(Bool_t multi=kTRUE)
Definition TGListBox.h:259
TGListBox operator=(const TGListBox &)=delete
virtual TGFrame * GetContainer() const
Definition TGListBox.h:267
virtual void Resize(TGDimension size)
Resize the frame.
Definition TGListBox.h:274
virtual void SetLayoutManager(TGLayoutManager *)
Set the layout manager for the composite frame.
Definition TGListBox.h:277
virtual void Selected(const char *txt)
Definition TGListBox.h:296
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.
The TGPicture class implements pictures and icons used in the different GUI elements and widgets.
Definition TGPicture.h:25
The classes in this file implement scrollbars.
Definition TGScrollBar.h:61
TGString wraps a TString and adds some graphics routines like drawing, size of string on screen depen...
Definition TGString.h:20
Text string listbox entries.
Definition TGListBox.h:48
UInt_t fTWidth
text width
Definition TGListBox.h:52
Bool_t fTextChanged
true if text has been changed
Definition TGListBox.h:54
const TGString * GetText() const
Definition TGListBox.h:79
GContext_t fNormGC
text drawing graphics context
Definition TGListBox.h:55
virtual TGDimension GetDefaultSize() const
std::cout << fWidth << "x" << fHeight << std::endl;
Definition TGListBox.h:78
FontStruct_t GetFontStruct() const
Definition TGListBox.h:89
static const TGFont * fgDefaultFont
Definition TGListBox.h:60
UInt_t fTHeight
text height
Definition TGListBox.h:53
TGString * fText
entry text string
Definition TGListBox.h:51
virtual void SetTitle(const char *text)
Definition TGListBox.h:82
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:88
FontStruct_t fFontStruct
font used to draw string
Definition TGListBox.h:56
virtual const char * GetTitle() const
Returns title of object.
Definition TGListBox.h:81
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:85
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:61
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.
The TGVScrollBar will generate the following event messages: kC_VSCROLL, kSB_SLIDERPOS,...
TGFrame * GetContainer() const
Definition TGCanvas.h:173
void SetContainer(TGFrame *f)
Add container frame to the viewport.
Definition TGCanvas.cxx:153
The widget base class.
Definition TGWidget.h:43
ROOT GUI Window base class.
Definition TGWindow.h:23
A doubly linked list.
Definition TList.h:38
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