TGedEditor.h

Go to the documentation of this file.
00001 // @(#)root/ged:$Id: TGedEditor.h 31320 2009-11-19 16:42:53Z bellenot $
00002 // Author: Marek Biskup, Ilka Antcheva   02/12/2003
00003 
00004 /*************************************************************************
00005  * Copyright (C) 1995-2000, 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_TGedEditor
00013 #define ROOT_TGedEditor
00014 
00015 //////////////////////////////////////////////////////////////////////////
00016 //                                                                      //
00017 // TGedEditor                                                           //
00018 //                                                                      //
00019 // Editor is a composite frame that contains GUI for editting objects   //
00020 // in a canvas. It looks for the class ROOT_classname + 'Editor'.       //
00021 //                                                                      //
00022 // It connects to a Canvas and listens for selected objects             //
00023 //                                                                      //
00024 //////////////////////////////////////////////////////////////////////////
00025 
00026 #ifndef ROOT_TGFrame
00027 #include "TGFrame.h"
00028 #endif
00029 #ifndef ROOT_TVirtualPadEditor
00030 #include "TVirtualPadEditor.h"
00031 #endif
00032 #ifndef ROOT_TList
00033 #include "TList.h"
00034 #endif
00035 #ifndef ROOT_TMap
00036 #include "TMap.h"
00037 #endif
00038 
00039 class TCanvas;
00040 class TGCanvas;
00041 class TGTab;
00042 class TGTabElement;
00043 class TVirtualPad;
00044 class TGedFrame;
00045 class TGedNameFrame;
00046 
00047 class TGedTabInfo;
00048 
00049 class TGedEditor : public TVirtualPadEditor, public TGMainFrame
00050 {
00051 private:
00052    TGedEditor(const TGedEditor&);            // Not implemented
00053    TGedEditor& operator=(const TGedEditor&); // Not implemented
00054 
00055 protected:
00056    TMap              fFrameMap;         //global map of available frames
00057    TMap              fExclMap;          //map of excluded editors for selected model
00058    TList             fGedFrames;        //list visible of frames 
00059 
00060    TGCanvas         *fCan;              //provides scroll bars
00061    TGTab            *fTab;              //tab widget holding the editor
00062 
00063    TList             fCreatedTabs;      //list of created tabs
00064    TList             fVisibleTabs;      //list ofcurrently used tabs
00065    TGCompositeFrame *fTabContainer;     //main tab container
00066 
00067    TObject          *fModel;            //selected object
00068    TVirtualPad      *fPad;              //selected pad
00069    TCanvas          *fCanvas;           //canvas related to the editor
00070    TClass           *fClass;            //class of the selected object
00071    Bool_t            fGlobal;           //true if editor is global
00072 
00073    void              ConfigureGedFrames(Bool_t objChaged);
00074 
00075    virtual TGedFrame* CreateNameFrame(const TGWindow* parent, const char* tab_name); 
00076 
00077    static TGedEditor *fgFrameCreator; 
00078 
00079 public:
00080    TGedEditor(TCanvas* canvas = 0, UInt_t width = 175, UInt_t height = 20);
00081    virtual ~TGedEditor();
00082 
00083    void          PrintFrameStat();
00084    virtual void  Update(TGedFrame* frame = 0);
00085    void          ReinitWorkspace();
00086    void          ActivateEditor (TClass* cl, Bool_t recurse);
00087    void          ActivateEditors(TList* bcl, Bool_t recurse);
00088    void          ExcludeClassEditor(TClass* cl, Bool_t recurse = kFALSE);
00089    void          InsertGedFrame(TGedFrame* f);
00090 
00091    TGCanvas*                 GetTGCanvas() const { return fCan; }
00092    TGTab*                    GetTab()      const { return fTab; }
00093    virtual TGCompositeFrame* GetEditorTab(const char* name);
00094    virtual TGedTabInfo*      GetEditorTabInfo(const char* name);
00095 
00096    virtual TCanvas*          GetCanvas() const { return fCanvas; }
00097    virtual TVirtualPad*      GetPad()    const { return fPad; }
00098    virtual TObject*          GetModel()  const { return fModel; }
00099 
00100 
00101    virtual void   CloseWindow();
00102    virtual void   ConnectToCanvas(TCanvas *c);
00103    virtual void   DisconnectFromCanvas();
00104    virtual Bool_t IsGlobal() const  { return fGlobal; } 
00105    virtual void   Hide();
00106    virtual void   GlobalClosed();
00107    virtual void   SetCanvas(TCanvas *c);
00108    virtual void   SetGlobal(Bool_t global);
00109    virtual void   GlobalSetModel(TVirtualPad *, TObject *, Int_t);
00110    virtual void   SetModel(TVirtualPad* pad, TObject* obj, Int_t event);
00111    virtual void   Show();
00112    virtual void   RecursiveRemove(TObject* obj);
00113 
00114    static TGedEditor* GetFrameCreator();
00115    static void SetFrameCreator(TGedEditor* e);
00116 
00117    ClassDef(TGedEditor,0)  // ROOT graphics editor
00118 };
00119 
00120 #endif

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