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