CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes | Static Private Attributes
FWCheckedTextTableCellRenderer Class Reference

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

Inheritance diagram for FWCheckedTextTableCellRenderer:
FWTextTableCellRenderer FWTableCellRendererBase

Public Member Functions

void buttonEvent (Event_t *iClickEvent, int iRelClickX, int iRelClickY) override
 
void checkBoxClicked ()
 
 ClassDefOverride (FWCheckedTextTableCellRenderer, 0)
 
void draw (Drawable_t iID, int iX, int iY, unsigned int iWidth, unsigned int iHeight) override
 
 FWCheckedTextTableCellRenderer (const TGGC *iContext=&(getDefaultGC()))
 
bool isChecked () const
 
void setChecked (bool)
 
UInt_t width () const override
 returns the minimum width of the cell to which the renderer is representing More...
 
 ~FWCheckedTextTableCellRenderer () 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 char *, bool isSelected)
 
void setData (const std::string &, 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
 FWTableCellRendererBase ()
 
virtual ~FWTableCellRendererBase ()
 

Private Attributes

bool m_isChecked
 

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: A Cell renderer which shows both a check box and text

Usage: <usage>

Definition at line 29 of file FWCheckedTextTableCellRenderer.h.

Constructor & Destructor Documentation

◆ FWCheckedTextTableCellRenderer()

FWCheckedTextTableCellRenderer::FWCheckedTextTableCellRenderer ( const TGGC *  iContext = &(getDefaultGC()))

Definition at line 30 of file FWCheckedTextTableCellRenderer.cc.

31  : FWTextTableCellRenderer(iContext), m_isChecked(false) {}

◆ ~FWCheckedTextTableCellRenderer()

FWCheckedTextTableCellRenderer::~FWCheckedTextTableCellRenderer ( )
override

Definition at line 38 of file FWCheckedTextTableCellRenderer.cc.

38 {}

Member Function Documentation

◆ buttonEvent()

void FWCheckedTextTableCellRenderer::buttonEvent ( Event_t *  iClickEvent,
int  iRelClickX,
int  iRelClickY 
)
overridevirtual

Called when a mouse button event occurs when the cursor is over a particular cell: arguments iClickEvent: the ROOT GUI event caused by the mouse button iRelClickX: the x position of the cursor click relative to the start of the cell drawing area iRelClickY: the y position of the cursor click relative to the start of the cell drawing area

Reimplemented from FWTableCellRendererBase.

Definition at line 74 of file FWCheckedTextTableCellRenderer.cc.

74  {
75  const int h = height();
76 
77  bool wasClicked =
78  iClickEvent->fType == kButtonRelease && iRelClickX >= 0 && iRelClickX <= h && iRelClickY >= 0 && iRelClickY <= h;
79  if (wasClicked) {
80  //std::cout <<"clicked"<<std::endl;
82  }
83 }

References checkBoxClicked(), h, and FWTextTableCellRenderer::height().

◆ checkBoxClicked()

void FWCheckedTextTableCellRenderer::checkBoxClicked ( )

Definition at line 85 of file FWCheckedTextTableCellRenderer.cc.

85 { Emit("checkBoxClicked()"); }

Referenced by buttonEvent().

◆ ClassDefOverride()

FWCheckedTextTableCellRenderer::ClassDefOverride ( FWCheckedTextTableCellRenderer  ,
 
)

◆ draw()

void FWCheckedTextTableCellRenderer::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 57 of file FWCheckedTextTableCellRenderer.cc.

57  {
58  const UInt_t h = height();
59 
60  //draw the check box
61  GContext_t c = graphicsContext()->GetGC();
62  gVirtualX->DrawLine(iID, c, iX, iY, iX, iY + h);
63  gVirtualX->DrawLine(iID, c, iX + h, iY + h, iX, iY + h);
64  gVirtualX->DrawLine(iID, c, iX + h, iY + h, iX + h, iY);
65  gVirtualX->DrawLine(iID, c, iX + h, iY, iX, iY);
66 
67  if (m_isChecked) {
68  gVirtualX->DrawLine(iID, c, iX, iY + h / 2, iX + h / 2, iY + h);
69  gVirtualX->DrawLine(iID, c, iX + h, iY, iX + h / 2, iY + h);
70  }
71  FWTextTableCellRenderer::draw(iID, iX + kGap + h, iY, iWidth - kGap - h, iHeight);
72 }

References c, FWTextTableCellRenderer::draw(), FWTextTableCellRenderer::graphicsContext(), FWTextTableCellRenderer::height(), kGap, and m_isChecked.

◆ isChecked()

bool FWCheckedTextTableCellRenderer::isChecked ( ) const

Definition at line 90 of file FWCheckedTextTableCellRenderer.cc.

90 { return m_isChecked; }

References m_isChecked.

◆ setChecked()

void FWCheckedTextTableCellRenderer::setChecked ( bool  iChecked)

Definition at line 55 of file FWCheckedTextTableCellRenderer.cc.

55 { m_isChecked = iChecked; }

References m_isChecked.

◆ width()

UInt_t FWCheckedTextTableCellRenderer::width ( ) const
overridevirtual

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

Implements FWTableCellRendererBase.

Definition at line 92 of file FWCheckedTextTableCellRenderer.cc.

92  {
93  UInt_t h = height();
95 }

References h, FWTextTableCellRenderer::height(), kGap, and FWTextTableCellRenderer::width().

Member Data Documentation

◆ kGap

const UInt_t FWCheckedTextTableCellRenderer::kGap = 2
staticprivate

Definition at line 58 of file FWCheckedTextTableCellRenderer.h.

Referenced by draw(), and width().

◆ m_isChecked

bool FWCheckedTextTableCellRenderer::m_isChecked
private

Definition at line 59 of file FWCheckedTextTableCellRenderer.h.

Referenced by draw(), isChecked(), and setChecked().

FWTextTableCellRenderer::draw
void draw(Drawable_t iID, int iX, int iY, unsigned int iWidth, unsigned int iHeight) override
Definition: FWTextTableCellRenderer.cc:66
FWTextTableCellRenderer::FWTextTableCellRenderer
FWTextTableCellRenderer(const TGGC *iContext=&(getDefaultGC()), const TGGC *iHighlightContext=&(getDefaultHighlightGC()), Justify iJustify=kJustifyLeft)
Definition: FWTextTableCellRenderer.cc:34
FWTextTableCellRenderer::graphicsContext
const TGGC * graphicsContext() const
Definition: FWTextTableCellRenderer.h:45
h
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
FWCheckedTextTableCellRenderer::checkBoxClicked
void checkBoxClicked()
Definition: FWCheckedTextTableCellRenderer.cc:85
FWCheckedTextTableCellRenderer::kGap
static const UInt_t kGap
Definition: FWCheckedTextTableCellRenderer.h:58
FWTextTableCellRenderer::width
UInt_t width() const override
returns the minimum width of the cell to which the renderer is representing
Definition: FWTextTableCellRenderer.cc:113
FWTextTableCellRenderer::height
UInt_t height() const override
returns the minimum height of the cell to which the renderer is representing
Definition: FWTextTableCellRenderer.cc:119
h
FWCheckedTextTableCellRenderer::m_isChecked
bool m_isChecked
Definition: FWCheckedTextTableCellRenderer.h:59
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:56