Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/root/TGTableCell.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // Author: Roel Aaij   14/08/2007
0002 
0003 /*************************************************************************
0004  * Copyright (C) 1995-2007, Rene Brun and Fons Rademakers.               *
0005  * All rights reserved.                                                  *
0006  *                                                                       *
0007  * For the licensing terms see $ROOTSYS/LICENSE.                         *
0008  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
0009  *************************************************************************/
0010 
0011 #ifndef ROOT_TGTableCell
0012 #define ROOT_TGTableCell
0013 
0014 #include "TGFrame.h"
0015 
0016 class TGTable;
0017 class TGString;
0018 class TGTooltip;
0019 class TGPicture;
0020 class TObjArray;
0021 class TGWindow;
0022 class TGToolTip;
0023 
0024 class TGTableCell : public TGFrame {
0025 
0026 friend class TGTable;
0027 
0028 protected:
0029    TGString      *fLabel;      ///< Text as shown in the cell
0030    TGToolTip     *fTip;        ///< Possible Tooltip
0031    Bool_t         fReadOnly;   ///< Cell readonly state
0032    Bool_t         fEnabled;    ///< Cell enabled state
0033    Int_t          fTMode;      ///< Text justify mode
0034    TGPicture     *fImage;      ///< Image or icon
0035    UInt_t         fTWidth;     ///< Label width
0036    UInt_t         fTHeight;    ///< Label height
0037    FontStruct_t   fFontStruct; ///< Font of the label
0038    Bool_t         fHasOwnFont; ///< Does the cell have it's own font
0039    GContext_t     fNormGC;     ///< graphics context used to draw the cell
0040    UInt_t         fColumn;     ///< Column this cell belongs to
0041    UInt_t         fRow;        ///< Row this cell belongs to
0042    TGTable       *fTable;      ///< TGTable that a cell belongs to
0043 
0044    static const TGGC   *fgDefaultGC;   ///< Default graphics context
0045    static const TGFont *fgDefaultFont; ///< Default font
0046 
0047    void DoRedraw() override;
0048    void DrawBorder() override;
0049    virtual void DrawBorder(Handle_t id, Int_t x, Int_t y);
0050    virtual void MoveDraw(Int_t x, Int_t y);
0051    void Resize(UInt_t width, UInt_t height) override;
0052    void Resize(TGDimension newsize) override;
0053 
0054    virtual void Highlight();
0055    void         Init(Bool_t resize);
0056 
0057 public:
0058    static FontStruct_t GetDefaultFontStruct();
0059    static const TGGC   &GetDefaultGC();
0060 
0061    TGTableCell(const TGWindow *p = nullptr, TGTable *table = nullptr, TGString *label = nullptr,
0062                UInt_t row = 0, UInt_t column = 0, UInt_t width = 80,
0063                UInt_t height = 25, GContext_t norm = GetDefaultGC()(),
0064                FontStruct_t font = GetDefaultFontStruct(), UInt_t option = 0,
0065                Bool_t resize = kTRUE);
0066    TGTableCell(const TGWindow *p, TGTable *table, const char *label,
0067                UInt_t row = 0, UInt_t column = 0, UInt_t width = 80,
0068                UInt_t height = 25, GContext_t norm = GetDefaultGC()(),
0069                FontStruct_t font = GetDefaultFontStruct(),
0070                UInt_t option = 0, Bool_t resize =  kTRUE);
0071 
0072    ~TGTableCell() override;
0073 
0074            void DrawCopy(Handle_t id, Int_t x, Int_t y) override;
0075 
0076    virtual void SetLabel(const char *label);
0077 
0078    virtual void SetImage(TGPicture *image);
0079    //   virtual void SetBckgndGC(TGGC *gc);
0080 
0081    virtual void SetTextJustify(Int_t tmode);
0082    virtual void SetFont(FontStruct_t font);
0083    virtual void SetFont(const char *fontName);
0084 
0085    virtual void Select();
0086    virtual void SelectRow();
0087    virtual void SelectColumn();
0088 
0089    virtual UInt_t      GetColumn() const { return fColumn; }
0090    virtual UInt_t      GetRow() const { return fRow; };
0091    virtual TGString*   GetLabel() const { return fLabel; }
0092    virtual TGPicture*  GetImage() const { return fImage; }
0093    virtual UInt_t      GetWidth() const { return fWidth; }
0094    virtual UInt_t      GetHeight() const {return fHeight; }
0095    virtual TGDimension GetSize() const { return TGDimension(fWidth, fHeight); }
0096    virtual Int_t       GetTextJustify() const { return fTMode; }
0097 
0098    ClassDefOverride(TGTableCell, 0) // A single cell in a TGTable.
0099 };
0100 
0101 #endif