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 void DoRedraw() override { }
32
33public:
34 TGLBEntry(const TGWindow *p = nullptr, Int_t id = -1, UInt_t options = kHorizontalFrame,
35 Pixel_t back = GetWhitePixel());
36
37 void Activate(Bool_t a) override;
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 override { return fActive; }
43
44 ClassDefOverride(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 void DoRedraw() override;
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 ~TGTextLBEntry() override;
77
78 TGDimension GetDefaultSize() const override { return TGDimension(fTWidth, fTHeight+1); }
79 const TGString *GetText() const { return fText; }
80 void SetText(TGString *new_text);
81 const char *GetTitle() const override { return fText->Data(); }
82 virtual void SetTitle(const char *text) { *fText = text; }
83
84 void DrawCopy(Handle_t id, Int_t x, Int_t y) override;
85 void Update(TGLBEntry *e) override
86 { SetText(new TGString(((TGTextLBEntry *)e)->GetText())); }
87
88 GContext_t GetNormGC() const { return fNormGC; }
90
91 void SavePrimitive(std::ostream &out, Option_t * = "") override;
92
93 ClassDefOverride(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 void DoRedraw() override;
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 ~TGLineLBEntry() override;
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 void Update(TGLBEntry *e) override;
126 void DrawCopy(Handle_t id, Int_t x, Int_t y) override;
127
128 ClassDefOverride(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 void DoRedraw() override;
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 ~TGIconLBEntry() override;
150
152 { return TGDimension(fTWidth, fTHeight+1); }
153 const TGPicture *GetPicture() const { return fPicture; }
154 virtual void SetPicture(const TGPicture *pic = nullptr);
155
156 void Update(TGLBEntry *e) override;
157 void DrawCopy(Handle_t id, Int_t x, Int_t y) override;
158
159 ClassDefOverride(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 void OnAutoScroll() override;
179 void DoRedraw() override;
180
181public:
182 TGLBContainer(const TGWindow *p = nullptr, UInt_t w = 1, UInt_t h = 1,
183 UInt_t options = kSunkenFrame,
185 ~TGLBContainer() override;
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 void RemoveAll() override;
193
194 void ActivateItem(TGFrameElement *el) override;
195 void Associate(const TGWindow *w) override { fMsgWindow = w; }
196 virtual void SetListBox(TGListBox *lb) { fListBox = lb; }
197 TGListBox *GetListBox() const { return fListBox; }
198 Bool_t HandleButton(Event_t *event) override;
199 Bool_t HandleDoubleClick(Event_t *event) override;
200 Bool_t HandleMotion(Event_t *event) override;
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 TGVScrollBar *GetVScrollbar() const override;
210 void SetVsbPosition(Int_t newPos) override;
211 void Layout() override;
212 UInt_t GetDefaultWidth() const override { return fWidth; }
213
214 virtual void SetMultipleSelections(Bool_t multi);
215 virtual Bool_t GetMultipleSelections() const { return fMultiSelect; }
216
217 ClassDefOverride(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 ~TGListBox() override;
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 void RemoveAll() override; //*MENU*
256 virtual void RemoveEntries(Int_t from_ID, Int_t to_ID);
257 void ChangeBackground(Pixel_t back) override;
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 void DrawBorder() override;
273 void Resize(UInt_t w, UInt_t h) override;
274 void Resize(TGDimension size) override { Resize(size.fWidth, size.fHeight); }
275 void MoveResize(Int_t x, Int_t y, UInt_t w, UInt_t h) override;
276 void Layout() override;
278 virtual void SortByName(Bool_t ascend = kTRUE); //*MENU*icon=bld_sortup.png*
280 TGDimension GetDefaultSize() const override;
281
282 Bool_t ProcessMessage(Longptr_t msg, Longptr_t parm1, Longptr_t parm2) override;
283
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 void SavePrimitive(std::ostream &out, Option_t *option = "") override;
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 ClassDefOverride(TGListBox,0) // Listbox widget
303};
304
305#endif
Handle_t GContext_t
Graphics context handle.
Definition GuiTypes.h:38
@ kSunkenFrame
Definition GuiTypes.h:383
@ kDoubleBorder
Definition GuiTypes.h:385
@ kHorizontalFrame
Definition GuiTypes.h:382
ULong_t Pixel_t
Pixel value.
Definition GuiTypes.h:40
ULongptr_t Handle_t
Generic resource handle.
Definition GuiTypes.h:26
Handle_t FontStruct_t
Pointer to font structure.
Definition GuiTypes.h:39
#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
short Style_t
Definition RtypesCore.h:89
bool Bool_t
Definition RtypesCore.h:63
int Int_t
Definition RtypesCore.h:45
long Longptr_t
Definition RtypesCore.h:82
unsigned int UInt_t
Definition RtypesCore.h:46
constexpr Bool_t kTRUE
Definition RtypesCore.h:100
const char Option_t
Definition RtypesCore.h:66
#define ClassDefOverride(name, id)
Definition Rtypes.h:341
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t option
Option_t Option_t SetLineWidth
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t sel
Option_t Option_t TPoint TPoint const char mode
Option_t Option_t width
Option_t Option_t style
Option_t Option_t TPoint TPoint const char text
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
void SetBackgroundColor(Pixel_t back) override
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
void DoRedraw() override
Redraw icon & text listbox entry.
~TGIconLBEntry() override
Delete icon & text listbox entry.
virtual void SetPicture(const TGPicture *pic=nullptr)
Change the icon of listbox entry containing icon & text.
TGDimension GetDefaultSize() const override
std::cout << fWidth << "x" << fHeight << std::endl;
Definition TGListBox.h:151
void DrawCopy(Handle_t id, Int_t x, Int_t y) override
Draw copy on window/pixmap.
const TGPicture * GetPicture() const
Definition TGListBox.h:153
TGIconLBEntry(const TGIconLBEntry &)=delete
TGIconLBEntry operator=(const TGIconLBEntry &)=delete
const TGPicture * fPicture
Definition TGListBox.h:139
void Update(TGLBEntry *e) override
Update icon & text listbox entry.
A Composite frame that contains a list of TGLBEnties.
Definition TGListBox.h:163
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.
void OnAutoScroll() override
Autoscroll while close to & beyond The Wall.
virtual void SetListBox(TGListBox *lb)
Definition TGListBox.h:196
void RemoveAll() override
Remove all entries in this container.
void SetVsbPosition(Int_t newPos) override
Set new vertical scroll bar position.
TGVScrollBar * GetVScrollbar() const override
Return a pointer to vertical scroll bar.
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.
Bool_t HandleButton(Event_t *event) override
Handle mouse button event in the listbox container.
TGListBox * GetListBox() const
Definition TGListBox.h:197
virtual Bool_t GetMultipleSelections() const
Definition TGListBox.h:215
void Layout() override
Layout container.
void ActivateItem(TGFrameElement *el) override
Activate item.
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
Bool_t HandleDoubleClick(Event_t *event) override
Handle double click mouse event in the listbox container.
virtual void RemoveEntries(Int_t from_ID, Int_t to_ID)
Remove entries from from_ID to to_ID (including).
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 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.
UInt_t GetDefaultWidth() const override
Definition TGListBox.h:212
virtual void InsertEntry(TGLBEntry *lbe, TGLayoutHints *lhints, Int_t afterID)
Insert listbox entry after specified entry with id afterID.
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.
void DoRedraw() override
redraw
void Associate(const TGWindow *w) override
Definition TGListBox.h:195
~TGLBContainer() override
Delete the listbox container.
Bool_t HandleMotion(Event_t *event) override
Handle mouse motion event in listbox container.
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
Basic listbox entries.
Definition TGListBox.h:24
Pixel_t fBkcolor
entry background color
Definition TGListBox.h:28
Int_t fEntryId
message id of listbox entry
Definition TGListBox.h:27
void DoRedraw() override
Redraw the frame.
Definition TGListBox.h:31
virtual void Update(TGLBEntry *)
Definition TGListBox.h:39
virtual void Toggle()
Toggle active state of listbox entry.
Bool_t IsActive() const override
Definition TGListBox.h:41
Int_t EntryId() const
Definition TGListBox.h:40
Bool_t fActive
true if entry is active
Definition TGListBox.h:29
void SetBackgroundColor(Pixel_t col) override
Set background color (override from TGWindow base class).
Definition TGListBox.h:42
void Activate(Bool_t a) override
Toggle active state of listbox entry.
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
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
void DrawCopy(Handle_t id, Int_t x, Int_t y) override
Draw copy on window/pixmap.
void DoRedraw() override
Redraw line style listbox entry.
TGLineLBEntry operator=(const TGLineLBEntry &)=delete
TGDimension GetDefaultSize() const override
std::cout << fWidth << "x" << fHeight << std::endl;
Definition TGListBox.h:118
void Update(TGLBEntry *e) override
Update line style listbox entry.
TGGC * GetLineGC() const
Definition TGListBox.h:124
virtual void SetLineStyle(Style_t style)
Set the line style corresponding to the TPad line styles.
~TGLineLBEntry() override
Delete line style listbox entry.
TGLineLBEntry(const TGLineLBEntry &)=delete
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 Bool_t GetSelection(Int_t id)
Definition TGListBox.h:287
virtual void SortByName(Bool_t ascend=kTRUE)
Sort entries by name.
void Resize(TGDimension size) override
Resize the frame.
Definition TGListBox.h:274
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
TGDimension GetDefaultSize() const override
Return default size of listbox widget.
void SetLayoutManager(TGLayoutManager *) override
Set the layout manager for the composite frame.
Definition TGListBox.h:277
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 void DoubleClicked(const char *txt)
Definition TGListBox.h:299
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
void Resize(UInt_t w, UInt_t h) override
Resize the listbox widget.
virtual Int_t GetSelected() const
Return id of selected listbox item.
~TGListBox() override
Delete a listbox widget.
void MoveResize(Int_t x, Int_t y, UInt_t w, UInt_t h) override
Move and resize the listbox widget.
virtual void SetTopEntry(Int_t id=-1)
Scroll the entry with id to the top of the listbox.
void ChangeBackground(Pixel_t back) override
Change background to all entries.
virtual void AddEntry(TGString *s, Int_t id)
Add entry with specified string and id to listbox.
void Layout() override
Layout the listbox components.
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 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
void DrawBorder() override
Draw borders of the list box widget.
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
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save a list box widget as a C++ statement(s) on output stream out.
virtual void Selected(const char *txt)
Definition TGListBox.h:296
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.
Bool_t ProcessMessage(Longptr_t msg, Longptr_t parm1, Longptr_t parm2) override
Process messages generated by the listbox container and forward messages to the listbox message handl...
virtual TGLBEntry * FindEntry(const char *s) const
Find entry by name.
void RemoveAll() override
Remove all entries.
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
FontStruct_t GetFontStruct() const
Definition TGListBox.h:89
static const TGFont * fgDefaultFont
Definition TGListBox.h:60
void DoRedraw() override
Redraw text listbox entry.
void SavePrimitive(std::ostream &out, Option_t *="") override
Save a list box entry widget as a C++ statement(s) on output stream out.
void DrawCopy(Handle_t id, Int_t x, Int_t y) override
Draw text listbox entry on window/pixmap.
const char * GetTitle() const override
Returns title of object.
Definition TGListBox.h:81
UInt_t fTHeight
text height
Definition TGListBox.h:53
~TGTextLBEntry() override
Delete text listbox entry.
TGString * fText
entry text string
Definition TGListBox.h:51
virtual void SetTitle(const char *text)
Definition TGListBox.h:82
void Update(TGLBEntry *e) override
Definition TGListBox.h:85
TGDimension GetDefaultSize() const override
std::cout << fWidth << "x" << fHeight << std::endl;
Definition TGListBox.h:78
GContext_t GetNormGC() const
Definition TGListBox.h:88
FontStruct_t fFontStruct
font used to draw string
Definition TGListBox.h:56
TGTextLBEntry & operator=(const TGTextLBEntry &)=delete
static FontStruct_t GetDefaultFontStruct()
Return default font structure in use for a text listbox entry.
static const TGGC & GetDefaultGC()
Return default graphics context in use for a text listbox entry.
TGTextLBEntry(const TGTextLBEntry &)=delete
static TGGC * fgDefaultGC
Definition TGListBox.h:61
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:376
Double_t y[n]
Definition legend1.C:17
Double_t x[n]
Definition legend1.C:17
Event structure.
Definition GuiTypes.h:174