26RMenuItems::~RMenuItems() =
default;
31void RMenuItems::PopulateObjectMenu(
void *obj,
TClass *cl)
41 while ((
m = (
TMethod *)iter()) !=
nullptr) {
45 if (
m->Getter() && strlen(
m->Getter()) > 0) {
47 }
else if (strncmp(
m->GetName(),
"Set", 3) == 0) {
48 getter =
TString(
m->GetName())(3, strlen(
m->GetName()) - 3);
50 getter =
TString(
"Has") + getter;
52 getter =
TString(
"Get") + getter;
54 getter =
TString(
"Is") + getter;
62 auto call = std::make_unique<TMethodCall>(cl, getter,
"");
66 call->Execute(obj,
l);
75 TList *args =
m->GetListOfMethodArgs();
77 if (!args || (args->
GetSize() == 0)) {
80 auto item = std::make_unique<Detail::RArgsMenuItem>(
m->GetName(),
m->GetTitle());
81 item->SetExec(
Form(
"%s()",
m->GetName()));
83 TIter args_iter(args);
86 while ((arg =
dynamic_cast<TMethodArg *
>(args_iter())) !=
nullptr) {
89 item->AddArg(menu_arg);
104 if (!drawable)
return nullptr;
108 drawable->PopulateMenu(*items);
char * Form(const char *fmt,...)
const RDrawable::RDisplayContext & GetContext() const
RDrawable * GetDrawable() const
TClass instances represent classes, structs and namespaces in the ROOT type system.
void GetMenuItems(TList *listitems)
Returns list of methods accessible by context menu.
TMethod * GetMethodAllAny(const char *method)
Return pointer to method without looking at parameters.
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
Each ROOT method (see TMethod) has a linked list of its arguments.
const char * GetFullTypeName() const
Get full type description of method argument, e.g.: "class TDirectory*".
const char * GetDefault() const
Get default value of method argument.
static const EReturnType kLong
Each ROOT class (see TClass) has a linked list of methods.
virtual const char * GetTitle() const
Returns title of object.
virtual const char * GetName() const
Returns name of object.