Logo ROOT   6.08/07
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 
56 TCanvasImp *TGuiFactory::CreateCanvasImp(TCanvas *c, const char *title, UInt_t width, UInt_t height)
57 {
58  return new TCanvasImp(c, title, width, height);
59 }
60 
61 ////////////////////////////////////////////////////////////////////////////////
62 /// Create a batch version of TCanvasImp.
63 
64 TCanvasImp *TGuiFactory::CreateCanvasImp(TCanvas *c, const char *title, Int_t x, Int_t y, UInt_t width, UInt_t height)
65 {
66  return new TCanvasImp(c, title, x, y, width, height);
67 }
68 
69 ////////////////////////////////////////////////////////////////////////////////
70 /// Create a batch version of TBrowserImp.
71 
72 TBrowserImp *TGuiFactory::CreateBrowserImp(TBrowser *b, const char *title, UInt_t width, UInt_t height, Option_t *)
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 }
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
A Control Bar is a fully user configurable tool which provides fast access to frequently used operati...
Definition: TControlBar.h:26
ABC describing GUI independent main window (with menubar, scrollbars and a drawing area)...
Definition: TCanvasImp.h:32
This class provides an interface to GUI independent context sensitive popup menus.
return c
const char Option_t
Definition: RtypesCore.h:62
TGuiFactory * gGuiFactory
Definition: TGuiFactory.cxx:32
ABC describing GUI independent control bar.
#define gROOT
Definition: TROOT.h:364
int Int_t
Definition: RtypesCore.h:41
virtual TContextMenuImp * CreateContextMenuImp(TContextMenu *c, const char *name, const char *title)
Create a batch version of TContextMenuImp.
Definition: TGuiFactory.cxx:88
ABC describing GUI independent application implementation protocol.
Double_t x[n]
Definition: legend1.C:17
virtual TApplicationImp * CreateApplicationImp(const char *classname, int *argc, char **argv)
Create a batch version of TApplicationImp.
Definition: TGuiFactory.cxx:48
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:33
Using a TBrowser one can browse all ROOT objects.
Definition: TBrowser.h:41
TGuiFactory * gBatchGuiFactory
Definition: TGuiFactory.cxx:33
This class provides an interface to context sensitive popup menus.
Definition: TContextMenu.h:44
unsigned int UInt_t
Definition: RtypesCore.h:42
char * Form(const char *fmt,...)
virtual TInspectorImp * CreateInspectorImp(const TObject *obj, UInt_t width, UInt_t height)
Create a batch version of TInspectorImp.
The Canvas class.
Definition: TCanvas.h:41
#define ClassImp(name)
Definition: Rtypes.h:279
unsigned long ULong_t
Definition: RtypesCore.h:51
Double_t y[n]
Definition: legend1.C:17
virtual TCanvasImp * CreateCanvasImp(TCanvas *c, const char *title, UInt_t width, UInt_t height)
Create a batch version of TCanvasImp.
Definition: TGuiFactory.cxx:56
Mother of all ROOT objects.
Definition: TObject.h:37
This ABC is a factory for GUI components.
Definition: TGuiFactory.h:44
you should not use this method at all Int_t Int_t Double_t Double_t Double_t Int_t Double_t Double_t Double_t Double_t b
Definition: TRolke.cxx:630
ABC describing GUI independent object inspector (abstraction mainly needed for Win32.
Definition: TInspectorImp.h:32
virtual TControlBarImp * CreateControlBarImp(TControlBar *c, const char *title)
Create a batch version of TControlBarImp.
Definition: TGuiFactory.cxx:96
char name[80]
Definition: TGX11.cxx:109
ABC describing GUI independent browser implementation protocol.
Definition: TBrowserImp.h:31