Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TGFSComboBox.h
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#ifndef ROOT_TGFSComboBox
13#define ROOT_TGFSComboBox
14
15
16#include "TGComboBox.h"
17
18#include <vector>
19#include <string>
20
21class TGPicture;
23
24
25class TGTreeLBEntry : public TGLBEntry {
26
27protected:
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
37
38 virtual void DoRedraw();
39
40 static const TGFont *fgDefaultFont;
42
43public:
45 static const TGGC &GetDefaultGC();
46
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();
52
53 const TGString *GetText() const { return fText; }
54 const TGPicture *GetPicture() const { return fPic; }
55 const TGString *GetPath() const { return fPath; }
56
57 virtual TGDimension GetDefaultSize() const;
58
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);
62
63 ClassDef(TGTreeLBEntry,0) // TGFSComboBox entry
64};
65
66
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 };
78
79 std::vector<Lbc_t> fLbc; ///<! list of default entries
80
81public:
82 TGFSComboBox(const TGWindow *p = 0, Int_t id = -1,
85
86 virtual void Update(const char *path);
87 virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
88
89 ClassDef(TGFSComboBox,0) // Combo box widget for file system path
90};
91
92#endif
@ 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 a(i)
Definition RSha256.hxx:99
#define e(i)
Definition RSha256.hxx:103
int Int_t
Definition RtypesCore.h:45
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)
char name[80]
Definition TGX11.cxx:110
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.
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a file system combo box as a C++ statement(s) on output stream out.
std::vector< Lbc_t > fLbc
! list of default entries
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).
const TGString * GetPath() const
static const TGFont * fgDefaultFont
virtual ~TGTreeLBEntry()
Delete tree listbox entry.
static TGGC * fgDefaultGC
virtual TGDimension GetDefaultSize() const
Return default size of tree listbox entry.
UInt_t fTWidth
width of entry text
virtual void DoRedraw()
Redraw the tree listbox entry.
const TGPicture * GetPicture() const
const TGPicture * fPic
entry picture
Bool_t fActive
true if active
FontStruct_t fFontStruct
font
UInt_t fTHeight
height of entry text
TGString * fPath
entry path
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
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
TGSelectedPicture * fSelPic
selected picture
TGString * fText
entry description
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
std::string fName
root prefix name
Int_t fId
widget id
std::string fPath
path
Int_t fIndent
identification level
Lbc_t(const char *name, const char *path, const char *pixmap, Int_t indent)
std::string fPixmap
picture file