Logo ROOT   6.14/05
Reference Guide
TGFSComboBox.cxx
Go to the documentation of this file.
1 // @(#)root/gui:$Id$
2 // Author: Fons Rademakers 19/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 
13  This source is based on Xclass95, a Win95-looking GUI toolkit.
14  Copyright (C) 1996, 1997 David Barth, Ricky Ralston, Hector Peraza.
15 
16  Xclass95 is free software; you can redistribute it and/or
17  modify it under the terms of the GNU Library General Public
18  License as published by the Free Software Foundation; either
19  version 2 of the License, or (at your option) any later version.
20 
21 **************************************************************************/
22 
23 //////////////////////////////////////////////////////////////////////////
24 // //
25 // TGFSComboBox, TGTreeLBEntry //
26 // //
27 // This is a combo box that is used in the File Selection dialog box. //
28 // It will allow the file path selection. //
29 // //
30 //////////////////////////////////////////////////////////////////////////
31 
32 #include "RConfigure.h"
33 
34 #include "TGFSComboBox.h"
35 #include "TGResourcePool.h"
36 #include "TGPicture.h"
37 #include "TSystem.h"
38 #include "Riostream.h"
39 #include <stdlib.h>
40 
43 
44 //--- this is temp here...
45 
46 struct Lbc_t {
47  const char *fName; // root prefix name
48  const char *fPath; // path
49  const char *fPixmap; // picture file
50  Int_t fId; // widget id
51  Int_t fIndent; // identification level
52  Int_t fFlags; // flag
53 };
54 
55 static struct Lbc_t gLbc[32];
56 
59 
60 ////////////////////////////////////////////////////////////////////////////////
61 /// Create a tree (i.e. entry can be indented) listbox entry.
62 /// The strings text and path are adopted by the entry.
63 
65  const TGPicture *pic, Int_t id, TGString *path,
66  GContext_t norm, FontStruct_t font, UInt_t options,
67  ULong_t back) :
68  TGLBEntry(p, id, options, back)
69 {
70  if (text && !pic)
71  Error("TGTreeLBEntry", "icon not found for entry %s", text->GetString());
72 
73  fPic = pic;
74  fSelPic = 0;
75  fTWidth = 0;
76  fText = text;
77  fPath = path;
78 
79  fNormGC = norm;
80  fFontStruct = font;
81 
82  fActive = kFALSE;
83 
84  int max_ascent, max_descent;
85  if (fText)
87  gVirtualX->GetFontProperties(fFontStruct, max_ascent, max_descent);
88  fTHeight = max_ascent + max_descent;
89  SetWindowName();
90 }
91 
92 ////////////////////////////////////////////////////////////////////////////////
93 /// Delete tree listbox entry.
94 
96 {
97  delete fText;
98  delete fPath;
99  delete fSelPic;
100 }
101 
102 ////////////////////////////////////////////////////////////////////////////////
103 /// Make entry active (highlight picture).
104 
106 {
107  if (fActive == a) return;
108  fActive = a;
109 
110  if (fActive) {
112  } else {
113  if (fSelPic) delete fSelPic;
114  fSelPic = 0;
115  }
116  DoRedraw();
117 }
118 
119 ////////////////////////////////////////////////////////////////////////////////
120 /// Redraw the tree listbox entry on pixmap/window.
121 
123 {
124  int ix, iy, lx, ly;
125 
126  ix = x;
127  iy = y + ((fHeight - fPic->GetHeight()) >> 1);
128  lx = x + (int)(fPic->GetWidth() + 4);
129  ly = y + (int)((fHeight - (fTHeight+1)) >> 1);
130 
131  if (fActive) {
132  if (fSelPic) fSelPic->Draw(id, fNormGC, ix, iy);
134  gVirtualX->FillRectangle(id, fNormGC, lx-2, ly, fWidth-(lx-x), fTHeight+1);
136  } else {
137  fPic->Draw(id, fNormGC, ix, iy);
138  gVirtualX->SetForeground(fNormGC, fgWhitePixel);
139  gVirtualX->FillRectangle(id, fNormGC, lx-2, ly, fWidth-(lx-x), fTHeight+1);
140  gVirtualX->SetForeground(fNormGC, fgBlackPixel);
141  }
142 
143  int max_ascent, max_descent;
144  gVirtualX->GetFontProperties(fFontStruct, max_ascent, max_descent);
145 
146  fText->Draw(id, fNormGC, lx, ly + max_ascent);
147 }
148 
149 ////////////////////////////////////////////////////////////////////////////////
150 /// Redraw the tree listbox entry.
151 
153 {
154  DrawCopy(fId, 0, 0);
155 }
156 
157 ////////////////////////////////////////////////////////////////////////////////
158 /// Return default size of tree listbox entry.
159 
161 {
162  TGDimension isize(fPic->GetWidth(), fPic->GetHeight());
163  TGDimension lsize(fTWidth, fTHeight+1);
164 
165  return TGDimension(isize.fWidth + lsize.fWidth + 4,
166  TMath::Max(isize.fHeight, lsize.fHeight) + 2);
167 }
168 
169 ////////////////////////////////////////////////////////////////////////////////
170 /// Update text and picture of a listbox entry.
171 
173 {
174  TGTreeLBEntry *te = (TGTreeLBEntry *) e;
175 
176  if (fText) delete fText;
177  fText = new TGString(te->GetText());
178  fPic = te->GetPicture();
180  gVirtualX->ClearWindow(fId);
181  fClient->NeedRedraw(this);
182 }
183 
184 ////////////////////////////////////////////////////////////////////////////////
185 /// Return default font structure.
186 
188 {
189  if (!fgDefaultFont)
190  fgDefaultFont = gClient->GetResourcePool()->GetDefaultFont();
191  return fgDefaultFont->GetFontStruct();
192 }
193 
194 ////////////////////////////////////////////////////////////////////////////////
195 /// Return default graphics context.
196 
198 {
199  if (!fgDefaultGC)
200  fgDefaultGC = new TGGC(*gClient->GetResourcePool()->GetFrameGC());
201  return *fgDefaultGC;
202 }
203 
204 
205 ////////////////////////////////////////////////////////////////////////////////
206 /// Create a file system combobox showing system directories.
207 
208 TGFSComboBox::TGFSComboBox(const TGWindow *parent, Int_t id, UInt_t options,
209  ULong_t back) :
210  TGComboBox(parent, id, options | kOwnBackground, back)
211 {
212  int i, indent;
213  const TGPicture *pic;
214  char *p;
215 
216  SetTopEntry(new TGTreeLBEntry(this, new TGString("Current dir"),
217  fClient->GetPicture("folder_t.xpm"), 0),
218  new TGLayoutHints(kLHintsExpandX | kLHintsExpandY, 4, 0, 0, 0));
219 
222 
223  //--- first check for the existence of some directories...
224 
225  const char *homeDir = gSystem->HomeDirectory();
226 #ifndef ROOTPREFIX
227  const char *rootSys = gSystem->Getenv("ROOTSYS");
228 #else
229  // const char *rootSys = ROOTPREFIX;
230 #endif
231 
232  Int_t idx = 0;
233  TList *volumes = gSystem->GetVolumes("all");
234  TList *curvol = gSystem->GetVolumes("cur");
235  TString infos;
236  const char *curdrive = "";
237  if (volumes && curvol) {
238  TNamed *named = (TNamed *)curvol->At(0);
239  if (named) {
240  curdrive = named->GetName();
241  infos = named->GetTitle();
242  gLbc[idx].fName = StrDup(infos.Data());
243  gLbc[idx].fPath = StrDup(Form("%s\\", curdrive));
244  if (infos.Contains("Removable"))
245  gLbc[idx].fPixmap = StrDup("fdisk_t.xpm");
246  else if (infos.Contains("Local"))
247  gLbc[idx].fPixmap = StrDup("hdisk_t.xpm");
248  else if (infos.Contains("CD"))
249  gLbc[idx].fPixmap = StrDup("cdrom_t.xpm");
250  else if (infos.Contains("Network"))
251  gLbc[idx].fPixmap = StrDup("netdisk_t.xpm");
252  else
253  gLbc[idx].fPixmap = StrDup("hdisk_t.xpm");
254  gLbc[idx].fId = 1000;
255  gLbc[idx].fIndent = 0;
256  gLbc[idx].fFlags = 0;
257  ++idx;
258  }
259  else {
260  gLbc[idx].fName = StrDup("Root");
261  gLbc[idx].fPath = StrDup("/");
262  gLbc[idx].fPixmap = StrDup("hdisk_t.xpm");
263  gLbc[idx].fId = 1000;
264  gLbc[idx].fIndent = 1;
265  gLbc[idx].fFlags = 0;
266  ++idx;
267  }
268  }
269  else {
270  gLbc[idx].fName = StrDup("Root");
271  gLbc[idx].fPath = StrDup("/");
272  gLbc[idx].fPixmap = StrDup("hdisk_t.xpm");
273  gLbc[idx].fId = 1000;
274  gLbc[idx].fIndent = 1;
275  gLbc[idx].fFlags = 0;
276  ++idx;
277  gLbc[idx].fName = StrDup("Floppy");
278  gLbc[idx].fPath = StrDup("/floppy");
279  gLbc[idx].fPixmap = StrDup("fdisk_t.xpm");
280  gLbc[idx].fId = 2000;
281  gLbc[idx].fIndent = 1;
282  gLbc[idx].fFlags = 0;
283  ++idx;
284  gLbc[idx].fName = StrDup("CD-ROM");
285  gLbc[idx].fPath = StrDup("/cdrom");
286  gLbc[idx].fPixmap = StrDup("cdrom_t.xpm");
287  gLbc[idx].fId = 3000;
288  gLbc[idx].fIndent = 1;
289  gLbc[idx].fFlags = 0;
290  ++idx;
291  }
292  gLbc[idx].fName = StrDup("Home");
293  gLbc[idx].fPath = StrDup("$HOME");
294  gLbc[idx].fPixmap = StrDup("home_t.xpm");
295  gLbc[idx].fId = (idx+1) * 1000;
296  gLbc[idx].fIndent = 1;
297  gLbc[idx].fFlags = 0;
298  ++idx;
299 #ifndef ROOTPREFIX
300  gLbc[idx].fName = StrDup("RootSys");
301  gLbc[idx].fPath = StrDup("$ROOTSYS");
302 #else
303  gLbc[idx].fName = StrDup(ROOTPREFIX);
304  gLbc[idx].fPath = StrDup(ROOTPREFIX);
305 #endif
306  gLbc[idx].fPixmap = StrDup("root_t.xpm");
307  gLbc[idx].fId = (idx+1) * 1000;
308  gLbc[idx].fIndent = 1;
309  gLbc[idx].fFlags = 0;
310  ++idx;
311 
312  if (volumes && curvol) {
313  TIter next(volumes);
314  TNamed *drive;
315  while ((drive = (TNamed *)next())) {
316  if (!strcmp(drive->GetName(), curdrive))
317  continue;
318  infos = drive->GetTitle();
319  gLbc[idx].fName = StrDup(drive->GetTitle());
320  gLbc[idx].fPath = StrDup(Form("%s\\", drive->GetName()));
321  if (infos.Contains("Removable"))
322  gLbc[idx].fPixmap = StrDup("fdisk_t.xpm");
323  else if (infos.Contains("Local"))
324  gLbc[idx].fPixmap = StrDup("hdisk_t.xpm");
325  else if (infos.Contains("CD"))
326  gLbc[idx].fPixmap = StrDup("cdrom_t.xpm");
327  else if (infos.Contains("Network"))
328  gLbc[idx].fPixmap = StrDup("netdisk_t.xpm");
329  else
330  gLbc[idx].fPixmap = StrDup("hdisk_t.xpm");
331  gLbc[idx].fId = (idx+1) * 1000;
332  gLbc[idx].fIndent = 0;
333  gLbc[idx].fFlags = 0;
334  ++idx;
335  }
336  delete volumes;
337  delete curvol;
338  }
339  gLbc[idx].fName = 0;
340  gLbc[idx].fPath = 0;
341  gLbc[idx].fPixmap = 0;
342  gLbc[idx].fId = (idx+1) * 1000;
343  gLbc[idx].fIndent = 0;
344  gLbc[idx].fFlags = 0;
345 
346  for (i = 0; gLbc[i].fPath != 0; ++i) {
347  if (strstr(gLbc[i].fPath, "$HOME") != 0) {
348  if (homeDir) {
349  int hlen = strlen(homeDir);
350  int blen = hlen + strlen(gLbc[i].fPath) - 3;
351  p = new char[blen];
352  strlcpy(p, homeDir, blen);
353  strlcat(p, &gLbc[i].fPath[5], blen-strlen(&gLbc[i].fPath[5]));
354  delete [] gLbc[i].fPath;
355  gLbc[i].fPath = p;
356  } else {
357  gLbc[i].fFlags = 0;
358  }
359  }
360 #ifndef ROOTPREFIX
361  // Below should _only_ be called if the prefix isn't set at build
362  // time. The code below expands the occurance of `$ROOTSYS' in
363  // the table above. However, in the case of prefix being set at
364  // build time, we do not need to expand the prefix, as it is
365  // already known, so the entries in the table above are actually
366  // fully expanded.
367  if (strstr(gLbc[i].fPath, "$ROOTSYS") != 0) {
368  // Get the size of the prefix template
369  const int plen = 8;
370  if (rootSys) {
371  int hlen = strlen(rootSys);
372  // Allocate enough memory to hold prefix (hlen), and
373  // what's in the path (strlen(gLbc[i].fPath)) minus the
374  // prefix template size, and one character for terminating
375  // null.
376  int blen = hlen + strlen(gLbc[i].fPath) - plen + 1;
377  p = new char[blen];
378  strlcpy(p, rootSys, blen);
379  strlcat(p, &(gLbc[i].fPath[plen]), blen-strlen(&gLbc[i].fPath[plen]));
380  // Figure out where to put the terminating NULL
381  int npos = hlen + strlen(&(gLbc[i].fPath[plen]));
382  p[npos] = '\0';
383  delete [] gLbc[i].fPath;
384  gLbc[i].fPath = p;
385  } else {
386  gLbc[i].fFlags = 0;
387  }
388  }
389 #endif
390  if (gSystem->AccessPathName(gLbc[i].fPath, kFileExists) == 0)
391  gLbc[i].fFlags = 1;
392  }
393 
394  //--- then init the contents...
395 
396  for (i = 0; gLbc[i].fName != 0; ++i) {
397  if (gLbc[i].fFlags) {
398  indent = 4 + (gLbc[i].fIndent * 10);
399  pic = fClient->GetPicture(gLbc[i].fPixmap);
400  if (!pic) Error("TGFSComboBox", "pixmap not found: %s", gLbc[i].fPixmap);
402  new TGString(gLbc[i].fName), pic, gLbc[i].fId,
403  new TGString(gLbc[i].fPath)),
404  new TGLayoutHints(kLHintsExpandX | kLHintsTop, indent, 0, 0, 0));
405  }
406  }
407  SetWindowName();
408 }
409 
410 ////////////////////////////////////////////////////////////////////////////////
411 /// Update file system combo box.
412 
413 void TGFSComboBox::Update(const char *path)
414 {
415  char dirname[1024], mpath[1024];
416  const char *tailpath = 0;
417  int i, indent_lvl = 0, afterID = -1, sel = -1;
418 
419  if (!path) return;
420 
421  for (i = 0; gLbc[i].fPath != 0; ++i)
422  RemoveEntries(gLbc[i].fId+1, gLbc[i+1].fId-1);
423 
424  int len = 0;
425  for (i = 0; gLbc[i].fName != 0; ++i) {
426  if (gLbc[i].fFlags) {
427  int slen = strlen(gLbc[i].fPath);
428  if (strncmp(path, gLbc[i].fPath, slen) == 0) {
429  if (slen > len) {
430  sel = afterID = gLbc[i].fId;
431  indent_lvl = gLbc[i].fIndent + 1;
432  if ((len > 0) && ((path[slen] == '\\') || (path[slen] == '/') ||
433  (path[slen] == 0)))
434  tailpath = path + slen;
435  strlcpy(mpath, gLbc[i].fPath, 1024);
436  len = slen;
437  }
438  }
439  }
440  }
441 
442  if (tailpath && *tailpath) {
443  if ((*tailpath == '/') || (*tailpath == '\\')) ++tailpath;
444  if (*tailpath)
445  while (1) {
446  const char *picname;
447  const char *semi = strchr(tailpath, '/');
448  if (semi == 0) semi = strchr(tailpath, '\\');
449  if (semi == 0) {
450  strlcpy(dirname, tailpath, 1024);
451  picname = "ofolder_t.xpm";
452  } else {
453  strlcpy(dirname, tailpath, (semi-tailpath)+1);
454  picname = "folder_t.xpm";
455  }
456  if ((mpath[strlen(mpath)-1] != '/') &&
457  (mpath[strlen(mpath)-1] != '\\')) {
458  strlcat(mpath, "/", 1024-strlen(mpath));
459  }
460  strlcat(mpath, dirname, 1024-strlen(mpath));
461  int indent = 4 + (indent_lvl * 10);
462  const TGPicture *pic = fClient->GetPicture(picname);
463  if (!pic) Error("Update", "pixmap not found: %s", picname);
465  new TGString(dirname), pic, afterID+1,
466  new TGString(mpath)),
468  indent, 0, 0, 0),
469  afterID);
470  sel = ++afterID;
471  ++indent_lvl;
472  if (semi == 0) break;
473  tailpath = ++semi;
474  }
475  }
476  if (sel > 0) Select(sel);
477 }
478 
479 ////////////////////////////////////////////////////////////////////////////////
480 /// Save a file system combo box as a C++ statement(s) on output stream out.
481 
482 void TGFSComboBox::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
483 {
484  if (fBackground != GetWhitePixel()) SaveUserColor(out, option);
485 
486  out << std::endl << " // file system combo box" << std::endl;
487  out << " TGFSComboBox *";
488  out << GetName() << " = new TGFSComboBox(" << fParent->GetName()
489  << "," << fWidgetId;
490  if (fBackground == GetWhitePixel()) {
492  out <<");" << std::endl;
493  } else {
494  out << "," << GetOptionString() <<");" << std::endl;
495  }
496  } else {
497  out << "," << GetOptionString() << ",ucolor);" << std::endl;
498  }
499  if (option && strstr(option, "keep_names"))
500  out << " " << GetName() << "->SetName(\"" << GetName() << "\");" << std::endl;
501 
502  out << " " << GetName() << "->Resize(" << GetWidth() << ","
503  << GetHeight() << ");" << std::endl;
504  out << " " << GetName() << "->Select(" << GetSelected() << ");" << std::endl;
505 
506 }
virtual const char * GetName() const
Returns name of object.
Definition: TNamed.h:47
virtual Bool_t AccessPathName(const char *path, EAccessMode mode=kFileExists)
Returns FALSE if one can access a file using the specified access mode.
Definition: TSystem.cxx:1276
Handle_t FontStruct_t
Definition: GuiTypes.h:38
const TGWindow * fParent
Definition: TGWindow.h:37
UInt_t fTHeight
Definition: TGFSComboBox.h:41
virtual UInt_t GetOptions() const
Definition: TGFrame.h:244
static TGGC * fgDefaultGC
Definition: TGFSComboBox.h:49
virtual TGFrame * GetContainer() const
Definition: TGListBox.h:335
void AddInput(UInt_t emask)
Add events specified in the emask to the events the frame should handle.
Definition: TGFrame.cxx:321
const char Option_t
Definition: RtypesCore.h:62
UInt_t GetHeight() const
Definition: TGFrame.h:272
static Pixel_t GetWhitePixel()
Get white pixel value.
Definition: TGFrame.cxx:691
virtual const char * HomeDirectory(const char *userName=0)
Return the user&#39;s home directory.
Definition: TSystem.cxx:885
const TGResourcePool * GetResourcePool() const
Definition: TGClient.h:133
static const TGFont * fgDefaultFont
Definition: TGFSComboBox.h:48
Handle_t GContext_t
Definition: GuiTypes.h:37
Basic string class.
Definition: TString.h:131
Pixel_t fBackground
Definition: TGFrame.h:142
#define gClient
Definition: TGClient.h:166
static Pixel_t fgWhitePixel
Definition: TGFrame.h:150
static FontStruct_t GetDefaultFontStruct()
Return default font structure.
virtual void InsertEntry(TGString *s, Int_t id, Int_t afterID)
Definition: TGComboBox.h:112
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
static Pixel_t fgDefaultSelectedBackground
Definition: TGFrame.h:149
UInt_t GetWidth() const
Definition: TGFrame.h:271
virtual void DrawCopy(Handle_t id, Int_t x, Int_t y)
Redraw the tree listbox entry on pixmap/window.
Int_t fWidgetId
Definition: TGWidget.h:58
UInt_t GetHeight() const
Definition: TGPicture.h:64
const TGString * GetText() const
Definition: TGFSComboBox.h:61
virtual ~TGTreeLBEntry()
Delete tree listbox entry.
void Draw(Option_t *="")
Default Draw method for all objects.
Definition: TGPicture.h:57
const Mask_t kPointerMotionMask
Definition: GuiTypes.h:162
virtual TGDimension GetDefaultSize() const
Return default size of tree listbox entry.
const TGPicture * GetPicture() const
Definition: TGFSComboBox.h:62
Double_t x[n]
Definition: legend1.C:17
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:29
TGFSComboBox(const TGWindow *p=0, Int_t id=-1, UInt_t options=kHorizontalFrame|kSunkenFrame|kDoubleBorder, Pixel_t back=GetWhitePixel())
Create a file system combobox showing system directories.
Pixel_t GetSelectedFgndColor() const
virtual void Select(Int_t id, Bool_t emit=kTRUE)
Make the selected item visible in the combo box window and emit signals according to the second param...
Definition: TGComboBox.cxx:443
virtual const char * Getenv(const char *env)
Get environment variable.
Definition: TSystem.cxx:1638
static Pixel_t fgBlackPixel
Definition: TGFrame.h:151
virtual void SetTopEntry(TGLBEntry *e, TGLayoutHints *lh)
Set a new combo box value (normally update of text string in fSelEntry is done via fSelEntry::Update(...
Definition: TGComboBox.cxx:425
UInt_t fTWidth
Definition: TGFSComboBox.h:40
virtual void Activate(Bool_t a)
Make entry active (highlight picture).
A doubly linked list.
Definition: TList.h:44
const Mask_t kButtonPressMask
Definition: GuiTypes.h:160
R__EXTERN TSystem * gSystem
Definition: TSystem.h:540
auto * a
Definition: textangle.C:12
virtual const char * GetName() const
Return unique name, used in SavePrimitive methods.
Definition: TGWindow.cxx:221
static struct Lbc_t gLbc[32]
TGListBox * fListBox
Definition: TGComboBox.h:78
unsigned int UInt_t
Definition: RtypesCore.h:42
TGString * fText
Definition: TGFSComboBox.h:36
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition: TObject.cxx:880
char * Form(const char *fmt,...)
TString fName
Definition: TGWindow.h:39
virtual TObject * At(Int_t idx) const
Returns the object at position idx. Returns 0 if idx is out of range.
Definition: TList.cxx:354
virtual void Update(const char *path)
Update file system combo box.
virtual void DoRedraw()
Redraw the tree listbox entry.
#define gVirtualX
Definition: TVirtualX.h:350
UInt_t fWidth
Definition: TGFrame.h:134
char * StrDup(const char *str)
Duplicate the string str.
Definition: TString.cxx:2465
const char * GetString() const
Definition: TGString.h:40
const Bool_t kFALSE
Definition: RtypesCore.h:88
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a file system combo box as a C++ statement(s) on output stream out.
#define ClassImp(name)
Definition: Rtypes.h:359
const TGPicture * fPic
Definition: TGFSComboBox.h:38
virtual void AddEntry(TGString *s, Int_t id)
Definition: TGComboBox.h:106
TText * text
const Mask_t kButtonReleaseMask
Definition: GuiTypes.h:161
const TGPicture * GetPicture(const char *name)
Get picture from the picture pool.
Definition: TGClient.cxx:287
Definition: TGFont.h:149
unsigned long ULong_t
Definition: RtypesCore.h:51
FontStruct_t GetFontStruct() const
Definition: TGFont.h:193
Double_t y[n]
Definition: legend1.C:17
virtual void Update(TGLBEntry *e)
Update text and picture of a listbox entry.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Definition: TString.h:619
UInt_t GetWidth() const
Definition: TGPicture.h:63
you should not use this method at all Int_t Int_t Double_t Double_t Double_t e
Definition: TRolke.cxx:630
UInt_t fHeight
Definition: TGFrame.h:135
TGSelectedPicture * fSelPic
Definition: TGFSComboBox.h:39
static const TGGC & GetDefaultGC()
Return default graphics context.
Handle_t fId
Definition: TGObject.h:36
virtual Int_t GetSelected() const
Definition: TGComboBox.h:134
TGClient * fClient
Definition: TGObject.h:37
Short_t Max(Short_t a, Short_t b)
Definition: TMathBase.h:200
Bool_t fActive
Definition: TGFSComboBox.h:42
virtual TList * GetVolumes(Option_t *) const
Definition: TSystem.h:435
void NeedRedraw(TGWindow *w, Bool_t force=kFALSE)
Set redraw flags.
Definition: TGClient.cxx:370
void SaveUserColor(std::ostream &out, Option_t *)
Save a user color in a C++ macro file - used in SavePrimitive().
Definition: TGFrame.cxx:2433
FontStruct_t fFontStruct
Definition: TGFSComboBox.h:44
TString GetOptionString() const
Returns a frame option string - used in SavePrimitive().
Definition: TGFrame.cxx:2460
virtual void RemoveEntries(Int_t from_ID, Int_t to_ID)
Definition: TGComboBox.h:125
TGString * fPath
Definition: TGFSComboBox.h:37
Int_t GetLength() const
Definition: TGString.h:39
Definition: TGGC.h:31
GContext_t fNormGC
Definition: TGFSComboBox.h:43
TGTreeLBEntry(const TGWindow *p=0, TGString *text=0, const TGPicture *pic=0, Int_t id=-1, TGString *path=0, GContext_t norm=GetDefaultGC()(), FontStruct_t font=GetDefaultFontStruct(), UInt_t options=kHorizontalFrame, Pixel_t back=GetWhitePixel())
Create a tree (i.e.
virtual void Draw(Drawable_t id, GContext_t gc, Int_t x, Int_t y)
Draw string.
Definition: TGString.cxx:51
virtual const char * GetTitle() const
Returns title of object.
Definition: TNamed.h:48
virtual void SetWindowName(const char *name=0)
Set window name.
Definition: TGWindow.cxx:118
const char * Data() const
Definition: TString.h:364
ULong_t Handle_t
Definition: GuiTypes.h:25