Logo ROOT  
Reference Guide
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 
28 
29 class TGPicture;
30 class TGSelectedPicture;
31 
32 
33 class TGTreeLBEntry : public TGLBEntry {
34 
35 protected:
36  TGString *fText; // entry description
37  TGString *fPath; // entry path
38  const TGPicture *fPic; // entry picture
39  TGSelectedPicture *fSelPic; // selected picture
40  UInt_t fTWidth; // width of entry text
41  UInt_t fTHeight; // height of entry text
42  Bool_t fActive; // true if active
43  GContext_t fNormGC; // entry drawing context
45 
46  virtual void DoRedraw();
47 
48  static const TGFont *fgDefaultFont;
49  static TGGC *fgDefaultGC;
50 
51 public:
53  static const TGGC &GetDefaultGC();
54 
55  TGTreeLBEntry(const TGWindow *p = 0, TGString *text = 0, const TGPicture *pic = 0,
56  Int_t id = -1, TGString *path = 0, GContext_t norm = GetDefaultGC()(),
58  UInt_t options = kHorizontalFrame, Pixel_t back = GetWhitePixel());
59  virtual ~TGTreeLBEntry();
60 
61  const TGString *GetText() const { return fText; }
62  const TGPicture *GetPicture() const { return fPic; }
63  const TGString *GetPath() const { return fPath; }
64 
65  virtual TGDimension GetDefaultSize() const;
66 
67  virtual void Activate(Bool_t a);
68  virtual void Update(TGLBEntry *e);
69  virtual void DrawCopy(Handle_t id, Int_t x, Int_t y);
70 
71  ClassDef(TGTreeLBEntry,0) // TGFSComboBox entry
72 };
73 
74 
75 class TGFSComboBox : public TGComboBox {
76 
77 public:
78  TGFSComboBox(const TGWindow *p = 0, Int_t id = -1,
81 
82  virtual void Update(const char *path);
83  virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
84 
85  ClassDef(TGFSComboBox,0) // Combo box widget for file system path
86 };
87 
88 #endif
TGComboBox.h
TGTreeLBEntry::GetDefaultSize
virtual TGDimension GetDefaultSize() const
Return default size of tree listbox entry.
Definition: TGFSComboBox.cxx:163
TGFSComboBox::Update
virtual void Update(const char *path)
Update file system combo box.
Definition: TGFSComboBox.cxx:416
TGWindow
Definition: TGWindow.h:31
e
#define e(i)
Definition: RSha256.hxx:121
TGPicture
Definition: TGPicture.h:36
TGDimension
Definition: TGDimension.h:27
Pixel_t
ULong_t Pixel_t
Definition: GuiTypes.h:39
TGTreeLBEntry::DoRedraw
virtual void DoRedraw()
Redraw the tree listbox entry.
Definition: TGFSComboBox.cxx:155
TGTreeLBEntry::fgDefaultGC
static TGGC * fgDefaultGC
Definition: TGFSComboBox.h:49
TGTreeLBEntry::fActive
Bool_t fActive
Definition: TGFSComboBox.h:42
FontStruct_t
Handle_t FontStruct_t
Definition: GuiTypes.h:38
TGTreeLBEntry::fFontStruct
FontStruct_t fFontStruct
Definition: TGFSComboBox.h:44
TGTreeLBEntry::DrawCopy
virtual void DrawCopy(Handle_t id, Int_t x, Int_t y)
Redraw the tree listbox entry on pixmap/window.
Definition: TGFSComboBox.cxx:125
TGFSComboBox::SavePrimitive
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a file system combo box as a C++ statement(s) on output stream out.
Definition: TGFSComboBox.cxx:485
TGTreeLBEntry
Definition: TGFSComboBox.h:33
TGTreeLBEntry::Update
virtual void Update(TGLBEntry *e)
Update text and picture of a listbox entry.
Definition: TGFSComboBox.cxx:175
TGTreeLBEntry::TGTreeLBEntry
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.
Definition: TGFSComboBox.cxx:67
Int_t
int Int_t
Definition: RtypesCore.h:45
TGTreeLBEntry::GetPicture
const TGPicture * GetPicture() const
Definition: TGFSComboBox.h:62
x
Double_t x[n]
Definition: legend1.C:17
TGSelectedPicture
Definition: TGPicture.h:78
TGTreeLBEntry::GetDefaultGC
static const TGGC & GetDefaultGC()
Return default graphics context.
Definition: TGFSComboBox.cxx:200
TGTreeLBEntry::fgDefaultFont
static const TGFont * fgDefaultFont
Definition: TGFSComboBox.h:48
Bool_t
bool Bool_t
Definition: RtypesCore.h:63
kDoubleBorder
@ kDoubleBorder
Definition: GuiTypes.h:385
text
TText * text
Definition: entrylist_figure1.C:10
bool
TGTreeLBEntry::GetText
const TGString * GetText() const
Definition: TGFSComboBox.h:61
GContext_t
Handle_t GContext_t
Definition: GuiTypes.h:37
TGTreeLBEntry::~TGTreeLBEntry
virtual ~TGTreeLBEntry()
Delete tree listbox entry.
Definition: TGFSComboBox.cxx:98
TGTreeLBEntry::fPic
const TGPicture * fPic
Definition: TGFSComboBox.h:38
TGTreeLBEntry::fSelPic
TGSelectedPicture * fSelPic
Definition: TGFSComboBox.h:39
Option_t
const typedef char Option_t
Definition: RtypesCore.h:66
kSunkenFrame
@ kSunkenFrame
Definition: GuiTypes.h:383
TGGC
Definition: TGGC.h:31
a
auto * a
Definition: textangle.C:12
y
Double_t y[n]
Definition: legend1.C:17
TGTreeLBEntry::fPath
TGString * fPath
Definition: TGFSComboBox.h:37
TGLBEntry
Definition: TGListBox.h:51
TGTreeLBEntry::fNormGC
GContext_t fNormGC
Definition: TGFSComboBox.h:43
unsigned int
TGComboBox
Definition: TGComboBox.h:67
kHorizontalFrame
@ kHorizontalFrame
Definition: GuiTypes.h:382
TGFSComboBox
Definition: TGFSComboBox.h:75
TGTreeLBEntry::fText
TGString * fText
Definition: TGFSComboBox.h:36
Handle_t
ULong_t Handle_t
Definition: GuiTypes.h:25
TGFSComboBox::TGFSComboBox
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.
Definition: TGFSComboBox.cxx:211
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
TGFrame::GetWhitePixel
static Pixel_t GetWhitePixel()
Get white pixel value.
Definition: TGFrame.cxx:694
TGTreeLBEntry::fTWidth
UInt_t fTWidth
Definition: TGFSComboBox.h:40
TGFont
Definition: TGFont.h:149
TGTreeLBEntry::GetDefaultFontStruct
static FontStruct_t GetDefaultFontStruct()
Return default font structure.
Definition: TGFSComboBox.cxx:190
TGTreeLBEntry::fTHeight
UInt_t fTHeight
Definition: TGFSComboBox.h:41
TGTreeLBEntry::GetPath
const TGString * GetPath() const
Definition: TGFSComboBox.h:63
TGString
Definition: TGString.h:30
TGTreeLBEntry::Activate
virtual void Activate(Bool_t a)
Make entry active (highlight picture).
Definition: TGFSComboBox.cxx:108
int