File indexing completed on 2025-01-18 10:11:49
0001
0002
0003
0004
0005
0006
0007
0008
0009
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;
0038 TMap fExclMap;
0039 TList fGedFrames;
0040
0041 TGCanvas *fCan;
0042 TGTab *fTab;
0043
0044 TList fCreatedTabs;
0045 TList fVisibleTabs;
0046 TGCompositeFrame *fTabContainer;
0047
0048 TObject *fModel;
0049 TVirtualPad *fPad;
0050 TCanvas *fCanvas;
0051 TClass *fClass;
0052 Bool_t fGlobal;
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)
0099 };
0100
0101 #endif