00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef ROOT_TEveGedEditor
00013 #define ROOT_TEveGedEditor
00014
00015 #include "TGedEditor.h"
00016 #include "TGedFrame.h"
00017 #include "TGButton.h"
00018
00019 class TEveElement;
00020 class TContextMenu;
00021
00022
00023
00024
00025
00026 class TEveGedEditor : public TGedEditor
00027 {
00028 TEveGedEditor(const TEveGedEditor&);
00029 TEveGedEditor& operator=(const TEveGedEditor&);
00030
00031 public:
00032 typedef TGedFrame* (*NameFrameCreator_t)(TEveGedEditor*, const TGWindow* parent, const char* tab_name);
00033
00034 protected:
00035 TEveElement *fElement;
00036 TObject *fObject;
00037
00038 virtual TGedFrame* CreateNameFrame(const TGWindow* parent, const char* tab_name);
00039
00040 static Int_t fgMaxExtraEditors;
00041 static TList *fgExtraEditors;
00042
00043 static TContextMenu *fgContextMenu;
00044
00045 public:
00046 TEveGedEditor(TCanvas* canvas=0, UInt_t width=250, UInt_t height=400);
00047 virtual ~TEveGedEditor();
00048
00049 virtual void CloseWindow();
00050 virtual void DeleteWindow();
00051
00052 TEveElement* GetEveElement() const;
00053
00054 void DisplayElement(TEveElement* re);
00055 void DisplayObject(TObject* obj);
00056
00057 virtual void SetModel(TVirtualPad* pad, TObject* obj, Int_t event);
00058 virtual void Update(TGedFrame* gframe=0);
00059
00060
00061
00062 static void SpawnNewEditor(TObject* obj);
00063 static void ElementChanged(TEveElement* el);
00064 static void ElementDeleted(TEveElement* el);
00065
00066 static void DestroyEditors();
00067
00068 static TContextMenu* GetContextMenu();
00069
00070 ClassDef(TEveGedEditor, 0);
00071 };
00072
00073
00074
00075
00076
00077
00078 class TEveGedNameFrame : public TGedFrame
00079 {
00080 private:
00081 TEveGedNameFrame(const TEveGedNameFrame&);
00082 TEveGedNameFrame& operator=(const TEveGedNameFrame&);
00083
00084 protected:
00085 TGTextButton *fNCButton;
00086
00087 public:
00088 TEveGedNameFrame(const TGWindow *p=0, Int_t width=140, Int_t height=30,
00089 UInt_t options=kChildFrame | kHorizontalFrame);
00090 virtual ~TEveGedNameFrame();
00091
00092 virtual void SetModel(TObject* obj);
00093
00094 void SpawnEditorClone();
00095
00096 ClassDef(TEveGedNameFrame, 0);
00097 };
00098
00099
00100
00101
00102
00103
00104 class TEveGedNameTextButton : public TGTextButton
00105 {
00106 private:
00107 TEveGedNameTextButton(const TEveGedNameTextButton&);
00108 TEveGedNameTextButton& operator=(const TEveGedNameTextButton&);
00109
00110 TEveGedNameFrame *fFrame;
00111
00112 public:
00113 TEveGedNameTextButton(TEveGedNameFrame* p);
00114 virtual ~TEveGedNameTextButton();
00115
00116 virtual Bool_t HandleButton(Event_t* event);
00117
00118 ClassDef(TEveGedNameTextButton, 0);
00119 };
00120
00121 #endif