Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:11:49

0001 // @(#)root/ged:$Id$
0002 // Author: Marek Biskup, Ilka Antcheva   02/12/2003
0003 
0004 /*************************************************************************
0005  * Copyright (C) 1995-2021, 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_TGedEditor
0013 #define ROOT_TGedEditor
0014 
0015 
0016 #include "TGFrame.h"
0017 #include "TVirtualPadEditor.h"
0018 #include "TList.h"
0019 #include "TMap.h"
0020 
0021 class TCanvas;
0022 class TGCanvas;
0023 class TGTab;
0024 class TGTabElement;
0025 class TVirtualPad;
0026 class TGedFrame;
0027 class TGedNameFrame;
0028 class TGedTabInfo;
0029 
0030 class TGedEditor : public TVirtualPadEditor, public TGMainFrame
0031 {
0032 private:
0033    TGedEditor(const TGedEditor&) = delete;
0034    TGedEditor& operator=(const TGedEditor&) = delete;
0035 
0036 protected:
0037    TMap              fFrameMap;         ///< global map of available frames
0038    TMap              fExclMap;          ///< map of excluded editors for selected model
0039    TList             fGedFrames;        ///< list visible of frames
0040 
0041    TGCanvas         *fCan;              ///< provides scroll bars
0042    TGTab            *fTab;              ///< tab widget holding the editor
0043 
0044    TList             fCreatedTabs;      ///< list of created tabs
0045    TList             fVisibleTabs;      ///< list ofcurrently used tabs
0046    TGCompositeFrame *fTabContainer;     ///< main tab container
0047 
0048    TObject          *fModel;            ///< selected object
0049    TVirtualPad      *fPad;              ///< selected pad
0050    TCanvas          *fCanvas;           ///< canvas related to the editor
0051    TClass           *fClass;            ///< class of the selected object
0052    Bool_t            fGlobal;           ///< true if editor is global
0053 
0054    void              ConfigureGedFrames(Bool_t objChaged);
0055 
0056    virtual TGedFrame* CreateNameFrame(const TGWindow* parent, const char* tab_name);
0057 
0058    static TGedEditor *fgFrameCreator;
0059 
0060 public:
0061    TGedEditor(TCanvas* canvas = nullptr, UInt_t width = 175, UInt_t height = 20);
0062    ~TGedEditor() override;
0063 
0064    void          PrintFrameStat();
0065    virtual void  Update(TGedFrame* frame = nullptr);
0066    void          ReinitWorkspace();
0067    void          ActivateEditor (TClass* cl, Bool_t recurse);
0068    void          ActivateEditors(TList* bcl, Bool_t recurse);
0069    void          ExcludeClassEditor(TClass* cl, Bool_t recurse = kFALSE);
0070    void          InsertGedFrame(TGedFrame* f);
0071 
0072    TGCanvas*                 GetTGCanvas() const { return fCan; }
0073    TGTab*                    GetTab()      const { return fTab; }
0074    virtual TGCompositeFrame* GetEditorTab(const char* name);
0075    virtual TGedTabInfo*      GetEditorTabInfo(const char* name);
0076 
0077    TCanvas*                  GetCanvas() const override { return fCanvas; }
0078    virtual TVirtualPad*      GetPad()    const { return fPad; }
0079    virtual TObject*          GetModel()  const { return fModel; }
0080 
0081 
0082    void           CloseWindow() override;
0083    virtual void   ConnectToCanvas(TCanvas *c);
0084    virtual void   DisconnectFromCanvas();
0085    Bool_t         IsGlobal() const  override { return fGlobal; }
0086    void           Hide() override;
0087    virtual void   GlobalClosed();
0088    virtual void   SetCanvas(TCanvas *c);
0089    void           SetGlobal(Bool_t global) override;
0090    virtual void   GlobalSetModel(TVirtualPad *, TObject *, Int_t);
0091    virtual void   SetModel(TVirtualPad* pad, TObject* obj, Int_t event, Bool_t force=kFALSE);
0092    void           Show() override;
0093    void           RecursiveRemove(TObject* obj) override;
0094 
0095    static TGedEditor* GetFrameCreator();
0096    static void SetFrameCreator(TGedEditor* e);
0097 
0098    ClassDefOverride(TGedEditor,0)  // ROOT graphics editor
0099 };
0100 
0101 #endif