Logo ROOT  
Reference Guide
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 
20 class TGListBox;
21 class TList;
22 
23 
24 class TGLBEntry : public TGFrame {
25 
26 protected:
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 
33 public:
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 
48 class TGTextLBEntry : public TGLBEntry {
49 
50 protected:
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;
61  static TGGC *fgDefaultGC;
62 
63 private:
64  TGTextLBEntry(const TGTextLBEntry &) = delete;
66 
67 public:
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 
97 class TGLineLBEntry : public TGTextLBEntry {
98 
99 private:
100  TGLineLBEntry(const TGLineLBEntry&) = delete;
102 
103 protected:
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 
111 public:
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 
118  virtual TGDimension GetDefaultSize() const
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 
132 class TGIconLBEntry : public TGTextLBEntry {
133 
134 private:
135  TGIconLBEntry(const TGIconLBEntry&) = delete;
137 
138 protected:
139  const TGPicture *fPicture; // icon
140 
141  virtual void DoRedraw();
142 
143 public:
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 
151  virtual TGDimension GetDefaultSize() const
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 
163 class TGLBContainer : public TGContainer {
164 
165 friend class TGListBox;
166 
167 private:
168  TGLBContainer(const TGLBContainer&) = delete;
170 
171 protected:
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 
181 public:
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; }
198  virtual Bool_t HandleButton(Event_t *event);
200  virtual Bool_t HandleMotion(Event_t *event);
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 
221 class TGListBox : public TGCompositeFrame, public TGWidget {
222 
223 private:
224  TGListBox(const TGListBox&) = delete;
225  TGListBox operator=(const TGListBox&) = delete;
226 
227 protected:
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 
238 public:
239  TGListBox(const TGWindow *p = nullptr, Int_t id = -1,
240  UInt_t options = kSunkenFrame | kDoubleBorder,
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(Long_t msg, Long_t parm1, Long_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
TGListBox::NewEntry
virtual void NewEntry(const char *s="Entry")
method used to add entry via context menu
Definition: TGListBox.cxx:1300
TGListBox::RemoveEntry
virtual void RemoveEntry(Int_t id=-1)
remove entry with id.
Definition: TGListBox.cxx:1318
TGListBox::SetContainer
void SetContainer(TGFrame *f)
Definition: TGListBox.h:234
TGListBox
A listbox is a box, possibly with scrollbar, containing entries.
Definition: TGListBox.h:221
TGIconLBEntry::TGIconLBEntry
TGIconLBEntry(const TGIconLBEntry &)=delete
TGLineLBEntry::GetLineStyle
Style_t GetLineStyle() const
Definition: TGListBox.h:122
TGTextLBEntry::GetDefaultGC
static const TGGC & GetDefaultGC()
Return default graphics context in use for a text listbox entry.
Definition: TGListBox.cxx:225
TGLBContainer::TGLBContainer
TGLBContainer(const TGLBContainer &)=delete
TGLineLBEntry::GetLineWidth
virtual Int_t GetLineWidth() const
Definition: TGListBox.h:120
TGLBContainer::AddEntrySort
virtual void AddEntrySort(TGLBEntry *lbe, TGLayoutHints *lhints)
Insert listbox entry before the list box entry with a higher id.
Definition: TGListBox.cxx:580
TGTextLBEntry::fgDefaultGC
static TGGC * fgDefaultGC
Definition: TGListBox.h:61
TGListBox::fItemVsize
UInt_t fItemVsize
maximum height of single entry
Definition: TGListBox.h:228
TGLBContainer::HandleDoubleClick
virtual Bool_t HandleDoubleClick(Event_t *event)
Handle double click mouse event in the listbox container.
Definition: TGListBox.cxx:931
TGWindow
ROOT GUI Window base class.
Definition: TGWindow.h:23
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:100
e
#define e(i)
Definition: RSha256.hxx:103
Style_t
short Style_t
Definition: RtypesCore.h:89
TGCompositeFrame::GetList
virtual TList * GetList() const
Definition: TGFrame.h:310
TGVScrollBar
The TGVScrollBar will generate the following event messages: kC_VSCROLL, kSB_SLIDERPOS,...
Definition: TGScrollBar.h:164
TGPicture
The TGPicture class implements pictures and icons used in the different GUI elements and widgets.
Definition: TGPicture.h:25
f
#define f(i)
Definition: RSha256.hxx:104
TGScrollBar
The classes in this file implement scrollbars.
Definition: TGScrollBar.h:61
TGDimension
Definition: TGDimension.h:18
TGTextLBEntry::fTHeight
UInt_t fTHeight
text height
Definition: TGListBox.h:53
TGFrame::SetBackgroundColor
virtual void SetBackgroundColor(Pixel_t back)
Set background color (override from TGWindow base class).
Definition: TGFrame.cxx:312
TGLBContainer::GetListBox
TGListBox * GetListBox() const
Definition: TGListBox.h:197
TGTextLBEntry::DrawCopy
virtual void DrawCopy(Handle_t id, Int_t x, Int_t y)
Draw text listbox entry on window/pixmap.
Definition: TGListBox.cxx:164
Option_t
const char Option_t
Definition: RtypesCore.h:66
TGListBox::IntegralHeight
virtual void IntegralHeight(Bool_t mode)
Definition: TGListBox.h:279
TGLBEntry::IsActive
Bool_t IsActive() const
Definition: TGListBox.h:41
TGLineLBEntry
Line style and width listbox entries.
Definition: TGListBox.h:97
TGLineLBEntry::fLineLength
UInt_t fLineLength
line length
Definition: TGListBox.h:106
TGLBContainer::SetMultipleSelections
virtual void SetMultipleSelections(Bool_t multi)
Enables and disables multiple selections of entries.
Definition: TGListBox.cxx:778
TString::Data
const char * Data() const
Definition: TString.h:369
TGListBox::Selected
virtual void Selected(Int_t id)
Definition: TGListBox.h:295
Pixel_t
ULong_t Pixel_t
Pixel value.
Definition: GuiTypes.h:40
TGTextLBEntry::fText
TGString * fText
entry text string
Definition: TGListBox.h:51
TGFrame::fWidth
UInt_t fWidth
frame width
Definition: TGFrame.h:87
FontStruct_t
Handle_t FontStruct_t
Pointer to font structure.
Definition: GuiTypes.h:39
TGListBox::SetMultipleSelections
virtual void SetMultipleSelections(Bool_t multi=kTRUE)
Definition: TGListBox.h:259
TGIconLBEntry::operator=
TGIconLBEntry operator=(const TGIconLBEntry &)=delete
TGListBox::fVScrollbar
TGVScrollBar * fVScrollbar
vertical scrollbar
Definition: TGListBox.h:232
TGLineLBEntry::TGLineLBEntry
TGLineLBEntry(const TGLineLBEntry &)=delete
TGLBEntry::DoRedraw
virtual void DoRedraw()
Redraw the frame.
Definition: TGListBox.h:31
TGLBContainer::DoRedraw
virtual void DoRedraw()
redraw
Definition: TGListBox.cxx:520
TGLineLBEntry::SetLineStyle
virtual void SetLineStyle(Style_t style)
Set the line style corresponding to the TPad line styles.
Definition: TGListBox.cxx:290
TGListBox::Selected
virtual void Selected(Int_t widgetId, Int_t id)
Emit Selected signal with list box id and entry id.
Definition: TGListBox.cxx:1609
TGListBox::Resize
virtual void Resize(UInt_t w, UInt_t h)
Resize the listbox widget.
Definition: TGListBox.cxx:1411
TGLBContainer::fListBox
TGListBox * fListBox
list box which contains this container
Definition: TGListBox.h:173
TGTextLBEntry::~TGTextLBEntry
virtual ~TGTextLBEntry()
Delete text listbox entry.
Definition: TGListBox.cxx:156
TGLBEntry::Activate
virtual void Activate(Bool_t a)
Toggle active state of listbox entry.
Definition: TGListBox.cxx:113
TGLineLBEntry::DrawCopy
virtual void DrawCopy(Handle_t id, Int_t x, Int_t y)
Draw copy on window/pixmap.
Definition: TGListBox.cxx:352
width
include TDocParser_001 C image html pict1_TDocParser_001 png width
Definition: TDocParser.cxx:121
TGeant4Unit::s
static constexpr double s
Definition: TGeant4SystemOfUnits.h:162
TGLBContainer::GetVScrollbar
virtual TGVScrollBar * GetVScrollbar() const
Return a pointer to vertical scroll bar.
Definition: TGListBox.cxx:798
Int_t
int Int_t
Definition: RtypesCore.h:45
TGWidget
The widget base class.
Definition: TGWidget.h:43
TGTextLBEntry::GetFontStruct
FontStruct_t GetFontStruct() const
Definition: TGListBox.h:89
TGTextLBEntry::operator=
TGTextLBEntry & operator=(const TGTextLBEntry &)=delete
TGTextLBEntry::fTWidth
UInt_t fTWidth
text width
Definition: TGListBox.h:52
event
Definition: triangle.c:553
x
Double_t x[n]
Definition: legend1.C:17
TGListBox::SavePrimitive
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a list box widget as a C++ statement(s) on output stream out.
Definition: TGListBox.cxx:1650
TGListBox::GetSelectedEntry
virtual TGLBEntry * GetSelectedEntry() const
Definition: TGListBox.h:288
TGTextLBEntry::fgDefaultFont
static const TGFont * fgDefaultFont
Definition: TGListBox.h:60
Handle_t
ULongptr_t Handle_t
Generic resource handle.
Definition: GuiTypes.h:26
TGListBox::InsertEntry
virtual void InsertEntry(TGString *s, Int_t id, Int_t afterID)
Insert entry with specified string and id behind the entry with afterID.
Definition: TGListBox.cxx:1278
TGFrame::GetDefaultFrameBackground
static Pixel_t GetDefaultFrameBackground()
Get default frame background.
Definition: TGFrame.cxx:683
TGLineLBEntry::GetLineGC
TGGC * GetLineGC() const
Definition: TGListBox.h:124
TGListBox::GetSelection
virtual Bool_t GetSelection(Int_t id)
Definition: TGListBox.h:287
TGListBox::SetTopEntry
virtual void SetTopEntry(Int_t id=-1)
Scroll the entry with id to the top of the listbox.
Definition: TGListBox.cxx:1387
TGListBox::SelectionChanged
virtual void SelectionChanged()
Definition: TGListBox.h:300
TGListBox::GetContainer
virtual TGFrame * GetContainer() const
Definition: TGListBox.h:267
TGListBox::~TGListBox
virtual ~TGListBox()
Delete a listbox widget.
Definition: TGListBox.cxx:1131
TGListBox::GetDefaultSize
virtual TGDimension GetDefaultSize() const
Return default size of listbox widget.
Definition: TGListBox.cxx:1436
TGListBox::ChangeBackground
virtual void ChangeBackground(Pixel_t back)
Change background to all entries.
Definition: TGListBox.cxx:1533
TGIconLBEntry::Update
virtual void Update(TGLBEntry *e)
Update icon & text listbox entry.
Definition: TGListBox.cxx:416
TGLBContainer::RemoveEntries
virtual void RemoveEntries(Int_t from_ID, Int_t to_ID)
Remove entries from from_ID to to_ID (including).
Definition: TGListBox.cxx:641
TGFrame
A subclasses of TGWindow, and is used as base class for some simple widgets (buttons,...
Definition: TGFrame.h:80
Bool_t
bool Bool_t
Definition: RtypesCore.h:63
TGIconLBEntry::SetPicture
virtual void SetPicture(const TGPicture *pic=nullptr)
Change the icon of listbox entry containing icon & text.
Definition: TGListBox.cxx:445
kDoubleBorder
@ kDoubleBorder
Definition: GuiTypes.h:385
TGLineLBEntry::GetDefaultSize
virtual TGDimension GetDefaultSize() const
std::cout << fWidth << "x" << fHeight << std::endl;
Definition: TGListBox.h:118
text
TText * text
Definition: entrylist_figure1.C:10
TGLBEntry::SetBackgroundColor
virtual void SetBackgroundColor(Pixel_t col)
Set background color (override from TGWindow base class).
Definition: TGListBox.h:42
TGLBEntry::TGLBEntry
TGLBEntry(const TGWindow *p=0, Int_t id=-1, UInt_t options=kHorizontalFrame, Pixel_t back=GetWhitePixel())
Base class entry constructor.
Definition: TGListBox.cxx:99
bool
TGLBContainer::Select
virtual TGLBEntry * Select(Int_t id, Bool_t sel)
Select / deselect the entry with the specified id.
Definition: TGListBox.cxx:702
TGLayoutManager
Frame layout manager.
Definition: TGLayout.h:135
GContext_t
Handle_t GContext_t
Graphics context handle.
Definition: GuiTypes.h:38
TGListBox::Layout
virtual void Layout()
Layout the listbox components.
Definition: TGListBox.cxx:1452
TGContainer::fMsgWindow
const TGWindow * fMsgWindow
window handling container messages
Definition: TGCanvas.h:42
style
TCanvas * style()
Definition: style.C:1
TGTextLBEntry::fNormGC
GContext_t fNormGC
text drawing graphics context
Definition: TGListBox.h:55
TGIconLBEntry::DoRedraw
virtual void DoRedraw()
Redraw icon & text listbox entry.
Definition: TGListBox.cxx:437
TGLBContainer
A Composite frame that contains a list of TGLBEnties.
Definition: TGListBox.h:163
TGListBox::operator=
TGListBox operator=(const TGListBox &)=delete
TGLBContainer::OnAutoScroll
virtual void OnAutoScroll()
Autoscroll while close to & beyond The Wall.
Definition: TGListBox.cxx:1029
kSunkenFrame
@ kSunkenFrame
Definition: GuiTypes.h:383
TGIconLBEntry
Icon + text listbox entry.
Definition: TGListBox.h:132
TGListBox::RemoveEntries
virtual void RemoveEntries(Int_t from_ID, Int_t to_ID)
Remove a range of entries defined by from_ID and to_ID.
Definition: TGListBox.cxx:1353
TGLBContainer::RemoveAll
virtual void RemoveAll()
Remove all entries in this container.
Definition: TGListBox.cxx:667
TGLBContainer::fMultiSelect
Bool_t fMultiSelect
true if multi selection is switched on
Definition: TGListBox.h:174
TGLBContainer::GetSelectedEntries
virtual void GetSelectedEntries(TList *selected)
Adds all selected entries (TGLBEntry) of the list box into the list selected.
Definition: TGListBox.cxx:761
TGLineLBEntry::Update
virtual void Update(TGLBEntry *e)
Update line style listbox entry.
Definition: TGListBox.cxx:278
TGTextLBEntry::GetDefaultSize
virtual TGDimension GetDefaultSize() const
std::cout << fWidth << "x" << fHeight << std::endl;
Definition: TGListBox.h:78
TGLBEntry::Toggle
virtual void Toggle()
Toggle active state of listbox entry.
Definition: TGListBox.cxx:123
TGListBox::GetVScrollbar
virtual TGVScrollBar * GetVScrollbar() const
Definition: TGListBox.h:270
h
#define h(i)
Definition: RSha256.hxx:106
size
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
TGGC
Encapsulate a graphics context used in the low level graphics.
Definition: TGGC.h:22
a
auto * a
Definition: textangle.C:12
TGTextLBEntry::SetText
void SetText(TGString *new_text)
Set or change text in text entry.
Definition: TGListBox.cxx:196
TGLBEntry::fActive
Bool_t fActive
true if entry is active
Definition: TGListBox.h:29
TGLBEntry::fEntryId
Int_t fEntryId
message id of listbox entry
Definition: TGListBox.h:27
TGLBEntry::fBkcolor
Pixel_t fBkcolor
entry background color
Definition: TGListBox.h:28
TGLBContainer::AddEntry
virtual void AddEntry(TGLBEntry *lbe, TGLayoutHints *lhints)
Add listbox entry with hints to container.
Definition: TGListBox.cxx:529
TGListBox::MoveResize
virtual void MoveResize(Int_t x, Int_t y, UInt_t w, UInt_t h)
Move and resize the listbox widget.
Definition: TGListBox.cxx:1424
TGFrame.h
Long_t
long Long_t
Definition: RtypesCore.h:54
TGListBox::GetMultipleSelections
virtual Bool_t GetMultipleSelections() const
Definition: TGListBox.h:261
TGLBContainer::GetMultipleSelections
virtual Bool_t GetMultipleSelections() const
Definition: TGListBox.h:215
TGLayoutHints
This class describes layout hints used by the layout classes.
Definition: TGLayout.h:50
TGLBEntry::Update
virtual void Update(TGLBEntry *)
Definition: TGListBox.h:39
TGIconLBEntry::DrawCopy
virtual void DrawCopy(Handle_t id, Int_t x, Int_t y)
Draw copy on window/pixmap.
Definition: TGListBox.cxx:424
TGViewPort
Definition: TGCanvas.h:158
TGLineLBEntry::SetLineWidth
virtual void SetLineWidth(Int_t width)
Set or change line width in an entry.
Definition: TGListBox.cxx:343
TGListBox::GetSelected
virtual Int_t GetSelected() const
Return id of selected listbox item.
Definition: TGListBox.cxx:1515
UInt_t
unsigned int UInt_t
Definition: RtypesCore.h:46
y
Double_t y[n]
Definition: legend1.C:17
TGTextLBEntry::GetDefaultFontStruct
static FontStruct_t GetDefaultFontStruct()
Return default font structure in use for a text listbox entry.
Definition: TGListBox.cxx:215
TGIconLBEntry::GetPicture
const TGPicture * GetPicture() const
Definition: TGListBox.h:153
TGLBEntry
Basic listbox entries.
Definition: TGListBox.h:24
TGTextLBEntry::fTextChanged
Bool_t fTextChanged
true if text has been changed
Definition: TGListBox.h:54
TGListBox::RemoveAll
virtual void RemoveAll()
Remove all entries.
Definition: TGListBox.cxx:1344
TGListBox::Resize
virtual void Resize(TGDimension size)
Resize the frame.
Definition: TGListBox.h:274
TGListBox::GetEntry
virtual TGLBEntry * GetEntry(Int_t id) const
Returns list box entry with specified id.
Definition: TGListBox.cxx:1372
TGListBox::Selected
virtual void Selected(const char *txt)
Definition: TGListBox.h:296
TGLBContainer::RemoveEntry
virtual void RemoveEntry(Int_t id)
Remove the entry with specified id from the listbox container.
Definition: TGListBox.cxx:613
unsigned int
TGLBContainer::GetDefaultWidth
virtual UInt_t GetDefaultWidth() const
Definition: TGListBox.h:212
TGLBContainer::fChangeStatus
Int_t fChangeStatus
defines the changes (select or unselect) while the mouse moves over a multi selectable list box
Definition: TGListBox.h:175
TGIconLBEntry::~TGIconLBEntry
virtual ~TGIconLBEntry()
Delete icon & text listbox entry.
Definition: TGListBox.cxx:408
kHorizontalFrame
@ kHorizontalFrame
Definition: GuiTypes.h:382
TGViewPort::GetContainer
TGFrame * GetContainer() const
Definition: TGCanvas.h:173
TGListBox::GetNumberOfEntries
virtual Int_t GetNumberOfEntries() const
Definition: TGListBox.h:263
TGLBContainer::Associate
virtual void Associate(const TGWindow *w)
Definition: TGListBox.h:195
TGListBox::Select
virtual TGLBEntry * Select(Int_t id, Bool_t sel=kTRUE)
Definition: TGListBox.h:284
TGTextLBEntry::TGTextLBEntry
TGTextLBEntry(const TGTextLBEntry &)=delete
TGListBox::GetSelectedEntries
virtual void GetSelectedEntries(TList *selected)
Adds all selected entries (TGLBEntry) of the list box into the list selected.
Definition: TGListBox.cxx:1525
TGLBContainer::operator=
TGLBContainer operator=(const TGLBContainer &)=delete
TGTextLBEntry::GetNormGC
GContext_t GetNormGC() const
Definition: TGListBox.h:88
TGListBox::TGListBox
TGListBox(const TGListBox &)=delete
TGLBContainer::Layout
virtual void Layout()
Layout container.
Definition: TGListBox.cxx:511
TGLBContainer::InsertEntry
virtual void InsertEntry(TGLBEntry *lbe, TGLayoutHints *lhints, Int_t afterID)
Insert listbox entry after specified entry with id afterID.
Definition: TGListBox.cxx:544
TGLBContainer::GetSelected
virtual Int_t GetSelected() const
Returns id of selected entry.
Definition: TGListBox.cxx:733
TGListBox::FindEntry
virtual TGLBEntry * FindEntry(const char *s) const
Find entry by name.
Definition: TGListBox.cxx:1635
TGContainer
Manages a content area.
Definition: TGCanvas.h:31
TGTextLBEntry::Update
virtual void Update(TGLBEntry *e)
Definition: TGListBox.h:85
TGLBContainer::ActivateItem
virtual void ActivateItem(TGFrameElement *el)
Activate item.
Definition: TGListBox.cxx:1083
TGListBox::GetScrollBar
virtual TGScrollBar * GetScrollBar() const
Definition: TGListBox.h:269
TGListBox::fLbc
TGLBContainer * fLbc
listbox container
Definition: TGListBox.h:230
TCollection::GetSize
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
Definition: TCollection.h:182
TGListBox::fIntegralHeight
Bool_t fIntegralHeight
true if height should be multiple of fItemVsize
Definition: TGListBox.h:229
TGTextLBEntry::fFontStruct
FontStruct_t fFontStruct
font used to draw string
Definition: TGListBox.h:56
TGLBContainer::fLastActive
TGLBEntry * fLastActive
last active listbox entry in single selection listbox
Definition: TGListBox.h:172
TGLBEntry::EntryId
Int_t EntryId() const
Definition: TGListBox.h:40
TGLineLBEntry::fLineStyle
Style_t fLineStyle
line style
Definition: TGListBox.h:105
TGLBContainer::SetVsbPosition
virtual void SetVsbPosition(Int_t newPos)
Set new vertical scroll bar position.
Definition: TGListBox.cxx:806
TGLBContainer::HandleButton
virtual Bool_t HandleButton(Event_t *event)
Handle mouse button event in the listbox container.
Definition: TGListBox.cxx:818
TGListBox::AddEntrySort
virtual void AddEntrySort(TGString *s, Int_t id)
Add entry with specified string and id to listbox sorted by increasing id.
Definition: TGListBox.cxx:1240
TGListBox::SortByName
virtual void SortByName(Bool_t ascend=kTRUE)
Sort entries by name.
Definition: TGListBox.cxx:1505
TGLineLBEntry::fLineGC
TGGC * fLineGC
line graphics context
Definition: TGListBox.h:107
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
TGListBox::DoubleClicked
virtual void DoubleClicked(Int_t id)
Definition: TGListBox.h:298
Event_t
Event structure.
Definition: GuiTypes.h:174
TGListBox::InitListBox
virtual void InitListBox()
Initiate the internal classes of a list box.
Definition: TGListBox.cxx:1143
TGListBox::SetLayoutManager
virtual void SetLayoutManager(TGLayoutManager *)
Set the layout manager for the composite frame.
Definition: TGListBox.h:277
TGIconLBEntry::fPicture
const TGPicture * fPicture
Definition: TGListBox.h:139
TGTextLBEntry
Text string listbox entries.
Definition: TGListBox.h:48
TGTextLBEntry::DoRedraw
virtual void DoRedraw()
Redraw text listbox entry.
Definition: TGListBox.cxx:188
TGLineLBEntry::fLineWidth
UInt_t fLineWidth
line width
Definition: TGListBox.h:104
TGCanvas.h
TGLineLBEntry::operator=
TGLineLBEntry operator=(const TGLineLBEntry &)=delete
TGFrame::GetWhitePixel
static Pixel_t GetWhitePixel()
Get white pixel value.
Definition: TGFrame.cxx:709
TGFrameElement
Definition: TGLayout.h:105
TGLineLBEntry::DoRedraw
virtual void DoRedraw()
Redraw line style listbox entry.
Definition: TGListBox.cxx:370
TGIconLBEntry::GetDefaultSize
virtual TGDimension GetDefaultSize() const
std::cout << fWidth << "x" << fHeight << std::endl;
Definition: TGListBox.h:151
TGTextLBEntry::SetTitle
virtual void SetTitle(const char *text)
Definition: TGListBox.h:82
TGLBContainer::GetSelection
virtual Bool_t GetSelection(Int_t id)
Returns kTrue if entry id is selected.
Definition: TGListBox.cxx:742
TGListBox::ProcessMessage
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...
Definition: TGListBox.cxx:1551
TGListBox::DrawBorder
virtual void DrawBorder()
Draw borders of the list box widget.
Definition: TGListBox.cxx:1176
TGLBContainer::GetSelectedEntry
TGLBEntry * GetSelectedEntry() const
Definition: TGListBox.h:204
TGTextLBEntry::GetTitle
virtual const char * GetTitle() const
Returns title of object.
Definition: TGListBox.h:81
TGListBox::DoubleClicked
virtual void DoubleClicked(const char *txt)
Definition: TGListBox.h:299
TGListBox::GetItemVsize
UInt_t GetItemVsize() const
Definition: TGListBox.h:290
TGFont
Encapsulate fonts used in the GUI system.
Definition: TGFont.h:140
TGTextLBEntry::SavePrimitive
virtual void SavePrimitive(std::ostream &out, Option_t *="")
Save a list box entry widget as a C++ statement(s) on output stream out.
Definition: TGListBox.cxx:1692
TGListBox::AddEntry
virtual void AddEntry(TGString *s, Int_t id)
Add entry with specified string and id to listbox.
Definition: TGListBox.cxx:1203
TGListBox::GetViewPort
virtual TGViewPort * GetViewPort() const
Definition: TGListBox.h:268
TGViewPort::SetContainer
void SetContainer(TGFrame *f)
Add container frame to the viewport.
Definition: TGCanvas.cxx:153
TGCompositeFrame
The base class for composite widgets (menu bars, list boxes, etc.).
Definition: TGFrame.h:287
TGListBox::fVport
TGViewPort * fVport
listbox viewport (see TGCanvas.h)
Definition: TGListBox.h:231
TGString
TGString wraps a TString and adds some graphics routines like drawing, size of string on screen depen...
Definition: TGString.h:20
TGScrollBar.h
TGLBContainer::HandleMotion
virtual Bool_t HandleMotion(Event_t *event)
Handle mouse motion event in listbox container.
Definition: TGListBox.cxx:949
TGListBox::DoubleClicked
virtual void DoubleClicked(Int_t widgetId, Int_t id)
Emit DoubleClicked signal with list box id and entry id.
Definition: TGListBox.cxx:1622
TGLBContainer::~TGLBContainer
virtual ~TGLBContainer()
Delete the listbox container.
Definition: TGListBox.cxx:503
TGLBContainer::GetPos
virtual Int_t GetPos(Int_t id)
Returns the position in the list box of the entry id.
Definition: TGListBox.cxx:1094
TList
A doubly linked list.
Definition: TList.h:44
TQObject::Emit
void Emit(const char *signal, const T &arg)
Activate signal with single parameter.
Definition: TQObject.h:164
TGLineLBEntry::~TGLineLBEntry
virtual ~TGLineLBEntry()
Delete line style listbox entry.
Definition: TGListBox.cxx:270
int
TGTextLBEntry::GetText
const TGString * GetText() const
Definition: TGListBox.h:79
TGLBContainer::SetListBox
virtual void SetListBox(TGListBox *lb)
Definition: TGListBox.h:196