CMS 3D CMS Logo

FWTextTableCellRenderer.h
Go to the documentation of this file.
1 #ifndef Fireworks_TableWidget_FWTextTableCellRenderer_h
2 #define Fireworks_TableWidget_FWTextTableCellRenderer_h
3 // -*- C++ -*-
4 //
5 // Package: TableWidget
6 // Class : FWTextTableCellRenderer
7 //
16 //
17 // Original Author: Chris Jones
18 // Created: Mon Feb 2 16:43:50 EST 2009
19 //
20 
21 // system include files
22 #include <string>
23 #include "GuiTypes.h"
24 #include "TGResourcePool.h"
25 #include "TGGC.h"
26 
27 // user include files
29 
30 // forward declarations
31 
33 public:
34  static const TGGC& getDefaultGC();
35  static const TGGC& getDefaultHighlightGC();
36 
38 
39  FWTextTableCellRenderer(const TGGC* iContext = &(getDefaultGC()),
40  const TGGC* iHighlightContext = &(getDefaultHighlightGC()),
41  Justify iJustify = kJustifyLeft);
42  ~FWTextTableCellRenderer() override;
43 
44  // ---------- const member functions ---------------------
45  const TGGC* graphicsContext() const { return m_context; }
46  const TGGC* highlightContext() const { return m_highlightContext; }
47  UInt_t width() const override;
48  UInt_t height() const override;
49 
50  const TGFont* font() const;
51  // ---------- static member functions --------------------
52 
53  // ---------- member functions ---------------------------
54  void setData(const std::string&, bool isSelected);
55  void setData(const char*, bool isSelected);
56  const std::string& data() { return m_data; }
57  void setGraphicsContext(const TGGC* iContext) { m_context = iContext; }
59  void setJustify(Justify);
60  bool selected() { return m_isSelected; }
61 
62  void draw(Drawable_t iID, int iX, int iY, unsigned int iWidth, unsigned int iHeight) override;
63 
64  FWTextTableCellRenderer(const FWTextTableCellRenderer&) = delete; // stop default
65 
66  const FWTextTableCellRenderer& operator=(const FWTextTableCellRenderer&) = delete; // stop default
67 
68 private:
69  // ---------- member data --------------------------------
70  const TGGC* m_context;
71  const TGGC* m_highlightContext;
72  TGFont* m_font;
76 };
77 
78 #endif
void draw(Drawable_t iID, int iX, int iY, unsigned int iWidth, unsigned int iHeight) override
FWTextTableCellRenderer(const TGGC *iContext=&(getDefaultGC()), const TGGC *iHighlightContext=&(getDefaultHighlightGC()), Justify iJustify=kJustifyLeft)
UInt_t height() const override
returns the minimum height of the cell to which the renderer is representing
const TGGC * graphicsContext() const
const TGGC * highlightContext() const
const FWTextTableCellRenderer & operator=(const FWTextTableCellRenderer &)=delete
UInt_t width() const override
returns the minimum width of the cell to which the renderer is representing
static const TGGC & getDefaultGC()
void setHighlightContext(const TGGC *context)
static const TGGC & getDefaultHighlightGC()
void setGraphicsContext(const TGGC *iContext)
const std::string & data()
void setData(const std::string &, bool isSelected)
bool isSelected(const std::vector< L1HPSPFTauQualityCut > &qualityCuts, const l1t::PFCandidate &pfCand, float_t primaryVertexZ)