Logo ROOT   master
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-2000, 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 //////////////////////////////////////////////////////////////////////////
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 // //
33 //////////////////////////////////////////////////////////////////////////
34 
35 #include "TGFrame.h"
36 #include "TGCanvas.h"
37 #include "TGScrollBar.h"
38 #include "TList.h"
39 
40 class TGListBox;
41 
42 
43 //////////////////////////////////////////////////////////////////////////
44 // //
45 // TGLBEntry //
46 // //
47 // Basic listbox entries. Listbox entries are created by a TGListBox //
48 // and not by the user. //
49 // //
50 //////////////////////////////////////////////////////////////////////////
51 
52 class TGLBEntry : public TGFrame {
53 
54 protected:
55  Int_t fEntryId; // message id of listbox entry
56  Pixel_t fBkcolor; // entry background color
57  Bool_t fActive; // true if entry is active
58 
59  virtual void DoRedraw() { }
60 
61 public:
62  TGLBEntry(const TGWindow *p = 0, Int_t id = -1, UInt_t options = kHorizontalFrame,
63  Pixel_t back = GetWhitePixel());
64 
65  virtual void Activate(Bool_t a);
66  virtual void Toggle();
67  virtual void Update(TGLBEntry *) { } // this is needed on TGComboBoxes :(
68  Int_t EntryId() const { return fEntryId; }
69  Bool_t IsActive() const { return fActive; }
71 
72  ClassDef(TGLBEntry,0) // Basic listbox entry
73 };
74 
75 
76 //////////////////////////////////////////////////////////////////////////
77 // //
78 // TGTextLBEntry //
79 // //
80 // Text string listbox entries. //
81 // //
82 //////////////////////////////////////////////////////////////////////////
83 
84 class TGTextLBEntry : public TGLBEntry {
85 
86 protected:
87  TGString *fText; // entry text string
88  UInt_t fTWidth; // text width
89  UInt_t fTHeight; // text height
90  Bool_t fTextChanged; // true if text has been changed
91  GContext_t fNormGC; // text drawing graphics context
92  FontStruct_t fFontStruct; // font used to draw string
93 
94  virtual void DoRedraw();
95 
96  static const TGFont *fgDefaultFont;
97  static TGGC *fgDefaultGC;
98 
99 private:
100  TGTextLBEntry(const TGTextLBEntry &); // not implemented
101  TGTextLBEntry &operator=(const TGTextLBEntry &); // not implemented
102 
103 public:
105  static const TGGC &GetDefaultGC();
106 
107  TGTextLBEntry(const TGWindow *p = 0, TGString *s = 0, Int_t id = -1,
108  GContext_t norm = GetDefaultGC()(),
110  UInt_t options = kHorizontalFrame,
111  Pixel_t back = GetWhitePixel());
112  virtual ~TGTextLBEntry();
113 
114  virtual TGDimension GetDefaultSize() const { return TGDimension(fTWidth, fTHeight+1); }
115  const TGString *GetText() const { return fText; }
116  void SetText(TGString *new_text);
117  virtual const char *GetTitle() const { return fText->Data(); }
118  virtual void SetTitle(const char *text) { *fText = text; }
119 
120  virtual void DrawCopy(Handle_t id, Int_t x, Int_t y);
121  virtual void Update(TGLBEntry *e)
122  { SetText(new TGString(((TGTextLBEntry *)e)->GetText())); }
123 
124  GContext_t GetNormGC() const { return fNormGC; }
126 
127  virtual void SavePrimitive(std::ostream &out, Option_t * = "");
128 
129  ClassDef(TGTextLBEntry,0) // Text listbox entry
130 };
131 
132 
133 //////////////////////////////////////////////////////////////////////////
134 // //
135 // TGLineLBEntry //
136 // //
137 // Line style & width listbox entry. //
138 // Line example and width number //
139 // //
140 //////////////////////////////////////////////////////////////////////////
141 
142 class TGLineLBEntry : public TGTextLBEntry {
143 
144 private:
145  TGLineLBEntry(const TGLineLBEntry&); // Not implemented
146  TGLineLBEntry operator=(const TGLineLBEntry&); // Not implemented
147 
148 protected:
149  UInt_t fLineWidth; // line width
150  Style_t fLineStyle; // line style
151  UInt_t fLineLength; // line length
152  TGGC *fLineGC; // line graphics context
153 
154  virtual void DoRedraw();
155 
156 public:
157  TGLineLBEntry(const TGWindow *p = 0, Int_t id = -1, const char *str = 0,
158  UInt_t w = 0, Style_t s = 0,
159  UInt_t options = kHorizontalFrame,
160  Pixel_t back = GetWhitePixel());
161  virtual ~TGLineLBEntry();
162 
163  virtual TGDimension GetDefaultSize() const
164  { return TGDimension(fTWidth, fTHeight+1); }
165  virtual Int_t GetLineWidth() const { return fLineWidth; }
166  virtual void SetLineWidth(Int_t width);
167  Style_t GetLineStyle() const { return fLineStyle; }
168  virtual void SetLineStyle(Style_t style);
169  TGGC *GetLineGC() const { return fLineGC; }
170  virtual void Update(TGLBEntry *e);
171  virtual void DrawCopy(Handle_t id, Int_t x, Int_t y);
172 
173  ClassDef(TGLineLBEntry, 0) // Line width listbox entry
174 };
175 
176 //////////////////////////////////////////////////////////////////////////
177 // //
178 // TGIconLBEntry //
179 // //
180 // Icon + text listbox entry. //
181 // //
182 //////////////////////////////////////////////////////////////////////////
183 
184 class TGIconLBEntry : public TGTextLBEntry {
185 
186 private:
187  TGIconLBEntry(const TGIconLBEntry&); // Not implemented
188  TGIconLBEntry operator=(const TGIconLBEntry&); // Not implemented
189 
190 protected:
191  const TGPicture *fPicture; // icon
192 
193  virtual void DoRedraw();
194 
195 public:
196  TGIconLBEntry(const TGWindow *p = 0, Int_t id = -1, const char *str = 0,
197  const TGPicture *pic = 0,
198  UInt_t w = 0, Style_t s = 0,
199  UInt_t options = kHorizontalFrame,
200  Pixel_t back = GetWhitePixel());
201  virtual ~TGIconLBEntry();
202 
203  virtual TGDimension GetDefaultSize() const
204  { return TGDimension(fTWidth, fTHeight+1); }
205  const TGPicture *GetPicture() const { return fPicture; }
206  virtual void SetPicture(const TGPicture *pic = 0);
207 
208  virtual void Update(TGLBEntry *e);
209  virtual void DrawCopy(Handle_t id, Int_t x, Int_t y);
210 
211  ClassDef(TGIconLBEntry, 0) // Icon + text listbox entry
212 };
213 
214 //////////////////////////////////////////////////////////////////////////
215 // //
216 // TGLBContainer //
217 // //
218 // A Composite frame that contains a list of TGLBEnties. //
219 // A TGLBContainer is created by the TGListBox and not by the user. //
220 // //
221 //////////////////////////////////////////////////////////////////////////
222 
223 class TGLBContainer : public TGContainer {
224 
225 friend class TGListBox;
226 
227 private:
228  TGLBContainer(const TGLBContainer&); // Not implemented
229  TGLBContainer operator=(const TGLBContainer&); // Not implemented
230 
231 protected:
232  TGLBEntry *fLastActive; // last active listbox entry in single selection listbox
233  TGListBox *fListBox; // list box which contains this container
234  Bool_t fMultiSelect; // true if multi selection is switched on
235  Int_t fChangeStatus; // defines the changes (select or unselect) while the mouse
236  // moves over a multi selectable list box
237 
238  virtual void OnAutoScroll();
239  virtual void DoRedraw();
240 
241 public:
242  TGLBContainer(const TGWindow *p = 0, UInt_t w = 1, UInt_t h = 1,
243  UInt_t options = kSunkenFrame,
245  virtual ~TGLBContainer();
246 
247  virtual void AddEntry(TGLBEntry *lbe, TGLayoutHints *lhints);
248  virtual void AddEntrySort(TGLBEntry *lbe, TGLayoutHints *lhints);
249  virtual void InsertEntry(TGLBEntry *lbe, TGLayoutHints *lhints, Int_t afterID);
250  virtual void RemoveEntry(Int_t id);
251  virtual void RemoveEntries(Int_t from_ID, Int_t to_ID);
252  virtual void RemoveAll();
253 
254  virtual void ActivateItem(TGFrameElement *el);
255  virtual void Associate(const TGWindow *w) { fMsgWindow = w; }
256  virtual void SetListBox(TGListBox *lb) { fListBox = lb; }
257  TGListBox *GetListBox() const { return fListBox; }
258  virtual Bool_t HandleButton(Event_t *event);
259  virtual Bool_t HandleDoubleClick(Event_t *event);
260  virtual Bool_t HandleMotion(Event_t *event);
261  virtual Int_t GetSelected() const;
262  virtual Bool_t GetSelection(Int_t id);
263  virtual Int_t GetPos(Int_t id);
265  virtual void GetSelectedEntries(TList *selected);
266  virtual TGLBEntry *Select(Int_t id, Bool_t sel);
267  virtual TGLBEntry *Select(Int_t id);
268 
269  virtual TGVScrollBar *GetVScrollbar() const;
270  virtual void SetVsbPosition(Int_t newPos);
271  virtual void Layout();
272  virtual UInt_t GetDefaultWidth() const { return fWidth; }
273 
274  virtual void SetMultipleSelections(Bool_t multi);
275  virtual Bool_t GetMultipleSelections() const { return fMultiSelect; }
276 
277  ClassDef(TGLBContainer,0) // Listbox container
278 };
279 
280 
281 //////////////////////////////////////////////////////////////////////////
282 // //
283 // TGListBox //
284 // //
285 // A TGListBox widget. //
286 // //
287 //////////////////////////////////////////////////////////////////////////
288 
289 class TGListBox : public TGCompositeFrame, public TGWidget {
290 
291 private:
292  TGListBox(const TGListBox&); // Not implemented
293  TGListBox operator=(const TGListBox&); // Not implemented
294 
295 protected:
296  UInt_t fItemVsize; // maximum height of single entry
297  Bool_t fIntegralHeight; // true if height should be multiple of fItemVsize
298  TGLBContainer *fLbc; // listbox container
299  TGViewPort *fVport; // listbox viewport (see TGCanvas.h)
300  TGVScrollBar *fVScrollbar; // vertical scrollbar
301 
303 
304  virtual void InitListBox();
305 
306 public:
307  TGListBox(const TGWindow *p = 0, Int_t id = -1,
308  UInt_t options = kSunkenFrame | kDoubleBorder,
309  Pixel_t back = GetWhitePixel());
310  virtual ~TGListBox();
311 
312  virtual void AddEntry(TGString *s, Int_t id);
313  virtual void AddEntry(const char *s, Int_t id);
314  virtual void AddEntry(TGLBEntry *lbe, TGLayoutHints *lhints);
315  virtual void AddEntrySort(TGString *s, Int_t id);
316  virtual void AddEntrySort(const char *s, Int_t id);
317  virtual void AddEntrySort(TGLBEntry *lbe, TGLayoutHints *lhints);
318  virtual void InsertEntry(TGString *s, Int_t id, Int_t afterID);
319  virtual void InsertEntry(const char *s , Int_t id, Int_t afterID);
320  virtual void InsertEntry(TGLBEntry *lbe, TGLayoutHints *lhints, Int_t afterID);
321  virtual void NewEntry(const char *s = "Entry"); //*MENU*
322  virtual void RemoveEntry(Int_t id = -1); //*MENU*
323  virtual void RemoveAll(); //*MENU*
324  virtual void RemoveEntries(Int_t from_ID, Int_t to_ID);
325  virtual void ChangeBackground(Pixel_t back);
326  virtual void SetTopEntry(Int_t id = -1);
327  virtual void SetMultipleSelections(Bool_t multi = kTRUE)
328  { fLbc->SetMultipleSelections(multi); } //*TOGGLE* *GETTER=GetMultipleSelections
330  { return fLbc->GetMultipleSelections(); }
331  virtual Int_t GetNumberOfEntries() const
332  { return fLbc->GetList()->GetSize(); }
333  virtual TGLBEntry *GetEntry(Int_t id) const;
334  virtual TGLBEntry *FindEntry(const char *s) const;
335  virtual TGFrame *GetContainer() const { return fVport->GetContainer(); }
336  virtual TGViewPort *GetViewPort() const { return fVport; }
337  virtual TGScrollBar *GetScrollBar() const { return fVScrollbar; }
338  virtual TGVScrollBar *GetVScrollbar() const { return fVScrollbar; }
339 
340  virtual void DrawBorder();
341  virtual void Resize(UInt_t w, UInt_t h);
342  virtual void Resize(TGDimension size) { Resize(size.fWidth, size.fHeight); }
343  virtual void MoveResize(Int_t x, Int_t y, UInt_t w, UInt_t h);
344  virtual void Layout();
346  virtual void SortByName(Bool_t ascend = kTRUE); //*MENU*icon=bld_sortup.png*
347  virtual void IntegralHeight(Bool_t mode) { fIntegralHeight = mode; }
348  virtual TGDimension GetDefaultSize() const;
349 
350  virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2);
351 
352  virtual TGLBEntry *Select(Int_t id, Bool_t sel = kTRUE)
353  { return fLbc->Select(id, sel); }
354  virtual Int_t GetSelected() const;
355  virtual Bool_t GetSelection(Int_t id) { return fLbc->GetSelection(id); }
356  virtual TGLBEntry *GetSelectedEntry() const { return fLbc->GetSelectedEntry(); }
357  virtual void GetSelectedEntries(TList *selected);
358  UInt_t GetItemVsize() const { return fItemVsize; }
359 
360  virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
361 
362  virtual void Selected(Int_t widgetId, Int_t id); //*SIGNAL*
363  virtual void Selected(Int_t id) { Emit("Selected(Int_t)", id); } //*SIGNAL*
364  virtual void Selected(const char *txt) { Emit("Selected(char*)", txt); } //*SIGNAL
365  virtual void DoubleClicked(Int_t widgetId, Int_t id); //*SIGNAL*
366  virtual void DoubleClicked(Int_t id) { Emit("DoubleClicked(Int_t)", id); } //*SIGNAL*
367  virtual void DoubleClicked(const char *txt) { Emit("DoubleClicked(char*)", txt); } //*SIGNAL
368  virtual void SelectionChanged() { Emit("SelectionChanged()"); } //*SIGNAL*
369 
370  ClassDef(TGListBox,0) // Listbox widget
371 };
372 
373 #endif
Handle_t FontStruct_t
Definition: GuiTypes.h:38
virtual void DrawCopy(Handle_t id, Int_t x, Int_t y)
Draw text listbox entry on window/pixmap.
Definition: TGListBox.cxx:139
Pixel_t fBkcolor
Definition: TGListBox.h:56
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:1701
Style_t fLineStyle
Definition: TGListBox.h:150
virtual void Resize(UInt_t w, UInt_t h)
Resize the listbox widget.
Definition: TGListBox.cxx:1420
virtual TGDimension GetDefaultSize() const
std::cout << fWidth << "x" << fHeight << std::endl;
Definition: TGListBox.h:163
virtual void AddEntry(TGString *s, Int_t id)
Add entry with specified string and id to listbox.
Definition: TGListBox.cxx:1212
virtual void SetTopEntry(Int_t id=-1)
Scroll the entry with id to the top of the listbox.
Definition: TGListBox.cxx:1396
virtual TGViewPort * GetViewPort() const
Definition: TGListBox.h:336
short Style_t
Definition: RtypesCore.h:76
static TGGC * fgDefaultGC
Definition: TGListBox.h:97
virtual void Update(TGLBEntry *e)
Definition: TGListBox.h:121
virtual TGLBEntry * FindEntry(const char *s) const
Find entry by name.
Definition: TGListBox.cxx:1644
virtual void SelectionChanged()
Definition: TGListBox.h:368
virtual ~TGLineLBEntry()
Delete line style listbox entry.
Definition: TGListBox.cxx:252
virtual void DoubleClicked(Int_t widgetId, Int_t id)
Emit DoubleClicked signal with list box id and entry id.
Definition: TGListBox.cxx:1631
virtual TGFrame * GetContainer() const
Definition: TGListBox.h:335
TGLBEntry * fLastActive
Definition: TGListBox.h:232
virtual void DoubleClicked(const char *txt)
Definition: TGListBox.h:367
UInt_t GetItemVsize() const
Definition: TGListBox.h:358
virtual TGDimension GetDefaultSize() const
Return default size of listbox widget.
Definition: TGListBox.cxx:1445
const char Option_t
Definition: RtypesCore.h:62
UInt_t fLineWidth
Definition: TGListBox.h:149
TGTextLBEntry & operator=(const TGTextLBEntry &)
virtual void DrawCopy(Handle_t id, Int_t x, Int_t y)
Draw copy on window/pixmap.
Definition: TGListBox.cxx:334
TGLBContainer operator=(const TGLBContainer &)
const TGPicture * GetPicture() const
Definition: TGListBox.h:205
const TGPicture * fPicture
Definition: TGListBox.h:191
virtual Int_t GetLineWidth() const
Definition: TGListBox.h:165
static Pixel_t GetWhitePixel()
Get white pixel value.
Definition: TGFrame.cxx:692
virtual void Update(TGLBEntry *)
Definition: TGListBox.h:67
UInt_t fTHeight
Definition: TGListBox.h:89
Bool_t IsActive() const
Definition: TGListBox.h:69
virtual TGDimension GetDefaultSize() const
std::cout << fWidth << "x" << fHeight << std::endl;
Definition: TGListBox.h:203
TGLineLBEntry(const TGLineLBEntry &)
static const TGGC & GetDefaultGC()
Return default graphics context in use for a text listbox entry.
Definition: TGListBox.cxx:200
TGLBEntry * GetSelectedEntry() const
Definition: TGListBox.h:264
virtual void Associate(const TGWindow *w)
Definition: TGListBox.h:255
virtual void SetPicture(const TGPicture *pic=0)
Change the icon of listbox entry containing icon & text.
Definition: TGListBox.cxx:434
virtual void RemoveEntry(Int_t id)
Remove the entry with specified id from the listbox container.
Definition: TGListBox.cxx:610
virtual const char * GetTitle() const
Returns title of object.
Definition: TGListBox.h:117
Handle_t GContext_t
Definition: GuiTypes.h:37
Bool_t fActive
Definition: TGListBox.h:57
virtual TGDimension GetDefaultSize() const
std::cout << fWidth << "x" << fHeight << std::endl;
Definition: TGListBox.h:114
virtual void SetLayoutManager(TGLayoutManager *)
Set the layout manager for the composite frame.
Definition: TGListBox.h:345
TGTextLBEntry(const TGTextLBEntry &)
virtual void SetMultipleSelections(Bool_t multi=kTRUE)
Definition: TGListBox.h:327
#define f(i)
Definition: RSha256.hxx:104
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
TGListBox * GetListBox() const
Definition: TGListBox.h:257
TGGC * GetLineGC() const
Definition: TGListBox.h:169
GContext_t GetNormGC() const
Definition: TGListBox.h:124
virtual void Layout()
Layout container.
Definition: TGListBox.cxx:508
virtual void DoRedraw()
Redraw the frame.
Definition: TGListBox.h:59
virtual void Activate(Bool_t a)
Toggle active state of listbox entry.
Definition: TGListBox.cxx:79
UInt_t fItemVsize
Definition: TGListBox.h:296
virtual void DoRedraw()
redraw
Definition: TGListBox.cxx:517
virtual TGLBEntry * Select(Int_t id, Bool_t sel)
Select / deselect the entry with the specified id.
Definition: TGListBox.cxx:698
virtual void Toggle()
Toggle active state of listbox entry.
Definition: TGListBox.cxx:89
const TGWindow * fMsgWindow
Definition: TGCanvas.h:52
virtual void DrawCopy(Handle_t id, Int_t x, Int_t y)
Draw copy on window/pixmap.
Definition: TGListBox.cxx:413
TGListBox operator=(const TGListBox &)
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:1362
TGIconLBEntry operator=(const TGIconLBEntry &)
virtual TGVScrollBar * GetVScrollbar() const
Definition: TGListBox.h:338
Int_t fEntryId
Definition: TGListBox.h:55
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:1287
virtual void MoveResize(Int_t x, Int_t y, UInt_t w, UInt_t h)
Move and resize the listbox widget.
Definition: TGListBox.cxx:1433
TGLineLBEntry operator=(const TGLineLBEntry &)
virtual void SetTitle(const char *text)
Definition: TGListBox.h:118
Double_t x[n]
Definition: legend1.C:17
virtual ~TGTextLBEntry()
Delete text listbox entry.
Definition: TGListBox.cxx:131
UInt_t fTWidth
Definition: TGListBox.h:88
TGListBox(const TGListBox &)
virtual ~TGListBox()
Delete a listbox widget.
Definition: TGListBox.cxx:1140
#define ClassDef(name, id)
Definition: Rtypes.h:326
ULong_t Pixel_t
Definition: GuiTypes.h:39
static Pixel_t GetDefaultFrameBackground()
Get default frame background.
Definition: TGFrame.cxx:666
virtual Bool_t GetMultipleSelections() const
Definition: TGListBox.h:329
FontStruct_t GetFontStruct() const
Definition: TGListBox.h:125
virtual ~TGIconLBEntry()
Delete icon & text listbox entry.
Definition: TGListBox.cxx:397
virtual void Selected(Int_t widgetId, Int_t id)
Emit Selected signal with list box id and entry id.
Definition: TGListBox.cxx:1618
virtual void InitListBox()
Initiate the internal classes of a list box.
Definition: TGListBox.cxx:1152
void SetContainer(TGFrame *f)
Definition: TGListBox.h:302
TGLBContainer(const TGLBContainer &)
virtual void SetBackgroundColor(Pixel_t back)
Set background color (override from TGWindow base class).
Definition: TGFrame.cxx:295
virtual TList * GetList() const
Definition: TGFrame.h:347
virtual void GetSelectedEntries(TList *selected)
Adds all selected entries (TGLBEntry) of the list box into the list selected.
Definition: TGListBox.cxx:757
static constexpr double s
virtual void Resize(TGDimension size)
Resize the frame.
Definition: TGListBox.h:342
TGFrame * GetContainer() const
Definition: TGCanvas.h:183
virtual Int_t GetSelected() const
Returns id of selected entry.
Definition: TGListBox.cxx:729
virtual void SortByName(Bool_t ascend=kTRUE)
Sort entries by name.
Definition: TGListBox.cxx:1514
virtual void ActivateItem(TGFrameElement *el)
Activate item.
Definition: TGListBox.cxx:1079
UInt_t fHeight
Definition: TGDimension.h:30
virtual Bool_t HandleMotion(Event_t *event)
Handle mouse motion event in listbox container.
Definition: TGListBox.cxx:945
virtual TGLBEntry * GetEntry(Int_t id) const
Returns list box entry with specified id.
Definition: TGListBox.cxx:1381
virtual TGLBEntry * Select(Int_t id, Bool_t sel=kTRUE)
Definition: TGListBox.h:352
virtual void SetVsbPosition(Int_t newPos)
Set new vertical scroll bar position.
Definition: TGListBox.cxx:802
virtual Int_t GetPos(Int_t id)
Returns the position in the list box of the entry id.
Definition: TGListBox.cxx:1090
TGLBEntry(const TGWindow *p=0, Int_t id=-1, UInt_t options=kHorizontalFrame, Pixel_t back=GetWhitePixel())
Base class entry constructor.
Definition: TGListBox.cxx:65
virtual TGLBEntry * GetSelectedEntry() const
Definition: TGListBox.h:356
A doubly linked list.
Definition: TList.h:44
virtual void AddEntry(TGLBEntry *lbe, TGLayoutHints *lhints)
Add listbox entry with hints to container.
Definition: TGListBox.cxx:526
virtual void RemoveAll()
Remove all entries.
Definition: TGListBox.cxx:1353
UInt_t fWidth
Definition: TGDimension.h:29
virtual void SetListBox(TGListBox *lb)
Definition: TGListBox.h:256
Bool_t fTextChanged
Definition: TGListBox.h:90
virtual void SetLineWidth(Int_t width)
Set or change line witdh in an entry.
Definition: TGListBox.cxx:325
TGIconLBEntry(const TGIconLBEntry &)
virtual Bool_t HandleDoubleClick(Event_t *event)
Handle double click mouse event in the listbox container.
Definition: TGListBox.cxx:927
virtual Bool_t GetSelection(Int_t id)
Returns kTrue if entry id is selected.
Definition: TGListBox.cxx:738
virtual void GetSelectedEntries(TList *selected)
Adds all selected entries (TGLBEntry) of the list box into the list selected.
Definition: TGListBox.cxx:1534
void SetContainer(TGFrame *f)
Add container frame to the viewport.
Definition: TGCanvas.cxx:149
virtual void DoRedraw()
Redraw line style listbox entry.
Definition: TGListBox.cxx:352
auto * a
Definition: textangle.C:12
Int_t EntryId() const
Definition: TGListBox.h:68
virtual void AddEntrySort(TGLBEntry *lbe, TGLayoutHints *lhints)
Insert listbox entry before the list box entry with a higher id.
Definition: TGListBox.cxx:577
TGLBContainer * fLbc
Definition: TGListBox.h:298
virtual void AddEntrySort(TGString *s, Int_t id)
Add entry with specified string and id to listbox sorted by increasing id.
Definition: TGListBox.cxx:1249
Int_t fChangeStatus
Definition: TGListBox.h:235
unsigned int UInt_t
Definition: RtypesCore.h:42
Bool_t fMultiSelect
Definition: TGListBox.h:234
virtual void Update(TGLBEntry *e)
Update line style listbox entry.
Definition: TGListBox.cxx:260
virtual void InsertEntry(TGLBEntry *lbe, TGLayoutHints *lhints, Int_t afterID)
Insert listbox entry after specified entry with id afterID.
Definition: TGListBox.cxx:541
virtual ~TGLBContainer()
Delete the listbox container.
Definition: TGListBox.cxx:500
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:1560
void SetText(TGString *new_text)
Set or change text in text entry.
Definition: TGListBox.cxx:171
#define h(i)
Definition: RSha256.hxx:106
UInt_t fWidth
Definition: TGFrame.h:112
virtual Int_t GetNumberOfEntries() const
Definition: TGListBox.h:331
TGString * fText
Definition: TGListBox.h:87
include TDocParser_001 C image html pict1_TDocParser_001 png width
Definition: TDocParser.cxx:120
virtual void DrawBorder()
Draw borders of the list box widget.
Definition: TGListBox.cxx:1185
FontStruct_t fFontStruct
Definition: TGListBox.h:92
long Long_t
Definition: RtypesCore.h:50
GContext_t fNormGC
Definition: TGListBox.h:91
TGListBox * fListBox
Definition: TGListBox.h:233
virtual Bool_t GetSelection(Int_t id)
Definition: TGListBox.h:355
const TGString * GetText() const
Definition: TGListBox.h:115
TGGC * fLineGC
Definition: TGListBox.h:152
virtual void SetLineStyle(Style_t style)
Set the line style corresponding to the TPad line styles.
Definition: TGListBox.cxx:272
TText * text
virtual void Selected(Int_t id)
Definition: TGListBox.h:363
Bool_t fIntegralHeight
Definition: TGListBox.h:297
Definition: TGFont.h:149
TCanvas * style()
Definition: style.C:1
Double_t y[n]
Definition: legend1.C:17
virtual TGVScrollBar * GetVScrollbar() const
Return a pointer to vertical scroll bar.
Definition: TGListBox.cxx:794
you should not use this method at all Int_t Int_t Double_t Double_t Double_t e
Definition: TRolke.cxx:630
virtual void DoRedraw()
Redraw icon & text listbox entry.
Definition: TGListBox.cxx:426
virtual void NewEntry(const char *s="Entry")
method used to add entry via context menu
Definition: TGListBox.cxx:1309
TGViewPort * fVport
Definition: TGListBox.h:299
static const TGFont * fgDefaultFont
Definition: TGListBox.h:96
TGVScrollBar * fVScrollbar
Definition: TGListBox.h:300
virtual TGScrollBar * GetScrollBar() const
Definition: TGListBox.h:337
virtual void Layout()
Layout the listbox components.
Definition: TGListBox.cxx:1461
virtual UInt_t GetDefaultWidth() const
Definition: TGListBox.h:272
virtual void SetBackgroundColor(Pixel_t col)
Set background color (override from TGWindow base class).
Definition: TGListBox.h:70
virtual void Update(TGLBEntry *e)
Update icon & text listbox entry.
Definition: TGListBox.cxx:405
virtual void SetMultipleSelections(Bool_t multi)
Enables and disables multiple selections of entries.
Definition: TGListBox.cxx:774
virtual Int_t GetSelected() const
Return id of selected listbox item.
Definition: TGListBox.cxx:1524
UInt_t fLineLength
Definition: TGListBox.h:151
virtual void DoubleClicked(Int_t id)
Definition: TGListBox.h:366
virtual void RemoveEntries(Int_t from_ID, Int_t to_ID)
Remove entries from from_ID to to_ID (including).
Definition: TGListBox.cxx:638
virtual Bool_t HandleButton(Event_t *event)
Handle mouse button event in the listbox container.
Definition: TGListBox.cxx:814
virtual Bool_t GetMultipleSelections() const
Definition: TGListBox.h:275
virtual void IntegralHeight(Bool_t mode)
Definition: TGListBox.h:347
void Emit(const char *signal, const T &arg)
Activate signal with single parameter.
Definition: TQObject.h:164
virtual void Selected(const char *txt)
Definition: TGListBox.h:364
virtual void ChangeBackground(Pixel_t back)
Change background to all entries.
Definition: TGListBox.cxx:1542
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
Definition: TCollection.h:182
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:1659
Style_t GetLineStyle() const
Definition: TGListBox.h:167
const Bool_t kTRUE
Definition: RtypesCore.h:87
static FontStruct_t GetDefaultFontStruct()
Return default font structure in use for a text listbox entry.
Definition: TGListBox.cxx:190
virtual void OnAutoScroll()
Autoscroll while close to & beyond The Wall.
Definition: TGListBox.cxx:1025
Definition: TGGC.h:31
virtual void DoRedraw()
Redraw text listbox entry.
Definition: TGListBox.cxx:163
virtual void RemoveAll()
Remove all entries in this container.
Definition: TGListBox.cxx:664
virtual void RemoveEntry(Int_t id=-1)
remove entry with id.
Definition: TGListBox.cxx:1327
const char * Data() const
Definition: TString.h:364
ULong_t Handle_t
Definition: GuiTypes.h:25