Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:12:05

0001 // Author: Roel Aaij   21/07/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_TGTableHeader
0012 #define ROOT_TGTableHeader
0013 
0014 #include "TGTableCell.h"
0015 
0016 enum EHeaderType {
0017    kColumnHeader,
0018    kRowHeader,
0019    kTableHeader
0020 };
0021 
0022 class TGWindow;
0023 
0024 class TGTableHeader : public TGTableCell {
0025 
0026 protected:
0027    EHeaderType fType;        ///< Type of header
0028    UInt_t      fWidth;       ///< Width for the column
0029    UInt_t      fHeight;      ///< Height of the row
0030    Bool_t      fReadOnly;    ///< Cell readonly state
0031    Bool_t      fEnabled;     ///< Cell enabled state
0032    Bool_t      fHasOwnLabel; ///< Flag on default or specific label usage
0033 
0034    void        Init();
0035 
0036 public:
0037    TGTableHeader(const TGWindow *p = nullptr, TGTable *table = nullptr,
0038                  TGString *label = nullptr, UInt_t position = 0,
0039                  EHeaderType type = kColumnHeader, UInt_t width = 80,
0040                  UInt_t height = 25, GContext_t norm = GetDefaultGC()(),
0041                  FontStruct_t font = GetDefaultFontStruct(),
0042                  UInt_t option = 0);
0043    TGTableHeader(const TGWindow *p, TGTable *table, const char *label,
0044                  UInt_t position, EHeaderType type = kColumnHeader,
0045                  UInt_t width = 80, UInt_t height = 25,
0046                  GContext_t norm = GetDefaultGC()(),
0047                  FontStruct_t font = GetDefaultFontStruct(),
0048                  UInt_t option = 0);
0049    ~TGTableHeader() override;
0050 
0051    void SetWidth(UInt_t width) override;
0052    void SetHeight(UInt_t height) override;
0053 
0054    void SetLabel(const char *label) override;
0055 
0056    virtual void SetDefaultLabel();
0057    virtual void SetPosition(UInt_t pos);
0058    void Resize(UInt_t width, UInt_t height) override;  // Resize width or height
0059    void Resize(TGDimension newsize) override;          // depending on type
0060    virtual void Sort(Bool_t order = kSortAscending);
0061    virtual void UpdatePosition();
0062 
0063    virtual EHeaderType GetType() { return fType; }
0064 
0065    ClassDefOverride(TGTableHeader, 0) // Header for use in TGTable.
0066 };
0067 
0068 #endif