38#include <QtCore/QSignalMapper>
49#include <QColorDialog>
50#include <QDoubleSpinBox>
64 gROOT->GetListOfCleanups()->Add(
this);
72 gROOT->GetListOfCleanups()->Remove(
this);
96 QPoint screenPos = widget->mapToGlobal(widget->rect().topLeft());
101 QObject::connect(&map, &QSignalMapper::mappedInt,
108 bool last_separ =
true;
116 TIter nextItem(menuItemList);
119 switch (menuItem->GetType()) {
134 TClass *classPtr =
nullptr;
135 TIter next(methodList);
138 while ((method = (
TMethod*) next())) {
139 if (classPtr != method->
GetClass()) {
163 if (member->GetterMethod()) {
164 QMenu *
r = menu.addMenu(method->
GetName());
165 TIter nxt(member->GetOptions());
172 auto act =
addMenuAction(
r, &map, it->fOptName.Data(), togglelist++, t);
173 act->setCheckable(
true);
175 act->setChecked(
true);
195 act->setCheckable(
true);
197 act->setChecked(
true);
208 const char* menuItemTitle = menuItem->
GetTitle();
209 if (menuItem->IsToggle()) {
217 if (strlen(menuItemTitle)==0)
218 menuItemTitle = method->
GetName();
219 auto act =
addMenuAction(&menu, &map, menuItemTitle, toggle++, t);
220 act->setCheckable(
true);
222 act->setChecked(
true);
225 if (strlen(menuItemTitle)==0)
226 menuItemTitle = menuItem->GetFunctionName();
227 addMenuAction(&menu, &map, menuItemTitle, userfunction++, menuItem);
237 menu.exec(screenPos + QPoint(
x,
y));
283 QAction* act =
new QAction(
text, menu);
286 if ((
text.compare(
"DrawClone") == 0) || (
text.compare(
"DrawClass") == 0) || (
text.compare(
"Inspect") == 0) ||
287 (
text.compare(
"SetShowProjectionX") == 0) || (
text.compare(
"SetShowProjectionY") == 0) ||
288 (
text.compare(
"DrawPanel") == 0) || (
text.compare(
"FitPanel") == 0))
289 act->setEnabled(
false);
291 QObject::connect(act, &QAction::triggered, [
id, map]() {
295 menu->addAction(act);
296 map->setMapping(act,
id);
338 if (t->GetState() == 0)
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize id
Option_t Option_t TPoint TPoint const char text
Specialized dialog to enter arguments for method exection.
void methodDialog(TContextMenu *menu, TObject *object, TFunction *func)
Run method dialog.
QPaintWidget * GetPaintWidget() const
TClass instances represent classes, structs and namespaces in the ROOT type system.
TList * GetMenuList() const
Return the list of menu items associated with the class.
TMethod * GetMethodWithPrototype(const char *method, const char *proto, Bool_t objectIsConst=kFALSE, ROOT::EFunctionMatchMode mode=ROOT::kConversionMatch)
Find the method with a given prototype.
void GetMenuItems(TList *listitems)
Returns list of methods accessible by context menu.
Global functions class (global functions are obtained from CINT).
void Add(TObject *obj) override
void Delete(Option_t *option="") override
Remove all objects from the list AND delete all heap based objects.
TClass * IsA() const override
Method or function calling interface.
TFunction * GetMethod()
Returns the TMethod describing the method to be executed.
Each ROOT class (see TClass) has a linked list of methods.
virtual TDataMember * FindDataMember()
Tries to guess DataMember from comment string and Method's name <==(only if 1 Argument!...
TClass * GetClass() const
EMenuItemKind IsMenuItem() const
TClass * IsA() const override
const char * GetName() const override
Returns name of object.
Mother of all ROOT objects.
virtual const char * GetTitle() const
Returns title of object.
This class defines toggling facility for both - object's method or variables.
virtual void SetOnValue(Long_t lon)
TMethodCall * GetSetter() const
return setter method request new for the TDataMember while it can be recreated at any time
virtual void SetToggledObject(TObject *obj, TMethod *anymethod)
Initializes it to toggle an object's datamember using this object's method.
virtual Bool_t GetState()
Returns the state of Toggle according to its current value and fOnValue, returns true if they match.