Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/root/TGFSComboBox.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // @(#)root/gui:$Id$
0002 // Author: Fons Rademakers   19/01/98
0003 
0004 /*************************************************************************
0005  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
0006  * All rights reserved.                                                  *
0007  *                                                                       *
0008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
0009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
0010  *************************************************************************/
0011 
0012 #ifndef ROOT_TGFSComboBox
0013 #define ROOT_TGFSComboBox
0014 
0015 
0016 #include "TGComboBox.h"
0017 
0018 #include <vector>
0019 #include <string>
0020 
0021 class TGPicture;
0022 class TGSelectedPicture;
0023 
0024 
0025 class TGTreeLBEntry : public TGLBEntry {
0026 
0027 protected:
0028    TGString           *fText;        ///< entry description
0029    TGString           *fPath;        ///< entry path
0030    const TGPicture    *fPic;         ///< entry picture
0031    TGSelectedPicture  *fSelPic;      ///< selected picture
0032    UInt_t              fTWidth;      ///< width of entry text
0033    UInt_t              fTHeight;     ///< height of entry text
0034    Bool_t              fActive;      ///< true if active
0035    GContext_t          fNormGC;      ///< entry drawing context
0036    FontStruct_t        fFontStruct;  ///< font
0037 
0038    void DoRedraw() override;
0039 
0040    static const TGFont *fgDefaultFont;
0041    static TGGC         *fgDefaultGC;
0042 
0043 public:
0044    static FontStruct_t  GetDefaultFontStruct();
0045    static const TGGC   &GetDefaultGC();
0046 
0047    TGTreeLBEntry(const TGWindow *p = nullptr, TGString *text = nullptr, const TGPicture *pic = nullptr,
0048                  Int_t id = -1, TGString *path = nullptr, GContext_t norm = GetDefaultGC()(),
0049                  FontStruct_t font = GetDefaultFontStruct(),
0050                  UInt_t options = kHorizontalFrame, Pixel_t back = GetWhitePixel());
0051    ~TGTreeLBEntry() override;
0052 
0053    const TGString  *GetText() const { return fText; }
0054    const TGPicture *GetPicture() const { return fPic; }
0055    const TGString  *GetPath() const { return fPath; }
0056 
0057    TGDimension GetDefaultSize() const override;
0058 
0059    void Activate(Bool_t a) override;
0060    void Update(TGLBEntry *e) override;
0061    void DrawCopy(Handle_t id, Int_t x, Int_t y) override;
0062 
0063    ClassDefOverride(TGTreeLBEntry,0)  // TGFSComboBox entry
0064 };
0065 
0066 
0067 class TGFSComboBox : public TGComboBox {
0068    struct Lbc_t {
0069       std::string fName;        ///< root prefix name
0070       std::string fPath;        ///< path
0071       std::string fPixmap;      ///< picture file
0072       Int_t       fId{0};       ///< widget id
0073       Int_t       fIndent{0};   ///< identification level
0074       Int_t       fFlags{0};    ///< flag
0075       Lbc_t(const char *name, const char *path, const char *pixmap, Int_t indent) :
0076          fName(name), fPath(path), fPixmap(pixmap), fIndent(indent) { }
0077    };
0078 
0079    std::vector<Lbc_t> fLbc; ///<!  list of default entries
0080 
0081 public:
0082    TGFSComboBox(const TGWindow *p = nullptr, Int_t id = -1,
0083                 UInt_t options = kHorizontalFrame | kSunkenFrame |
0084                 kDoubleBorder, Pixel_t back = GetWhitePixel());
0085 
0086    virtual void Update(const char *path);
0087    void SavePrimitive(std::ostream &out, Option_t *option = "") override;
0088 
0089    ClassDefOverride(TGFSComboBox,0)  // Combo box widget for file system path
0090 };
0091 
0092 #endif