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//////////////////////////////////////////////////////////////////////////
17// //
18// TGFSComboBox, TGTreeLBEntry //
19// //
20// This is a combo box that is used in the File Selection dialog box. //
21// It will allow the file path selection. //
22// //
23//////////////////////////////////////////////////////////////////////////
24
25#include "TGComboBox.h"
26
27#include <vector>
28#include <string>
29
30class TGPicture;
32
33
34class TGTreeLBEntry : public TGLBEntry {
35
36protected:
37 TGString *fText; // entry description
38 TGString *fPath; // entry path
39 const TGPicture *fPic; // entry picture
40 TGSelectedPicture *fSelPic; // selected picture
41 UInt_t fTWidth; // width of entry text
42 UInt_t fTHeight; // height of entry text
43 Bool_t fActive; // true if active
44 GContext_t fNormGC; // entry drawing context
46
47 virtual void DoRedraw();
48
49 static const TGFont *fgDefaultFont;
51
52public:
54 static const TGGC &GetDefaultGC();
55
56 TGTreeLBEntry(const TGWindow *p = 0, TGString *text = 0, const TGPicture *pic = 0,
57 Int_t id = -1, TGString *path = 0, GContext_t norm = GetDefaultGC()(),
59 UInt_t options = kHorizontalFrame, Pixel_t back = GetWhitePixel());
60 virtual ~TGTreeLBEntry();
61
62 const TGString *GetText() const { return fText; }
63 const TGPicture *GetPicture() const { return fPic; }
64 const TGString *GetPath() const { return fPath; }
65
66 virtual TGDimension GetDefaultSize() const;
67
68 virtual void Activate(Bool_t a);
69 virtual void Update(TGLBEntry *e);
70 virtual void DrawCopy(Handle_t id, Int_t x, Int_t y);
71
72 ClassDef(TGTreeLBEntry,0) // TGFSComboBox entry
73};
74
75
76class TGFSComboBox : public TGComboBox {
77 struct Lbc_t {
78 std::string fName; // root prefix name
79 std::string fPath; // path
80 std::string fPixmap; // picture file
81 Int_t fId{0}; // widget id
82 Int_t fIndent{0}; // identification level
83 Int_t fFlags{0}; // flag
84 Lbc_t(const char *name, const char *path, const char *pixmap, Int_t indent) :
85 fName(name), fPath(path), fPixmap(pixmap), fIndent(indent) { }
86 };
87
88 std::vector<Lbc_t> fLbc; ///<! list of default entries
89
90public:
91 TGFSComboBox(const TGWindow *p = 0, Int_t id = -1,
94
95 virtual void Update(const char *path);
96 virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
97
98 ClassDef(TGFSComboBox,0) // Combo box widget for file system path
99};
100
101#endif
ULong_t Handle_t
Generic resource handle.
Definition GuiTypes.h:26
@ 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
#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
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.
static Pixel_t GetWhitePixel()
Get white pixel value.
Definition TGFrame.cxx:694
Definition TGGC.h:31
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.
virtual void DoRedraw()
Redraw the tree listbox entry.
const TGPicture * GetPicture() const
const TGPicture * fPic
FontStruct_t fFontStruct
TGString * fPath
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
TGSelectedPicture * fSelPic
TGString * fText
static FontStruct_t GetDefaultFontStruct()
Return default font structure.
TText * text
Double_t y[n]
Definition legend1.C:17
Double_t x[n]
Definition legend1.C:17
Lbc_t(const char *name, const char *path, const char *pixmap, Int_t indent)
std::string fPixmap