Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/root/TGuiBuilder.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: Valeriy Onuchin   12/08/04
0003 
0004 /*************************************************************************
0005  * Copyright (C) 1995-2004, 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_TGuiBuilder
0013 #define ROOT_TGuiBuilder
0014 
0015 
0016 #include "TNamed.h"
0017 
0018 enum EGuiBldAction { kGuiBldNone, kGuiBldCtor,  kGuiBldProj,
0019                      kGuiBldMacro, kGuiBldFunc };
0020 
0021 class TGFrame;
0022 class TGLayoutHints;
0023 class TGPicture;
0024 //////////////////////////////////////////////////////////////////////////
0025 class TGuiBldAction : public TNamed {
0026 
0027 public:
0028    Int_t          fType;   // type of action
0029    TString        fAct;    // action, after action execution new frame is created
0030    const char    *fPic;    // picture name
0031    const TGPicture *fPicture; // picture
0032    TGLayoutHints *fHints;  // layout hints for frame created by action
0033 
0034    TGuiBldAction(const char *name = nullptr, const char *title = nullptr,
0035                  Int_t type = kGuiBldCtor, TGLayoutHints *hints = nullptr);
0036    ~TGuiBldAction() override;
0037 
0038    ClassDefOverride(TGuiBldAction,0)  // gui builder action
0039 };
0040 
0041 
0042 //////////////////////////////////////////////////////////////////////////
0043 class TGuiBuilder {
0044 
0045 protected:
0046    TGuiBldAction *fAction;   // current action
0047 
0048 public:
0049    TGuiBuilder();
0050    virtual ~TGuiBuilder();
0051 
0052    virtual void      AddAction(TGuiBldAction *, const char * /*section*/) {}
0053    virtual void      AddSection(const char * /*section*/) {}
0054    virtual TGFrame  *ExecuteAction() { return nullptr; }
0055    virtual void      SetAction(TGuiBldAction *act) { fAction = act; }
0056    TGuiBldAction    *GetAction() const { return fAction; }
0057    virtual Bool_t    IsExecutable() const  { return fAction && !fAction->fAct.IsNull(); }
0058    virtual void      Show() {}
0059    virtual void      Hide() {}
0060 
0061    static  TGuiBuilder  *Instance();
0062 
0063    ClassDef(TGuiBuilder,0)  // ABC for gui builder
0064 };
0065 
0066 R__EXTERN TGuiBuilder *gGuiBuilder; // global gui builder
0067 
0068 #endif