Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
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
44  FontStruct_t fFontStruct; // font
45 
46  virtual void DoRedraw();
47 
48  static const TGFont *fgDefaultFont;
49  static TGGC *fgDefaultGC;
50 
51 public:
52  static FontStruct_t GetDefaultFontStruct();
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()(),
57  FontStruct_t font = GetDefaultFontStruct(),
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,
79  UInt_t options = kHorizontalFrame | kSunkenFrame |
80  kDoubleBorder, Pixel_t back = GetWhitePixel());
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