41 TClass *last_class =
nullptr;
42 bool has_editor =
false;
44 auto match = [](
const TObject *
v,
const char *
name) {
return !strcmp(
v->GetName(),
name); };
46 while ((
m = (
TMethod *)iter()) !=
nullptr) {
49 bool is_editor =
false;
51 if (match(m_cl,
"TH1")) {
52 if (match(
m,
"SetHighlight"))
continue;
53 if (match(
m,
"DrawPanel")) is_editor =
true;
54 }
else if (match(m_cl,
"TGraph")) {
55 if (match(
m,
"SetHighlight"))
continue;
56 if (match(
m,
"DrawPanel")) is_editor =
true;
57 }
else if (match(m_cl,
"TAttFill")) {
58 if (match(
m,
"SetFillAttributes")) is_editor =
true;
59 }
else if (match(m_cl,
"TAttLine")) {
60 if (match(
m,
"SetLineAttributes")) is_editor =
true;
61 }
else if (match(m_cl,
"TAttMarker")) {
62 if (match(
m,
"SetMarkerAttributes")) is_editor =
true;
63 }
else if (match(m_cl,
"TAttText")) {
64 if (match(
m,
"SetTextAttributes")) is_editor =
true;
69 AddMenuItem(
"Editor",
"Attributes editor",
"Show:Editor", last_class ? last_class : m_cl);
79 if (
m->Getter() && strlen(
m->Getter()) > 0) {
81 }
else if (strncmp(
m->GetName(),
"Set", 3) == 0) {
82 getter =
TString(
m->GetName())(3, strlen(
m->GetName()) - 3);
84 getter =
TString(
"Has") + getter;
86 getter =
TString(
"Get") + getter;
88 getter =
TString(
"Is") + getter;
96 auto call = std::make_unique<TMethodCall>(cl, getter,
"");
100 call->Execute(obj,
l);
109 TList *args =
m->GetListOfMethodArgs();
111 if (!args || (args->
GetSize() == 0)) {
114 auto item = std::make_unique<Detail::RArgsMenuItem>(
m->GetName(),
m->GetTitle());
115 item->SetExec(
Form(
"%s()",
m->GetName()));
116 item->SetClassName(m_cl->
GetName());
118 TIter args_iter(args);
121 while ((arg =
dynamic_cast<TMethodArg *
>(args_iter())) !=
nullptr) {
124 item->AddArg(menu_arg);
127 Add(std::move(item));
139 if (!drawable)
return nullptr;
143 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.
static TClass * GetClass(const char *name, Bool_t load=kTRUE, Bool_t silent=kFALSE)
Static method returning pointer to TClass of the specified class name.
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.
Mother of all ROOT objects.