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 void DoRedraw() override;
40 static const TGFont *fgDefaultFont;
45 static const TGGC &GetDefaultGC();
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 virtual ~TGTreeLBEntry();
53 const TGString *GetText() const { return fText; }
54 const TGPicture *GetPicture() const { return fPic; }
55 const TGString *GetPath() const { return fPath; }
57 TGDimension GetDefaultSize() const override;
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;
63 ClassDefOverride(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 = nullptr, Int_t id = -1,
86 virtual void Update(const char *path);
87 void SavePrimitive(std::ostream &out, Option_t *option = "") override;
89 ClassDefOverride(TGFSComboBox,0) // Combo box widget for file system path
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 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:339
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.
Definition: TGFSComboBox.h:67
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save a file system combo box as a C++ statement(s) on output stream out.
TGFSComboBox(const TGWindow *p=nullptr, 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
const TGString * GetPath() const
Definition: TGFSComboBox.h:55
static const TGFont * fgDefaultFont
Definition: TGFSComboBox.h:40
virtual ~TGTreeLBEntry()
Delete tree listbox entry.
static TGGC * fgDefaultGC
Definition: TGFSComboBox.h:41
UInt_t fTWidth
width of entry text
Definition: TGFSComboBox.h:32
void Activate(Bool_t a) override
Make entry active (highlight picture).
const TGPicture * GetPicture() const
Definition: TGFSComboBox.h:54
const TGPicture * fPic
entry picture
Definition: TGFSComboBox.h:30
Bool_t fActive
true if active
Definition: TGFSComboBox.h:34
TGDimension GetDefaultSize() const override
Return default size of tree listbox entry.
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
static const TGGC & GetDefaultGC()
Return default graphics context.
const TGString * GetText() const
Definition: TGFSComboBox.h:53
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
void Update(TGLBEntry *e) override
Update text and picture of a listbox entry.
TGTreeLBEntry(const TGWindow *p=nullptr, TGString *text=nullptr, const TGPicture *pic=nullptr, Int_t id=-1, TGString *path=nullptr, GContext_t norm=GetDefaultGC()(), FontStruct_t font=GetDefaultFontStruct(), UInt_t options=kHorizontalFrame, Pixel_t back=GetWhitePixel())
Create a tree (i.e.
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
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
TArc a
Definition: textangle.C:12