CMS 3D CMS Logo

Public Member Functions | Public Attributes

FWGeometryTableManager::ColorBoxRenderer Class Reference

Inheritance diagram for FWGeometryTableManager::ColorBoxRenderer:
FWTableCellRendererBase

List of all members.

Public Member Functions

 ColorBoxRenderer ()
virtual void draw (Drawable_t iID, int iX, int iY, unsigned int iWidth, unsigned int iHeight)
virtual UInt_t height () const
 returns the minimum height of the cell to which the renderer is representing
void setData (Color_t c, bool)
virtual UInt_t width () const
 returns the minimum width of the cell to which the renderer is representing
virtual ~ColorBoxRenderer ()

Public Attributes

Pixel_t m_color
TGGC * m_colorContext
UInt_t m_height
bool m_isSelected
UInt_t m_width

Detailed Description

Definition at line 103 of file FWGeometryTableManager.h.


Constructor & Destructor Documentation

FWGeometryTableManager::ColorBoxRenderer::ColorBoxRenderer ( )

Definition at line 58 of file FWGeometryTableManager.cc.

References m_colorContext.

                                                        :
   FWTableCellRendererBase(),
   m_width(1),
   m_height(1),
   m_color(0xffffff),
   m_isSelected(false)
{
   GCValues_t gval; 
   gval.fMask       = kGCForeground | kGCBackground | kGCStipple | kGCFillStyle  | kGCGraphicsExposures;
   gval.fStipple    = gClient->GetResourcePool()->GetCheckeredBitmap();
   gval.fGraphicsExposures = kFALSE;
   gval.fBackground = gVirtualX->GetPixel(kGray);
   m_colorContext = gClient->GetResourcePool()->GetGCPool()->GetGC(&gval,kTRUE);

}
FWGeometryTableManager::ColorBoxRenderer::~ColorBoxRenderer ( ) [virtual]

Definition at line 74 of file FWGeometryTableManager.cc.

{
   gClient->GetResourcePool()->GetGCPool()->FreeGC(m_colorContext->GetGC());
}

Member Function Documentation

void FWGeometryTableManager::ColorBoxRenderer::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()

Implements FWTableCellRendererBase.

Definition at line 86 of file FWGeometryTableManager.cc.

References FWTabularWidget::kTextBuffer.

{
   iX -= FWTabularWidget::kTextBuffer;
   iY -= FWTabularWidget::kTextBuffer;
   iWidth += 2*FWTabularWidget::kTextBuffer;
   iHeight += 2*FWTabularWidget::kTextBuffer;

   m_colorContext->SetFillStyle(kFillSolid);
   Pixel_t baq =  m_colorContext->GetForeground();
   m_colorContext->SetForeground(m_color);
   gVirtualX->FillRectangle(iID, m_colorContext->GetGC(), iX, iY, iWidth, iHeight);

   if (m_isSelected)
   {
      m_colorContext->SetFillStyle(kFillOpaqueStippled);
      gVirtualX->FillRectangle(iID, m_colorContext->GetGC(), iX, iY, iWidth, iHeight);
   }
   m_colorContext->SetForeground(baq);
}
virtual UInt_t FWGeometryTableManager::ColorBoxRenderer::height ( ) const [inline, virtual]

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

Implements FWTableCellRendererBase.

Definition at line 110 of file FWGeometryTableManager.h.

References m_height.

{ return m_height; }
void FWGeometryTableManager::ColorBoxRenderer::setData ( Color_t  c,
bool  s 
)

Definition at line 79 of file FWGeometryTableManager.cc.

References asciidump::s.

Referenced by FWGeometryTableManager::cellRenderer().

{
   m_color = gVirtualX->GetPixel(c);
   m_isSelected = s;
}
virtual UInt_t FWGeometryTableManager::ColorBoxRenderer::width ( ) const [inline, virtual]

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

Implements FWTableCellRendererBase.

Definition at line 109 of file FWGeometryTableManager.h.

References m_width.

{ return m_width; }

Member Data Documentation

Definition at line 116 of file FWGeometryTableManager.h.

Definition at line 118 of file FWGeometryTableManager.h.

Referenced by ColorBoxRenderer().

Definition at line 117 of file FWGeometryTableManager.h.