CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes
FWCollectionSummaryModelCellRenderer Class Reference

#include <Fireworks/Core/interface/FWCollectionSummaryModelCellRenderer.h>

Inheritance diagram for FWCollectionSummaryModelCellRenderer:
FWTextTableCellRenderer FWTableCellRendererBase

Public Types

enum  ClickHit { kMiss, kHitCheck, kHitColor }
 
- Public Types inherited from FWTextTableCellRenderer
enum  Justify { kJustifyLeft, kJustifyRight, kJustifyCenter }
 

Public Member Functions

ClickHit clickHit (int iX, int iY) const
 
void draw (Drawable_t iID, int iX, int iY, unsigned int iWidth, unsigned int iHeight) override
 
 FWCollectionSummaryModelCellRenderer (const TGGC *iContext, const TGGC *iSelectContext)
 
void setData (const FWEventItem *iItem, int iIndex)
 
UInt_t width () const override
 returns the minimum width of the cell to which the renderer is representing More...
 
 ~FWCollectionSummaryModelCellRenderer () override
 
- Public Member Functions inherited from FWTextTableCellRenderer
const std::string & data ()
 
void draw (Drawable_t iID, int iX, int iY, unsigned int iWidth, unsigned int iHeight) override
 
const TGFont * font () const
 
 FWTextTableCellRenderer (const TGGC *iContext=&(getDefaultGC()), const TGGC *iHighlightContext=&(getDefaultHighlightGC()), Justify iJustify=kJustifyLeft)
 
const TGGC * graphicsContext () const
 
UInt_t height () const override
 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)
 
UInt_t width () const override
 returns the minimum width of the cell to which the renderer is representing More...
 
 ~FWTextTableCellRenderer () override
 
- Public Member Functions inherited from FWTableCellRendererBase
virtual void buttonEvent (Event_t *iClickEvent, int iRelClickX, int iRelClickY)
 
 FWTableCellRendererBase ()
 
virtual ~FWTableCellRendererBase ()
 

Private Member Functions

 FWCollectionSummaryModelCellRenderer (const FWCollectionSummaryModelCellRenderer &)=delete
 
const FWCollectionSummaryModelCellRendereroperator= (const FWCollectionSummaryModelCellRenderer &)=delete
 

Private Attributes

FWCheckBoxIconm_checkBox
 
FWColorBoxIconm_colorBox
 
TGGC * m_colorContext
 

Additional Inherited Members

- Static Public Member Functions inherited from FWTextTableCellRenderer
static const TGGC & getDefaultGC ()
 
static const TGGC & getDefaultHighlightGC ()
 

Detailed Description

Description: <one line="" class="" summary>="">

Usage: <usage>

Definition at line 31 of file FWCollectionSummaryModelCellRenderer.h.

Member Enumeration Documentation

Constructor & Destructor Documentation

FWCollectionSummaryModelCellRenderer::FWCollectionSummaryModelCellRenderer ( const TGGC *  iContext,
const TGGC *  iSelectContext 
)

Definition at line 37 of file FWCollectionSummaryModelCellRenderer.cc.

References m_colorBox, m_colorContext, FWColorBoxIcon::setColor(), and OrderedSet::t.

38  : FWTextTableCellRenderer(iGC, iSelectContext),
41  GCValues_t t = *(iGC->GetAttributes());
42  m_colorContext = gClient->GetResourcePool()->GetGCPool()->GetGC(&t, kTRUE);
44 }
FWTextTableCellRenderer(const TGGC *iContext=&(getDefaultGC()), const TGGC *iHighlightContext=&(getDefaultHighlightGC()), Justify iJustify=kJustifyLeft)
static const unsigned int kIconSize
void setColor(GContext_t iColorContext)
FWCollectionSummaryModelCellRenderer::~FWCollectionSummaryModelCellRenderer ( )
override

Definition at line 51 of file FWCollectionSummaryModelCellRenderer.cc.

References m_checkBox, m_colorBox, and m_colorContext.

51  {
52  delete m_colorBox;
53  delete m_checkBox;
54  gClient->GetResourcePool()->GetGCPool()->FreeGC(m_colorContext->GetGC());
55 }
FWCollectionSummaryModelCellRenderer::FWCollectionSummaryModelCellRenderer ( const FWCollectionSummaryModelCellRenderer )
privatedelete

Member Function Documentation

FWCollectionSummaryModelCellRenderer::ClickHit FWCollectionSummaryModelCellRenderer::clickHit ( int  iX,
int  iY 
) const

Definition at line 100 of file FWCollectionSummaryModelCellRenderer.cc.

References kHitCheck, kHitColor, kIconSize, kMiss, and kSeparation.

Referenced by FWCollectionSummaryTableManager::buttonReleasedInRowHeader().

100  {
101  if (iY < 0 || iY > static_cast<int>(kIconSize)) {
102  return kMiss;
103  }
104  if (iX >= 0 && iX <= static_cast<int>(kIconSize)) {
105  return kHitCheck;
106  }
107  if (iX >= static_cast<int>(kIconSize + kSeparation) && iX <= static_cast<int>(kIconSize + kSeparation + kIconSize)) {
108  return kHitColor;
109  }
110  return kMiss;
111 }
static const unsigned int kSeparation
static const unsigned int kIconSize
void FWCollectionSummaryModelCellRenderer::draw ( Drawable_t  iID,
int  iX,
int  iY,
unsigned int  iWidth,
unsigned int  iHeight 
)
overridevirtual

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()

Implements FWTableCellRendererBase.

Definition at line 77 of file FWCollectionSummaryModelCellRenderer.cc.

References FWBoxIconBase::draw(), FWTextTableCellRenderer::draw(), FWTextTableCellRenderer::graphicsContext(), kIconSize, kSeparation, m_checkBox, and m_colorBox.

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

78  {
79  int dY = (iHeight - kIconSize) / 2;
80  m_checkBox->draw(iID, graphicsContext()->GetGC(), iX, iY + dY);
81  m_colorBox->draw(iID, graphicsContext()->GetGC(), iX + kIconSize + kSeparation, iY + dY);
84  iY,
86  iHeight);
87  return;
88 }
void draw(Drawable_t iID, int iX, int iY, unsigned int iWidth, unsigned int iHeight) override
static const unsigned int kSeparation
void draw(Drawable_t iID, GContext_t iContext, int iX, int iY) const
static const unsigned int kIconSize
const TGGC * graphicsContext() const
const FWCollectionSummaryModelCellRenderer& FWCollectionSummaryModelCellRenderer::operator= ( const FWCollectionSummaryModelCellRenderer )
privatedelete
void FWCollectionSummaryModelCellRenderer::setData ( const FWEventItem iItem,
int  iIndex 
)

Definition at line 90 of file FWCollectionSummaryModelCellRenderer.cc.

References FWDisplayProperties::color(), FWEventItem::ModelInfo::displayProperties(), FWEventItem::ModelInfo::isSelected(), FWDisplayProperties::isVisible(), m_checkBox, m_colorContext, FWEventItem::modelInfo(), FWEventItem::modelName(), FWCheckBoxIcon::setChecked(), and FWTextTableCellRenderer::setData().

Referenced by FWCollectionSummaryTableManager::rowHeader().

90  {
91  FWEventItem::ModelInfo mi = iItem->modelInfo(iIndex);
94  m_colorContext->SetForeground(gVirtualX->GetPixel(mi.displayProperties().color()));
95 }
const FWDisplayProperties & displayProperties() const
Definition: FWEventItem.h:64
std::string modelName(int iIndex) const
Definition: FWEventItem.cc:471
bool isSelected() const
Definition: FWEventItem.h:65
Color_t color() const
void setChecked(bool iChecked)
void setData(const std::string &, bool isSelected)
ModelInfo modelInfo(int iIndex) const
Definition: FWEventItem.cc:446
UInt_t FWCollectionSummaryModelCellRenderer::width ( ) const
overridevirtual

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

Implements FWTableCellRendererBase.

Definition at line 72 of file FWCollectionSummaryModelCellRenderer.cc.

References kIconSize, kSeparation, w, 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::drawPortLines(), Vispa.Gui.ConnectableWidget.ConnectableWidget::drawPortNames(), Vispa.Gui.VispaWidget.VispaWidget::imageRectF(), Vispa.Gui.ConnectableWidget.ConnectableWidget::positionizeMenuWidget(), Vispa.Gui.VispaWidget.VispaWidget::resize(), Vispa.Views.PropertyView.PropertyView::resizeEvent(), Vispa.Views.PropertyView.PropertyView::sectionResized(), Vispa.Gui.VispaWidget.VispaWidget::setZoom(), and Vispa.Main.MainWindow.MainWindow::updateStartupScreenGeometry().

72  {
74  return w + kIconSize + kIconSize + kSeparation + kSeparation;
75 }
const double w
Definition: UKUtility.cc:23
static const unsigned int kSeparation
UInt_t width() const override
returns the minimum width of the cell to which the renderer is representing
static const unsigned int kIconSize

Member Data Documentation

FWCheckBoxIcon* FWCollectionSummaryModelCellRenderer::m_checkBox
private
FWColorBoxIcon* FWCollectionSummaryModelCellRenderer::m_colorBox
private
TGGC* FWCollectionSummaryModelCellRenderer::m_colorContext
private