CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch9/src/Fireworks/TableWidget/src/FWTabularWidget.h

Go to the documentation of this file.
00001 #ifndef Fireworks_TableWidget_FWTabularWidget_h
00002 #define Fireworks_TableWidget_FWTabularWidget_h
00003 // -*- C++ -*-
00004 //
00005 // Package:     TableWidget
00006 // Class  :     FWTabularWidget
00007 // 
00016 //
00017 // Original Author:  Chris Jones
00018 //         Created:  Mon Feb  2 16:45:19 EST 2009
00019 // $Id: FWTabularWidget.h,v 1.6 2011/03/07 13:13:51 amraktad Exp $
00020 //
00021 
00022 // system include files
00023 #include <vector>
00024 #include "TGFrame.h"
00025 
00026 // user include files
00027 
00028 // forward declarations
00029 class FWTableManagerBase;
00030 
00031 class FWTabularWidget : public TGFrame
00032 {
00033 
00034 public:
00035    static const TGGC&  getDefaultGC();
00036       
00037    static const int kTextBuffer;
00038    static const int kSeperatorWidth;
00039 
00040    FWTabularWidget(FWTableManagerBase* iManager,const TGWindow* p=0, GContext_t context = getDefaultGC()());
00041    virtual ~FWTabularWidget();
00042 
00043    // ---------- const member functions ---------------------
00044    const std::vector<unsigned int>& widthOfTextInColumns() const { return m_widthOfTextInColumns;}
00045    UInt_t verticalOffset() const {return m_vOffset;}
00046    UInt_t horizontalOffset() const { return m_hOffset;}
00047 
00048    // ---------- static member functions --------------------
00049 
00050    // ---------- member functions ---------------------------
00051    void setWidthOfTextInColumns(const std::vector<unsigned int>& );
00052    void DoRedraw();
00053    TGDimension GetDefaultSize() const;
00054 
00055    void setVerticalOffset(UInt_t);
00056    void setHorizontalOffset(UInt_t);
00057 
00058    virtual Bool_t HandleButton(Event_t *event);
00059 
00060    void buttonPressed(Int_t row, Int_t column, Event_t* event, Int_t relX, Int_t relY); //*SIGNAL*
00061    void buttonReleased(Int_t row, Int_t column, Event_t* event, Int_t relX, Int_t relY); //*SIGNAL*
00062 
00063    void dataChanged();
00064    void needToRedraw();
00065 
00066    ClassDef(FWTabularWidget,0);
00067    
00068    void setLineContext(GContext_t iContext);
00069    void setBackgroundAreaContext(GContext_t iContext);
00070    
00071    void disableGrowInWidth() { m_growInWidth = false; }
00072 
00073 private:
00074    //FWTabularWidget(const FWTabularWidget&); // stop default
00075 
00076    //const FWTabularWidget& operator=(const FWTabularWidget&); // stop default
00077 
00078    // ---------- member data --------------------------------
00079 
00080    void translateToRowColumn(Int_t iX, Int_t iY, Int_t& oRow, Int_t& oCol, Int_t&oRelX, Int_t& oRelY) const;
00081 
00082    FWTableManagerBase* m_table;
00083    std::vector<unsigned int> m_widthOfTextInColumns;
00084    std::vector<unsigned int> m_widthOfTextInColumnsMax;
00085    int m_textHeight;
00086    int m_tableWidth;
00087 
00088    unsigned int m_vOffset;
00089    unsigned int m_hOffset;
00090 
00091    GContext_t m_normGC;
00092    GContext_t m_backgroundGC;
00093 
00094    bool m_growInWidth;
00095 };
00096 
00097 
00098 #endif