#ifndef ROOT_TEveGedEditor
#define ROOT_TEveGedEditor
#include "TGedEditor.h"
#include "TGedFrame.h"
#include "TGButton.h"
class TEveElement;
class TContextMenu;
class TEveGedEditor : public TGedEditor
{
TEveGedEditor(const TEveGedEditor&);
TEveGedEditor& operator=(const TEveGedEditor&);
public:
typedef TGedFrame* (*NameFrameCreator_t)(TEveGedEditor*, const TGWindow* parent, const char* tab_name);
protected:
TEveElement *fElement;
TObject *fObject;
virtual TGedFrame* CreateNameFrame(const TGWindow* parent, const char* tab_name);
static Int_t fgMaxExtraEditors;
static TList *fgExtraEditors;
static TContextMenu *fgContextMenu;
public:
TEveGedEditor(TCanvas* canvas=0, UInt_t width=250, UInt_t height=400);
virtual ~TEveGedEditor();
virtual void CloseWindow();
virtual void DeleteWindow();
TEveElement* GetEveElement() const;
void DisplayElement(TEveElement* re);
void DisplayObject(TObject* obj);
virtual void SetModel(TVirtualPad* pad, TObject* obj, Int_t event);
virtual void Update(TGedFrame* gframe=0);
static void SpawnNewEditor(TObject* obj);
static void ElementChanged(TEveElement* el);
static void ElementDeleted(TEveElement* el);
static void DestroyEditors();
static TContextMenu* GetContextMenu();
ClassDef(TEveGedEditor, 0);
};
class TEveGedNameFrame : public TGedFrame
{
private:
TEveGedNameFrame(const TEveGedNameFrame&);
TEveGedNameFrame& operator=(const TEveGedNameFrame&);
protected:
TGTextButton *fNCButton;
public:
TEveGedNameFrame(const TGWindow *p=0, Int_t width=140, Int_t height=30,
UInt_t options=kChildFrame | kHorizontalFrame);
virtual ~TEveGedNameFrame();
virtual void SetModel(TObject* obj);
void SpawnEditorClone();
ClassDef(TEveGedNameFrame, 0);
};
class TEveGedNameTextButton : public TGTextButton
{
TEveGedNameFrame *fFrame;
public:
TEveGedNameTextButton(TEveGedNameFrame* p);
virtual ~TEveGedNameTextButton();
virtual Bool_t HandleButton(Event_t* event);
ClassDef(TEveGedNameTextButton, 0);
};
#endif