47#include "RConfigure.h"
69 gROOT->GetListOfCleanups()->Add(
this);
79 gROOT->GetListOfCleanups()->Remove(
this);
90 if (
fClient->IsEditable())
return;
108 int xx, yy, topx = 0, topy = 0;
125 parent =
dynamic_cast<TGWindow *
>(pad->GetCanvasImp());
126 else if ((pad =
fContextMenu->GetSelectedPad()) && pad->GetCanvasImp())
127 parent =
dynamic_cast<TGWindow *
>(pad->GetCanvasImp());
129 parent =
dynamic_cast<TGWindow *
>(browser->GetBrowserImp());
156 if ((opt_ptr=cmd.
Index(
"*MENU={")) !=
kNPOS ||
168 while((obj = iter())) {
173 if (tend ==
kNPOS)
continue;
174 hierarchy = token(tstart,tend - tstart);
186 last_component = obj->
GetName();
207 currentMenu->
AddPopup(last_component,
r,ptr2);
210 last_component = obj->
GetName();
231 strcmp(ptr2->
GetName(), s)<0 )) { }
233 currentMenu->
AddEntry(s,
id,ud,p,ptr2);
241 if (!
object ||
fClient->IsEditable())
return;
254 TIter nextItem(menuItemList);
275 TIter next(methodList);
278 while ((method = (
TMethod*) next())) {
279 if (classPtr != method->
GetClass()) {
293 if (needSep && currentMenu ==
this) {
305 if (
m->GetterMethod()) {
307 if (needSep && currentMenu ==
this) {
311 if (last_component.
Length()) {
312 currentMenu->
AddPopup(last_component,
r);
317 TIter nxt(
m->GetOptions());
328 r->AddEntry(
name, togglelist++, t);
330 r->CheckEntry(togglelist-1);
333 if (needSep && currentMenu ==
this) {
350 if (needSep && currentMenu ==
this) {
368 const char* menuItemTitle = menuItem->
GetTitle();
378 if (strlen(menuItemTitle)==0) menuItemTitle = method->
GetName();
379 AddEntry(menuItemTitle, toggle++, t);
383 if (strlen(menuItemTitle)==0) menuItemTitle = menuItem->
GetFunctionName();
384 AddEntry(menuItemTitle,userfunction++,menuItem);
412 if (!function)
return;
416 selfobjpos =
fContextMenu->GetSelectedMenuItem()->GetSelfObjectPos();
417 else selfobjpos = -1;
443 TIter next(function->GetListOfMethodArgs());
448 if (selfobjpos != argpos) {
449 const char *argname =
fContextMenu->CreateArgumentTitle(argument);
452 const char *charstar =
"char*";
460 Warning(
"Dialog",
"data type is not basic type, assuming (int)");
461 strlcpy(basictype,
"int", 32);
464 if (strchr(argname,
'*')) {
465 strlcat(basictype,
"*",32);
466 if (!strncmp(type,
"char", 4) || !strncmp(type,
"Option_t", 8))
468 else if (strstr(argname,
"[default:")) {
477 if (
m &&
object &&
m->GetterMethod(
object->IsA())) {
483 if (!strncmp(basictype,
"char*", 5)) {
485 m->GetterMethod()->Execute(
object,
"", &tdefval);
486 strlcpy(val, tdefval,
sizeof(val));
487 }
else if (!strncmp(basictype,
"float", 5) ||
488 !strncmp(basictype,
"double", 6)) {
490 m->GetterMethod()->Execute(
object,
"", ddefval);
492 }
else if (!strncmp(basictype,
"char", 4) ||
493 !strncmp(basictype,
"bool", 4) ||
494 !strncmp(basictype,
"int", 3) ||
495 !strncmp(basictype,
"long", 4) ||
496 !strncmp(basictype,
"short", 5)) {
498 m->GetterMethod()->Execute(
object,
"", ldefval);
499 snprintf(val, 256,
"%zi", (
size_t)ldefval);
503 if (
m->GetOptions()) {
504 Warning(
"Dialog",
"option menu not yet implemented");
507 fDialog->Add(argname, val, type);
513 if (tval && strlen(tval)) {
515 strlcpy(val, tval + (tval[0] ==
'"' ? 1 : 0),
sizeof(val));
516 if (val[strlen(val)-1] ==
'"')
517 val[strlen(val)-1]= 0;
519 fDialog->Add(argname, val, type);
534 static int max_ascent = 0, max_descent = 0;
539 if (max_ascent == 0) {
542 offset = (entry->
GetEh() - (max_ascent + max_descent)) / 2;
543 ty = entry->
GetEy() + max_ascent + offset - 1;
601 static int toggle = 0;
605 if (handCur ==
kNone)
607 if (rightCur ==
kNone)
611 gVirtualX->ChangeActivePointerGrab(
fId, mask, rightCur);
625 gVirtualX->ChangeActivePointerGrab(
fId, mask, rightCur);
639 TString url =
gEnv->GetValue(
"Browser.StartUrl",
"https://root.cern.ch/doc/master");
709 const char *args =
fDialog->GetParameters();
715 const char *args =
fDialog->GetParameters();
738 const char *args =
fDialog->GetParameters();
Handle_t Cursor_t
Cursor handle.
const Mask_t kButtonPressMask
const Mask_t kPointerMotionMask
const Mask_t kButtonReleaseMask
int Int_t
Signed integer 4 bytes (int).
long Longptr_t
Integer large enough to hold a pointer (platform-dependent).
int Ssiz_t
String size (currently int).
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int).
long Long_t
Signed long integer 4 bytes (long). Size depends on architecture.
bool Bool_t
Boolean (0=false, 1=true) (bool).
double Double_t
Double 8 bytes.
constexpr Ssiz_t kNPOS
The equivalent of std::string::npos for the ROOT class TString.
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.
TList * GetMenuList() const
Return the list of menu items associated with the class.
TMethod * GetMethodWithPrototype(const char *method, const char *proto, Bool_t objectIsConst=kFALSE, ROOT::EFunctionMatchMode mode=ROOT::kConversionMatch)
Find the method with a given prototype.
Long_t Property() const override
Returns the properties of the TClass as a bit field stored as a Long_t value.
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.
All ROOT classes may have RTTI (run time type identification) support added.
Basic data type descriptor (datatype information is obtained from CINT).
TString GetTypeName()
Get basic type of typedef, e,g.: "class TDirectory*" -> "TDirectory".
Global functions class (global functions are obtained from CINT).
void AddInput(UInt_t emask)
Add events specified in the emask to the events the frame should handle.
void Resize(UInt_t w=0, UInt_t h=0) override
Resize the frame.
virtual UInt_t GetDefaultWidth() const
virtual UInt_t GetDefaultHeight() const
TGHotString is a string with a "hot" character underlined.
void Draw(Drawable_t id, GContext_t gc, Int_t x, Int_t y) override
Draw a hot string and underline the hot character.
TGClient * fClient
Connection to display server.
Handle_t fId
X11/Win32 Window identifier.
The TGPicture class implements pictures and icons used in the different GUI elements and widgets.
TObject * Last() const override
Return the last object in the list. Returns 0 when list is empty.
TClass * IsA() const override
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.
Each ROOT class (see TClass) has a linked list of methods.
virtual const char * GetCommentString()
Returns a comment string from the class declaration.
virtual TDataMember * FindDataMember()
Tries to guess DataMember from comment string and Method's name <==(only if 1 Argument!...
TClass * GetClass() const
EMenuItemKind IsMenuItem() const
TClass * IsA() const override
const char * GetName() const override
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.
virtual TClass * IsA() const
This class creates a ROOT object browser, constituted by three main tabs.
This class creates a main window with menubar, scrollbars and a drawing area.
A TRootDialog is used to prompt for the arguments of an object's member function.
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.
EGEventType fType
of event (see EGEventType)