00001 #ifndef Fireworks_TableWidget_FWFramedTextTableCellRenderer_h 00002 #define Fireworks_TableWidget_FWFramedTextTableCellRenderer_h 00003 // -*- C++ -*- 00004 // 00005 // Package: TableWidget 00006 // Class : FWFramedTextTableCellRenderer 00007 // 00017 // 00018 // Original Author: Chris Jones 00019 // Created: Mon Feb 2 16:43:50 EST 2009 00020 // $Id: FWFramedTextTableCellRenderer.h,v 1.1 2010/04/23 21:36:27 chrjones Exp $ 00021 // 00022 00023 // system include files 00024 #include <string> 00025 #include "GuiTypes.h" 00026 #include "TGResourcePool.h" 00027 #include "TGGC.h" 00028 00029 // user include files 00030 #include "Fireworks/TableWidget/interface/FWTableCellRendererBase.h" 00031 00032 // forward declarations 00033 00034 class FWFramedTextTableCellRenderer : public FWTableCellRendererBase { 00035 00036 public: 00037 static const TGGC& getDefaultGC(); 00038 static const TGGC& getFillGC(); 00039 00040 enum Justify { 00041 kJustifyLeft, 00042 kJustifyRight, 00043 kJustifyCenter 00044 }; 00045 00046 FWFramedTextTableCellRenderer(const TGGC* iTextContext=&(getDefaultGC()), 00047 const TGGC* iFillContext=&(getFillGC()), 00048 Justify iJustify=kJustifyLeft); 00049 virtual ~FWFramedTextTableCellRenderer(); 00050 00051 // ---------- const member functions --------------------- 00052 const TGGC* graphicsContext() const { return m_context;} 00053 virtual UInt_t width() const; 00054 virtual UInt_t height() const; 00055 00056 const TGFont* font() const; 00057 // ---------- static member functions -------------------- 00058 00059 // ---------- member functions --------------------------- 00060 void setData(const std::string&); 00061 void setGraphicsContext(const TGGC* iContext) { m_context = iContext;} 00062 void setJustify(Justify); 00063 00064 virtual void draw(Drawable_t iID, int iX, int iY, unsigned int iWidth, unsigned int iHeight); 00065 00066 00067 private: 00068 FWFramedTextTableCellRenderer(const FWFramedTextTableCellRenderer&); // stop default 00069 00070 const FWFramedTextTableCellRenderer& operator=(const FWFramedTextTableCellRenderer&); // stop default 00071 00072 // ---------- member data -------------------------------- 00073 const TGGC* m_context; 00074 const TGGC* m_frameContext; 00075 TGFont* m_font; 00076 std::string m_data; 00077 Justify m_justify; 00078 }; 00079 00080 00081 #endif