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
15This ABC is a factory for GUI components. Depending on which
16factory is active one gets either ROOT native (X11 based with Win95
17look and feel), Win32 or Mac components.
18
19In case there is no platform dependent implementation on can run in
20batch 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
40TGuiFactory::TGuiFactory(const char *name, const char *title)
41 : TNamed(name, title)
42{
43}
44
45////////////////////////////////////////////////////////////////////////////////
46/// Create a batch version of TApplicationImp.
47
48TApplicationImp *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%zx);", (size_t)obj));
119 return 0;
120}
#define b(i)
Definition: RSha256.hxx:100
#define c(i)
Definition: RSha256.hxx:101
int Int_t
Definition: RtypesCore.h:45
unsigned int UInt_t
Definition: RtypesCore.h:46
const char Option_t
Definition: RtypesCore.h:66
#define ClassImp(name)
Definition: Rtypes.h:364
include TDocParser_001 C image html pict1_TDocParser_001 png width
Definition: TDocParser.cxx:121
char name[80]
Definition: TGX11.cxx:110
TGuiFactory * gGuiFactory
Definition: TGuiFactory.cxx:32
TGuiFactory * gBatchGuiFactory
Definition: TGuiFactory.cxx:33
#define gROOT
Definition: TROOT.h:404
char * Form(const char *fmt,...)
ABC describing GUI independent application implementation protocol.
ABC describing GUI independent browser implementation protocol.
Definition: TBrowserImp.h:29
Using a TBrowser one can browse all ROOT objects.
Definition: TBrowser.h:37
ABC describing GUI independent main window (with menubar, scrollbars and a drawing area).
Definition: TCanvasImp.h:30
The Canvas class.
Definition: TCanvas.h:23
This class provides an interface to GUI independent context sensitive popup menus.
This class provides an interface to context sensitive popup menus.
Definition: TContextMenu.h:44
ABC describing GUI independent control bar.
A Control Bar is a fully user configurable tool which provides fast access to frequently used operati...
Definition: TControlBar.h:26
This ABC is a factory for GUI components.
Definition: TGuiFactory.h:42
virtual TApplicationImp * CreateApplicationImp(const char *classname, int *argc, char **argv)
Create a batch version of TApplicationImp.
Definition: TGuiFactory.cxx:48
TGuiFactory(const char *name="Batch", const char *title="Batch GUI Factory")
TGuiFactory ctor only called by derived classes.
Definition: TGuiFactory.cxx:40
virtual TContextMenuImp * CreateContextMenuImp(TContextMenu *c, const char *name, const char *title)
Create a batch version of TContextMenuImp.
Definition: TGuiFactory.cxx:88
virtual TInspectorImp * CreateInspectorImp(const TObject *obj, UInt_t width, UInt_t height)
Create a batch version of TInspectorImp.
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
virtual TCanvasImp * CreateCanvasImp(TCanvas *c, const char *title, UInt_t width, UInt_t height)
Create a batch version of TCanvasImp.
Definition: TGuiFactory.cxx:56
virtual TControlBarImp * CreateControlBarImp(TControlBar *c, const char *title)
Create a batch version of TControlBarImp.
Definition: TGuiFactory.cxx:96
ABC describing GUI independent object inspector (abstraction mainly needed for Win32.
Definition: TInspectorImp.h:30
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:29
Mother of all ROOT objects.
Definition: TObject.h:37
Double_t y[n]
Definition: legend1.C:17
Double_t x[n]
Definition: legend1.C:17