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 // $Id: FWTextTableCellRenderer.h,v 1.6 2011/03/02 18:34:17 amraktad Exp $
20 //
21 
22 // system include files
23 #include <string>
24 #include "GuiTypes.h"
25 #include "TGResourcePool.h"
26 #include "TGGC.h"
27 
28 // user include files
30 
31 // forward declarations
32 
34 
35 public:
36  static const TGGC& getDefaultGC();
37  static const TGGC& getDefaultHighlightGC();
38 
39  enum Justify {
43  };
44 
45  FWTextTableCellRenderer(const TGGC* iContext=&(getDefaultGC()),
46  const TGGC* iHighlightContext=&(getDefaultHighlightGC()),
47  Justify iJustify=kJustifyLeft);
48  virtual ~FWTextTableCellRenderer();
49 
50  // ---------- const member functions ---------------------
51  const TGGC* graphicsContext() const { return m_context; }
52  const TGGC* highlightContext() const { return m_highlightContext; }
53  virtual UInt_t width() const;
54  virtual UInt_t height() const;
55 
56  const TGFont* font() const;
57  // ---------- static member functions --------------------
58 
59  // ---------- member functions ---------------------------
60  void setData(const std::string&, bool isSelected);
61  void setData(const char*, bool isSelected);
62  const std::string &data() { return m_data; }
63  void setGraphicsContext(const TGGC* iContext) { m_context = iContext;}
64  void setHighlightContext(const TGGC* context) { m_highlightContext = context; }
65  void setJustify(Justify);
66  bool selected() { return m_isSelected; }
67 
68  virtual void draw(Drawable_t iID, int iX, int iY, unsigned int iWidth, unsigned int iHeight);
69 
70 
71 private:
72  FWTextTableCellRenderer(const FWTextTableCellRenderer&); // stop default
73 
74  const FWTextTableCellRenderer& operator=(const FWTextTableCellRenderer&); // stop default
75 
76  // ---------- member data --------------------------------
77  const TGGC* m_context;
78  const TGGC* m_highlightContext;
79  TGFont* m_font;
80  std::string m_data;
83 };
84 
85 
86 #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()
unsigned int UInt_t
Definition: FUTypes.h:12
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)