// @(#)root/ged:$Id$
// Author: Marek Biskup, Ilka Antcheva   02/12/2003

/*************************************************************************
 * Copyright (C) 1995-2000, 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_TGedEditor
#define ROOT_TGedEditor

//////////////////////////////////////////////////////////////////////////
//                                                                      //
// TGedEditor                                                           //
//                                                                      //
// Editor is a composite frame that contains GUI for editting objects   //
// in a canvas. It looks for the class ROOT_classname + 'Editor'.       //
//                                                                      //
// It connects to a Canvas and listens for selected objects             //
//                                                                      //
//////////////////////////////////////////////////////////////////////////

#ifndef ROOT_TGFrame
#include "TGFrame.h"
#endif
#ifndef ROOT_TVirtualPadEditor
#include "TVirtualPadEditor.h"
#endif
#ifndef ROOT_TList
#include "TList.h"
#endif
#ifndef ROOT_TMap
#include "TMap.h"
#endif

class TCanvas;
class TGCanvas;
class TGTab;
class TGTabElement;
class TVirtualPad;
class TGedFrame;
class TGedNameFrame;

class TGedTabInfo;

class TGedEditor : public TVirtualPadEditor, public TGMainFrame
{
private:
   TGedEditor(const TGedEditor&);            // Not implemented
   TGedEditor& operator=(const TGedEditor&); // Not implemented

protected:
   TMap              fFrameMap;         //global map of available frames
   TMap              fExclMap;          //map of excluded editors for selected model
   TList             fGedFrames;        //list visible of frames

   TGCanvas         *fCan;              //provides scroll bars
   TGTab            *fTab;              //tab widget holding the editor

   TList             fCreatedTabs;      //list of created tabs
   TList             fVisibleTabs;      //list ofcurrently used tabs
   TGCompositeFrame *fTabContainer;     //main tab container

   TObject          *fModel;            //selected object
   TVirtualPad      *fPad;              //selected pad
   TCanvas          *fCanvas;           //canvas related to the editor
   TClass           *fClass;            //class of the selected object
   Bool_t            fGlobal;           //true if editor is global

   void              ConfigureGedFrames(Bool_t objChaged);

   virtual TGedFrame* CreateNameFrame(const TGWindow* parent, const char* tab_name);

   static TGedEditor *fgFrameCreator;

public:
   TGedEditor(TCanvas* canvas = 0, UInt_t width = 175, UInt_t height = 20);
   virtual ~TGedEditor();

   void          PrintFrameStat();
   virtual void  Update(TGedFrame* frame = 0);
   void          ReinitWorkspace();
   void          ActivateEditor (TClass* cl, Bool_t recurse);
   void          ActivateEditors(TList* bcl, Bool_t recurse);
   void          ExcludeClassEditor(TClass* cl, Bool_t recurse = kFALSE);
   void          InsertGedFrame(TGedFrame* f);

   TGCanvas*                 GetTGCanvas() const { return fCan; }
   TGTab*                    GetTab()      const { return fTab; }
   virtual TGCompositeFrame* GetEditorTab(const char* name);
   virtual TGedTabInfo*      GetEditorTabInfo(const char* name);

   virtual TCanvas*          GetCanvas() const { return fCanvas; }
   virtual TVirtualPad*      GetPad()    const { return fPad; }
   virtual TObject*          GetModel()  const { return fModel; }


   virtual void   CloseWindow();
   virtual void   ConnectToCanvas(TCanvas *c);
   virtual void   DisconnectFromCanvas();
   virtual Bool_t IsGlobal() const  { return fGlobal; }
   virtual void   Hide();
   virtual void   GlobalClosed();
   virtual void   SetCanvas(TCanvas *c);
   virtual void   SetGlobal(Bool_t global);
   virtual void   GlobalSetModel(TVirtualPad *, TObject *, Int_t);
   virtual void   SetModel(TVirtualPad* pad, TObject* obj, Int_t event);
   virtual void   Show();
   virtual void   RecursiveRemove(TObject* obj);

   static TGedEditor* GetFrameCreator();
   static void SetFrameCreator(TGedEditor* e);

   ClassDef(TGedEditor,0)  // ROOT graphics editor
};

#endif
 TGedEditor.h:1
 TGedEditor.h:2
 TGedEditor.h:3
 TGedEditor.h:4
 TGedEditor.h:5
 TGedEditor.h:6
 TGedEditor.h:7
 TGedEditor.h:8
 TGedEditor.h:9
 TGedEditor.h:10
 TGedEditor.h:11
 TGedEditor.h:12
 TGedEditor.h:13
 TGedEditor.h:14
 TGedEditor.h:15
 TGedEditor.h:16
 TGedEditor.h:17
 TGedEditor.h:18
 TGedEditor.h:19
 TGedEditor.h:20
 TGedEditor.h:21
 TGedEditor.h:22
 TGedEditor.h:23
 TGedEditor.h:24
 TGedEditor.h:25
 TGedEditor.h:26
 TGedEditor.h:27
 TGedEditor.h:28
 TGedEditor.h:29
 TGedEditor.h:30
 TGedEditor.h:31
 TGedEditor.h:32
 TGedEditor.h:33
 TGedEditor.h:34
 TGedEditor.h:35
 TGedEditor.h:36
 TGedEditor.h:37
 TGedEditor.h:38
 TGedEditor.h:39
 TGedEditor.h:40
 TGedEditor.h:41
 TGedEditor.h:42
 TGedEditor.h:43
 TGedEditor.h:44
 TGedEditor.h:45
 TGedEditor.h:46
 TGedEditor.h:47
 TGedEditor.h:48
 TGedEditor.h:49
 TGedEditor.h:50
 TGedEditor.h:51
 TGedEditor.h:52
 TGedEditor.h:53
 TGedEditor.h:54
 TGedEditor.h:55
 TGedEditor.h:56
 TGedEditor.h:57
 TGedEditor.h:58
 TGedEditor.h:59
 TGedEditor.h:60
 TGedEditor.h:61
 TGedEditor.h:62
 TGedEditor.h:63
 TGedEditor.h:64
 TGedEditor.h:65
 TGedEditor.h:66
 TGedEditor.h:67
 TGedEditor.h:68
 TGedEditor.h:69
 TGedEditor.h:70
 TGedEditor.h:71
 TGedEditor.h:72
 TGedEditor.h:73
 TGedEditor.h:74
 TGedEditor.h:75
 TGedEditor.h:76
 TGedEditor.h:77
 TGedEditor.h:78
 TGedEditor.h:79
 TGedEditor.h:80
 TGedEditor.h:81
 TGedEditor.h:82
 TGedEditor.h:83
 TGedEditor.h:84
 TGedEditor.h:85
 TGedEditor.h:86
 TGedEditor.h:87
 TGedEditor.h:88
 TGedEditor.h:89
 TGedEditor.h:90
 TGedEditor.h:91
 TGedEditor.h:92
 TGedEditor.h:93
 TGedEditor.h:94
 TGedEditor.h:95
 TGedEditor.h:96
 TGedEditor.h:97
 TGedEditor.h:98
 TGedEditor.h:99
 TGedEditor.h:100
 TGedEditor.h:101
 TGedEditor.h:102
 TGedEditor.h:103
 TGedEditor.h:104
 TGedEditor.h:105
 TGedEditor.h:106
 TGedEditor.h:107
 TGedEditor.h:108
 TGedEditor.h:109
 TGedEditor.h:110
 TGedEditor.h:111
 TGedEditor.h:112
 TGedEditor.h:113
 TGedEditor.h:114
 TGedEditor.h:115
 TGedEditor.h:116
 TGedEditor.h:117
 TGedEditor.h:118
 TGedEditor.h:119
 TGedEditor.h:120