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"
46 fPopup =
new QPopupMenu;
51 fMousePosX = fMousePosY = 0;
81 static char methodTitle[128];
84 snprintf(methodTitle, 127,
"%s::%s", object->
ClassName(), method->
GetName());
96 static Char_t argTitle[128];
98 snprintf(argTitle, 127,
"(%s) %s", argument->
GetTitle(), argument->
GetName());
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)) {
231 snprintf(val, 255,
"%g", ddefval);
233 else if (!strncmp(basictype,
"char", 4) ||
234 !strncmp(basictype,
"int", 3) ||
235 !strncmp(basictype,
"long", 4) ||
236 !strncmp(basictype,
"short", 5)) {
239 snprintf(val, 255,
"%li", ldefval);
244 std::cout <<
"*** Warning in Dialog(): option menu not yet implemented " << opt << std::endl;
256 if (tval) strlcpy(val, tval, 256);
virtual const char * GetTitle() const
Returns title 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.
ClassImp(TSeqCollection) Int_t TSeqCollection TIter next(this)
Return index of object in collection.
RooArgList L(const RooAbsArg &v1)
All ROOT classes may have RTTI (run time type identification) support added.
TVirtualPad * GetPadSave() const
void SetTCanvas(TCanvas *aCanvas)
Each ROOT method (see TMethod) has a linked list of its arguments.
const char * GetMethodName() const
void Add(const char *argname, const char *value, const char *type)
Add widgets for arguments.
virtual TObject * At(Int_t idx) const
Returns the object at position idx. Returns 0 if idx is out of range.
static struct mg_connection * fc(struct mg_context *ctx)
TDataMember * GetDataMember() const
Returns TDataMember pointed by this methodarg.
void Init(const TFunction *func)
Initialize the method invocation environment based on the TFunction object.
std::map< std::string, std::string >::const_iterator iter
const char * GetDefault() const
Get default value of method argument.
TVirtualPad is an abstract base class for the Pad and Canvas classes.
virtual TList * GetListOfMethodArgs()
Returns methodarg list and additionally updates fDataMember in TMethod by calling FindDataMember();...
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.
virtual const char * ClassName() const
Returns name of class to which the object belongs.
virtual const char * GetName() const
Returns name of object.
The ROOT global object gROOT contains a list of all defined classes.
const char * GetTypeName() const
Get type of method argument, e.g.
virtual void Modified(Bool_t flag=1)=0
virtual const char * GetName() const
Returns name of object.
virtual void Clear(Option_t *option="")
Remove all objects from the list.
Mother of all ROOT objects.
TList * GetOptions() const
Returns list of options - list of TOptionListItems.
virtual TObject * First() const
Return the first object in the list. Returns 0 when list is empty.
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.
void Popup()
Show the dialog.
void Modified(Bool_t flag=1)