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 Attributes | Private Attributes
Vispa.Gui.MenuWidget.MenuWidget Class Reference
Inheritance diagram for Vispa.Gui.MenuWidget.MenuWidget:
Vispa.Gui.VispaWidget.VispaWidget Vispa.Gui.ZoomableWidget.ZoomableWidget Vispa.Gui.Zoomable.Zoomable

Public Member Functions

def __init__
 
def addEntry
 
def cursorHasEntered
 
def drawMenuEntries
 
def enterEvent
 
def entry
 
def hide
 
def leaveEvent
 
def len
 
def mouseMoveEvent
 
def mousePressEvent
 
def paint
 
def removeEntry
 
def setEntryText
 
def showEvent
 
def sizeHint
 
- Public Member Functions inherited from Vispa.Gui.VispaWidget.VispaWidget
def __init__
 
def autosize
 
def autosizeEnabled
 
def bodyWidget
 
def boundingRect
 
def colorHeaderBackgroundEnabled
 
def contentRect
 
def defineArrowBackgroundShape
 
def defineCircleBackgroundShape
 
def defineDistances
 
def defineRectBackgroundShape
 
def defineRoundRectBackgroundShape
 
def delete
 
def distances
 
def dragReferencePoint
 
def dragWidget
 
def drawBody
 
def drawHeaderBackground
 
def drawImage
 
def drawTextField
 
def drawTitle
 
def enableAutopositionizeWhenZooming
 
def enableAutosizing
 
def enableBackgroundGradient
 
def enableColorHeaderBackground
 
def getDistance
 
def height
 
def imageRectF
 
def imageSizeF
 
def isDeletable
 
def isDragable
 
def isSelectable
 
def isSelected
 
def isTitlePoint
 
def isUseBackgroundGradientEnabled
 
def keyPressEvent
 
def mouseDoubleClickEvent
 
def mouseMoveEvent
 
def mousePressEvent
 
def mouseReleaseEvent
 
def move
 
def noRearangeContent
 
def paint
 
def paintEvent
 
def penColor
 
def previousDragPosition
 
def rearangeContent
 
def resetMouseDragOffset
 
def resize
 
def scale
 
def scheduleCalculateDistances
 
def scheduleRearangeContent
 
def select
 
def setArrowShape
 
def setBodyWidget
 
def setColors
 
def setDeletable
 
def setDragable
 
def setDragReferencePoint
 
def setImage
 
def setMaximumSize
 
def setMinimumSize
 
def setPreviousDragPosition
 
def setSelectable
 
def setShape
 
def setText
 
def setTextFieldAutosizeFont
 
def setTextFieldAutotruncateText
 
def setTitle
 
def setZoom
 
def showEvent
 
def sizeHint
 
def text
 
def textField
 
def textFieldIsSet
 
def title
 
def titleField
 
def titleIsSet
 
def unzoomedX
 
def unzoomedY
 
def width
 
- Public Member Functions inherited from Vispa.Gui.ZoomableWidget.ZoomableWidget
def __init__
 
def exportImage
 
def setZoom
 
- Public Member Functions inherited from Vispa.Gui.Zoomable.Zoomable
def __init__
 
def decrementZoom
 
def incrementZoom
 
def setZoom
 
def zoom
 
def zoomFactor
 

Static Public Attributes

 AUTOSIZE = True
 
 AUTOSIZE_KEEP_ASPECT_RATIO = False
 
string BACKGROUND_SHAPE = 'ROUNDRECT'
 
tuple FILL_COLOR1 = QColor(59, 59, 59, 200)
 
int HEIGHT = 30
 
tuple HOVER_COLOR1 = QColor(0, 0, 240)
 
tuple HOVER_COLOR2 = QColor(0, 0, 200)
 
tuple PEN_COLOR = QColor(242, 230, 242)
 
int ROUNDRECT_RADIUS = 10
 
 SELECTABLE_FLAG = False
 
tuple TITLE_COLOR = QColor(Qt.white)
 
 USE_BACKGROUND_GRADIENT_FLAG = False
 
- Static Public Attributes inherited from Vispa.Gui.VispaWidget.VispaWidget
 ARROW_SHAPE = None
 
int ARROW_SHAPE_BOTTOM = 2
 
int ARROW_SHAPE_LEFT = 1
 
int ARROW_SHAPE_RIGHT = 3
 
int ARROW_SHAPE_TOP = 0
 
int ARROW_SIZE = 30
 
 AUTOPOSITIONIZE_WHEN_ZOOMING_FLAG = True
 
 AUTOSIZE = False
 
 AUTOSIZE_KEEP_ASPECT_RATIO = True
 
string BACKGROUND_SHAPE = 'RECT'
 
int BOTTOM_MARGIN = 5
 
 COLOR_HEADER_BACKGROUND_FLAG = True
 
tuple FILL_COLOR1 = QColor(188, 215, 241)
 
tuple FILL_COLOR2 = QColor(242, 230, 242)
 
 FOCUSPOLICY = Qt.StrongFocus
 
int HEIGHT = 80
 
int HORIZONTAL_INNER_MARGIN = 5
 
int LEFT_MARGIN = 5
 
int MINIMUM_HEIGHT = 0
 
int MINIMUM_WIDTH = 30
 
tuple PEN_COLOR = QColor(128, 186, 224)
 
int RIGHT_MARGIN = 5
 
int ROUNDRECT_RADIUS = 30
 
tuple SELECT_COLOR = QColor('darkblue')
 
 SELECTABLE_FLAG = True
 
int SELECTED_FRAME_WIDTH = 2
 
 TEXTFIELD_AUTOSIZE_FONT_FLAG = False
 
 TEXTFIELD_AUTOTRUNCATE_TEXT_FLAG = False
 
 TEXTFIELD_FLAGS = Qt.TextWordWrap
 
int TEXTFIELD_FONTSIZE = 12
 
int TEXTFIELD_FONTSIZE_MAX = 20
 
int TEXTFIELD_FONTSIZE_MIN = 2
 
tuple TITLE_COLOR = QColor(Qt.white)
 
int TITLEFIELD_FONTSIZE = 12
 
int TOP_MARGIN = 5
 
 USE_BACKGROUND_GRADIENT_FLAG = True
 
int VERTICAL_INNTER_MARGIN = 5
 
int WIDTH = 100
 

Private Attributes

 _associatedWidget
 
 _cursorEntered
 
 _hoverEntry
 
 _hoverGradient
 
 _menuEntrySlots
 
 _menuEntryTextFields
 
 _scaleHeight
 
 _scaleWidth
 
 _spacer
 

Additional Inherited Members

- Public Attributes inherited from Vispa.Gui.VispaWidget.VispaWidget
 fillColor1
 
 fillColor2
 
 framePenColor
 
 HEIGHT
 
 WIDTH
 

Detailed Description

Definition at line 8 of file MenuWidget.py.

Constructor & Destructor Documentation

def Vispa.Gui.MenuWidget.MenuWidget.__init__ (   self,
  parent = None,
  associatedWidget = None,
  orientation = Qt.Horizontal 
)
Constructor

Definition at line 29 of file MenuWidget.py.

29 
30  def __init__(self, parent=None, associatedWidget=None, orientation=Qt.Horizontal):
31  """ Constructor
32  """
33  logging.debug("%s: Constructor" % self.__class__.__name__)
34  self._cursorEntered = False
35 
37  self._menuEntrySlots = []
38  self._hoverEntry = None
39 
40  self._spacer = TextField()
41 
42  VispaWidget.__init__(self, parent)
43  self.hide()
44  self._associatedWidget = associatedWidget
45  self.setMouseTracking(True)
46  self.setDragable(False)
47  #self._hoverBrush = QBrush(self.HOVER_COLOR1)
48  self._hoverGradient = QRadialGradient()
49  self._hoverGradient.setColorAt(0, self.HOVER_COLOR1)
50  self._hoverGradient.setColorAt(1, self.HOVER_COLOR2)
51  #self._hoverBrush = QBrush(self.HOVER_COLOR1)
52 
53  self._spacer.setFontSizeRange(self.TEXTFIELD_FONTSIZE_MIN, self.TEXTFIELD_FONTSIZE_MAX)
54  #self._textField.setDefaultWidth(self.getDistance('textFieldWidth', 1, True))
55  #entry.setDefaultHeight(self.getDistance('textFieldHeight', 1, True))
56  self._spacer.setDefaultFontSize(self.TEXTFIELD_FONTSIZE)
57  self._spacer.setAutosizeFont(self.TEXTFIELD_AUTOSIZE_FONT_FLAG)
58  self._spacer.setAutotruncate(self.TEXTFIELD_AUTOTRUNCATE_TEXT_FLAG)
59  self._spacer.setAutoscale(True, False)
60  self._spacer.setPenColor(self.TITLE_COLOR)
61  self._spacer.setFont(self.font())
62  self._spacer.setText(" | ")
63  self._spacer.calculateDimensions()

Member Function Documentation

def Vispa.Gui.MenuWidget.MenuWidget.addEntry (   self,
  name,
  slot = None 
)

Definition at line 64 of file MenuWidget.py.

References FWFramedTextTableCellRenderer.font(), FWTextTableCellRenderer.font(), Vispa.Gui.VispaWidget.TextField.font(), Vispa.Gui.VispaWidget.VispaWidget.scheduleRearangeContent(), Vispa.Gui.VispaWidget.VispaWidget.TEXTFIELD_AUTOSIZE_FONT_FLAG, Vispa.Gui.VispaWidget.VispaWidget.TEXTFIELD_AUTOTRUNCATE_TEXT_FLAG, Vispa.Gui.VispaWidget.VispaWidget.TEXTFIELD_FONTSIZE, Vispa.Gui.VispaWidget.VispaWidget.TEXTFIELD_FONTSIZE_MAX, Vispa.Gui.VispaWidget.VispaWidget.TEXTFIELD_FONTSIZE_MIN, and Vispa.Gui.MenuWidget.MenuWidget.TITLE_COLOR.

64 
65  def addEntry(self, name, slot=None):
66  entry = TextField()
67  entry.setFontSizeRange(self.TEXTFIELD_FONTSIZE_MIN, self.TEXTFIELD_FONTSIZE_MAX)
68  #self._textField.setDefaultWidth(self.getDistance('textFieldWidth', 1, True))
69  #entry.setDefaultHeight(self.getDistance('textFieldHeight', 1, True))
70  entry.setDefaultFontSize(self.TEXTFIELD_FONTSIZE)
71  entry.setAutosizeFont(self.TEXTFIELD_AUTOSIZE_FONT_FLAG)
72  entry.setAutotruncate(self.TEXTFIELD_AUTOTRUNCATE_TEXT_FLAG)
73  entry.setAutoscale(True, False)
74  entry.setPenColor(self.TITLE_COLOR)
75  entry.setFont(self.font())
76  entry.setText(name)
77  entry.calculateDimensions()
78  self._menuEntryTextFields.append(entry)
79  self._menuEntrySlots.append(slot)
80 
82  return entry
def Vispa.Gui.MenuWidget.MenuWidget.cursorHasEntered (   self)

Definition at line 213 of file MenuWidget.py.

References Vispa.Gui.MenuWidget.MenuWidget._cursorEntered.

def Vispa.Gui.MenuWidget.MenuWidget.drawMenuEntries (   self,
  painter 
)
Tells TextField object of text field to draw title on widget.

Definition at line 144 of file MenuWidget.py.

References Vispa.Gui.MenuWidget.MenuWidget._hoverEntry, Vispa.Gui.MenuWidget.MenuWidget._hoverGradient, Vispa.Gui.MenuWidget.MenuWidget._menuEntryTextFields, ValidateGeometry.getDistance(), Vispa.Gui.VispaWidget.VispaWidget.getDistance(), min, and Vispa.Gui.Zoomable.Zoomable.zoomFactor().

Referenced by Vispa.Gui.MenuWidget.MenuWidget.paint().

145  def drawMenuEntries(self, painter):
146  """ Tells TextField object of text field to draw title on widget.
147  """
148  x = self.getDistance('textFieldX')
149  y = self.getDistance('textFieldY')
150  spacerWidth = self._spacer.getWidth() * self.zoomFactor()
151  originalPen = QPen()
152  painter.setPen(originalPen)
153  firstFlag = True
154  for entry in self._menuEntryTextFields:
155  if not firstFlag:
156  self._spacer.paint(painter, x, y, self.zoomFactor())
157  x += spacerWidth
158  if self._hoverEntry == entry:
159  hoverRectXOffset = 0.3 * spacerWidth
160  hoverRectYOffset = 0.3 * self.getDistance('topMargin')
161  hoverWidth = entry.getWidth() * self.zoomFactor() + 2 * hoverRectXOffset
162  hoverHeight = entry.getHeight() * self.zoomFactor() + 2 * hoverRectYOffset
163  #self._hoverGradient.setColorAt(0, self.HOVER_COLOR1)
164  #self._hoverGradient.setColorAt(1, self.HOVER_COLOR2)
165  self._hoverGradient.setCenter(QPointF(entry.getDrawRect(self.zoomFactor()).center()))
166  self._hoverGradient.setFocalPoint(QPointF(entry.getDrawRect(self.zoomFactor()).center()))
167  self._hoverGradient.setRadius(min(hoverWidth, hoverHeight))
168  #painter.setBrush(self._hoverBrush)
169  painter.setBrush(self._hoverGradient)
170  painter.setPen(Qt.NoPen)
171  #painter.drawRoundedRect(entry.getDrawRect(self.zoomFactor()), 10, 10)
172  painter.drawRoundedRect(x - hoverRectXOffset, y - hoverRectYOffset, hoverWidth, hoverHeight, 5, 5)
173  painter.setPen(originalPen)
174  entry.paint(painter, x, y, self.zoomFactor())
175  x += entry.getWidth() * self.zoomFactor()
176  firstFlag = False
#define min(a, b)
Definition: mlp_lapack.h:161
def Vispa.Gui.MenuWidget.MenuWidget.enterEvent (   self,
  event 
)

Definition at line 210 of file MenuWidget.py.

References Vispa.Gui.MenuWidget.MenuWidget._cursorEntered.

211  def enterEvent(self, event):
212  self._cursorEntered = True
def Vispa.Gui.MenuWidget.MenuWidget.entry (   self,
  index 
)

Definition at line 98 of file MenuWidget.py.

References Vispa.Gui.MenuWidget.MenuWidget._menuEntryTextFields, and Vispa.Gui.MenuWidget.MenuWidget.len().

98 
99  def entry(self, index):
100  if len(self._menuEntryTextFields) >= index + 1:
101  return self._menuEntryTextFields[index]
102  return None
def Vispa.Gui.MenuWidget.MenuWidget.hide (   self)

Definition at line 202 of file MenuWidget.py.

References Vispa.Gui.MenuWidget.MenuWidget._hoverEntry.

Referenced by Vispa.Gui.MenuWidget.MenuWidget.leaveEvent(), and Vispa.Gui.MenuWidget.MenuWidget.mousePressEvent().

203  def hide(self):
204  VispaWidget.hide(self)
205  self._hoverEntry = None
def Vispa.Gui.MenuWidget.MenuWidget.leaveEvent (   self,
  event 
)

Definition at line 195 of file MenuWidget.py.

References Vispa.Gui.MenuWidget.MenuWidget._associatedWidget, Vispa.Gui.MenuWidget.MenuWidget._hoverEntry, python.DBCopy.DBCopy.cursor, TiXmlParsingData.cursor, CSCDCCExaminer::OStream.hide(), Vispa.Gui.MenuWidget.MenuWidget.hide(), python.multivaluedict.MyUserList.parent, FSimVertex.parent(), reco::PattRecoNode< Cluster >.parent(), DDI::Division.parent(), EmDQMReco::FourVectorMonitorElements.parent, graphwalker< ReferenceCountingPointer, ReferenceCountingPointer >.parent(), graphwalker< DDLogicalPart, DDPosData * >.parent(), graphwalker< N, E >.parent(), OpticalObject.parent(), DDLSAX2FileHandler.parent(), edm::DocFormatHelper.parent(), FWPSetTableManager::PSetData.parent, DDFilteredView.parent(), confdb.HLTProcess.parent, DDExpandedView.parent(), DDDivision.parent(), stor::TriggerSelector::TreeElement.parent(), DDXMLElement.parent(), argparse.HelpFormatter._Section.parent, python.rootplot.argparse.HelpFormatter._Section.parent, globcontrol.parent, TiXmlNode.parent, Vispa.Views.LineDecayView.DecayObject.parent(), DDDWorldObserver< Event >.update(), PixelTrackFilter.update(), SaveSimTrack.update(), PTStatistics.update(), KillSecondariesRunAction.update(), KillSecondariesTrackAction.update(), HIPixelTrackFilter.update(), HIProtoTrackFilter.update(), reco::KalmanGhostTrackUpdater.update(), KalmanAlignmentMetricsUpdator.update(), PrintTrackNumberAction.update(), GenericMVAComputerCache.update(), MSLayersAtAngle.update(), SimpleMetricsUpdator.update(), DDG4ProductionCuts.update(), HICMuonUpdator.update(), LagrangeChildUpdator.update(), VertexTrackUpdator< N >.update(), DummyVertexTrackUpdator< N >.update(), MultiMetricsUpdator.update(), FastFedCablingTask.update(), TrajectoryStateUpdator.update(), ErrorCorrelation.update(), ApvTimingTask.update(), DaqScopeModeTask.update(), FedTimingTask.update(), VpspScanTask.update(), DummyMetricsUpdator.update(), OptoScanTask.update(), PedestalsTask.update(), GsfMultiStateUpdator.update(), ApvTimingHistosUsingDb.update(), NoiseHistosUsingDb.update(), OptoScanHistosUsingDb.update(), PedestalsHistosUsingDb.update(), PedsFullNoiseHistosUsingDb.update(), PedsOnlyHistosUsingDb.update(), VpspScanHistosUsingDb.update(), CalibrationScanTask.update(), CalibrationTask.update(), FineDelayTask.update(), LatencyTask.update(), MonopoleSteppingAction.update(), CurrentAlignmentKFUpdator.update(), RHStopTracer.update(), FastFedCablingHistosUsingDb.update(), FedCablingTask.update(), PrintSensitive.update(), TkPixelMeasurementDet.update(), SamplingHistosUsingDb.update(), LatencyHistosUsingDb.update(), NoiseTask.update(), PedsOnlyTask.update(), KFStrip1DUpdator.update(), KFStripUpdator.update(), EcalUnpackerWorkerBase.update(), CheckOverlap.update(), CalibrationHistosUsingDb.update(), ChildUpdator.update(), KFSwitchingUpdator.update(), FineDelayHistosUsingDb.update(), CountProcessesAction.update(), PedsFullNoiseTask.update(), PrintGeomInfoAction.update(), PrintMaterialBudgetInfo.update(), progressbar.Widget.update(), MeasurementTracker.update(), KinematicConstrainedVertexUpdator.update(), ora::PVectorUpdater.update(), MaterialBudgetHcal.update(), PhysicsTools::MVAComputerCache.update(), OnDemandMeasurementTracker.update(), StoreSecondary.update(), BinomialProbability.update(), ESUnpackerWorker.update(), TrackingMaterialProducer.update(), GraphPath< N, E >.update(), MuonServiceProxy.update(), GflashG4Watcher.update(), EcalUnpackerWorker.update(), EcalSimHitsValidProducer.update(), MaterialBudgetForward.update(), funct::Master< F >.update(), KFSwitching1DUpdator.update(), Observer< T >.update(), Observer< const Event * >.update(), CheckSecondary.update(), Observer< const BeginOfJob * >.update(), Observer< const BeginOfTrack * >.update(), Observer< const G4Step * >.update(), Observer< const EndOfRun * >.update(), Observer< const EndOfTrack * >.update(), Observer< const T * >.update(), Observer< const BeginOfEvent * >.update(), Observer< const EndOfEvent * >.update(), Observer< const BeginOfRun * >.update(), Observer< const DDDWorld * >.update(), pat::CandidateSummaryTable::Record.update(), HLTMonBTagClient.update(), KalmanVertexTrackUpdator< N >.update(), KFUpdator.update(), KalmanVertexTrackUpdator< 5 >.update(), CaloTrkProcessing.update(), HcalTestAnalysis.update(), HcaluLUTTPGCoder.update(), TkStripMeasurementDet.update(), pos::PixelConfig.update(), jptJetAnalysis::TrackPropagatorToCalo.update(), ora::IRelationalUpdater.update(), KalmanAlignmentUserVariables.update(), BasicMultiTrajectoryState.update(), FWJobMetadataManager.update(), TrackingVerboseAction.update(), PhysicsTools::TreeReader.update(), MaterialBudgetAction.update(), KalmanVertexUpdator< 5 >.update(), reco::GhostTrackFitter::PredictionUpdater.update(), KalmanVertexUpdator< N >.update(), FiberSD.update(), SingleParticleEvent.update(), ora::QueryableVectorUpdater.update(), SimG4HcalValidation.update(), KinematicConstrainedVertexUpdatorT< nTrk, nConstraint >.update(), fwlite::RecordWriter.update(), SiStripPartition.update(), MuonTrajectoryUpdator.update(), simwatcher::BeginOfTrackCounter.update(), FWParameterSetterBase.update(), progressbar.Timer.update(), TotemTestGem.update(), PLTSensitiveDetector.update(), DQMOldReceiver.update(), MuonUpdatorAtVertex.update(), TkAccumulatingSensitiveDetector.update(), ora::OraPtrUpdater.update(), LaserAlignmentSimulation.update(), jptJetAnalysis::StripSignalOverNoiseCalculator.update(), HcalTB02Analysis.update(), ora::PrimitiveUpdater.update(), ora::UniqueRefUpdater.update(), ora::OraReferenceUpdater.update(), ora::CArrayUpdater.update(), ApvAnalysisFactory.update(), HcalTB06Analysis.update(), BTagPerformanceAnalyzerOnData.update, ora::ObjectUpdater.update(), TotemSD.update(), progressbar.WidgetHFill.update(), MeasurementTrackerImpl.update(), StMeasurementDetSet.update(), HcalForwardAnalysis.update(), MuonSensitiveDetector.update(), ora::BlobUpdater.update(), SimTracer.update(), ora::InlineCArrayUpdater.update(), HcalTB04Analysis.update(), sistrip::RawToDigiUnpacker.update(), DAClusterizerInZ.update(), DTVDriftCalibration::cellInfo.update(), DTSegmentUpdator.update(), ora::STLContainerUpdater.update(), DynamicTruncation.update(), sim_act::Signaler< EndOfTrack >.update(), sim_act::Signaler< BeginOfJob >.update(), sim_act::Signaler< T >.update(), EcalTBH4Trigger.update(), sim_act::Signaler< BeginOfTrack >.update(), sim_act::Signaler< EndOfRun >.update(), sim_act::Signaler< EndOfEvent >.update(), sim_act::Signaler< BeginOfEvent >.update(), sim_act::Signaler< G4Step >.update(), sim_act::Signaler< DDDWorld >.update(), sim_act::Signaler< BeginOfRun >.update(), DoCastorAnalysis.update(), ora::NamedRefUpdater.update(), ZdcTestAnalysis.update(), CastorTestAnalysis.update(), CaloSD.update(), BTagPerformanceAnalyzerMC.update, BscSD.update(), edm::service::SimpleMemoryCheck.update(), edm::BMixingModule.update(), PhysicsTools::MVAModuleHelper< Record, Object, Filler >::Value.update(), ora::Container.update(), BetafuncEvtVtxGenerator.update(), PhysicsTools::TreeReader::Value.update(), progressbar.Bar.update(), FP420SD.update(), progressbar.BouncingBar.update(), HLTScalersClient::CountLSFifo_t.update(), GaussianSumUtilities1D.update(), CastorShowerLibraryMaker.update(), MonitorElement.update(), ora::Database.update(), StandAloneMuonFilter.update(), DTRecSegment2D.update(), DQMNet::Peer.update, FWPSetTableManager.update(), CommissioningTask.update(), progressbar.FormatLabel.update(), DQMNet::AutoPeer.update, G4StepStatistics.update(), FWLiteESRecordWriterAnalyzer.update(), python.seqvaluedict.seqdict.update(), FP420Test.update(), Folder.update(), BscTest.update(), TrajectoryStateOnSurface.update(), BasicTrajectoryState.update(), progressbar.ProgressBar.update(), DetSetVector< T >.update(), const_iterator.update(), edmNew::DetSetVector< T >.update(), DetSetVector< SiStripCluster >.update(), DetSetVector< ClusterType >.update(), DetSetVector< SiPixelCluster >.update(), and evf::iDie::lsStat.update().

196  def leaveEvent(self, event):
197  #logging.debug("%s: leaveEvent()" % self.__class__.__name__)
198  if not self._associatedWidget or self.parent().childAt(self.parent().mapFromGlobal(self.cursor().pos())) != self._associatedWidget:
199  self.hide()
200  self._hoverEntry = None
201  self.update()
def Vispa.Gui.MenuWidget.MenuWidget.len (   self)

Definition at line 95 of file MenuWidget.py.

References Vispa.Gui.MenuWidget.MenuWidget._menuEntryTextFields.

Referenced by Vispa.Gui.MenuWidget.MenuWidget.entry().

95 
96  def len(self):
97  return len(self._menuEntryTextFields)
def Vispa.Gui.MenuWidget.MenuWidget.mouseMoveEvent (   self,
  event 
)

Definition at line 177 of file MenuWidget.py.

References Vispa.Gui.MenuWidget.MenuWidget._hoverEntry, Vispa.Gui.MenuWidget.MenuWidget._menuEntryTextFields, edm.contains(), DDDWorldObserver< Event >.update(), SaveSimTrack.update(), PixelTrackFilter.update(), PTStatistics.update(), KillSecondariesRunAction.update(), KillSecondariesTrackAction.update(), HIPixelTrackFilter.update(), HIProtoTrackFilter.update(), PrintTrackNumberAction.update(), GenericMVAComputerCache.update(), KalmanAlignmentMetricsUpdator.update(), reco::KalmanGhostTrackUpdater.update(), DDG4ProductionCuts.update(), HICMuonUpdator.update(), SimpleMetricsUpdator.update(), MSLayersAtAngle.update(), TrajectoryStateUpdator.update(), FastFedCablingTask.update(), MultiMetricsUpdator.update(), LagrangeChildUpdator.update(), VertexTrackUpdator< N >.update(), DummyVertexTrackUpdator< N >.update(), VpspScanTask.update(), ErrorCorrelation.update(), ApvTimingTask.update(), DaqScopeModeTask.update(), FedTimingTask.update(), PedestalsTask.update(), OptoScanTask.update(), DummyMetricsUpdator.update(), GsfMultiStateUpdator.update(), MonopoleSteppingAction.update(), ApvTimingHistosUsingDb.update(), NoiseHistosUsingDb.update(), PedestalsHistosUsingDb.update(), OptoScanHistosUsingDb.update(), PedsFullNoiseHistosUsingDb.update(), PedsOnlyHistosUsingDb.update(), VpspScanHistosUsingDb.update(), CalibrationScanTask.update(), CalibrationTask.update(), FineDelayTask.update(), LatencyTask.update(), RHStopTracer.update(), CurrentAlignmentKFUpdator.update(), FastFedCablingHistosUsingDb.update(), PrintSensitive.update(), FedCablingTask.update(), SamplingHistosUsingDb.update(), TkPixelMeasurementDet.update(), NoiseTask.update(), PedsOnlyTask.update(), EcalUnpackerWorkerBase.update(), KFStrip1DUpdator.update(), KFStripUpdator.update(), LatencyHistosUsingDb.update(), CheckOverlap.update(), CalibrationHistosUsingDb.update(), KFSwitchingUpdator.update(), ChildUpdator.update(), PedsFullNoiseTask.update(), CountProcessesAction.update(), PrintGeomInfoAction.update(), PrintMaterialBudgetInfo.update(), FineDelayHistosUsingDb.update(), progressbar.Widget.update(), ora::PVectorUpdater.update(), MeasurementTracker.update(), KinematicConstrainedVertexUpdator.update(), PhysicsTools::MVAComputerCache.update(), MaterialBudgetHcal.update(), StoreSecondary.update(), ESUnpackerWorker.update(), BinomialProbability.update(), OnDemandMeasurementTracker.update(), TrackingMaterialProducer.update(), GraphPath< N, E >.update(), MuonServiceProxy.update(), EcalSimHitsValidProducer.update(), GflashG4Watcher.update(), EcalUnpackerWorker.update(), MaterialBudgetForward.update(), funct::Master< F >.update(), CheckSecondary.update(), Observer< const BeginOfEvent * >.update(), Observer< T >.update(), pat::CandidateSummaryTable::Record.update(), KFSwitching1DUpdator.update(), Observer< const DDDWorld * >.update(), Observer< const BeginOfTrack * >.update(), Observer< const G4Step * >.update(), Observer< const EndOfTrack * >.update(), Observer< const T * >.update(), Observer< const BeginOfJob * >.update(), Observer< const EndOfEvent * >.update(), Observer< const Event * >.update(), Observer< const EndOfRun * >.update(), Observer< const BeginOfRun * >.update(), KFUpdator.update(), HLTMonBTagClient.update(), KalmanVertexTrackUpdator< 5 >.update(), KalmanVertexTrackUpdator< N >.update(), HcalTestAnalysis.update(), HcaluLUTTPGCoder.update(), CaloTrkProcessing.update(), pos::PixelConfig.update(), TkStripMeasurementDet.update(), jptJetAnalysis::TrackPropagatorToCalo.update(), ora::IRelationalUpdater.update(), FWJobMetadataManager.update(), BasicMultiTrajectoryState.update(), KalmanAlignmentUserVariables.update(), TrackingVerboseAction.update(), PhysicsTools::TreeReader.update(), MaterialBudgetAction.update(), ora::QueryableVectorUpdater.update(), FiberSD.update(), SingleParticleEvent.update(), KalmanVertexUpdator< 5 >.update(), reco::GhostTrackFitter::PredictionUpdater.update(), KalmanVertexUpdator< N >.update(), SimG4HcalValidation.update(), SiStripPartition.update(), fwlite::RecordWriter.update(), KinematicConstrainedVertexUpdatorT< nTrk, nConstraint >.update(), FWParameterSetterBase.update(), simwatcher::BeginOfTrackCounter.update(), MuonTrajectoryUpdator.update(), progressbar.Timer.update(), TotemTestGem.update(), PLTSensitiveDetector.update(), DQMOldReceiver.update(), TkAccumulatingSensitiveDetector.update(), MuonUpdatorAtVertex.update(), ora::OraPtrUpdater.update(), LaserAlignmentSimulation.update(), jptJetAnalysis::StripSignalOverNoiseCalculator.update(), HcalTB02Analysis.update(), ora::PrimitiveUpdater.update(), ora::UniqueRefUpdater.update(), ora::CArrayUpdater.update(), ora::OraReferenceUpdater.update(), HcalTB06Analysis.update(), ApvAnalysisFactory.update(), BTagPerformanceAnalyzerOnData.update, TotemSD.update(), progressbar.WidgetHFill.update(), ora::ObjectUpdater.update(), MuonSensitiveDetector.update(), HcalForwardAnalysis.update(), MeasurementTrackerImpl.update(), StMeasurementDetSet.update(), ora::BlobUpdater.update(), SimTracer.update(), ora::InlineCArrayUpdater.update(), HcalTB04Analysis.update(), sistrip::RawToDigiUnpacker.update(), DTVDriftCalibration::cellInfo.update(), DTSegmentUpdator.update(), DAClusterizerInZ.update(), ora::STLContainerUpdater.update(), DynamicTruncation.update(), EcalTBH4Trigger.update(), sim_act::Signaler< BeginOfEvent >.update(), sim_act::Signaler< BeginOfRun >.update(), sim_act::Signaler< G4Step >.update(), sim_act::Signaler< EndOfRun >.update(), sim_act::Signaler< T >.update(), sim_act::Signaler< BeginOfJob >.update(), sim_act::Signaler< BeginOfTrack >.update(), sim_act::Signaler< EndOfEvent >.update(), sim_act::Signaler< DDDWorld >.update(), sim_act::Signaler< EndOfTrack >.update(), DoCastorAnalysis.update(), ora::NamedRefUpdater.update(), CastorTestAnalysis.update(), ZdcTestAnalysis.update(), CaloSD.update(), BTagPerformanceAnalyzerMC.update, BscSD.update(), edm::service::SimpleMemoryCheck.update(), edm::BMixingModule.update(), PhysicsTools::MVAModuleHelper< Record, Object, Filler >::Value.update(), ora::Container.update(), BetafuncEvtVtxGenerator.update(), PhysicsTools::TreeReader::Value.update(), progressbar.Bar.update(), FP420SD.update(), progressbar.BouncingBar.update(), GaussianSumUtilities1D.update(), HLTScalersClient::CountLSFifo_t.update(), CastorShowerLibraryMaker.update(), MonitorElement.update(), ora::Database.update(), StandAloneMuonFilter.update(), DTRecSegment2D.update(), DQMNet::Peer.update, CommissioningTask.update(), FWPSetTableManager.update(), progressbar.FormatLabel.update(), DQMNet::AutoPeer.update, G4StepStatistics.update(), FWLiteESRecordWriterAnalyzer.update(), python.seqvaluedict.seqdict.update(), FP420Test.update(), Folder.update(), BscTest.update(), TrajectoryStateOnSurface.update(), BasicTrajectoryState.update(), progressbar.ProgressBar.update(), const_iterator.update(), DetSetVector< SiStripCluster >.update(), DetSetVector< ClusterType >.update(), edmNew::DetSetVector< T >.update(), DetSetVector< SiPixelCluster >.update(), DetSetVector< T >.update(), evf::iDie::lsStat.update(), and Vispa.Gui.Zoomable.Zoomable.zoomFactor().

178  def mouseMoveEvent(self, event):
179  if bool(event.buttons() & Qt.LeftButton):
180  VispaWidget.mouseMoveEvent(self, event)
181  return
182  for entry in self._menuEntryTextFields:
183  if entry.getDrawRect(self.zoomFactor()).contains(event.pos()):
184  self._hoverEntry = entry
185  self.update()
186  break
bool contains(EventRange const &lh, EventID const &rh)
Definition: EventRange.cc:38
def Vispa.Gui.MenuWidget.MenuWidget.mousePressEvent (   self,
  event 
)

Definition at line 187 of file MenuWidget.py.

References Vispa.Gui.MenuWidget.MenuWidget._menuEntrySlots, Vispa.Gui.MenuWidget.MenuWidget._menuEntryTextFields, edm.contains(), CSCDCCExaminer::OStream.hide(), Vispa.Gui.MenuWidget.MenuWidget.hide(), and Vispa.Gui.Zoomable.Zoomable.zoomFactor().

188  def mousePressEvent(self, event):
189  VispaWidget.mousePressEvent(self, event)
190  for i, entry in enumerate(self._menuEntryTextFields):
191  if self._menuEntrySlots[i] and entry.getDrawRect(self.zoomFactor()).contains(event.pos()):
192  self.hide()
193  self._menuEntrySlots[i]()
194  break
bool contains(EventRange const &lh, EventID const &rh)
Definition: EventRange.cc:38
def Vispa.Gui.MenuWidget.MenuWidget.paint (   self,
  painter,
  event = None 
)
Takes care of painting widget content on given painter.

Definition at line 138 of file MenuWidget.py.

References Vispa.Gui.MenuWidget.MenuWidget.drawMenuEntries().

Referenced by Vispa.Gui.VispaWidget.VispaWidget.paintEvent().

139  def paint(self, painter, event=None):
140  """ Takes care of painting widget content on given painter.
141  """
142  VispaWidget.paint(self, painter, event)
143  self.drawMenuEntries(painter)
def Vispa.Gui.MenuWidget.MenuWidget.removeEntry (   self,
  entry 
)

Definition at line 83 of file MenuWidget.py.

References Vispa.Gui.MenuWidget.MenuWidget._menuEntryTextFields.

83 
84  def removeEntry(self, entry):
85  if entry in self._menuEntryTextFields:
86  index = self._menuEntryTextFields.index(entry)
87  self._menuEntryTextFields.remove(entry)
88  self._menuEntrySlots.pop(index)
def Vispa.Gui.MenuWidget.MenuWidget.setEntryText (   self,
  entry,
  text 
)

Definition at line 89 of file MenuWidget.py.

References Vispa.Gui.MenuWidget.MenuWidget._menuEntryTextFields, and Vispa.Gui.VispaWidget.VispaWidget.scheduleRearangeContent().

89 
90  def setEntryText(self, entry, text):
91  if entry in self._menuEntryTextFields:
92  entry.setText(text)
93  entry.calculateDimensions()
def Vispa.Gui.MenuWidget.MenuWidget.showEvent (   self,
  event 
)

Definition at line 206 of file MenuWidget.py.

References Vispa.Gui.MenuWidget.MenuWidget._cursorEntered.

207  def showEvent(self, event):
208  VispaWidget.showEvent(self, event)
209  self._cursorEntered = False
def Vispa.Gui.MenuWidget.MenuWidget.sizeHint (   self)
Calculates needed space for widget content.

Definition at line 103 of file MenuWidget.py.

Referenced by Vispa.Gui.VispaWidget.VispaWidget.autosize().

104  def sizeHint(self):
105  """ Calculates needed space for widget content.
106  """
107  self._scaleWidth = 1 # for getDistance()
108  self._scaleHeight = 1
109 
110  neededWidth = self.getDistance('leftMargin', 1) + self.getDistance('rightMargin', 1)
111  neededHeight = self.getDistance('topMargin', 1) + self.getDistance('bottomMargin', 1)
112 
113  textFieldWidth = 0
114  textFieldHeight = 0
115  for entry in self._menuEntryTextFields:
116  textFieldWidth += entry.getWidth()
117  textFieldHeight = max(textFieldHeight, entry.getHeight())
118  textFieldWidth += max(0, (len(self._menuEntryTextFields) -1) * self._spacer.getWidth())
119 
120  neededWidth += textFieldWidth
121  neededHeight += textFieldHeight
122 
123  # evaluate maximum size
124  maxWidth = self.maximumSize().width()
125  maxHeight = self.maximumSize().height()
126 
127  maxScaleWidth = min(1.0, 1.0 * maxWidth/neededWidth)
128  maxScaleHeight = min(1.0, 1.0 * maxHeight/neededHeight)
129  if maxScaleWidth != 1.0 or maxScaleHeight != 1.0:
130  # this is not limited by keepAspectRationFlag
131  # as it is about absolute sizes here
132  # ratio is evaluated in autosize()
133  scale = min(maxScaleWidth, maxScaleHeight)
134  neededWidth *= scale
135  neededHeight *= scale
136 
137  return QSize(max(self.minimumSize().width(), neededWidth), max(self.minimumSize().height(), neededHeight))
#define min(a, b)
Definition: mlp_lapack.h:161
const T & max(const T &a, const T &b)

Member Data Documentation

Vispa.Gui.MenuWidget.MenuWidget._associatedWidget
private

Definition at line 43 of file MenuWidget.py.

Referenced by Vispa.Gui.MenuWidget.MenuWidget.leaveEvent().

Vispa.Gui.MenuWidget.MenuWidget._cursorEntered
private

Definition at line 33 of file MenuWidget.py.

Referenced by Vispa.Gui.MenuWidget.MenuWidget.cursorHasEntered(), Vispa.Gui.MenuWidget.MenuWidget.enterEvent(), and Vispa.Gui.MenuWidget.MenuWidget.showEvent().

Vispa.Gui.MenuWidget.MenuWidget._hoverEntry
private

Definition at line 37 of file MenuWidget.py.

Referenced by Vispa.Gui.MenuWidget.MenuWidget.drawMenuEntries(), Vispa.Gui.MenuWidget.MenuWidget.hide(), Vispa.Gui.MenuWidget.MenuWidget.leaveEvent(), and Vispa.Gui.MenuWidget.MenuWidget.mouseMoveEvent().

Vispa.Gui.MenuWidget.MenuWidget._hoverGradient
private

Definition at line 47 of file MenuWidget.py.

Referenced by Vispa.Gui.MenuWidget.MenuWidget.drawMenuEntries().

Vispa.Gui.MenuWidget.MenuWidget._menuEntrySlots
private

Definition at line 36 of file MenuWidget.py.

Referenced by Vispa.Gui.MenuWidget.MenuWidget.mousePressEvent().

Vispa.Gui.MenuWidget.MenuWidget._menuEntryTextFields
private

Definition at line 35 of file MenuWidget.py.

Referenced by Vispa.Gui.MenuWidget.MenuWidget.drawMenuEntries(), Vispa.Gui.MenuWidget.MenuWidget.entry(), Vispa.Gui.MenuWidget.MenuWidget.len(), Vispa.Gui.MenuWidget.MenuWidget.mouseMoveEvent(), Vispa.Gui.MenuWidget.MenuWidget.mousePressEvent(), Vispa.Gui.MenuWidget.MenuWidget.removeEntry(), and Vispa.Gui.MenuWidget.MenuWidget.setEntryText().

Vispa.Gui.MenuWidget.MenuWidget._scaleHeight
private

Definition at line 107 of file MenuWidget.py.

Referenced by Vispa.Gui.VispaWidget.VispaWidget.autosize(), Vispa.Gui.VispaWidget.VispaWidget.defineDistances(), and Vispa.Gui.VispaWidget.VispaWidget.sizeHint().

Vispa.Gui.MenuWidget.MenuWidget._scaleWidth
private

Definition at line 106 of file MenuWidget.py.

Referenced by Vispa.Gui.VispaWidget.VispaWidget.autosize(), Vispa.Gui.VispaWidget.VispaWidget.defineDistances(), and Vispa.Gui.VispaWidget.VispaWidget.sizeHint().

Vispa.Gui.MenuWidget.MenuWidget._spacer
private

Definition at line 39 of file MenuWidget.py.

Vispa.Gui.MenuWidget.MenuWidget.AUTOSIZE = True
static

Definition at line 20 of file MenuWidget.py.

Vispa.Gui.MenuWidget.MenuWidget.AUTOSIZE_KEEP_ASPECT_RATIO = False
static

Definition at line 21 of file MenuWidget.py.

string Vispa.Gui.MenuWidget.MenuWidget.BACKGROUND_SHAPE = 'ROUNDRECT'
static

Definition at line 12 of file MenuWidget.py.

tuple Vispa.Gui.MenuWidget.MenuWidget.FILL_COLOR1 = QColor(59, 59, 59, 200)
static

Definition at line 16 of file MenuWidget.py.

Referenced by Vispa.Gui.PortConnection.PointToPointConnection.drawCorner(), Vispa.Gui.PortConnection.PointToPointConnection.drawLineSection(), Vispa.Gui.PortConnection.PointToPointConnection.drawSection(), and Vispa.Gui.WidgetContainer.WidgetContainer.toggleCollapse().

int Vispa.Gui.MenuWidget.MenuWidget.HEIGHT = 30
static

Definition at line 11 of file MenuWidget.py.

Referenced by Vispa.Gui.VispaWidget.VispaWidget.autosize(), and Vispa.Gui.VispaWidget.VispaWidget.defineDistances().

tuple Vispa.Gui.MenuWidget.MenuWidget.HOVER_COLOR1 = QColor(0, 0, 240)
static

Definition at line 26 of file MenuWidget.py.

tuple Vispa.Gui.MenuWidget.MenuWidget.HOVER_COLOR2 = QColor(0, 0, 200)
static

Definition at line 27 of file MenuWidget.py.

tuple Vispa.Gui.MenuWidget.MenuWidget.PEN_COLOR = QColor(242, 230, 242)
static

Definition at line 15 of file MenuWidget.py.

Referenced by Vispa.Gui.WidgetContainer.WidgetContainer.toggleCollapse().

int Vispa.Gui.MenuWidget.MenuWidget.ROUNDRECT_RADIUS = 10
static

Definition at line 13 of file MenuWidget.py.

Referenced by Vispa.Gui.VispaWidget.VispaWidget.defineArrowBackgroundShape(), and Vispa.Gui.VispaWidget.VispaWidget.defineRoundRectBackgroundShape().

Vispa.Gui.MenuWidget.MenuWidget.SELECTABLE_FLAG = False
static

Definition at line 22 of file MenuWidget.py.

tuple Vispa.Gui.MenuWidget.MenuWidget.TITLE_COLOR = QColor(Qt.white)
static

Definition at line 18 of file MenuWidget.py.

Referenced by Vispa.Gui.VispaWidget.VispaWidget._initTitleField(), and Vispa.Gui.MenuWidget.MenuWidget.addEntry().

Vispa.Gui.MenuWidget.MenuWidget.USE_BACKGROUND_GRADIENT_FLAG = False
static

Definition at line 23 of file MenuWidget.py.