TGedFrame.h

Go to the documentation of this file.
00001 // @(#)root/ged:$Id: TGedFrame.h 33457 2010-05-11 07:11:07Z bellenot $
00002 // Author: Ilka  Antcheva 10/05/04
00003 
00004 /*************************************************************************
00005  * Copyright (C) 1995-2002, 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_TGedFrame
00013 #define ROOT_TGedFrame
00014 
00015 //////////////////////////////////////////////////////////////////////////
00016 //                                                                      //
00017 //  TGedFrame                                                           //
00018 //                                                                      //
00019 //  Base editor's attribute frame - a service class.                    //
00020 //                                                                      //
00021 //////////////////////////////////////////////////////////////////////////
00022 
00023 #ifndef ROOT_TGFrame
00024 #include "TGFrame.h"
00025 #endif
00026 
00027 class TVirtualPad;
00028 class TCanvas;
00029 class TGLabel;
00030 class TGToolTip;
00031 class TList;
00032 class TGTab;
00033 class TGedEditor;
00034 
00035 class TGedFrame : public TGCompositeFrame {
00036 
00037 public:
00038    // Inner class to store information for each extra tab.
00039    class TGedSubFrame : public TObject {
00040    private:
00041       TGedSubFrame(const TGedSubFrame&);            // Not implemented
00042       TGedSubFrame& operator=(const TGedSubFrame&); // Not implemented
00043    public:
00044       TString            fName;
00045       TGCompositeFrame  *fFrame;
00046 
00047       TGedSubFrame(TString n,  TGCompositeFrame* f) : fName(n), fFrame(f) {}
00048    };
00049 
00050 private:
00051    TGedFrame(const TGedFrame&);            // Not implemented
00052    TGedFrame& operator=(const TGedFrame&); // Not implemented
00053 
00054 protected:
00055    Bool_t          fInit;        // init flag for setting signals/slots
00056    TGedEditor     *fGedEditor;   // manager of this frame
00057    TClass         *fModelClass;  // class corresponding to instantiated GedFrame
00058    Bool_t          fAvoidSignal; // flag for executing slots
00059 
00060    TList          *fExtraTabs;   // addtional tabs in ged editor
00061    Int_t           fPriority;    // location in GedEditor
00062 
00063    virtual void MakeTitle(const char *title);
00064 
00065 public:
00066    TGedFrame(const TGWindow *p = 0,
00067              Int_t width = 140, Int_t height = 30,
00068              UInt_t options = kChildFrame,
00069              Pixel_t back = GetDefaultFrameBackground());
00070    virtual ~TGedFrame();
00071 
00072    virtual void      Update();
00073 
00074    virtual Option_t *GetDrawOption() const;
00075 
00076    TClass*           GetModelClass()              { return fModelClass;  }
00077    Int_t             GetPriority()                { return fPriority;    }
00078    TList*            GetExtraTabs()               { return fExtraTabs;   }
00079    TGedEditor*       GetGedEditor()               { return fGedEditor;   }
00080    virtual void      AddExtraTab(TGedSubFrame* sf);
00081    virtual TGVerticalFrame* CreateEditorTabSubFrame(const char* name);
00082 
00083    virtual void      Refresh(TObject *model);
00084    virtual void      SetDrawOption(Option_t *option="");
00085    virtual Bool_t    AcceptModel(TObject*) { return kTRUE; }
00086    void              SetModelClass(TClass* mcl)   { fModelClass = mcl; }
00087    virtual void      SetModel(TObject* obj) = 0;
00088    virtual void      SetGedEditor(TGedEditor* ed) { fGedEditor = ed; }
00089    virtual void      ActivateBaseClassEditors(TClass* cl);
00090 
00091    ClassDef(TGedFrame, 0); //base editor's frame
00092 };
00093 
00094 class TGedNameFrame : public TGedFrame {
00095 private:
00096    TGedNameFrame(const TGedNameFrame&);            // not implemented
00097    TGedNameFrame& operator=(const TGedNameFrame&); // not implemented
00098 
00099 protected:
00100    TGLabel          *fLabel;      //label of attribute frame
00101    TGCompositeFrame *f1, *f2;     //container frames
00102    TGToolTip        *fTip;            //tool tip associated with button
00103 
00104 public:
00105    TGedNameFrame(const TGWindow *p =0 ,
00106                  Int_t width = 170, Int_t height = 30,
00107                  UInt_t options = kChildFrame,
00108                  Pixel_t back = GetDefaultFrameBackground());
00109    virtual ~TGedNameFrame();
00110 
00111    virtual Bool_t   HandleButton(Event_t *event);
00112    virtual Bool_t   HandleCrossing(Event_t *event);
00113 
00114    virtual void     SetModel(TObject* obj);
00115 
00116    ClassDef(TGedNameFrame,0)      //frame showing the selected object name
00117 };
00118 
00119 #endif
00120 

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