00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 #ifndef ROOT_TGTableCell
00012 #define ROOT_TGTableCell
00013 
00014 #ifndef ROOT_TGFrame
00015 #include "TGFrame.h"
00016 #endif
00017 
00018 class TGTable;
00019 class TGString;
00020 class TGTooltip;
00021 class TGPicture;
00022 class TObjArray;
00023 class TGWindow;
00024 class TGToolTip;
00025 
00026 class TGTableCell : public TGFrame {
00027 
00028 friend class TGTable;
00029 
00030 protected:
00031    TGString      *fLabel;      
00032    TGToolTip     *fTip;        
00033    Bool_t         fReadOnly;   
00034    Bool_t         fEnabled;    
00035    Int_t          fTMode;      
00036    TGPicture     *fImage;      
00037    UInt_t         fTWidth;     
00038    UInt_t         fTHeight;    
00039    FontStruct_t   fFontStruct; 
00040    Bool_t         fHasOwnFont; 
00041    GContext_t     fNormGC;     
00042    UInt_t         fColumn;     
00043    UInt_t         fRow;        
00044    TGTable       *fTable;      
00045 
00046    static const TGGC   *fgDefaultGC;   
00047    static const TGFont *fgDefaultFont; 
00048 
00049    virtual void DoRedraw();
00050    virtual void DrawBorder();
00051    virtual void DrawBorder(Handle_t id, Int_t x, Int_t y);
00052    virtual void MoveDraw(Int_t x, Int_t y); 
00053    virtual void Resize(UInt_t width, UInt_t height);
00054    virtual void Resize(TGDimension newsize);
00055 
00056    virtual void Highlight();
00057    void         Init(Bool_t resize);
00058 
00059 public:
00060    static FontStruct_t GetDefaultFontStruct();
00061    static const TGGC   &GetDefaultGC();
00062 
00063    TGTableCell(const TGWindow *p = 0, TGTable *table = 0, TGString *label = 0, 
00064                UInt_t row = 0, UInt_t column = 0, UInt_t width = 80, 
00065                UInt_t height = 25, GContext_t norm = GetDefaultGC()(), 
00066                FontStruct_t font = GetDefaultFontStruct(), UInt_t option = 0,
00067                Bool_t resize = kTRUE);
00068    TGTableCell(const TGWindow *p, TGTable *table, const char *label, 
00069                UInt_t row = 0, UInt_t column = 0, UInt_t width = 80, 
00070                UInt_t height = 25, GContext_t norm = GetDefaultGC()(),
00071                FontStruct_t font = GetDefaultFontStruct(),
00072                UInt_t option = 0, Bool_t resize =  kTRUE);
00073 
00074 
00075 
00076 
00077 
00078 
00079 
00080 
00081 
00082 
00083    virtual ~TGTableCell();
00084 
00085    virtual void DrawCopy(Handle_t id, Int_t x, Int_t y);
00086     
00087    virtual void SetLabel(const char *label);
00088    
00089    virtual void SetImage(TGPicture *image);
00090    
00091 
00092    virtual void SetTextJustify(Int_t tmode); 
00093    virtual void SetFont(FontStruct_t font);
00094    virtual void SetFont(const char *fontName);
00095 
00096    virtual void Select();
00097    virtual void SelectRow();
00098    virtual void SelectColumn();
00099 
00100    virtual UInt_t      GetColumn() const { return fColumn; }
00101    virtual UInt_t      GetRow() const { return fRow; };
00102    virtual TGString*   GetLabel() const { return fLabel; }
00103    virtual TGPicture*  GetImage() const { return fImage; }
00104    virtual UInt_t      GetWidth() const { return fWidth; }
00105    virtual UInt_t      GetHeight() const {return fHeight; }
00106    virtual TGDimension GetSize() const { return TGDimension(fWidth, fHeight); }
00107    virtual Int_t       GetTextJustify() const { return fTMode; }
00108 
00109    ClassDef(TGTableCell, 0) 
00110 } ;
00111 
00112 #endif