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 void DoRedraw() override;
39
40 static const TGFont *fgDefaultFont;
42
43public:
45 static const TGGC &GetDefaultGC();
46
47 TGTreeLBEntry(const TGWindow *p = nullptr, TGString *text = nullptr, const TGPicture *pic = nullptr,
48 Int_t id = -1, TGString *path = nullptr, GContext_t norm = GetDefaultGC()(),
50 UInt_t options = kHorizontalFrame, Pixel_t back = GetWhitePixel());
51 ~TGTreeLBEntry() override;
52
53 const TGString *GetText() const { return fText; }
54 const TGPicture *GetPicture() const { return fPic; }
55 const TGString *GetPath() const { return fPath; }
56
57 TGDimension GetDefaultSize() const override;
58
59 void Activate(Bool_t a) override;
60 void Update(TGLBEntry *e) override;
61 void DrawCopy(Handle_t id, Int_t x, Int_t y) override;
62
63 ClassDefOverride(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 = nullptr, Int_t id = -1,
85
86 virtual void Update(const char *path);
87 void SavePrimitive(std::ostream &out, Option_t *option = "") override;
88
89 ClassDefOverride(TGFSComboBox,0) // Combo box widget for file system path
90};
91
92#endif
Handle_t GContext_t
Graphics context handle.
Definition GuiTypes.h:38
@ kSunkenFrame
Definition GuiTypes.h:383
@ kDoubleBorder
Definition GuiTypes.h:385
@ kHorizontalFrame
Definition GuiTypes.h:382
ULong_t Pixel_t
Pixel value.
Definition GuiTypes.h:40
ULongptr_t Handle_t
Generic resource handle.
Definition GuiTypes.h:26
Handle_t FontStruct_t
Pointer to font structure.
Definition GuiTypes.h:39
#define a(i)
Definition RSha256.hxx:99
#define e(i)
Definition RSha256.hxx:103
bool Bool_t
Definition RtypesCore.h:63
int Int_t
Definition RtypesCore.h:45
const char Option_t
Definition RtypesCore.h:66
#define ClassDefOverride(name, id)
Definition Rtypes.h:346
static void indent(ostringstream &buf, int indent_level)
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t option
Option_t Option_t TPoint TPoint const char text
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.
void SavePrimitive(std::ostream &out, Option_t *option="") override
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
const TGString * GetPath() const
static const TGFont * fgDefaultFont
static TGGC * fgDefaultGC
UInt_t fTWidth
width of entry text
void Activate(Bool_t a) override
Make entry active (highlight picture).
const TGPicture * GetPicture() const
const TGPicture * fPic
entry picture
Bool_t fActive
true if active
TGDimension GetDefaultSize() const override
Return default size of tree listbox entry.
FontStruct_t fFontStruct
font
UInt_t fTHeight
height of entry text
TGString * fPath
entry path
static const TGGC & GetDefaultGC()
Return default graphics context.
const TGString * GetText() const
GContext_t fNormGC
entry drawing context
~TGTreeLBEntry() override
Delete tree listbox entry.
TGSelectedPicture * fSelPic
selected picture
TGString * fText
entry description
void Update(TGLBEntry *e) override
Update text and picture of a listbox entry.
static FontStruct_t GetDefaultFontStruct()
Return default font structure.
void DrawCopy(Handle_t id, Int_t x, Int_t y) override
Redraw the tree listbox entry on pixmap/window.
void DoRedraw() override
Redraw the tree listbox entry.
ROOT GUI Window base class.
Definition TGWindow.h:23
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