73#include "RConfigure.h"
91 "ROOT files",
"*.root",
128 "TRootBrowser",
this,
129 "EventInfo(Int_t, Int_t, Int_t, TObject*)");
152 "TRootBrowser",
this,
153 "EventInfo(Int_t, Int_t, Int_t, TObject*)");
215 "HandleMenu(Int_t)");
235#if defined(R__HAS_COCOA)
261 fTabRight->
Connect(
"Selected(Int_t)",
"TRootBrowser",
this,
"DoTab(Int_t)");
262 fTabRight->
Connect(
"CloseTab(Int_t)",
"TRootBrowser",
this,
"CloseTab(Int_t)");
282 int parts[] = { 33, 10, 10, 47 };
300 if (!strcmp(
gROOT->GetDefCanvasName(),
"c1"))
301 gROOT->SetDefCanvasName(
"Canvas_1");
408 this,
"EventInfo(Int_t, Int_t, Int_t, TObject*)");
415 if (!container)
continue;
443 if (!container)
continue;
473 if (!container)
continue;
498 Emit(
"CloseWindow()");
507 this,
"EventInfo(Int_t, Int_t, Int_t, TObject*)");
528 const Int_t kTMAX=256;
529 static char atext[kTMAX];
540 snprintf(atext, kTMAX,
"%c", (
char) px);
542 snprintf(atext, kTMAX,
"%d,%d", px, py);
557 if (cmd && strlen(cmd)) {
563 else if (fname && strlen(fname)) {
566 if (t > 0) pname.
Remove(t);
572 return gROOT->ProcessLine(command.
Data());
575 retval =
gROOT->ProcessLine(command.
Data());
576 if (command.
Contains(
"new TCanvas")) {
577 pname =
gPad->GetName();
617 gVirtualX->LookupString(event, input,
sizeof(input), keysym);
636 switch ((
EKeySym)keysym & ~0x20) {
679 static Int_t eNr = 1;
701 gROOT->ProcessLine(
Form(
"new TFile(\"%s\");",
707 gROOT->ProcessLine(
Form(
"new TFile(\"%s\");",
728 sprintf(str,
"About ROOT %s...",
gROOT->GetVersion());
747 hd =
new TRootHelpDialog(
this,
"Help on Graphics Editor...", 600, 400);
775 cmd.
Form(
"new TGTextEditor((const char *)0, gClient->GetRoot())");
781 gROOT->ProcessLine(
"new TCanvas()");
786 cmd.
Form(
"new TGHtmlBrowser(\"%s\", gClient->GetRoot())",
787 gEnv->
GetValue(
"Browser.StartUrl",
"http://root.cern.ch"));
807 strlcpy(command,
"new TGLSAViewer(gClient->GetRoot(), 0);",
810 "Enter plugin command line:",
812 if (strcmp(command,
"")) {
846 if ((opt == 0) || (!opt[0]))
851 if (strchr(opt,
'F')) {
852 cmd.
Form(
"new TGFileBrowser(gClient->GetRoot(), (TBrowser *)0x%lx, 200, 500);", (
ULong_t)
fBrowser);
859 Int_t i, len = strlen(opt);
860 for (i=0; i<len; ++i) {
863 cmd.
Form(
"new TGTextEditor((const char *)0, gClient->GetRoot());");
871 cmd.
Form(
"new TGHtmlBrowser(\"%s\", gClient->GetRoot());",
873 "http://root.cern.ch/root/html/ClassIndex.html"));
880 if ((opt[i] ==
'C') && !
IsWebGUI()) {
881 cmd.
Form(
"new TCanvas();");
888 cmd.
Form(
"new TGLSAViewer(gClient->GetRoot(), 0);");
895 cmd.
Form(
"new TSessionViewer();");
903 if (strchr(opt,
'I')) {
904 cmd.
Form(
"new TGCommandPlugin(gClient->GetRoot(), 700, 300);");
1142 el->
fFrame->
Connect(
"ProcessedConfigure(Event_t*)",
"TGCompositeFrame",
1178 if (embed && embed->
GetList()) {
1188 if (nw->
fFrame == menu) {
1204 if (popup->
GetEntry(
"Close Canvas")) {
1208 if (popup->
GetEntry(
"Close Viewer")) {
1212 if (popup->
GetEntry(
"Quit ROOT")) {
1236 Emit(
"DoubleClicked(TObject*)", (
Long_t)obj);
1249 Emit(
"Checked(TObject*,Bool_t)", args);
1257 Emit(
"ExecuteDefaultAction(TObject*)", (
Long_t)obj);
const Mask_t kKeyLockMask
const Mask_t kKeyMod1Mask
typically the Alt key
const Mask_t kKeyReleaseMask
const Mask_t kKeyPressMask
const Mask_t kKeyShiftMask
const Mask_t kKeyControlMask
const Mask_t kKeyMod2Mask
typically mod on numeric keys
R__EXTERN const char gHelpObjects[]
R__EXTERN const char gHelpPullDownMenus[]
R__EXTERN const char gHelpRemote[]
R__EXTERN const char gHelpAbout[]
R__EXTERN const char gHelpGraphicsEditor[]
R__EXTERN const char gHelpCanvas[]
R__EXTERN const char gHelpBrowser[]
R__EXTERN const char gHelpPostscript[]
R__EXTERN TApplication * gApplication
include TDocParser_001 C image html pict1_TDocParser_001 png width
R__EXTERN C unsigned int sleep(unsigned int seconds)
R__EXTERN void * gTQSender
static const char * gPluginFileTypes[]
static const char * gOpenFileTypes[]
char * Form(const char *fmt,...)
R__EXTERN TSystem * gSystem
virtual void Terminate(Int_t status=0)
Terminate the application by call TSystem::Exit() unless application has been told to return from Run...
ABC describing GUI independent browser implementation protocol.
virtual Option_t * GetDrawOption() const
virtual void BrowseObj(TObject *)
virtual void RecursiveRemove(TObject *)
virtual void Refresh(Bool_t=kFALSE)
virtual void Add(TObject *, const char *, Int_t)
TBrowser * fBrowser
TBrowser associated with this implementation.
Using a TBrowser one can browse all ROOT objects.
void SetBrowserImp(TBrowserImp *i)
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.
virtual Bool_t IsEmpty() const
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
virtual Int_t GetValue(const char *name, Int_t dflt) const
Returns the integer value for a resource.
const TGWindow * GetRoot() const
Returns current root (i.e.
virtual TList * GetList() const
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
virtual void SetEditable(Bool_t on=kTRUE)
Switch ON/OFF edit mode.
virtual void Layout()
Layout the elements of the composite frame.
virtual void SetCleanup(Int_t mode=kLocalCleanup)
Turn on automatic cleanup of child frames in dtor.
virtual TGDimension GetDefaultSize() const
std::cout << fWidth << "x" << fHeight << std::endl;
virtual void MapSubwindows()
Map all sub windows that are part of the composite frame.
virtual void ShowFrame(TGFrame *f)
Show sub frame.
static TGLayoutHints * fgDefaultHints
virtual void HideFrame(TGFrame *f)
Hide sub frame.
void Selected(char *)
A ROOT File has been selected in TGHtmlBrowser.
Bool_t fMultipleSelection
void SetIniDir(const char *inidir)
Set directory name.
void AddInput(UInt_t emask)
Add events specified in the emask to the events the frame should handle.
virtual void ReparentWindow(const TGWindow *p, Int_t x=0, Int_t y=0)
Reparent window, make p the new parent and position the window at position (x,y) in new parent.
virtual void DeleteWindow()
Delete window.
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
void SetFrameElement(TGFrameElement *fe)
virtual void MoveResize(Int_t x, Int_t y, UInt_t w=0, UInt_t h=0)
Move and/or resize the frame.
virtual void MapWindow()
map window
virtual void UnmapWindow()
unmap window
virtual void SetFrame(TGFrame *frame, Bool_t above)
Set frame to be resized.
void SetClassHints(const char *className, const char *resourceName)
Set the windows class and resource name.
virtual Bool_t BindKey(const TGWindow *w, Int_t keycode, Int_t modifier) const
Bind key to a window.
void SetIconName(const char *name)
Set window icon name. This is typically done via the window manager.
virtual Bool_t HandleKey(Event_t *event)
Handle keyboard events.
void SetWMPosition(Int_t x, Int_t y)
Give the window manager a window position hint.
void SetWMSizeHints(UInt_t wmin, UInt_t hmin, UInt_t wmax, UInt_t hmax, UInt_t winc, UInt_t hinc)
Give the window manager minimum and maximum size hints.
void SetWindowName(const char *name=0)
Set window name. This is typically done via the window manager.
const TGPicture * SetIconPixmap(const char *iconName)
Set window icon pixmap by name.
virtual void SetText(TGString *text, Int_t partidx=0)
Set text in partition partidx in status bar.
virtual void SetParts(Int_t npart)
Divide the status bar in npart equal sized parts.
void SetText(TGString *text)
Set new tab text.
const char * GetString() const
virtual void ShowClose(Bool_t on=kTRUE)
Show/hide close icon on the tab element, then apply layout to compute correct elements size.
TGTabElement * GetTabTab(Int_t tabIndex) const
Return the tab element of tab with index tabIndex.
Int_t GetNumberOfTabs() const
Return number of tabs.
virtual Bool_t SetTab(Int_t tabIndex, Bool_t emit=kTRUE)
Brings the composite frame with the index tabIndex to the front and generate the following event if t...
virtual void RemoveTab(Int_t tabIndex=-1, Bool_t storeRemoved=kTRUE)
Remove container and tab of tab with index tabIndex.
virtual void Selected(Int_t id)
TGCompositeFrame * GetTabContainer(Int_t tabIndex) const
Return container of tab with index tabIndex.
virtual TGCompositeFrame * AddTab(TGString *text)
Add a tab to the tab widget.
virtual void SetFrame(TGFrame *frame, Bool_t left)
Set frame to be resized.
const TGWindow * GetParent() const
virtual void Add(TObject *obj)
virtual TObject * Remove(TObject *obj)
Remove object from the list.
virtual TObject * FindObject(const char *name) const
Find an object in this list using its name.
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.
virtual TObject * First() const
Return the first object in the list. Returns 0 when list is empty.
virtual void SetName(const char *name)
Set the name of the TNamed.
virtual const char * GetName() const
Returns name of object.
Collectable string class.
const TString & GetString() const
Mother of all ROOT objects.
virtual const char * GetName() const
Returns name of object.
virtual char * GetObjectInfo(Int_t px, Int_t py) const
Returns string containing info about the object at position (px,py).
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
virtual const char * GetTitle() const
Returns title of object.
void Emit(const char *signal, const T &arg)
Activate signal with single parameter.
Bool_t Connect(const char *signal, const char *receiver_class, void *receiver, const char *slot)
Non-static method is used to connect from the signal of this object to the receiver slot.
Bool_t Disconnect(const char *signal=0, void *receiver=0, const char *slot=0)
Disconnects signal of this object from slot of receiver.
static const TString & GetBinDir()
Get the binary directory in the installation. Static utility function.
UInt_t References() const
TGPopupMenu * fMenuExecPlugin
TGHorizontalFrame * fMenuFrame
TGTab * GetTab(Int_t pos) const
Returns the TGTab at position pos.
void StartEmbedding(Int_t pos=kRight, Int_t subpos=-1) override
Start embedding external frame in the tab "pos" and tab element "subpos".
void SetTabTitle(const char *title, Int_t pos=kRight, Int_t subpos=-1)
Set text "title" of Tab "subpos" in TGTab "pos".
void ExecuteDefaultAction(TObject *obj) override
Emits signal "ExecuteDefaultAction(TObject*)".
TRootBrowser(const TRootBrowser &)=delete
Bool_t IsWebGUI()
Check if the GUI factory is set to use the Web GUI.
virtual void DoubleClicked(TObject *obj)
Emits signal when double clicking on icon.
TBrowserImp * fActBrowser
TGCompositeFrame * fEditFrame
virtual void CloseTab(Int_t id)
Remove tab element id from right tab.
static TBrowserImp * NewBrowser(TBrowser *b=nullptr, const char *title="ROOT Browser", UInt_t width=800, UInt_t height=500, Option_t *opt="")
static contructor returning TBrowserImp, as needed by the plugin mechanism.
TGCompositeFrame * fActMenuBar
void ReallyDelete() override
Really delete the browser and the this GUI.
void StopEmbedding(const char *name=nullptr) override
const TGPicture * fIconPic
void DoTab(Int_t id)
Handle Tab navigation.
void RecursiveRemove(TObject *obj) override
Recursively remove object from browser.
void CreateBrowser(const char *name)
TGHorizontalFrame * fPreMenuFrame
void EventInfo(Int_t event, Int_t px, Int_t py, TObject *selected)
Display a tooltip with infos about the primitive below the cursor.
Bool_t HandleKey(Event_t *event) override
Handle keyboard events.
void SetTab(Int_t pos=kRight, Int_t subpos=-1)
Switch to Tab "subpos" in TGTab "pos".
void CloneBrowser()
Clone the browser.
void HandleMenu(Int_t id)
Handle menu entries events.
Long_t ExecPlugin(const char *name=nullptr, const char *fname=nullptr, const char *cmd=nullptr, Int_t pos=kRight, Int_t subpos=-1) override
Execute a macro and embed the created frame in the tab "pos" and tab element "subpos".
void RemoveTab(Int_t pos, Int_t subpos)
Remove tab element "subpos" from tab "pos".
void Refresh(Bool_t force=kFALSE) override
Refresh the actual browser contents.
void SwitchMenus(TGCompositeFrame *from)
Move the menu from original frame to our TGMenuFrame, or display the menu associated to the current t...
void BrowseObj(TObject *obj) override
Browse object.
virtual void Checked(TObject *obj, Bool_t check)
Emits signal when double clicking on icon.
void ShowMenu(TGCompositeFrame *menu)
Show the selected frame's menu and hide previous one.
void SetStatusText(const char *txt, Int_t col) override
Set text in culumn col in status bar.
void CloseWindow() override
Called when window is closed via the window manager.
void Add(TObject *obj, const char *name=nullptr, Int_t check=-1) override
Add items to the actual browser.
TGHorizontalFrame * fTopMenuFrame
void InitPlugins(Option_t *opt="")
Initialize default plugins.
virtual ~TRootBrowser()
Clean up all widgets, frames and layouthints that were used.
void RecursiveReparent(TGPopupMenu *popup)
Recursively reparent TGPopupMenu to gClient->GetDefaultRoot().
void CloseTabs() override
Properly close the mainframes embedded in the different tabs.
Option_t * GetDrawOption() const override
Returns drawing option.
TGHorizontalFrame * fToolbarFrame
void SetText(const char *helpText)
Set help text from helpText buffer in TGTextView.
void Popup()
Show help dialog.
const char * Data() const
Ssiz_t Last(char c) const
Find last occurrence of a character c.
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.
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
virtual Int_t Exec(const char *shellcmd)
Execute a command.
virtual int Load(const char *module, const char *entry="", Bool_t system=kFALSE)
Load a shared library.
virtual const char * UnixPathName(const char *unixpathname)
Convert from a local pathname to a Unix pathname.
virtual const char * BaseName(const char *pathname)
Base name of a file name. Base name of /user/root is root.
virtual void Sleep(UInt_t milliSec)
Sleep milliSec milli seconds.
virtual Bool_t ProcessEvents()
Process pending events (GUI, timers, sockets).
static void Terminate()
Close the global pad editor. Static method.
EGEventType fType
of event (see EGEventType)
UInt_t fState
key or button mask