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; }
58  void setHighlightContext(const TGGC* context) { m_highlightContext = context; }
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 private:
65  FWTextTableCellRenderer(const FWTextTableCellRenderer&) = delete; // stop default
66 
67  const FWTextTableCellRenderer& operator=(const FWTextTableCellRenderer&) = delete; // stop default
68 
69  // ---------- member data --------------------------------
70  const TGGC* m_context;
71  const TGGC* m_highlightContext;
72  TGFont* m_font;
76 };
77 
78 #endif
FWTextTableCellRenderer::draw
void draw(Drawable_t iID, int iX, int iY, unsigned int iWidth, unsigned int iHeight) override
Definition: FWTextTableCellRenderer.cc:66
FWTextTableCellRenderer::FWTextTableCellRenderer
FWTextTableCellRenderer(const TGGC *iContext=&(getDefaultGC()), const TGGC *iHighlightContext=&(getDefaultHighlightGC()), Justify iJustify=kJustifyLeft)
Definition: FWTextTableCellRenderer.cc:34
FWTextTableCellRenderer::kJustifyCenter
Definition: FWTextTableCellRenderer.h:37
FWTextTableCellRenderer::Justify
Justify
Definition: FWTextTableCellRenderer.h:37
FWTextTableCellRenderer::graphicsContext
const TGGC * graphicsContext() const
Definition: FWTextTableCellRenderer.h:45
FWTextTableCellRenderer
Definition: FWTextTableCellRenderer.h:32
FWTextTableCellRenderer::operator=
const FWTextTableCellRenderer & operator=(const FWTextTableCellRenderer &)=delete
FWTextTableCellRenderer::kJustifyLeft
Definition: FWTextTableCellRenderer.h:37
FWTextTableCellRenderer::setHighlightContext
void setHighlightContext(const TGGC *context)
Definition: FWTextTableCellRenderer.h:58
FWTextTableCellRenderer::kJustifyRight
Definition: FWTextTableCellRenderer.h:37
FWTextTableCellRenderer::getDefaultHighlightGC
static const TGGC & getDefaultHighlightGC()
Definition: FWTextTableCellRenderer.cc:133
FWTextTableCellRenderer::m_highlightContext
const TGGC * m_highlightContext
Definition: FWTextTableCellRenderer.h:71
FWTextTableCellRenderer::width
UInt_t width() const override
returns the minimum width of the cell to which the renderer is representing
Definition: FWTextTableCellRenderer.cc:113
FWTextTableCellRenderer::height
UInt_t height() const override
returns the minimum height of the cell to which the renderer is representing
Definition: FWTextTableCellRenderer.cc:119
FWTextTableCellRenderer::selected
bool selected()
Definition: FWTextTableCellRenderer.h:60
FWTextTableCellRenderer::highlightContext
const TGGC * highlightContext() const
Definition: FWTextTableCellRenderer.h:46
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
FWTextTableCellRenderer::setGraphicsContext
void setGraphicsContext(const TGGC *iContext)
Definition: FWTextTableCellRenderer.h:57
FWTextTableCellRenderer::m_font
TGFont * m_font
Definition: FWTextTableCellRenderer.h:72
FWTextTableCellRenderer::data
const std::string & data()
Definition: FWTextTableCellRenderer.h:56
FWTextTableCellRenderer::getDefaultGC
static const TGGC & getDefaultGC()
Definition: FWTextTableCellRenderer.cc:128
FWTableCellRendererBase
Definition: FWTableCellRendererBase.h:44
FWTextTableCellRenderer::m_isSelected
bool m_isSelected
Definition: FWTextTableCellRenderer.h:74
FWTextTableCellRenderer::font
const TGFont * font() const
Definition: FWTextTableCellRenderer.cc:123
FWTextTableCellRenderer::setJustify
void setJustify(Justify)
Definition: FWTextTableCellRenderer.cc:108
FWTextTableCellRenderer::setData
void setData(const std::string &, bool isSelected)
Definition: FWTextTableCellRenderer.cc:98
FWTextTableCellRenderer::m_context
const TGGC * m_context
Definition: FWTextTableCellRenderer.h:70
FWTextTableCellRenderer::~FWTextTableCellRenderer
~FWTextTableCellRenderer() override
Definition: FWTextTableCellRenderer.cc:49
FWTableCellRendererBase.h
FWTextTableCellRenderer::m_data
std::string m_data
Definition: FWTextTableCellRenderer.h:73
FWTextTableCellRenderer::m_justify
Justify m_justify
Definition: FWTextTableCellRenderer.h:75