15 #include "qpushbutton.h" 18 #if (QT_VERSION > 0x039999) // Added by cholm@nbi.dk - for Qt 4 22 # include "q3popupmenu.h" 24 # include "qpopupmenu.h" 81 static char methodTitle[128];
96 static Char_t argTitle[128];
100 if (arg_def && *arg_def) {
101 strncat(argTitle,
" [default: ", 127 - strlen(argTitle));
102 strncat(argTitle, arg_def, 127 - strlen(argTitle));
103 strncat(argTitle,
"]", 127 - strlen(argTitle));
128 QString buffer=klass->
GetName();
131 fPopup->insertItem(buffer,
this, SLOT(
Execute(
int) ), 0,curId); curId++;
133 fPopup->insertSeparator();
136 while ( (method = dynamic_cast<TMethod*>(iter())) != 0) {
138 fPopup->insertItem(buffer,
this, SLOT(
Execute(
int) ), 0,curId);
147 fPopup->popup(e->globalPos(), 0);
172 gROOT->SetSelectedPad(psave);
173 gROOT->GetSelectedPad()->Update();
174 gROOT->GetSelectedPad()->Modified();
186 if (!(
object && method))
return;
197 const char *charstar =
"char*";
204 if (strncmp(type,
"enum", 4) != 0)
205 std::cout <<
"*** Warning in Dialog(): data type is not basic type, assuming (int)\n";
206 strcpy(basictype,
"int");
209 if (strchr(argname,
'*')) {
210 strcat(basictype,
"*");
216 char gettername[256] =
"";
221 if (!strncmp(basictype,
"char*", 5)) {
224 if (tdefval && strlen(tdefval))
225 strlcpy(val, tdefval, 256);
227 else if (!strncmp(basictype,
"float", 5) ||
228 !strncmp(basictype,
"double", 6)) {
233 else if (!strncmp(basictype,
"char", 4) ||
234 !strncmp(basictype,
"int", 3) ||
235 !strncmp(basictype,
"long", 4) ||
236 !strncmp(basictype,
"short", 5)) {
244 std::cout <<
"*** Warning in Dialog(): option menu not yet implemented " << opt << std::endl;
256 if (tval) strlcpy(val, tval, 256);
virtual const char * GetName() const
Returns name of object.
TMethodCall * GetterMethod(TClass *cl=0)
Return a TMethodCall method responsible for getting the value of data member.
TString GetTypeName()
Get basic type of typedef, e,g.
All ROOT classes may have RTTI (run time type identification) support added.
void SetTCanvas(TCanvas *aCanvas)
TVirtualPad * GetPadSave() const
TList * GetOptions() const
Returns list of options - list of TOptionListItems.
Each ROOT method (see TMethod) has a linked list of its arguments.
const char * GetTypeName() const
Get type of method argument, e.g.
void Add(const char *argname, const char *value, const char *type)
Add widgets for arguments.
virtual const char * ClassName() const
Returns name of class to which the object belongs.
void Init(const TFunction *func)
Initialize the method invocation environment based on the TFunction object.
static constexpr double L
TVirtualPad is an abstract base class for the Pad and Canvas classes.
const char * GetMethodName() const
virtual TList * GetListOfMethodArgs()
Returns methodarg list and additionally updates fDataMember in TMethod by calling FindDataMember();...
virtual TObject * First() const
Return the first object in the list. Returns 0 when list is empty.
Basic data type descriptor (datatype information is obtained from CINT).
virtual void Execute(const char *method, const char *params, Int_t *error=0)
Execute method on this object with the given parameter string, e.g.
The ROOT global object gROOT contains a list of all defined classes.
virtual TObject * At(Int_t idx) const
Returns the object at position idx. Returns 0 if idx is out of range.
TDataMember * GetDataMember() const
Returns TDataMember pointed by this methodarg.
virtual void Modified(Bool_t flag=1)=0
you should not use this method at all Int_t Int_t Double_t Double_t Double_t e
virtual void Clear(Option_t *option="")
Remove all objects from the list.
Mother of all ROOT objects.
const char * GetDefault() const
Get default value of method argument.
void Execute(const char *, const char *, int *=0)
Execute method on this object with the given parameter string, e.g.
Each ROOT class (see TClass) has a linked list of methods.
void GetMenuItems(TList *listitems)
Returns list of methods accessible by context menu.
virtual void HandleInput(EEventType button, Int_t x, Int_t y)
Handle Input Events.
virtual const char * GetName() const
Returns name of object.
void Popup()
Show the dialog.
void Modified(Bool_t flag=1)
virtual const char * GetTitle() const
Returns title of object.