Go to the documentation of this file.00001 #ifndef Fireworks_TableWidget_FWTabularWidget_h
00002 #define Fireworks_TableWidget_FWTabularWidget_h
00003
00004
00005
00006
00007
00016
00017
00018
00019
00020
00021
00022
00023 #include <vector>
00024 #include "TGFrame.h"
00025
00026
00027
00028
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
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
00049
00050
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);
00061 void buttonReleased(Int_t row, Int_t column, Event_t* event, Int_t relX, Int_t relY);
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
00075
00076
00077
00078
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