51 #include "RConfigure.h"
72 gROOT->GetListOfCleanups()->Add(
this);
82 gROOT->GetListOfCleanups()->Remove(
this);
111 int xx, yy, topx = 0, topy = 0;
128 parent = dynamic_cast<TGWindow *>(pad->GetCanvasImp());
130 parent = dynamic_cast<TGWindow *>(pad->GetCanvasImp());
132 parent = dynamic_cast<TGWindow *>(browser->GetBrowserImp());
159 if ((opt_ptr=cmd.
Index(
"*MENU={")) !=
kNPOS ||
165 option = cmd(start,end - start);
171 while((obj =
iter())) {
173 if (token.Index(
"Hierarchy=\"") !=
kNPOS) {
175 Ssiz_t tend = token.Index(
"\"",tstart+1);
176 if (tend ==
kNPOS)
continue;
177 hierarchy = token(tstart,tend - tstart);
189 last_component = obj->
GetName();
208 last_component.
CompareTo(ptr2->GetName()) > 0 )) { }
210 currentMenu->
AddPopup(last_component, r,ptr2);
213 last_component = obj->
GetName();
234 strcmp(ptr2->
GetName(), s)<0 )) { }
236 currentMenu->
AddEntry(s,
id,ud,p,ptr2);
254 TList *menuItemList =
object->IsA()->GetMenuList();
257 TIter nextItem(menuItemList);
274 object->IsA()->GetMenuItems(methodList);
282 if (classPtr != method->
GetClass()) {
296 if (needSep && currentMenu ==
this) {
303 if ((m = method->FindDataMember())) {
306 currentMenu =
FindHierarchy(method->GetCommentString(),last_component);
310 if (needSep && currentMenu ==
this) {
314 if (last_component.
Length()) {
315 currentMenu->
AddPopup(last_component, r);
317 currentMenu->
AddPopup(method->GetName(),
r);
323 const char *
name = it->fOptName;
336 if (needSep && currentMenu ==
this) {
340 AddEntrySorted(currentMenu,last_component.
Length() ? last_component.
Data() : method->GetName(), entry++, method,0,currentMenu !=
this);
352 currentMenu =
FindHierarchy(method->GetCommentString(),last_component);
353 if (needSep && currentMenu ==
this) {
357 AddEntrySorted(currentMenu,last_component.
Length() ? last_component.
Data() : method->GetName(), toggle++, t,0,currentMenu !=
this);
358 if (t->GetState()) currentMenu->
CheckEntry(toggle-1);
371 const char* menuItemTitle = menuItem->
GetTitle();
381 if (strlen(menuItemTitle)==0) menuItemTitle = method->
GetName();
382 AddEntry(menuItemTitle, toggle++, t);
386 if (strlen(menuItemTitle)==0) menuItemTitle = menuItem->
GetFunctionName();
387 AddEntry(menuItemTitle,userfunction++,menuItem);
415 if (!
function)
return;
420 else selfobjpos = -1;
451 if (selfobjpos != argpos) {
453 const char *
type = argument->GetTypeName();
455 const char *charstar =
"char*";
463 Warning(
"Dialog",
"data type is not basic type, assuming (int)");
464 strlcpy(basictype,
"int", 32);
467 if (strchr(argname,
'*')) {
468 strlcat(basictype,
"*",32);
469 if (!strncmp(type,
"char", 4) || !strncmp(type,
"Option_t", 8))
471 else if (strstr(argname,
"[default:")) {
486 if (!strncmp(basictype,
"char*", 5)) {
489 strlcpy(val, tdefval,
sizeof(val));
490 }
else if (!strncmp(basictype,
"float", 5) ||
491 !strncmp(basictype,
"double", 6)) {
494 snprintf(val,256,
"%g", ddefval);
495 }
else if (!strncmp(basictype,
"char", 4) ||
496 !strncmp(basictype,
"bool", 4) ||
497 !strncmp(basictype,
"int", 3) ||
498 !strncmp(basictype,
"long", 4) ||
499 !strncmp(basictype,
"short", 5)) {
502 snprintf(val,256,
"%li", ldefval);
510 Warning(
"Dialog",
"option menu not yet implemented");
512 TMotifOptionMenu *o=
new TMotifOptionMenu(argname);
519 if (value != -9999) {
521 snprintf(val,256,
"%li", value);
522 o->AddItem(name, val);
524 o->AddItem(name, label);
536 const char *tval = argument->GetDefault();
537 if (tval && strlen(tval)) {
539 strlcpy(val, tval + (tval[0] ==
'"' ? 1 : 0),
sizeof(val));
540 if (val[strlen(val)-1] ==
'"')
541 val[strlen(val)-1]= 0;
558 static int max_ascent = 0, max_descent = 0;
563 if (max_ascent == 0) {
566 offset = (entry->
GetEh() - (max_ascent + max_descent)) / 2;
567 ty = entry->
GetEy() + max_ascent + offset - 1;
625 static int toggle = 0;
629 if (handCur ==
kNone)
631 if (rightCur ==
kNone)
635 gVirtualX->ChangeActivePointerGrab(
fId, mask, rightCur);
649 gVirtualX->ChangeActivePointerGrab(
fId, mask, rightCur);
676 TMethod *method = obj->IsA()->GetMethodAllAny(smeth.
Data());
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
Ssiz_t Last(char c) const
Find last occurrence of a character c.
TMethodCall * GetterMethod(TClass *cl=0)
Return a TMethodCall method responsible for getting the value of data member.
virtual void Delete(Option_t *option="")
Remove all objects from the list AND delete all heap based objects.
TString GetTypeName()
Get basic type of typedef, e,g.
This class defines toggling facility for both - object's method or variables.
virtual void Add(const char *argname, const char *value, const char *type)
Add a label and text input field.
ClassImp(TSeqCollection) Int_t TSeqCollection TIter next(this)
Return index of object in collection.
virtual void SetState(Bool_t state)
Sets the value of toggle to fOnValue or fOffValue according to passed argument.
All ROOT classes may have RTTI (run time type identification) support added.
Long_t Property() const
Set TObject::fBits and fStreamerType to cache information about the class.
TObject * GetObject() const
Each ROOT method (see TMethod) has a linked list of its arguments.
TBrowserImp * GetBrowserImp() const
Bool_t IsEditable() const
const Mask_t kPointerMotionMask
const char * Data() const
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString...
void SetObject(TObject *obj, Bool_t fixMustCleanupBit=kTRUE)
Set obj as the spy target.
std::map< std::string, std::string >::const_iterator iter
TMethodCall * GetSetter() const
virtual Bool_t GetState()
Returns the state of Toggle according to its current value and fOnValue, returns true if they match...
virtual const char * GetCommentString()
Returns a comment string from the class declaration.
Method or function calling interface.
TVirtualPad is an abstract base class for the Pad and Canvas classes.
virtual UInt_t GetDefaultWidth() const
virtual void SetOnValue(Long_t lon)
const Mask_t kButtonPressMask
Using a TBrowser one can browse all ROOT objects.
void function(const char *name_, T fun, const char *docstring=0)
Bool_t EndsWith(const char *pat, ECaseCompare cmp=kExact) const
Return true if string ends with the specified string.
Basic data type descriptor (datatype information is obtained from CINT).
virtual const char * GetParameters()
Get parameter string (called by contextmenu after OK or Apply has been selected). ...
virtual Int_t GetValue(const char *name, Int_t dflt)
Returns the integer value for a resource.
virtual const char * ClassName() const
Returns name of class to which the object belongs.
virtual void Draw(Drawable_t id, GContext_t gc, Int_t x, Int_t y)
Draw a hot string and underline the hot character.
virtual const char * GetName() const
Returns name of object.
The ROOT global object gROOT contains a list of all defined classes.
virtual Int_t GetCanvasID() const =0
TGWindow * GetWindowById(Window_t sw) const
Find a TGWindow via its handle. If window is not found return 0.
TObjArray * Tokenize(const TString &delim) const
This function is used to isolate sequential tokens in a TString.
virtual TObject * Last() const
Return the last object in the list. Returns 0 when list is empty.
TString & Remove(Ssiz_t pos)
TClass * GetClass() const
Long_t fValue
Data member to which this option belongs.
TFunction * GetMethod()
Returns the TMethod describing the method to be executed.
TCanvasImp * GetCanvasImp() const
Get canvas implementation pointer if any.
virtual void SetToggledObject(TObject *obj, TMethod *anymethod)
Initializes it to toggle an object's datamember using this object's method.
EMenuItemKind IsMenuItem() const
virtual const char * GetName() const
Returns name of object.
const Mask_t kButtonReleaseMask
virtual void Popup()
Popup dialog.
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.
Mother of all ROOT objects.
TList * GetOptions() const
Returns list of options - list of TOptionListItems.
Global functions class (global functions are obtained from CINT).
virtual UInt_t GetDefaultHeight() const
virtual void Add(TObject *obj)
void Execute(const char *, const char *, int *=0)
Execute method on this object with the given parameter string, e.g.
Int_t GetCanvasID() const
Get canvas identifier.
Each ROOT class (see TClass) has a linked list of methods.
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
Monitors objects for deletion and reflects the deletion by reverting the internal pointer to zero...
int CompareTo(const char *cs, ECaseCompare cmp=kExact) const
Compare a string to char *cs2.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.