CMS 3D CMS Logo

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

#include <FWTextTreeCellRenderer.h>

Inheritance diagram for FWTextTreeCellRenderer:
FWTextTableCellRenderer FWTableCellRendererBase

Public Member Functions

virtual void draw (Drawable_t iID, int iX, int iY, unsigned int iWidth, unsigned int iHeight)
 
 FWTextTreeCellRenderer (const TGGC *iContext=&(getDefaultGC()), const TGGC *iHighlightContext=&(getDefaultHighlightGC()), Justify iJustify=kJustifyLeft)
 
virtual void setCellEditor (TGTextEntry *editor)
 
virtual void setIndentation (int indentation=0)
 
void setIsOpen (bool value)
 
void setIsParent (bool value)
 
virtual void showEditor (bool value)
 
virtual UInt_t width () const
 returns the minimum width of the cell to which the renderer is representing More...
 
- 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 ()
 

Static Public Member Functions

static const TGPicture * closedImage ()
 
static const TString & coreIcondir ()
 
static int iconWidth ()
 
static const TGPicture * openedImage ()
 
- Static Public Member Functions inherited from FWTextTableCellRenderer
static const TGGC & getDefaultGC ()
 
static const TGGC & getDefaultHighlightGC ()
 

Static Protected Attributes

static const int s_iconOffset = 2
 

Private Attributes

const TGGC * m_editContext
 
TGTextEntry * m_editor
 
int m_indentation
 
bool m_isOpen
 
bool m_isParent
 
bool m_showEditor
 

Additional Inherited Members

- Public Types inherited from FWTextTableCellRenderer
enum  Justify { kJustifyLeft, kJustifyRight, kJustifyCenter }
 

Detailed Description

Definition at line 15 of file FWTextTreeCellRenderer.h.

Constructor & Destructor Documentation

FWTextTreeCellRenderer::FWTextTreeCellRenderer ( const TGGC *  iContext = &(getDefaultGC()),
const TGGC *  iHighlightContext = &(getDefaultHighlightGC()),
Justify  iJustify = kJustifyLeft 
)
inline

Definition at line 22 of file FWTextTreeCellRenderer.h.

25  : FWTextTableCellRenderer(iContext, iHighlightContext, iJustify),
26  m_indentation(0),
27  m_editor(0),
28  m_showEditor(false),
29  m_isParent(false),
30  m_isOpen(false)
31  {}
FWTextTableCellRenderer(const TGGC *iContext=&(getDefaultGC()), const TGGC *iHighlightContext=&(getDefaultHighlightGC()), Justify iJustify=kJustifyLeft)

Member Function Documentation

static const TGPicture* FWTextTreeCellRenderer::closedImage ( )
inlinestatic

Definition at line 45 of file FWTextTreeCellRenderer.h.

References coreIcondir().

Referenced by draw().

46  {
47  static const TGPicture* s_picture=gClient->GetPicture(coreIcondir()+"arrow-black-right.png");
48  return s_picture;
49  }
static const TString & coreIcondir()
static const TString& FWTextTreeCellRenderer::coreIcondir ( )
inlinestatic

Definition at line 34 of file FWTextTreeCellRenderer.h.

References path().

Referenced by closedImage(), and openedImage().

34  {
35  static TString path = Form("%s/src/Fireworks/Core/icons/",gSystem->Getenv("CMSSW_BASE"));
36  if ( gSystem->AccessPathName(path.Data()) ){ // cannot find directory
37  assert(gSystem->Getenv("CMSSW_RELEASE_BASE"));
38  path = Form("%s/src/Fireworks/Core/icons/",gSystem->Getenv("CMSSW_RELEASE_BASE"));
39  }
40 
41  return path;
42  }
int path() const
Definition: HLTadd.h:3
virtual void FWTextTreeCellRenderer::draw ( Drawable_t  iID,
int  iX,
int  iY,
unsigned int  iWidth,
unsigned int  iHeight 
)
inlinevirtual
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 78 of file FWTextTreeCellRenderer.h.

References trackerHits::c, closedImage(), FWTextTableCellRenderer::data(), FWTextTableCellRenderer::font(), FWTextTableCellRenderer::getDefaultGC(), FWTextTableCellRenderer::graphicsContext(), FWTextTableCellRenderer::highlightContext(), FWTabularWidget::kTextBuffer, m_editor, m_indentation, m_isOpen, m_isParent, m_showEditor, openedImage(), s_iconOffset, FWTextTableCellRenderer::selected(), and findQualityFiles::size.

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

79  {
80  if (m_showEditor && m_editor)
81  {
82  // printf("renderer draw editor %d %d %d %d \n", iX, iY, m_editor->GetWidth(), m_editor->GetHeight());
83 
84  // fill to cover buffer offset
85  static TGGC editGC(FWTextTableCellRenderer::getDefaultGC());
86  editGC.SetForeground(m_editor->GetBackground());
87  gVirtualX->FillRectangle(iID, editGC(), iX - FWTabularWidget::kTextBuffer, iY - FWTabularWidget::kTextBuffer,
89 
90  if ( iY > -2)
91  {
92  // redraw editor
93  if (!m_editor->IsMapped())
94  {
95  m_editor->MapWindow();
96  m_editor->SetFocus();
97  }
98  m_editor->MoveResize(iX , iY, m_editor->GetWidth(), m_editor->GetHeight());
99  m_editor->SetCursorPosition( data().size());
100  gClient->NeedRedraw(m_editor);
101 
102  return;
103  }
104  else
105  {
106  // hide editor if selected entry scrolled away
107  if (m_editor->IsMapped()) m_editor->UnmapWindow();
108  }
109  }
110 
111  if (selected())
112  {
113  GContext_t c = highlightContext()->GetGC();
114  gVirtualX->FillRectangle(iID, c, iX - FWTabularWidget::kTextBuffer, iY - FWTabularWidget::kTextBuffer,
116  }
117  int xOffset = 0;
118  if(m_isParent) {
119  if(m_isOpen) {
120  openedImage()->Draw(iID,graphicsContext()->GetGC(),m_indentation+iX,iY +2);
121  xOffset += openedImage()->GetWidth() + s_iconOffset;
122  } else {
123  closedImage()->Draw(iID,graphicsContext()->GetGC(),m_indentation+iX,iY +2);
124  xOffset += closedImage()->GetWidth() + s_iconOffset;
125  }
126  }
127 
128  FontMetrics_t metrics;
129  font()->GetFontMetrics(&metrics);
130 
131 
132  gVirtualX->DrawString(iID, graphicsContext()->GetGC(),
133  iX+m_indentation+xOffset, iY+metrics.fAscent,
134  data().c_str(),data().size());
135  }
const TGGC * highlightContext() const
static const TGGC & getDefaultGC()
const TGFont * font() const
static const TGPicture * closedImage()
static const TGPicture * openedImage()
const TGGC * graphicsContext() const
const std::string & data()
static const int kTextBuffer
tuple size
Write out results.
static int FWTextTreeCellRenderer::iconWidth ( )
inlinestatic

Definition at line 59 of file FWTextTreeCellRenderer.h.

References openedImage(), and s_iconOffset.

Referenced by FWPSetTableManager::cellRenderer(), FWGeometryTableManager::cellRenderer(), and width().

60  {
61  return openedImage()->GetWidth() + s_iconOffset;
62  }
static const TGPicture * openedImage()
static const TGPicture* FWTextTreeCellRenderer::openedImage ( )
inlinestatic

Definition at line 52 of file FWTextTreeCellRenderer.h.

References coreIcondir().

Referenced by draw(), and iconWidth().

53  {
54  static const TGPicture* s_picture=gClient->GetPicture(coreIcondir()+"arrow-black-down.png");
55  return s_picture;
56  }
static const TString & coreIcondir()
virtual void FWTextTreeCellRenderer::setCellEditor ( TGTextEntry *  editor)
inlinevirtual

Definition at line 65 of file FWTextTreeCellRenderer.h.

References idDealer::editor, and m_editor.

Referenced by FWPSetTableManager::setCellValueEditor().

65 { m_editor = editor; }
tuple editor
Definition: idDealer.py:73
virtual void FWTextTreeCellRenderer::setIndentation ( int  indentation = 0)
inlinevirtual
void FWTextTreeCellRenderer::setIsOpen ( bool  value)
inline
void FWTextTreeCellRenderer::setIsParent ( bool  value)
inline
virtual void FWTextTreeCellRenderer::showEditor ( bool  value)
inlinevirtual
virtual UInt_t FWTextTreeCellRenderer::width ( ) const
inlinevirtual

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

Reimplemented from FWTextTableCellRenderer.

Definition at line 71 of file FWTextTreeCellRenderer.h.

References iconWidth(), m_indentation, m_isParent, and FWTextTableCellRenderer::width().

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

72  {
74  if (m_isParent) w += iconWidth();
75  return w;
76  }
virtual UInt_t width() const
returns the minimum width of the cell to which the renderer is representing

Member Data Documentation

const TGGC* FWTextTreeCellRenderer::m_editContext
private

Definition at line 142 of file FWTextTreeCellRenderer.h.

TGTextEntry* FWTextTreeCellRenderer::m_editor
private

Definition at line 138 of file FWTextTreeCellRenderer.h.

Referenced by draw(), and setCellEditor().

int FWTextTreeCellRenderer::m_indentation
private

Definition at line 137 of file FWTextTreeCellRenderer.h.

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

bool FWTextTreeCellRenderer::m_isOpen
private

Definition at line 141 of file FWTextTreeCellRenderer.h.

Referenced by draw(), and setIsOpen().

bool FWTextTreeCellRenderer::m_isParent
private

Definition at line 140 of file FWTextTreeCellRenderer.h.

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

bool FWTextTreeCellRenderer::m_showEditor
private

Definition at line 139 of file FWTextTreeCellRenderer.h.

Referenced by draw(), and showEditor().

const int FWTextTreeCellRenderer::s_iconOffset = 2
staticprotected

Definition at line 18 of file FWTextTreeCellRenderer.h.

Referenced by draw(), and iconWidth().