Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
TGTableHeader.h
Go to the documentation of this file.
1 // Author: Roel Aaij 21/07/2007
2 
3 /*************************************************************************
4  * Copyright (C) 1995-2007, Rene Brun and Fons Rademakers. *
5  * All rights reserved. *
6  * *
7  * For the licensing terms see $ROOTSYS/LICENSE. *
8  * For the list of contributors see $ROOTSYS/README/CREDITS. *
9  *************************************************************************/
10 
11 #ifndef ROOT_TGTableHeader
12 #define ROOT_TGTableHeader
13 
14 #include "TGTableCell.h"
15 
16 enum EHeaderType {
17  kColumnHeader,
18  kRowHeader,
19  kTableHeader
20 };
21 
22 class TGWindow;
23 
24 class TGTableHeader : public TGTableCell {
25 
26 protected:
27  EHeaderType fType; // Type of header
28  UInt_t fWidth; // Width for the column
29  UInt_t fHeight; // Height of the row
30  Bool_t fReadOnly; // Cell readonly state
31  Bool_t fEnabled; // Cell enabled state
32  Bool_t fHasOwnLabel; // Flag on default or specific label usage
33 
34  void Init();
35 
36 public:
37  TGTableHeader(const TGWindow *p = 0, TGTable *table = 0,
38  TGString *label = 0, UInt_t position = 0,
39  EHeaderType type = kColumnHeader, UInt_t width = 80,
40  UInt_t height = 25, GContext_t norm = GetDefaultGC()(),
41  FontStruct_t font = GetDefaultFontStruct(),
42  UInt_t option = 0);
43  TGTableHeader(const TGWindow *p, TGTable *table, const char *label,
44  UInt_t position, EHeaderType type = kColumnHeader,
45  UInt_t width = 80, UInt_t height = 25,
46  GContext_t norm = GetDefaultGC()(),
47  FontStruct_t font = GetDefaultFontStruct(),
48  UInt_t option = 0);
49  virtual ~TGTableHeader();
50 
51  virtual void SetWidth(UInt_t width);
52  virtual void SetHeight(UInt_t height);
53 
54  virtual void SetLabel(const char *label);
55 
56  virtual void SetDefaultLabel();
57  virtual void SetPosition(UInt_t pos);
58  virtual void Resize(UInt_t width, UInt_t height); // Resize width or height
59  virtual void Resize(TGDimension newsize); // depending on type
60  virtual void Sort(Bool_t order = kSortAscending);
61  virtual void UpdatePosition();
62 
63  virtual EHeaderType GetType() { return fType; }
64 
65  ClassDef(TGTableHeader, 0) // Header for use in TGTable.
66 };
67 
68 #endif