File indexing completed on 2024-04-06 12:11:52
0001 #ifndef Fireworks_TableWidget_FWTableWidget_h
0002 #define Fireworks_TableWidget_FWTableWidget_h
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024 #include "TGFrame.h"
0025
0026
0027
0028
0029 class FWTableManagerBase;
0030 class FWTabularWidget;
0031 class TGVScrollBar;
0032 class TGHScrollBar;
0033 class TGGC;
0034
0035 class FWTableWidget : public TGCompositeFrame {
0036 public:
0037 FWTableWidget(FWTableManagerBase* iManager, const TGWindow* p = nullptr);
0038 ~FWTableWidget() override;
0039
0040
0041
0042 TGDimension GetDefaultSize() const override;
0043
0044
0045
0046
0047 using TGFrame::Resize;
0048 void Resize(UInt_t w, UInt_t h) override;
0049 void MoveResize(Int_t x, Int_t y, UInt_t w = 0, UInt_t h = 0) override;
0050 void SetBackgroundColor(Pixel_t) override;
0051 void SetHeaderBackgroundColor(Pixel_t);
0052 void SetHeaderForegroundColor(Pixel_t);
0053 void SetLineSeparatorColor(Pixel_t);
0054
0055 Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2) override;
0056
0057
0058
0059
0060 void sort(UInt_t iColumn, bool iDescendingSort);
0061
0062 void buttonReleasedInHeader(Int_t row, Int_t column, Event_t* event, Int_t, Int_t);
0063 void buttonReleasedInBody(Int_t row, Int_t column, Event_t* event, Int_t, Int_t);
0064
0065
0066
0067
0068
0069
0070
0071
0072
0073 void rowClicked(Int_t iRow, Int_t iButton, Int_t iKeyMod, Int_t iGlobalX, Int_t iGlobalY);
0074 void cellClicked(Int_t iRow, Int_t iColumn, Int_t iButton, Int_t iKeyMod, Int_t iGlobalX, Int_t iGlobalY);
0075 void columnClicked(Int_t iColumn, Int_t iButton, Int_t iKeyMod);
0076 void childrenEvent(Event_t*);
0077 void Clicked();
0078
0079 ClassDefOverride(FWTableWidget, 0);
0080
0081 void forceLayout() { m_forceLayout = true; }
0082 void dataChanged();
0083
0084 void buttonPressedInRowHeader(Int_t row, Int_t column, Event_t* event, Int_t relX, Int_t relY);
0085 void buttonReleasedInRowHeader(Int_t row, Int_t column, Event_t* event, Int_t relX, Int_t relY);
0086
0087 int sortedColumn() const { return m_sortedColumn; }
0088 bool descendingSort() const { return m_descendingSort; }
0089
0090 FWTabularWidget* body() { return m_body; }
0091
0092 void disableGrowInWidth();
0093
0094 protected:
0095 void DoRedraw() override;
0096
0097 private:
0098
0099
0100
0101
0102
0103 bool handleResize(UInt_t w, UInt_t h);
0104 FWTableManagerBase* m_bodyTable;
0105 FWTableManagerBase* m_headerTable;
0106 FWTableManagerBase* m_rowHeaderTable;
0107 FWTabularWidget* m_header;
0108 FWTabularWidget* m_body;
0109 FWTabularWidget* m_rowHeader;
0110 TGVScrollBar* m_vSlider;
0111 TGHScrollBar* m_hSlider;
0112 bool m_showingVSlider;
0113 bool m_showingHSlider;
0114
0115 int m_sortedColumn;
0116 bool m_descendingSort;
0117 bool m_forceLayout;
0118
0119 TGGC* m_headerBackground;
0120 TGGC* m_headerForeground;
0121 TGGC* m_lineSeparator;
0122 };
0123
0124 #endif