TGTableHeader.h

Go to the documentation of this file.
00001 // Author: Roel Aaij   21/07/2007
00002 
00003 /*************************************************************************
00004  * Copyright (C) 1995-2007, Rene Brun and Fons Rademakers.               *
00005  * All rights reserved.                                                  *
00006  *                                                                       *
00007  * For the licensing terms see $ROOTSYS/LICENSE.                         *
00008  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
00009  *************************************************************************/
00010 
00011 #ifndef ROOT_TGTableHeader
00012 #define ROOT_TGTableHeader
00013 
00014 #ifndef ROOT_TGTableCell
00015 #include "TGTableCell.h"
00016 #endif
00017 
00018 enum EHeaderType {
00019    kColumnHeader,
00020    kRowHeader,
00021    kTableHeader
00022 };   
00023 
00024 class TGWindow;
00025 
00026 class TGTableHeader : public TGTableCell {
00027 
00028 protected:
00029    EHeaderType fType;        // Type of header
00030    UInt_t      fWidth;       // Width for the column
00031    UInt_t      fHeight;      // Height of the row
00032    Bool_t      fReadOnly;    // Cell readonly state
00033    Bool_t      fEnabled;     // Cell enabled state
00034    Bool_t      fHasOwnLabel; // Flag on default or specific label usage
00035 
00036    void        Init();
00037 
00038 public:
00039    TGTableHeader(const TGWindow *p = 0, TGTable *table = 0, 
00040                  TGString *label = 0, UInt_t position = 0, 
00041                  EHeaderType type = kColumnHeader, UInt_t width = 80,
00042                  UInt_t height = 25, GContext_t norm = GetDefaultGC()(),
00043                  FontStruct_t font = GetDefaultFontStruct(),
00044                  UInt_t option = 0);
00045    TGTableHeader(const TGWindow *p, TGTable *table, const char *label, 
00046                  UInt_t position, EHeaderType type = kColumnHeader, 
00047                  UInt_t width = 80, UInt_t height = 25, 
00048                  GContext_t norm = GetDefaultGC()(),
00049                  FontStruct_t font = GetDefaultFontStruct(),
00050                  UInt_t option = 0);
00051    virtual ~TGTableHeader();
00052 
00053    virtual void SetWidth(UInt_t width);    
00054    virtual void SetHeight(UInt_t height);
00055 
00056    virtual void SetLabel(const char *label);
00057 
00058    virtual void SetDefaultLabel();
00059    virtual void SetPosition(UInt_t pos);
00060    virtual void Resize(UInt_t width, UInt_t height);  // Resize width or height
00061    virtual void Resize(TGDimension newsize);          // depending on type
00062    virtual void Sort(Bool_t order = kSortAscending);
00063    virtual void UpdatePosition();
00064 
00065    virtual EHeaderType GetType() { return fType; }
00066 
00067    ClassDef(TGTableHeader, 0) // Header for use in TGTable.
00068 };
00069 
00070 #endif

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