File indexing completed on 2024-04-06 12:11:52
0001 #ifndef Fireworks_TableWidget_FWTabularWidget_h
0002 #define Fireworks_TableWidget_FWTabularWidget_h
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022 #include <vector>
0023 #include "TGFrame.h"
0024 #include "TVirtualX.h"
0025
0026
0027
0028
0029 class FWTableManagerBase;
0030
0031 class FWTabularWidget : public TGFrame {
0032 public:
0033 static const TGGC& getDefaultGC();
0034
0035 static const int kTextBuffer;
0036 static const int kSeperatorWidth;
0037
0038 FWTabularWidget(FWTableManagerBase* iManager, const TGWindow* p = nullptr, GContext_t context = getDefaultGC()());
0039 ~FWTabularWidget() override;
0040
0041
0042 const std::vector<unsigned int>& widthOfTextInColumns() const { return m_widthOfTextInColumns; }
0043 UInt_t verticalOffset() const { return m_vOffset; }
0044 UInt_t horizontalOffset() const { return m_hOffset; }
0045
0046
0047
0048
0049 void setWidthOfTextInColumns(const std::vector<unsigned int>&);
0050 void DoRedraw() override;
0051 TGDimension GetDefaultSize() const override;
0052
0053 void setVerticalOffset(UInt_t);
0054 void setHorizontalOffset(UInt_t);
0055
0056 Bool_t HandleButton(Event_t* event) override;
0057
0058 void buttonPressed(Int_t row, Int_t column, Event_t* event, Int_t relX, Int_t relY);
0059 void buttonReleased(Int_t row, Int_t column, Event_t* event, Int_t relX, Int_t relY);
0060
0061 void dataChanged();
0062 void needToRedraw();
0063
0064 ClassDefOverride(FWTabularWidget, 0);
0065
0066 void setLineContext(GContext_t iContext);
0067 void setBackgroundAreaContext(GContext_t iContext);
0068
0069 void disableGrowInWidth() { m_growInWidth = false; }
0070
0071 private:
0072
0073
0074
0075
0076
0077
0078 void translateToRowColumn(Int_t iX, Int_t iY, Int_t& oRow, Int_t& oCol, Int_t& oRelX, Int_t& oRelY) const;
0079
0080 FWTableManagerBase* m_table;
0081 std::vector<unsigned int> m_widthOfTextInColumns;
0082 std::vector<unsigned int> m_widthOfTextInColumnsMax;
0083 int m_textHeight;
0084 int m_tableWidth;
0085
0086 unsigned int m_vOffset;
0087 unsigned int m_hOffset;
0088
0089 GContext_t m_normGC;
0090 GContext_t m_backgroundGC;
0091
0092 bool m_growInWidth;
0093 };
0094
0095 #endif