test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 
34 public:
35  static const TGGC& getDefaultGC();
36  static const TGGC& getDefaultHighlightGC();
37 
38  enum Justify {
42  };
43 
44  FWTextTableCellRenderer(const TGGC* iContext=&(getDefaultGC()),
45  const TGGC* iHighlightContext=&(getDefaultHighlightGC()),
46  Justify iJustify=kJustifyLeft);
47  virtual ~FWTextTableCellRenderer();
48 
49  // ---------- const member functions ---------------------
50  const TGGC* graphicsContext() const { return m_context; }
51  const TGGC* highlightContext() const { return m_highlightContext; }
52  virtual UInt_t width() const;
53  virtual UInt_t height() const;
54 
55  const TGFont* font() const;
56  // ---------- static member functions --------------------
57 
58  // ---------- member functions ---------------------------
59  void setData(const std::string&, bool isSelected);
60  void setData(const char*, bool isSelected);
61  const std::string &data() { return m_data; }
62  void setGraphicsContext(const TGGC* iContext) { m_context = iContext;}
63  void setHighlightContext(const TGGC* context) { m_highlightContext = context; }
64  void setJustify(Justify);
65  bool selected() { return m_isSelected; }
66 
67  virtual void draw(Drawable_t iID, int iX, int iY, unsigned int iWidth, unsigned int iHeight);
68 
69 
70 private:
71  FWTextTableCellRenderer(const FWTextTableCellRenderer&); // stop default
72 
73  const FWTextTableCellRenderer& operator=(const FWTextTableCellRenderer&); // stop default
74 
75  // ---------- member data --------------------------------
76  const TGGC* m_context;
77  const TGGC* m_highlightContext;
78  TGFont* m_font;
82 };
83 
84 
85 #endif
virtual UInt_t height() const
returns the minimum height of the cell to which the renderer is representing
FWTextTableCellRenderer(const TGGC *iContext=&(getDefaultGC()), const TGGC *iHighlightContext=&(getDefaultHighlightGC()), Justify iJustify=kJustifyLeft)
const TGGC * highlightContext() const
const FWTextTableCellRenderer & operator=(const FWTextTableCellRenderer &)
static const TGGC & getDefaultGC()
const TGFont * font() const
void setHighlightContext(const TGGC *context)
static const TGGC & getDefaultHighlightGC()
void setGraphicsContext(const TGGC *iContext)
const TGGC * graphicsContext() const
const std::string & data()
void setData(const std::string &, bool isSelected)
virtual UInt_t width() const
returns the minimum width of the cell to which the renderer is representing
virtual void draw(Drawable_t iID, int iX, int iY, unsigned int iWidth, unsigned int iHeight)