TGuiBuilder.h

Go to the documentation of this file.
00001 // @(#)root/gui:$Id: TGuiBuilder.h 23115 2008-04-10 13:35:37Z rdm $
00002 // Author: Valeriy Onuchin   12/08/04
00003 
00004 /*************************************************************************
00005  * Copyright (C) 1995-2004, Rene Brun and Fons Rademakers.               *
00006  * All rights reserved.                                                  *
00007  *                                                                       *
00008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
00009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
00010  *************************************************************************/
00011 
00012 #ifndef ROOT_TGuiBuilder
00013 #define ROOT_TGuiBuilder
00014 
00015 
00016 //////////////////////////////////////////////////////////////////////////
00017 //                                                                      //
00018 // TGuiBuilder                                                          //
00019 //                                                                      //
00020 //////////////////////////////////////////////////////////////////////////
00021 
00022 
00023 #ifndef ROOT_TNamed
00024 #include "TNamed.h"
00025 #endif
00026 
00027 enum EGuiBldAction { kGuiBldNone, kGuiBldCtor,  kGuiBldProj,
00028                      kGuiBldMacro, kGuiBldFunc };
00029 
00030 class TGFrame;
00031 class TGLayoutHints;
00032 class TGPicture;
00033 //////////////////////////////////////////////////////////////////////////
00034 class TGuiBldAction : public TNamed {
00035 
00036 public:
00037    Int_t          fType;   // type of action
00038    TString        fAct;    // action, after action execution new frame is created
00039    const char    *fPic;    // picture name
00040    const TGPicture *fPicture; // picture
00041    TGLayoutHints *fHints;  // layout hints for frame created by action
00042 
00043    TGuiBldAction(const char *name = 0, const char *title = 0,
00044                  Int_t type = kGuiBldCtor, TGLayoutHints *hints = 0);
00045    virtual ~TGuiBldAction();
00046 
00047    ClassDef(TGuiBldAction,0)  // gui builder action
00048 };
00049 
00050 
00051 //////////////////////////////////////////////////////////////////////////
00052 class TGuiBuilder {
00053 
00054 protected:
00055    TGuiBldAction *fAction;   // current action
00056 
00057 public:
00058    TGuiBuilder();
00059    virtual ~TGuiBuilder();
00060 
00061    virtual void      AddAction(TGuiBldAction *, const char * /*section*/) {}
00062    virtual void      AddSection(const char * /*section*/) {}
00063    virtual TGFrame  *ExecuteAction() { return 0; }
00064    virtual void      SetAction(TGuiBldAction *act) { fAction = act; }
00065    TGuiBldAction    *GetAction() const { return fAction; }
00066    virtual Bool_t    IsExecutable() const  { return fAction && !fAction->fAct.IsNull(); }
00067    virtual void      Show() {}
00068    virtual void      Hide() {}
00069 
00070    static  TGuiBuilder  *Instance();
00071 
00072    ClassDef(TGuiBuilder,0)  // ABC for gui builder
00073 };
00074 
00075 R__EXTERN TGuiBuilder *gGuiBuilder; // global gui builder
00076 
00077 #endif

Generated on Tue Jul 5 14:20:10 2011 for ROOT_528-00b_version by  doxygen 1.5.1