ROOT logo
// @(#)root/gui:$Id$
// Author: Valeriy Onuchin   12/08/04

/*************************************************************************
 * Copyright (C) 1995-2004, Rene Brun and Fons Rademakers.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

#ifndef ROOT_TGuiBuilder
#define ROOT_TGuiBuilder


//////////////////////////////////////////////////////////////////////////
//                                                                      //
// TGuiBuilder                                                          //
//                                                                      //
//////////////////////////////////////////////////////////////////////////


#ifndef ROOT_TNamed
#include "TNamed.h"
#endif

enum EGuiBldAction { kGuiBldNone, kGuiBldCtor,  kGuiBldProj,
                     kGuiBldMacro, kGuiBldFunc };

class TGFrame;
class TGLayoutHints;
class TGPicture;
//////////////////////////////////////////////////////////////////////////
class TGuiBldAction : public TNamed {

public:
   Int_t          fType;   // type of action
   TString        fAct;    // action, after action execution new frame is created
   const char    *fPic;    // picture name
   const TGPicture *fPicture; // picture
   TGLayoutHints *fHints;  // layout hints for frame created by action

   TGuiBldAction(const char *name = 0, const char *title = 0,
                 Int_t type = kGuiBldCtor, TGLayoutHints *hints = 0);
   virtual ~TGuiBldAction();

   ClassDef(TGuiBldAction,0)  // gui builder action
};


//////////////////////////////////////////////////////////////////////////
class TGuiBuilder {

protected:
   TGuiBldAction *fAction;   // current action

public:
   TGuiBuilder();
   virtual ~TGuiBuilder();

   virtual void      AddAction(TGuiBldAction *, const char * /*section*/) {}
   virtual void      AddSection(const char * /*section*/) {}
   virtual TGFrame  *ExecuteAction() { return 0; }
   virtual void      SetAction(TGuiBldAction *act) { fAction = act; }
   TGuiBldAction    *GetAction() const { return fAction; }
   virtual Bool_t    IsExecutable() const  { return fAction && !fAction->fAct.IsNull(); }
   virtual void      Show() {}
   virtual void      Hide() {}

   static  TGuiBuilder  *Instance();

   ClassDef(TGuiBuilder,0)  // ABC for gui builder
};

R__EXTERN TGuiBuilder *gGuiBuilder; // global gui builder

#endif
 TGuiBuilder.h:1
 TGuiBuilder.h:2
 TGuiBuilder.h:3
 TGuiBuilder.h:4
 TGuiBuilder.h:5
 TGuiBuilder.h:6
 TGuiBuilder.h:7
 TGuiBuilder.h:8
 TGuiBuilder.h:9
 TGuiBuilder.h:10
 TGuiBuilder.h:11
 TGuiBuilder.h:12
 TGuiBuilder.h:13
 TGuiBuilder.h:14
 TGuiBuilder.h:15
 TGuiBuilder.h:16
 TGuiBuilder.h:17
 TGuiBuilder.h:18
 TGuiBuilder.h:19
 TGuiBuilder.h:20
 TGuiBuilder.h:21
 TGuiBuilder.h:22
 TGuiBuilder.h:23
 TGuiBuilder.h:24
 TGuiBuilder.h:25
 TGuiBuilder.h:26
 TGuiBuilder.h:27
 TGuiBuilder.h:28
 TGuiBuilder.h:29
 TGuiBuilder.h:30
 TGuiBuilder.h:31
 TGuiBuilder.h:32
 TGuiBuilder.h:33
 TGuiBuilder.h:34
 TGuiBuilder.h:35
 TGuiBuilder.h:36
 TGuiBuilder.h:37
 TGuiBuilder.h:38
 TGuiBuilder.h:39
 TGuiBuilder.h:40
 TGuiBuilder.h:41
 TGuiBuilder.h:42
 TGuiBuilder.h:43
 TGuiBuilder.h:44
 TGuiBuilder.h:45
 TGuiBuilder.h:46
 TGuiBuilder.h:47
 TGuiBuilder.h:48
 TGuiBuilder.h:49
 TGuiBuilder.h:50
 TGuiBuilder.h:51
 TGuiBuilder.h:52
 TGuiBuilder.h:53
 TGuiBuilder.h:54
 TGuiBuilder.h:55
 TGuiBuilder.h:56
 TGuiBuilder.h:57
 TGuiBuilder.h:58
 TGuiBuilder.h:59
 TGuiBuilder.h:60
 TGuiBuilder.h:61
 TGuiBuilder.h:62
 TGuiBuilder.h:63
 TGuiBuilder.h:64
 TGuiBuilder.h:65
 TGuiBuilder.h:66
 TGuiBuilder.h:67
 TGuiBuilder.h:68
 TGuiBuilder.h:69
 TGuiBuilder.h:70
 TGuiBuilder.h:71
 TGuiBuilder.h:72
 TGuiBuilder.h:73
 TGuiBuilder.h:74
 TGuiBuilder.h:75
 TGuiBuilder.h:76
 TGuiBuilder.h:77