CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes | Static Private Attributes
FWColumnLabelCellRenderer Class Reference

#include <Fireworks/TableWidget/interface/FWColumnLabelCellRenderer.h>

Inheritance diagram for FWColumnLabelCellRenderer:
FWTextTableCellRenderer FWTableCellRendererBase

Public Member Functions

virtual void draw (Drawable_t iID, int iX, int iY, unsigned int iWidth, unsigned int iHeight)
 
 FWColumnLabelCellRenderer (const TGGC *iContext=&(getDefaultGC()), bool isSortable=true)
 
void setSortOrder (fireworks::table::SortOrder)
 
fireworks::table::SortOrder sortOrder () const
 
virtual UInt_t width () const
 returns the minimum width of the cell to which the renderer is representing More...
 
virtual ~FWColumnLabelCellRenderer ()
 
- Public Member Functions inherited from FWTextTableCellRenderer
const std::string & data ()
 
const TGFont * font () const
 
 FWTextTableCellRenderer (const TGGC *iContext=&(getDefaultGC()), const TGGC *iHighlightContext=&(getDefaultHighlightGC()), Justify iJustify=kJustifyLeft)
 
const TGGC * graphicsContext () const
 
virtual UInt_t height () const
 returns the minimum height of the cell to which the renderer is representing More...
 
const TGGC * highlightContext () const
 
bool selected ()
 
void setData (const std::string &, bool isSelected)
 
void setData (const char *, bool isSelected)
 
void setGraphicsContext (const TGGC *iContext)
 
void setHighlightContext (const TGGC *context)
 
void setJustify (Justify)
 
virtual ~FWTextTableCellRenderer ()
 
- Public Member Functions inherited from FWTableCellRendererBase
virtual void buttonEvent (Event_t *iClickEvent, int iRelClickX, int iRelClickY)
 
 FWTableCellRendererBase ()
 
virtual ~FWTableCellRendererBase ()
 

Private Attributes

bool m_isSortable
 
int m_sizeOfOrderIcon
 
int m_sizeOfOrderIconStartX
 
fireworks::table::SortOrder m_sortOrder
 

Static Private Attributes

static const UInt_t kGap = 2
 

Additional Inherited Members

- Public Types inherited from FWTextTableCellRenderer
enum  Justify { kJustifyLeft, kJustifyRight, kJustifyCenter }
 
- Static Public Member Functions inherited from FWTextTableCellRenderer
static const TGGC & getDefaultGC ()
 
static const TGGC & getDefaultHighlightGC ()
 

Detailed Description

Description: Cell Renderer which handles the labels at the top of columns

Usage: This renderer will draw both the text of the column's label and if the sort order has been set to kAscendingSort or kDescendingSort it will also draw the appropriate symbol denoting the sort order of the column.

Definition at line 31 of file FWColumnLabelCellRenderer.h.

Constructor & Destructor Documentation

FWColumnLabelCellRenderer::FWColumnLabelCellRenderer ( const TGGC *  iContext = &(getDefaultGC()),
bool  isSortable = true 
)

Definition at line 35 of file FWColumnLabelCellRenderer.cc.

References FWTextTableCellRenderer::font(), m_isSortable, m_sizeOfOrderIcon, and m_sizeOfOrderIconStartX.

35  :
36 FWTextTableCellRenderer(iContext),
39 m_isSortable(isSortable)
40 {
41  if (m_isSortable)
42  {
43  FontMetrics_t metrics;
44  font()->GetFontMetrics(&metrics);
45 
46  m_sizeOfOrderIcon -= 2*metrics.fDescent;
47  m_sizeOfOrderIconStartX = metrics.fDescent;
48  //we want the number to be even so that the point of the triangle
49  // will be right in the middle
50  if(1 == m_sizeOfOrderIcon % 2) {
52  }
53  }
54 }
virtual UInt_t height() const
returns the minimum height of the cell to which the renderer is representing
FWTextTableCellRenderer(const TGGC *iContext=&(getDefaultGC()), const TGGC *iHighlightContext=&(getDefaultHighlightGC()), Justify iJustify=kJustifyLeft)
const TGFont * font() const
fireworks::table::SortOrder m_sortOrder
FWColumnLabelCellRenderer::~FWColumnLabelCellRenderer ( )
virtual

Definition at line 62 of file FWColumnLabelCellRenderer.cc.

63 {
64 }

Member Function Documentation

void FWColumnLabelCellRenderer::draw ( Drawable_t  iID,
int  iX,
int  iY,
unsigned int  iWidth,
unsigned int  iHeight 
)
virtual
Called to draw a particular cell: arguments

iID: the id for the drawable in the window. Needed in order to do calls to gVirtualX or to TGFont iX: screen x position that the cell drawing area starts iY: screen y position that the cell drawing area starts iWidth: width (x dimension) of cell drawing area. May be larger than value returned from width() iHeight: height (x dimension) of cell drawing area. May be larger than value returned from height()

Reimplemented from FWTextTableCellRenderer.

Definition at line 89 of file FWColumnLabelCellRenderer.cc.

References trackerHits::c, FWTextTableCellRenderer::draw(), FWTextTableCellRenderer::graphicsContext(), h, fireworks::table::kAscendingSort, kDescendingSort, kGap, m_isSortable, m_sizeOfOrderIcon, m_sizeOfOrderIconStartX, m_sortOrder, and asciidump::table.

Referenced by Vispa.Gui.PortConnection.PointToPointConnection::paintEvent().

90 {
91  if (m_isSortable)
92  {
93  using namespace fireworks::table;
95  const GContext_t c = graphicsContext()->GetGC();
96  int dY = m_sizeOfOrderIconStartX;
97 
99  gVirtualX->DrawLine(iID, c, iX+h/2, iY+2+dY, iX, iY+h-2+dY);
100  gVirtualX->DrawLine(iID, c, iX, iY+h-2+dY, iX+h, iY+h-2+dY);
101  gVirtualX->DrawLine(iID, c, iX+h/2, iY+2+dY, iX+h, iY+h-2+dY);
102  }
104  gVirtualX->DrawLine(iID, c, iX, iY+2+dY, iX+h, iY+2+dY);
105  gVirtualX->DrawLine(iID, c, iX+h/2, iY+h-2+dY, iX+h, iY+2+dY);
106  gVirtualX->DrawLine(iID, c, iX+h/2, iY+h-2+dY, iX, iY+2+dY);
107  }
108  FWTextTableCellRenderer::draw(iID,iX+kGap+h,iY,iWidth-kGap-h,iHeight);
109  }
110  else
111  {
112  return FWTextTableCellRenderer::draw(iID, iX+kGap, iY-kGap, iWidth, iHeight);
113  }
114 
115 }
list table
Definition: asciidump.py:386
static const std::string kDescendingSort
Definition: FWTableView.cc:201
const TGGC * graphicsContext() const
unsigned int UInt_t
Definition: FUTypes.h:12
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
fireworks::table::SortOrder m_sortOrder
virtual void draw(Drawable_t iID, int iX, int iY, unsigned int iWidth, unsigned int iHeight)
void FWColumnLabelCellRenderer::setSortOrder ( fireworks::table::SortOrder  iOrder)
fireworks::table::SortOrder FWColumnLabelCellRenderer::sortOrder ( ) const

Definition at line 120 of file FWColumnLabelCellRenderer.cc.

References m_sortOrder.

121 {
122  return m_sortOrder;
123 }
fireworks::table::SortOrder m_sortOrder
UInt_t FWColumnLabelCellRenderer::width ( ) const
virtual

returns the minimum width of the cell to which the renderer is representing

Reimplemented from FWTextTableCellRenderer.

Definition at line 125 of file FWColumnLabelCellRenderer.cc.

References kGap, m_isSortable, m_sizeOfOrderIcon, and FWTextTableCellRenderer::width().

Referenced by Vispa.Main.MainWindow.MainWindow::_saveIni(), Vispa.Gui.VispaWidget.VispaWidget::autosize(), Vispa.Gui.VispaWidget.VispaWidget::boundingRect(), Vispa.Gui.VispaWidget.VispaWidget::contentRect(), Vispa.Gui.VispaWidget.VispaWidget::defineArrowBackgroundShape(), Vispa.Gui.VispaWidget.VispaWidget::defineCircleBackgroundShape(), Vispa.Gui.VispaWidget.VispaWidget::defineRoundRectBackgroundShape(), Vispa.Gui.VispaWidget.VispaWidget::drawHeaderBackground(), Vispa.Gui.ConnectableWidget.ConnectableWidget::drawPortNames(), Vispa.Gui.VispaWidget.VispaWidget::imageRectF(), Vispa.Gui.ConnectableWidget.ConnectableWidget::positionizeMenuWidget(), Vispa.Views.PropertyView.PropertyView::resizeEvent(), Vispa.Views.PropertyView.PropertyView::sectionResized(), Vispa.Gui.VispaWidget.VispaWidget::setZoom(), and Vispa.Main.MainWindow.MainWindow::updateStartupScreenGeometry().

126 {
127  if (m_isSortable)
129  else {
131  }
132 
133 }
virtual UInt_t width() const
returns the minimum width of the cell to which the renderer is representing

Member Data Documentation

const UInt_t FWColumnLabelCellRenderer::kGap = 2
staticprivate

Definition at line 56 of file FWColumnLabelCellRenderer.h.

Referenced by draw(), and width().

bool FWColumnLabelCellRenderer::m_isSortable
private

Definition at line 61 of file FWColumnLabelCellRenderer.h.

Referenced by draw(), FWColumnLabelCellRenderer(), setSortOrder(), and width().

int FWColumnLabelCellRenderer::m_sizeOfOrderIcon
private

Definition at line 58 of file FWColumnLabelCellRenderer.h.

Referenced by draw(), FWColumnLabelCellRenderer(), and width().

int FWColumnLabelCellRenderer::m_sizeOfOrderIconStartX
private

Definition at line 59 of file FWColumnLabelCellRenderer.h.

Referenced by draw(), and FWColumnLabelCellRenderer().

fireworks::table::SortOrder FWColumnLabelCellRenderer::m_sortOrder
private

Definition at line 57 of file FWColumnLabelCellRenderer.h.

Referenced by draw(), setSortOrder(), and sortOrder().