48#include "RConfigure.h"
71 gROOT->GetListOfCleanups()->Add(
this);
81 gROOT->GetListOfCleanups()->Remove(
this);
128 use_mac_x11_workaroud =
gVirtualX->InheritsFrom(
"TGX11");
130 if (use_mac_x11_workaroud) {
146 int xx, yy, topx = 0, topy = 0;
163 parent =
dynamic_cast<TGWindow *
>(pad->GetCanvasImp());
165 parent =
dynamic_cast<TGWindow *
>(pad->GetCanvasImp());
167 parent =
dynamic_cast<TGWindow *
>(browser->GetBrowserImp());
194 if ((opt_ptr=cmd.
Index(
"*MENU={")) !=
kNPOS ||
200 option = cmd(start,end - start);
206 while((obj = iter())) {
211 if (tend ==
kNPOS)
continue;
212 hierarchy = token(tstart,tend - tstart);
224 last_component = obj->
GetName();
245 currentMenu->
AddPopup(last_component,
r,ptr2);
248 last_component = obj->
GetName();
269 strcmp(ptr2->
GetName(), s)<0 )) { }
292 TIter nextItem(menuItemList);
311 TClass *classPtr =
nullptr;
312 TIter next(methodList);
315 while (
auto method = (
TMethod*) next()) {
316 if (classPtr != method->
GetClass()) {
328 currentMenu =
FindHierarchy(method->GetCommentString(),last_component);
329 if (needSep && currentMenu ==
this) {
333 AddEntrySorted(currentMenu,last_component.
Length() ? last_component.
Data() : method->GetName(), entry++, method,0,currentMenu !=
this);
336 if (
auto member = method->FindDataMember()) {
339 currentMenu =
FindHierarchy(method->GetCommentString(),last_component);
341 if (member->GetterMethod()) {
343 if (needSep && currentMenu ==
this) {
347 if (last_component.
Length()) {
348 currentMenu->
AddPopup(last_component,
r);
350 currentMenu->
AddPopup(method->GetName(),
r);
353 TIter nxt(member->GetOptions());
360 r->AddEntry(it->fOptName, togglelist++, t);
362 r->CheckEntry(togglelist-1);
365 if (needSep && currentMenu ==
this) {
369 AddEntrySorted(currentMenu,last_component.
Length() ? last_component.
Data() : method->GetName(), entry++, method,0,currentMenu !=
this);
381 currentMenu =
FindHierarchy(method->GetCommentString(),last_component);
382 if (needSep && currentMenu ==
this) {
386 AddEntrySorted(currentMenu,last_component.
Length() ? last_component.
Data() : method->GetName(), toggle++, t,0,currentMenu !=
this);
400 const char* menuItemTitle = menuItem->
GetTitle();
410 if (strlen(menuItemTitle)==0) menuItemTitle = method->
GetName();
411 AddEntry(menuItemTitle, toggle++, t);
415 if (strlen(menuItemTitle)==0) menuItemTitle = menuItem->
GetFunctionName();
416 AddEntry(menuItemTitle,userfunction++,menuItem);
444 if (!function)
return;
449 else selfobjpos = -1;
480 if (selfobjpos != argpos) {
484 const char *charstar =
"char*";
492 Warning(
"Dialog",
"data type is not basic type, assuming (int)");
493 strlcpy(basictype,
"int", 32);
496 if (strchr(argname,
'*')) {
497 strlcat(basictype,
"*",32);
498 if (!strncmp(
type,
"char", 4) || !strncmp(
type,
"Option_t", 8))
500 else if (strstr(argname,
"[default:")) {
509 if (
m &&
object &&
m->GetterMethod(
object->IsA())) {
515 if (!strncmp(basictype,
"char*", 5)) {
517 m->GetterMethod()->
Execute(
object,
"", &tdefval);
518 strlcpy(val, tdefval,
sizeof(val));
519 }
else if (!strncmp(basictype,
"float", 5) ||
520 !strncmp(basictype,
"double", 6)) {
522 m->GetterMethod()->
Execute(
object,
"", ddefval);
523 snprintf(val,256,
"%g", ddefval);
524 }
else if (!strncmp(basictype,
"char", 4) ||
525 !strncmp(basictype,
"bool", 4) ||
526 !strncmp(basictype,
"int", 3) ||
527 !strncmp(basictype,
"long", 4) ||
528 !strncmp(basictype,
"short", 5)) {
530 m->GetterMethod()->
Execute(
object,
"", ldefval);
531 snprintf(val, 256,
"%zi", (
size_t)ldefval);
535 if (
m->GetOptions()) {
536 Warning(
"Dialog",
"option menu not yet implemented");
545 if (tval && strlen(tval)) {
547 strlcpy(val, tval + (tval[0] ==
'"' ? 1 : 0),
sizeof(val));
548 if (val[strlen(val)-1] ==
'"')
549 val[strlen(val)-1]= 0;
566 static int max_ascent = 0, max_descent = 0;
571 if (max_ascent == 0) {
574 offset = (entry->
GetEh() - (max_ascent + max_descent)) / 2;
633 static int toggle = 0;
637 if (handCur ==
kNone)
639 if (rightCur ==
kNone)
678 clname +=
"::" + smeth;
const Mask_t kButtonPressMask
const Mask_t kPointerMotionMask
Handle_t Cursor_t
Cursor handle.
const Mask_t kButtonReleaseMask
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
long Longptr_t
Integer large enough to hold a pointer (platform-dependent)
constexpr Ssiz_t kNPOS
The equivalent of std::string::npos for the ROOT class TString.
R__EXTERN TApplication * gApplication
void Warning(const char *location, const char *msgfmt,...)
Use this function in warning situations.
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t mask
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h offset
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize id
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t type
void OpenReferenceGuideFor(const TString &strippedClass)
It opens the online reference guide, generated with Doxygen, for the chosen scope (class/namespace/st...
Using a TBrowser one can browse all ROOT objects.
TBrowserImp * GetBrowserImp() const
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).
TList * GetListOfMethodArgs()
Return list containing the TMethodArgs of a TFunction.
Bool_t IsEditable() const
TGWindow * GetWindowById(Window_t sw) const
Find a TGWindow via its handle. If window is not found return 0.
virtual TGDimension GetDefaultSize() const
std::cout << fWidth << "x" << fHeight << std::endl;
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.
UInt_t fHeight
frame height
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.
ROOT GUI Window base class.
virtual void Resize(UInt_t w, UInt_t h)
Resize the window.
void Add(TObject *obj) override
TObject * Last() const override
Return the last object in the list. Returns 0 when list is empty.
void Delete(Option_t *option="") override
Remove all objects from the list AND delete all heap based objects.
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.
TClass * GetClass() 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 void Execute(const char *method, const char *params, Int_t *error=nullptr)
Execute method on this object with the given parameter string, e.g.
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.
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.
const char * Data() const
TObjArray * Tokenize(const TString &delim) const
This function is used to isolate sequential tokens in 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
return setter method request new for the TDataMember while it can be recreated at any time
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