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