Logo ROOT  
Reference Guide
TGuiFactory.cxx
Go to the documentation of this file.
1 // @(#)root/base:$Id$
2 // Author: Fons Rademakers 15/11/95
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 /** \class TGuiFactory
13 \ingroup Base
14 
15 This ABC is a factory for GUI components. Depending on which
16 factory is active one gets either ROOT native (X11 based with Win95
17 look and feel), Win32 or Mac components.
18 
19 In case there is no platform dependent implementation on can run in
20 batch mode directly using an instance of this base class.
21 */
22 
23 #include "TGuiFactory.h"
24 #include "TApplicationImp.h"
25 #include "TCanvasImp.h"
26 #include "TBrowserImp.h"
27 #include "TContextMenuImp.h"
28 #include "TControlBarImp.h"
29 #include "TInspectorImp.h"
30 #include "TROOT.h"
31 
34 
36 
37 ////////////////////////////////////////////////////////////////////////////////
38 /// TGuiFactory ctor only called by derived classes.
39 
40 TGuiFactory::TGuiFactory(const char *name, const char *title)
41  : TNamed(name, title)
42 {
43 }
44 
45 ////////////////////////////////////////////////////////////////////////////////
46 /// Create a batch version of TApplicationImp.
47 
48 TApplicationImp *TGuiFactory::CreateApplicationImp(const char *classname, int *argc, char **argv)
49 {
50  return new TApplicationImp(classname, argc, argv);
51 }
52 
53 ////////////////////////////////////////////////////////////////////////////////
54 /// Create a batch version of TCanvasImp.
55 
57 {
58  return new TCanvasImp(c, title, width, height);
59 }
60 
61 ////////////////////////////////////////////////////////////////////////////////
62 /// Create a batch version of TCanvasImp.
63 
65 {
66  return new TCanvasImp(c, title, x, y, width, height);
67 }
68 
69 ////////////////////////////////////////////////////////////////////////////////
70 /// Create a batch version of TBrowserImp.
71 
73 {
74  return new TBrowserImp(b, title, width, height);
75 }
76 
77 ////////////////////////////////////////////////////////////////////////////////
78 /// Create a batch version of TBrowserImp.
79 
81 {
82  return new TBrowserImp(b, title, x, y, width, height);
83 }
84 
85 ////////////////////////////////////////////////////////////////////////////////
86 /// Create a batch version of TContextMenuImp.
87 
89 {
90  return new TContextMenuImp(c);
91 }
92 
93 ////////////////////////////////////////////////////////////////////////////////
94 /// Create a batch version of TControlBarImp.
95 
97 {
98  return new TControlBarImp(c, title);
99 }
100 
101 ////////////////////////////////////////////////////////////////////////////////
102 /// Create a batch version of TControlBarImp.
103 
105 {
106  return new TControlBarImp(c, title, x, y);
107 }
108 
109 ////////////////////////////////////////////////////////////////////////////////
110 /// Create a batch version of TInspectorImp.
111 
113 {
114  if (gROOT->IsBatch()) {
115  return new TInspectorImp(obj, width, height);
116  }
117 
118  gROOT->ProcessLine(Form("TInspectCanvas::Inspector((TObject*)0x%lx);", (ULong_t)obj));
119  return 0;
120 }
TControlBarImp
ABC describing GUI independent control bar.
Definition: TControlBarImp.h:30
TCanvasImp.h
c
#define c(i)
Definition: RSha256.hxx:101
TBrowser
Using a TBrowser one can browse all ROOT objects.
Definition: TBrowser.h:37
TContextMenuImp
This class provides an interface to GUI independent context sensitive popup menus.
Definition: TContextMenuImp.h:33
Option_t
const char Option_t
Definition: RtypesCore.h:66
gGuiFactory
TGuiFactory * gGuiFactory
Definition: TGuiFactory.cxx:32
ClassImp
#define ClassImp(name)
Definition: Rtypes.h:364
Form
char * Form(const char *fmt,...)
TApplicationImp.h
TApplicationImp
ABC describing GUI independent application implementation protocol.
Definition: TApplicationImp.h:29
TGuiFactory::CreateApplicationImp
virtual TApplicationImp * CreateApplicationImp(const char *classname, int *argc, char **argv)
Create a batch version of TApplicationImp.
Definition: TGuiFactory.cxx:48
width
include TDocParser_001 C image html pict1_TDocParser_001 png width
Definition: TDocParser.cxx:121
x
Double_t x[n]
Definition: legend1.C:17
TControlBarImp.h
b
#define b(i)
Definition: RSha256.hxx:100
TControlBar
A Control Bar is a fully user configurable tool which provides fast access to frequently used operati...
Definition: TControlBar.h:26
TGuiFactory::CreateContextMenuImp
virtual TContextMenuImp * CreateContextMenuImp(TContextMenu *c, const char *name, const char *title)
Create a batch version of TContextMenuImp.
Definition: TGuiFactory.cxx:88
gBatchGuiFactory
TGuiFactory * gBatchGuiFactory
Definition: TGuiFactory.cxx:33
TROOT.h
TBrowserImp.h
TContextMenu
This class provides an interface to context sensitive popup menus.
Definition: TContextMenu.h:44
TGuiFactory::TGuiFactory
TGuiFactory(const char *name="Batch", const char *title="Batch GUI Factory")
TGuiFactory ctor only called by derived classes.
Definition: TGuiFactory.cxx:40
TBrowserImp
ABC describing GUI independent browser implementation protocol.
Definition: TBrowserImp.h:29
TInspectorImp.h
TGuiFactory
This ABC is a factory for GUI components.
Definition: TGuiFactory.h:42
TNamed
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:29
TCanvasImp
ABC describing GUI independent main window (with menubar, scrollbars and a drawing area).
Definition: TCanvasImp.h:30
y
Double_t y[n]
Definition: legend1.C:17
ULong_t
unsigned long ULong_t
Definition: RtypesCore.h:55
unsigned int
TGuiFactory::CreateCanvasImp
virtual TCanvasImp * CreateCanvasImp(TCanvas *c, const char *title, UInt_t width, UInt_t height)
Create a batch version of TCanvasImp.
Definition: TGuiFactory.cxx:56
TCanvas
The Canvas class.
Definition: TCanvas.h:23
TGuiFactory::CreateInspectorImp
virtual TInspectorImp * CreateInspectorImp(const TObject *obj, UInt_t width, UInt_t height)
Create a batch version of TInspectorImp.
Definition: TGuiFactory.cxx:112
TObject
Mother of all ROOT objects.
Definition: TObject.h:37
TContextMenuImp.h
TGuiFactory::CreateControlBarImp
virtual TControlBarImp * CreateControlBarImp(TControlBar *c, const char *title)
Create a batch version of TControlBarImp.
Definition: TGuiFactory.cxx:96
name
char name[80]
Definition: TGX11.cxx:110
TInspectorImp
ABC describing GUI independent object inspector (abstraction mainly needed for Win32.
Definition: TInspectorImp.h:30
TGuiFactory::CreateBrowserImp
virtual TBrowserImp * CreateBrowserImp(TBrowser *b, const char *title, UInt_t width, UInt_t height, Option_t *opt="")
Create a batch version of TBrowserImp.
Definition: TGuiFactory.cxx:72
TGuiFactory.h
gROOT
#define gROOT
Definition: TROOT.h:406
int