52#include "RConfigure.h"
75 gROOT->GetListOfCleanups()->Add(
this);
85 gROOT->GetListOfCleanups()->Remove(
this);
114 int xx, yy, topx = 0, topy = 0;
131 parent =
dynamic_cast<TGWindow *
>(pad->GetCanvasImp());
133 parent =
dynamic_cast<TGWindow *
>(pad->GetCanvasImp());
135 parent =
dynamic_cast<TGWindow *
>(browser->GetBrowserImp());
162 if ((opt_ptr=cmd.
Index(
"*MENU={")) !=
kNPOS ||
168 option = cmd(start,end - start);
174 while((obj = iter())) {
179 if (tend ==
kNPOS)
continue;
180 hierarchy = token(tstart,tend - tstart);
192 last_component = obj->
GetName();
216 last_component = obj->
GetName();
237 strcmp(
ptr2->GetName(), s)<0 )) { }
257 TList *menuItemList =
object->IsA()->GetMenuList();
260 TIter nextItem(menuItemList);
277 object->IsA()->GetMenuItems(methodList);
281 TIter next(methodList);
284 while ((method = (
TMethod*) next())) {
285 if (classPtr != method->
GetClass()) {
299 if (needSep && currentMenu ==
this) {
306 if ((
m = method->FindDataMember())) {
309 currentMenu =
FindHierarchy(method->GetCommentString(),last_component);
311 if (
m->GetterMethod()) {
313 if (needSep && currentMenu ==
this) {
317 if (last_component.
Length()) {
318 currentMenu->
AddPopup(last_component,
r);
320 currentMenu->
AddPopup(method->GetName(),
r);
323 TIter nxt(
m->GetOptions());
334 r->AddEntry(
name, togglelist++, t);
336 r->CheckEntry(togglelist-1);
339 if (needSep && currentMenu ==
this) {
343 AddEntrySorted(currentMenu,last_component.
Length() ? last_component.
Data() : method->GetName(), entry++, method,0,currentMenu !=
this);
355 currentMenu =
FindHierarchy(method->GetCommentString(),last_component);
356 if (needSep && currentMenu ==
this) {
360 AddEntrySorted(currentMenu,last_component.
Length() ? last_component.
Data() : method->GetName(), toggle++, t,0,currentMenu !=
this);
374 const char* menuItemTitle = menuItem->
GetTitle();
384 if (strlen(menuItemTitle)==0) menuItemTitle = method->
GetName();
385 AddEntry(menuItemTitle, toggle++, t);
389 if (strlen(menuItemTitle)==0) menuItemTitle = menuItem->
GetFunctionName();
390 AddEntry(menuItemTitle,userfunction++,menuItem);
418 if (!function)
return;
423 else selfobjpos = -1;
431 if (
c->GetCanvasImp()->IsA()->InheritsFrom(TGFrame::Class())) {
449 TIter next(function->GetListOfMethodArgs());
454 if (selfobjpos != argpos) {
458 const char *charstar =
"char*";
466 Warning(
"Dialog",
"data type is not basic type, assuming (int)");
467 strlcpy(basictype,
"int", 32);
470 if (strchr(argname,
'*')) {
471 strlcat(basictype,
"*",32);
472 if (!strncmp(
type,
"char", 4) || !strncmp(
type,
"Option_t", 8))
474 else if (strstr(argname,
"[default:")) {
483 if (
m &&
object &&
m->GetterMethod(
object->IsA())) {
489 if (!strncmp(basictype,
"char*", 5)) {
492 strlcpy(val, tdefval,
sizeof(val));
493 }
else if (!strncmp(basictype,
"float", 5) ||
494 !strncmp(basictype,
"double", 6)) {
496 m->GetterMethod()->Execute(
object,
"", ddefval);
498 }
else if (!strncmp(basictype,
"char", 4) ||
499 !strncmp(basictype,
"bool", 4) ||
500 !strncmp(basictype,
"int", 3) ||
501 !strncmp(basictype,
"long", 4) ||
502 !strncmp(basictype,
"short", 5)) {
504 m->GetterMethod()->Execute(
object,
"", ldefval);
512 if ((opt =
m->GetOptions())) {
513 Warning(
"Dialog",
"option menu not yet implemented");
515 TMotifOptionMenu *o=
new TMotifOptionMenu(argname);
522 if (value != -9999) {
525 o->AddItem(
name, val);
527 o->AddItem(
name, label);
540 if (tval && strlen(tval)) {
542 strlcpy(val, tval + (tval[0] ==
'"' ? 1 : 0),
sizeof(val));
543 if (val[strlen(val)-1] ==
'"')
544 val[strlen(val)-1]= 0;
561 static int max_ascent = 0, max_descent = 0;
566 if (max_ascent == 0) {
569 offset = (entry->
GetEh() - (max_ascent + max_descent)) / 2;
570 ty = entry->
GetEy() + max_ascent + offset - 1;
628 static int toggle = 0;
632 if (handCur ==
kNone)
634 if (rightCur ==
kNone)
638 gVirtualX->ChangeActivePointerGrab(
fId, mask, rightCur);
652 gVirtualX->ChangeActivePointerGrab(
fId, mask, rightCur);
679 TMethod *method = obj->IsA()->GetMethodAllAny(smeth.
Data());
Handle_t Cursor_t
Cursor handle.
const Mask_t kButtonPressMask
const Mask_t kPointerMotionMask
const Mask_t kButtonReleaseMask
void Warning(const char *location, const char *msgfmt,...)
Use this function in warning situations.
Using a TBrowser one can browse all ROOT objects.
TClass instances represent classes, structs and namespaces in the ROOT type system.
Long_t Property() const
Returns the properties of the TClass as a bit field stored as a Long_t value.
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.
All ROOT classes may have RTTI (run time type identification) support added.
TMethodCall * GetterMethod(TClass *cl=0)
Return a TMethodCall method responsible for getting the value of data member.
Basic data type descriptor (datatype information is obtained from CINT).
TString GetTypeName()
Get basic type of typedef, e,g.: "class TDirectory*" -> "TDirectory".
virtual Int_t GetValue(const char *name, Int_t dflt) const
Returns the integer value for a resource.
Global functions class (global functions are obtained from CINT).
Bool_t IsEditable() const
TGWindow * GetWindowById(Window_t sw) const
Find a TGWindow via its handle. If window is not found return 0.
void AddInput(UInt_t emask)
Add events specified in the emask to the events the frame should handle.
virtual UInt_t GetDefaultWidth() const
virtual UInt_t GetDefaultHeight() const
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
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 void Add(TObject *obj)
virtual TObject * Last() const
Return the last object in the list. Returns 0 when list is empty.
virtual void Delete(Option_t *option="")
Remove all objects from the list AND delete all heap based objects.
Each ROOT method (see TMethod) has a linked list of its arguments.
const char * GetDefault() const
Get default value of method argument.
const char * GetTypeName() const
Get type of method argument, e.g.: "class TDirectory*" -> "TDirectory" Result needs to be used or cop...
TDataMember * GetDataMember() const
Returns TDataMember pointed by this methodarg.
Method or function calling interface.
TFunction * GetMethod()
Returns the TMethod describing the method to be executed.
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.
virtual const char * GetCommentString()
Returns a comment string from the class declaration.
TClass * GetClass() const
EMenuItemKind IsMenuItem() const
virtual const char * GetName() const
Returns name of object.
Monitors objects for deletion and reflects the deletion by reverting the internal pointer to zero.
TObject * GetObject() const
void SetObject(TObject *obj, Bool_t fixMustCleanupBit=kTRUE)
Set obj as the spy target.
Mother of all ROOT objects.
virtual const char * GetName() const
Returns name of object.
virtual const char * ClassName() const
Returns name of class to which the object belongs.
Long_t fValue
Data member to which this option belongs.
virtual void Add(const char *argname, const char *value, const char *type)
Add a label and text input field.
virtual const char * GetParameters()
Get parameter string (called by contextmenu after OK or Apply has been selected).
virtual void Popup()
Popup dialog.
int CompareTo(const char *cs, ECaseCompare cmp=kExact) const
Compare a string to char *cs2.
Bool_t EndsWith(const char *pat, ECaseCompare cmp=kExact) const
Return true if string ends with the specified string.
const char * Data() const
Ssiz_t Last(char c) const
Find last occurrence of a character c.
TObjArray * Tokenize(const TString &delim) const
This function is used to isolate sequential tokens in a TString.
TString & Remove(Ssiz_t pos)
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
This class defines toggling facility for both - object's method or variables.
virtual void SetOnValue(Long_t lon)
TMethodCall * GetSetter() const
virtual void SetToggledObject(TObject *obj, TMethod *anymethod)
Initializes it to toggle an object's datamember using this object's method.
virtual void SetState(Bool_t state)
Sets the value of toggle to fOnValue or fOffValue according to passed argument.
virtual Bool_t GetState()
Returns the state of Toggle according to its current value and fOnValue, returns true if they match.
TVirtualPad is an abstract base class for the Pad and Canvas classes.
virtual Int_t GetCanvasID() const =0
EGEventType fType
of event (see EGEventType)