Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:11:52

0001 #ifndef Fireworks_TableWidget_FWTabularWidget_h
0002 #define Fireworks_TableWidget_FWTabularWidget_h
0003 // -*- C++ -*-
0004 //
0005 // Package:     TableWidget
0006 // Class  :     FWTabularWidget
0007 //
0008 /**\class FWTabularWidget FWTabularWidget.h Fireworks/TableWidget/interface/FWTabularWidget.h
0009 
0010  Description: Widget that draws part of a table [Implementation detail of FWTableWidget]
0011 
0012  Usage:
0013     This class is used internally by FWTableWidget.
0014 
0015 */
0016 //
0017 // Original Author:  Chris Jones
0018 //         Created:  Mon Feb  2 16:45:19 EST 2009
0019 //
0020 
0021 // system include files
0022 #include <vector>
0023 #include "TGFrame.h"
0024 #include "TVirtualX.h"
0025 
0026 // user include files
0027 
0028 // forward declarations
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   // ---------- const member functions ---------------------
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   // ---------- static member functions --------------------
0047 
0048   // ---------- member functions ---------------------------
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);   //*SIGNAL*
0059   void buttonReleased(Int_t row, Int_t column, Event_t* event, Int_t relX, Int_t relY);  //*SIGNAL*
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   //FWTabularWidget(const FWTabularWidget&); // stop default
0073 
0074   //const FWTabularWidget& operator=(const FWTabularWidget&); // stop default
0075 
0076   // ---------- member data --------------------------------
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