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