CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
FWColumnLabelCellRenderer.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: TableWidget
4 // Class : FWColumnLabelCellRenderer
5 //
6 // Implementation:
7 // <Notes on implementation>
8 //
9 // Original Author: Chris Jones
10 // Created: Mon Feb 2 16:44:04 EST 2009
11 // $Id: FWColumnLabelCellRenderer.cc,v 1.1 2009/02/03 20:33:04 chrjones Exp $
12 //
13 
14 // system include files
15 #include "TVirtualX.h"
16 #include "TGFont.h"
17 
18 // user include files
20 
21 
22 //
23 // constants, enums and typedefs
24 //
25 
26 //
27 // static data member definitions
28 //
29 
30 //
31 // constructors and destructor
32 //
34 FWTextTableCellRenderer(iContext),
35 m_sortOrder(fireworks::table::kNotSorted),
36 m_sizeOfOrderIcon(height())
37 {
38  FontMetrics_t metrics;
39  font()->GetFontMetrics(&metrics);
40 
41  m_sizeOfOrderIcon -= 2*metrics.fDescent;
42  m_sizeOfOrderIconStartX = metrics.fDescent;
43  //we want the number to be even so that the point of the triangle
44  // will be right in the middle
45  if(1 == m_sizeOfOrderIcon % 2) {
47  }
48 }
49 
50 
51 // FWColumnLabelCellRenderer::FWColumnLabelCellRenderer(const FWColumnLabelCellRenderer& rhs)
52 // {
53 // // do actual copying here;
54 // }
55 
57 {
58 }
59 
60 //
61 // assignment operators
62 //
63 // const FWColumnLabelCellRenderer& FWColumnLabelCellRenderer::operator=(const FWColumnLabelCellRenderer& rhs)
64 // {
65 // //An exception safe implementation is
66 // FWColumnLabelCellRenderer temp(rhs);
67 // swap(rhs);
68 //
69 // return *this;
70 // }
71 
72 //
73 // member functions
74 //
76  m_sortOrder = iOrder;
77 }
78 
79 void
80 FWColumnLabelCellRenderer::draw(Drawable_t iID, int iX, int iY, unsigned int iWidth, unsigned int iHeight)
81 {
82  using namespace fireworks::table;
84  const GContext_t c = graphicsContext()->GetGC();
85  int dY = m_sizeOfOrderIconStartX;
86 
88  gVirtualX->DrawLine(iID, c, iX+h/2, iY+2+dY, iX, iY+h-2+dY);
89  gVirtualX->DrawLine(iID, c, iX, iY+h-2+dY, iX+h, iY+h-2+dY);
90  gVirtualX->DrawLine(iID, c, iX+h/2, iY+2+dY, iX+h, iY+h-2+dY);
91  }
93  gVirtualX->DrawLine(iID, c, iX, iY+2+dY, iX+h, iY+2+dY);
94  gVirtualX->DrawLine(iID, c, iX+h/2, iY+h-2+dY, iX+h, iY+2+dY);
95  gVirtualX->DrawLine(iID, c, iX+h/2, iY+h-2+dY, iX, iY+2+dY);
96  }
97  FWTextTableCellRenderer::draw(iID,iX+kGap+h,iY,iWidth-kGap-h,iHeight);
98 }
99 
100 //
101 // const member functions
102 //
104 {
105  return m_sortOrder;
106 }
107 
109 {
111 }
112 
113 //
114 // static member functions
115 //
list table
Definition: asciidump.py:386
static const std::string kDescendingSort
Definition: FWTableView.cc:200
void setSortOrder(fireworks::table::SortOrder)
FWColumnLabelCellRenderer(const TGGC *iContext=&(getDefaultGC()))
const TGFont * font() const
const TGGC * graphicsContext() const
unsigned int UInt_t
Definition: FUTypes.h:12
fireworks::table::SortOrder sortOrder() const
virtual UInt_t width() const
returns the minimum width of the cell to which the renderer is representing
virtual void draw(Drawable_t iID, int iX, int iY, unsigned int iWidth, unsigned int iHeight)
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 UInt_t width() const
returns the minimum width of the cell to which the renderer is representing
virtual void draw(Drawable_t iID, int iX, int iY, unsigned int iWidth, unsigned int iHeight)