CMS 3D CMS Logo

FWTabularWidget.h
Go to the documentation of this file.
1 #ifndef Fireworks_TableWidget_FWTabularWidget_h
2 #define Fireworks_TableWidget_FWTabularWidget_h
3 // -*- C++ -*-
4 //
5 // Package: TableWidget
6 // Class : FWTabularWidget
7 //
16 //
17 // Original Author: Chris Jones
18 // Created: Mon Feb 2 16:45:19 EST 2009
19 //
20 
21 // system include files
22 #include <vector>
23 #include "TGFrame.h"
24 
25 // user include files
26 
27 // forward declarations
28 class FWTableManagerBase;
29 
30 class FWTabularWidget : public TGFrame
31 {
32 
33 public:
34  static const TGGC& getDefaultGC();
35 
36  static const int kTextBuffer;
37  static const int kSeperatorWidth;
38 
39  FWTabularWidget(FWTableManagerBase* iManager,const TGWindow* p=nullptr, GContext_t context = getDefaultGC()());
40  ~FWTabularWidget() override;
41 
42  // ---------- const member functions ---------------------
43  const std::vector<unsigned int>& widthOfTextInColumns() const { return m_widthOfTextInColumns;}
44  UInt_t verticalOffset() const {return m_vOffset;}
45  UInt_t horizontalOffset() const { return m_hOffset;}
46 
47  // ---------- static member functions --------------------
48 
49  // ---------- member functions ---------------------------
50  void setWidthOfTextInColumns(const std::vector<unsigned int>& );
51  void DoRedraw() override;
52  TGDimension GetDefaultSize() const override;
53 
54  void setVerticalOffset(UInt_t);
55  void setHorizontalOffset(UInt_t);
56 
57  Bool_t HandleButton(Event_t *event) override;
58 
59  void buttonPressed(Int_t row, Int_t column, Event_t* event, Int_t relX, Int_t relY); //*SIGNAL*
60  void buttonReleased(Int_t row, Int_t column, Event_t* event, Int_t relX, Int_t relY); //*SIGNAL*
61 
62  void dataChanged();
63  void needToRedraw();
64 
66 
67  void setLineContext(GContext_t iContext);
68  void setBackgroundAreaContext(GContext_t iContext);
69 
70  void disableGrowInWidth() { m_growInWidth = false; }
71 
72 private:
73  //FWTabularWidget(const FWTabularWidget&); // stop default
74 
75  //const FWTabularWidget& operator=(const FWTabularWidget&); // stop default
76 
77  // ---------- member data --------------------------------
78 
79  void translateToRowColumn(Int_t iX, Int_t iY, Int_t& oRow, Int_t& oCol, Int_t&oRelX, Int_t& oRelY) const;
80 
82  std::vector<unsigned int> m_widthOfTextInColumns;
83  std::vector<unsigned int> m_widthOfTextInColumnsMax;
86 
87  unsigned int m_vOffset;
88  unsigned int m_hOffset;
89 
90  GContext_t m_normGC;
91  GContext_t m_backgroundGC;
92 
94 };
95 
96 
97 #endif
void buttonReleased(Int_t row, Int_t column, Event_t *event, Int_t relX, Int_t relY)
void translateToRowColumn(Int_t iX, Int_t iY, Int_t &oRow, Int_t &oCol, Int_t &oRelX, Int_t &oRelY) const
Bool_t HandleButton(Event_t *event) override
unsigned int m_vOffset
void DoRedraw() override
void setLineContext(GContext_t iContext)
void buttonPressed(Int_t row, Int_t column, Event_t *event, Int_t relX, Int_t relY)
FWTabularWidget(FWTableManagerBase *iManager, const TGWindow *p=nullptr, GContext_t context=getDefaultGC()())
void setWidthOfTextInColumns(const std::vector< unsigned int > &)
UInt_t verticalOffset() const
~FWTabularWidget() override
static const TGGC & getDefaultGC()
TGDimension GetDefaultSize() const override
GContext_t m_backgroundGC
GContext_t m_normGC
std::vector< unsigned int > m_widthOfTextInColumns
void disableGrowInWidth()
void setHorizontalOffset(UInt_t)
const std::vector< unsigned int > & widthOfTextInColumns() const
ClassDefOverride(FWTabularWidget, 0)
unsigned int m_hOffset
UInt_t horizontalOffset() const
FWTableManagerBase * m_table
void setBackgroundAreaContext(GContext_t iContext)
std::vector< unsigned int > m_widthOfTextInColumnsMax
static const int kSeperatorWidth
static const int kTextBuffer
void setVerticalOffset(UInt_t)
Definition: event.py:1