Logo ROOT  
Reference Guide
Go to the documentation of this file.
1// @(#)root/gui:$Id$
2// Author: Fons Rademakers 19/01/98
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 *************************************************************************/
12#ifndef ROOT_TGFSComboBox
13#define ROOT_TGFSComboBox
16#include "TGComboBox.h"
18#include <vector>
19#include <string>
21class TGPicture;
25class TGTreeLBEntry : public TGLBEntry {
28 TGString *fText; ///< entry description
29 TGString *fPath; ///< entry path
30 const TGPicture *fPic; ///< entry picture
31 TGSelectedPicture *fSelPic; ///< selected picture
32 UInt_t fTWidth; ///< width of entry text
33 UInt_t fTHeight; ///< height of entry text
34 Bool_t fActive; ///< true if active
35 GContext_t fNormGC; ///< entry drawing context
38 virtual void DoRedraw();
40 static const TGFont *fgDefaultFont;
45 static const TGGC &GetDefaultGC();
47 TGTreeLBEntry(const TGWindow *p = 0, TGString *text = 0, const TGPicture *pic = 0,
48 Int_t id = -1, TGString *path = 0, GContext_t norm = GetDefaultGC()(),
50 UInt_t options = kHorizontalFrame, Pixel_t back = GetWhitePixel());
51 virtual ~TGTreeLBEntry();
53 const TGString *GetText() const { return fText; }
54 const TGPicture *GetPicture() const { return fPic; }
55 const TGString *GetPath() const { return fPath; }
57 virtual TGDimension GetDefaultSize() const;
59 virtual void Activate(Bool_t a);
60 virtual void Update(TGLBEntry *e);
61 virtual void DrawCopy(Handle_t id, Int_t x, Int_t y);
63 ClassDef(TGTreeLBEntry,0) // TGFSComboBox entry
67class TGFSComboBox : public TGComboBox {
68 struct Lbc_t {
69 std::string fName; ///< root prefix name
70 std::string fPath; ///< path
71 std::string fPixmap; ///< picture file
72 Int_t fId{0}; ///< widget id
73 Int_t fIndent{0}; ///< identification level
74 Int_t fFlags{0}; ///< flag
75 Lbc_t(const char *name, const char *path, const char *pixmap, Int_t indent) :
76 fName(name), fPath(path), fPixmap(pixmap), fIndent(indent) { }
77 };
79 std::vector<Lbc_t> fLbc; ///<! list of default entries
82 TGFSComboBox(const TGWindow *p = 0, Int_t id = -1,
86 virtual void Update(const char *path);
87 virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
89 ClassDef(TGFSComboBox,0) // Combo box widget for file system path
int Int_t
Definition: CPyCppyy.h:43
unsigned int UInt_t
Definition: CPyCppyy.h:44
@ kSunkenFrame
Definition: GuiTypes.h:383
@ kDoubleBorder
Definition: GuiTypes.h:385
@ kHorizontalFrame
Definition: GuiTypes.h:382
Handle_t GContext_t
Graphics context handle.
Definition: GuiTypes.h:38
Handle_t FontStruct_t
Pointer to font structure.
Definition: GuiTypes.h:39
ULong_t Pixel_t
Pixel value.
Definition: GuiTypes.h:40
ULongptr_t Handle_t
Generic resource handle.
Definition: GuiTypes.h:26
#define e(i)
Definition: RSha256.hxx:103
bool Bool_t
Definition: RtypesCore.h:63
const char Option_t
Definition: RtypesCore.h:66
#define ClassDef(name, id)
Definition: Rtypes.h:325
static void indent(ostringstream &buf, int indent_level)
A combobox (also known as a drop down listbox) allows the selection of one item out of a list of item...
Definition: TGComboBox.h:47
This is a combo box that is used in the File Selection dialog box.
Definition: TGFSComboBox.h:67
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a file system combo box as a C++ statement(s) on output stream out.
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.
std::vector< Lbc_t > fLbc
! list of default entries
Definition: TGFSComboBox.h:79
virtual void Update(const char *path)
Update file system combo box.
Encapsulate fonts used in the GUI system.
Definition: TGFont.h:140
static Pixel_t GetWhitePixel()
Get white pixel value.
Definition: TGFrame.cxx:709
Encapsulate a graphics context used in the low level graphics.
Definition: TGGC.h:22
Basic listbox entries.
Definition: TGListBox.h:24
The TGPicture class implements pictures and icons used in the different GUI elements and widgets.
Definition: TGPicture.h:25
TGString wraps a TString and adds some graphics routines like drawing, size of string on screen depen...
Definition: TGString.h:20
virtual void Activate(Bool_t a)
Make entry active (highlight picture).
static const TGFont * fgDefaultFont
Definition: TGFSComboBox.h:40
virtual ~TGTreeLBEntry()
Delete tree listbox entry.
static TGGC * fgDefaultGC
Definition: TGFSComboBox.h:41
virtual TGDimension GetDefaultSize() const
Return default size of tree listbox entry.
UInt_t fTWidth
width of entry text
Definition: TGFSComboBox.h:32
const TGString * GetPath() const
Definition: TGFSComboBox.h:55
virtual void DoRedraw()
Redraw the tree listbox entry.
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.
const TGPicture * fPic
entry picture
Definition: TGFSComboBox.h:30
Bool_t fActive
true if active
Definition: TGFSComboBox.h:34
FontStruct_t fFontStruct
Definition: TGFSComboBox.h:36
UInt_t fTHeight
height of entry text
Definition: TGFSComboBox.h:33
TGString * fPath
entry path
Definition: TGFSComboBox.h:29
virtual void Update(TGLBEntry *e)
Update text and picture of a listbox entry.
static const TGGC & GetDefaultGC()
Return default graphics context.
const TGString * GetText() const
Definition: TGFSComboBox.h:53
virtual void DrawCopy(Handle_t id, Int_t x, Int_t y)
Redraw the tree listbox entry on pixmap/window.
GContext_t fNormGC
entry drawing context
Definition: TGFSComboBox.h:35
TGSelectedPicture * fSelPic
selected picture
Definition: TGFSComboBox.h:31
TGString * fText
entry description
Definition: TGFSComboBox.h:28
const TGPicture * GetPicture() const
Definition: TGFSComboBox.h:54
static FontStruct_t GetDefaultFontStruct()
Return default font structure.
ROOT GUI Window base class.
Definition: TGWindow.h:23
TText * text
Double_t y[n]
Definition: legend1.C:17
Double_t x[n]
Definition: legend1.C:17
static const std::string name("name")
std::string fName
root prefix name
Definition: TGFSComboBox.h:69
Int_t fId
widget id
Definition: TGFSComboBox.h:72
std::string fPath
Definition: TGFSComboBox.h:70
Int_t fIndent
identification level
Definition: TGFSComboBox.h:73
Lbc_t(const char *name, const char *path, const char *pixmap, Int_t indent)
Definition: TGFSComboBox.h:75
std::string fPixmap
picture file
Definition: TGFSComboBox.h:71
auto * a
Definition: textangle.C:12