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 #include "TVirtualX.h"
25 
26 // user include files
27 
28 // forward declarations
29 class FWTableManagerBase;
30 
31 class FWTabularWidget : public TGFrame {
32 public:
33  static const TGGC& getDefaultGC();
34 
35  static const int kTextBuffer;
36  static const int kSeperatorWidth;
37 
38  FWTabularWidget(FWTableManagerBase* iManager, const TGWindow* p = nullptr, GContext_t context = getDefaultGC()());
39  ~FWTabularWidget() override;
40 
41  // ---------- const member functions ---------------------
42  const std::vector<unsigned int>& widthOfTextInColumns() const { return m_widthOfTextInColumns; }
43  UInt_t verticalOffset() const { return m_vOffset; }
44  UInt_t horizontalOffset() const { return m_hOffset; }
45 
46  // ---------- static member functions --------------------
47 
48  // ---------- member functions ---------------------------
49  void setWidthOfTextInColumns(const std::vector<unsigned int>&);
50  void DoRedraw() override;
51  TGDimension GetDefaultSize() const override;
52 
53  void setVerticalOffset(UInt_t);
54  void setHorizontalOffset(UInt_t);
55 
56  Bool_t HandleButton(Event_t* event) override;
57 
58  void buttonPressed(Int_t row, Int_t column, Event_t* event, Int_t relX, Int_t relY); //*SIGNAL*
59  void buttonReleased(Int_t row, Int_t column, Event_t* event, Int_t relX, Int_t relY); //*SIGNAL*
60 
61  void dataChanged();
62  void needToRedraw();
63 
65 
66  void setLineContext(GContext_t iContext);
67  void setBackgroundAreaContext(GContext_t iContext);
68 
69  void disableGrowInWidth() { m_growInWidth = false; }
70 
71 private:
72  //FWTabularWidget(const FWTabularWidget&); // stop default
73 
74  //const FWTabularWidget& operator=(const FWTabularWidget&); // stop default
75 
76  // ---------- member data --------------------------------
77 
78  void translateToRowColumn(Int_t iX, Int_t iY, Int_t& oRow, Int_t& oCol, Int_t& oRelX, Int_t& oRelY) const;
79 
81  std::vector<unsigned int> m_widthOfTextInColumns;
82  std::vector<unsigned int> m_widthOfTextInColumnsMax;
85 
86  unsigned int m_vOffset;
87  unsigned int m_hOffset;
88 
89  GContext_t m_normGC;
90  GContext_t m_backgroundGC;
91 
93 };
94 
95 #endif
void buttonReleased(Int_t row, Int_t column, Event_t *event, Int_t relX, Int_t relY)
Bool_t HandleButton(Event_t *event) override
unsigned int m_vOffset
void DoRedraw() override
void setLineContext(GContext_t iContext)
TGDimension GetDefaultSize() const override
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 > &)
~FWTabularWidget() override
static const TGGC & getDefaultGC()
GContext_t m_backgroundGC
GContext_t m_normGC
std::vector< unsigned int > m_widthOfTextInColumns
void disableGrowInWidth()
void setHorizontalOffset(UInt_t)
ClassDefOverride(FWTabularWidget, 0)
unsigned int m_hOffset
FWTableManagerBase * m_table
void setBackgroundAreaContext(GContext_t iContext)
UInt_t verticalOffset() const
std::vector< unsigned int > m_widthOfTextInColumnsMax
static const int kSeperatorWidth
const std::vector< unsigned int > & widthOfTextInColumns() const
static const int kTextBuffer
void setVerticalOffset(UInt_t)
void translateToRowColumn(Int_t iX, Int_t iY, Int_t &oRow, Int_t &oCol, Int_t &oRelX, Int_t &oRelY) const
UInt_t horizontalOffset() const
Definition: event.py:1