Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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
20};
21
22class TGWindow;
23
24class TGTableHeader : public TGTableCell {
25
26protected:
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
36public:
37 TGTableHeader(const TGWindow *p = nullptr, TGTable *table = nullptr,
38 TGString *label = nullptr, UInt_t position = 0,
40 UInt_t height = 25, GContext_t norm = GetDefaultGC()(),
42 UInt_t option = 0);
43 TGTableHeader(const TGWindow *p, TGTable *table, const char *label,
45 UInt_t width = 80, UInt_t height = 25,
46 GContext_t norm = GetDefaultGC()(),
48 UInt_t option = 0);
49 ~TGTableHeader() override;
50
51 void SetWidth(UInt_t width) override;
52 void SetHeight(UInt_t height) override;
53
54 void SetLabel(const char *label) override;
55
56 virtual void SetDefaultLabel();
57 virtual void SetPosition(UInt_t pos);
58 void Resize(UInt_t width, UInt_t height) override; // Resize width or height
59 void Resize(TGDimension newsize) override; // depending on type
60 virtual void Sort(Bool_t order = kSortAscending);
61 virtual void UpdatePosition();
62
63 virtual EHeaderType GetType() { return fType; }
64
65 ClassDefOverride(TGTableHeader, 0) // Header for use in TGTable.
66};
67
68#endif
Handle_t GContext_t
Graphics context handle.
Definition GuiTypes.h:38
Handle_t FontStruct_t
Pointer to font structure.
Definition GuiTypes.h:39
#define ClassDefOverride(name, id)
Definition Rtypes.h:346
EHeaderType
@ kColumnHeader
@ kRowHeader
@ kTableHeader
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t option
Option_t Option_t width
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t type
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t height
const Bool_t kSortAscending
Definition TList.h:31
TGString wraps a TString and adds some graphics routines like drawing, size of string on screen depen...
Definition TGString.h:20
TGTableCell is the class that represents a single cell in a TGTable.
Definition TGTableCell.h:24
static FontStruct_t GetDefaultFontStruct()
Return default font structure.
static const TGGC & GetDefaultGC()
Return default graphics context.
TGTableHeader is the class that implements a header for a row or column.
virtual EHeaderType GetType()
void Resize(UInt_t width, UInt_t height) override
Resize the TGTableHeader.
void SetWidth(UInt_t width) override
Resize the TGTableHeader.
virtual void SetPosition(UInt_t pos)
Set the position of the TGTableHeader to pos.
UInt_t fWidth
Width for the column.
EHeaderType fType
Type of header.
UInt_t fHeight
Height of the row.
virtual void Sort(Bool_t order=kSortAscending)
Sort the contents of this row or column in given order.
void Init()
Initialize the TGTableHeader.
Bool_t fHasOwnLabel
Flag on default or specific label usage.
virtual void UpdatePosition()
Update the positon of the TGTableHeader.
virtual void SetDefaultLabel()
Set the label of the TGTableHeader to the default label, "Row #" or "Col #".
void SetLabel(const char *label) override
Set the label of the TGTableHeader to label.
Bool_t fEnabled
Cell enabled state.
void SetHeight(UInt_t height) override
Resize the TGTableHeader.
~TGTableHeader() override
TGTableHeader destructor.
Bool_t fReadOnly
Cell readonly state.
Create an array to hold a bunch of numbers.
Definition TGTable.h:34
ROOT GUI Window base class.
Definition TGWindow.h:23