File indexing completed on 2024-04-06 12:11:52
0001 #ifndef Fireworks_TableWidget_FWFramedTextTableCellRenderer_h
0002 #define Fireworks_TableWidget_FWFramedTextTableCellRenderer_h
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023 #include <string>
0024 #include "GuiTypes.h"
0025 #include "TGResourcePool.h"
0026 #include "TGGC.h"
0027
0028
0029 #include "Fireworks/TableWidget/interface/FWTableCellRendererBase.h"
0030
0031
0032
0033 class FWFramedTextTableCellRenderer : public FWTableCellRendererBase {
0034 public:
0035 static const TGGC& getDefaultGC();
0036 static const TGGC& getFillGC();
0037
0038 enum Justify { kJustifyLeft, kJustifyRight, kJustifyCenter };
0039
0040 FWFramedTextTableCellRenderer(const TGGC* iTextContext = &(getDefaultGC()),
0041 const TGGC* iFillContext = &(getFillGC()),
0042 Justify iJustify = kJustifyLeft);
0043 ~FWFramedTextTableCellRenderer() override;
0044
0045
0046 const TGGC* graphicsContext() const { return m_context; }
0047 UInt_t width() const override;
0048 UInt_t height() const override;
0049
0050 const TGFont* font() const;
0051
0052
0053
0054 void setData(const std::string&);
0055 void setGraphicsContext(const TGGC* iContext) { m_context = iContext; }
0056 void setJustify(Justify);
0057
0058 void draw(Drawable_t iID, int iX, int iY, unsigned int iWidth, unsigned int iHeight) override;
0059
0060 FWFramedTextTableCellRenderer(const FWFramedTextTableCellRenderer&) = delete;
0061
0062 const FWFramedTextTableCellRenderer& operator=(const FWFramedTextTableCellRenderer&) = delete;
0063
0064 private:
0065
0066 const TGGC* m_context;
0067 const TGGC* m_frameContext;
0068 TGFont* m_font;
0069 std::string m_data;
0070 Justify m_justify;
0071 };
0072
0073 #endif