Logo ROOT  
Reference Guide
TRootEmbeddedCanvas.h
Go to the documentation of this file.
1// @(#)root/gui:$Id$
2// Author: Fons Rademakers 15/07/98
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
13#ifndef ROOT_TRootEmbeddedCanvas
14#define ROOT_TRootEmbeddedCanvas
15
16//////////////////////////////////////////////////////////////////////////
17// //
18// TRootEmbeddedCanvas //
19// //
20// This class creates a TGCanvas in which a TCanvas is created. Use //
21// GetCanvas() to get a pointer to the TCanvas. //
22// //
23//////////////////////////////////////////////////////////////////////////
24
25#include "TGCanvas.h"
26
27
28class TCanvas;
29class TRootEmbeddedContainer;
30class TDNDData;
31
33
35
36protected:
37 Int_t fCWinId; // window id used by embedded TCanvas
38 TRootEmbeddedContainer *fCanvasContainer; // container in canvas widget
39 TCanvas *fCanvas; // pointer to TCanvas
40 Bool_t fAutoFit; // canvas container keeps same size as canvas
41 Int_t fButton; // currently pressed button
42 Atom_t *fDNDTypeList; // handles DND types
43
51
52private:
53 TRootEmbeddedCanvas(const TRootEmbeddedCanvas&); // not implemented
55
56public:
57 TRootEmbeddedCanvas(const char *name = 0, const TGWindow *p = 0, UInt_t w = 10,
58 UInt_t h = 10, UInt_t options = kSunkenFrame | kDoubleBorder,
60 virtual ~TRootEmbeddedCanvas();
61
62 void AdoptCanvas(TCanvas *c);
63 TCanvas *GetCanvas() const { return fCanvas; }
64 Int_t GetCanvasWindowId() const { return fCWinId; }
65 Bool_t GetAutoFit() const { return fAutoFit; }
66 void SetAutoFit(Bool_t fit = kTRUE) { fAutoFit = fit; }
67 virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
68
69 virtual Bool_t HandleDNDDrop(TDNDData *data);
70 virtual Atom_t HandleDNDPosition(Int_t /*x*/, Int_t /*y*/, Atom_t action,
71 Int_t /*xroot*/, Int_t /*yroot*/);
72 virtual Atom_t HandleDNDEnter(Atom_t * typelist);
73 virtual Bool_t HandleDNDLeave();
74
75 ClassDef(TRootEmbeddedCanvas,0) //A ROOT TCanvas that can be embedded in a TGFrame
76};
77
78#endif
Handle_t Atom_t
Definition: GuiTypes.h:36
ULong_t Pixel_t
Definition: GuiTypes.h:39
#define c(i)
Definition: RSha256.hxx:101
#define h(i)
Definition: RSha256.hxx:106
int Int_t
Definition: RtypesCore.h:41
unsigned int UInt_t
Definition: RtypesCore.h:42
bool Bool_t
Definition: RtypesCore.h:59
const Bool_t kTRUE
Definition: RtypesCore.h:87
const char Option_t
Definition: RtypesCore.h:62
#define ClassDef(name, id)
Definition: Rtypes.h:326
@ kSunkenFrame
Definition: TGFrame.h:61
@ kDoubleBorder
Definition: TGFrame.h:63
char name[80]
Definition: TGX11.cxx:109
The Canvas class.
Definition: TCanvas.h:31
static Pixel_t GetDefaultFrameBackground()
Get default frame background.
Definition: TGFrame.cxx:665
virtual Atom_t HandleDNDEnter(Atom_t *typelist)
Handle drag enter events.
virtual ~TRootEmbeddedCanvas()
Delete embedded ROOT canvas.
virtual Bool_t HandleContainerCrossing(Event_t *ev)
Handle enter/leave events. Only leave is activated at the moment.
virtual Atom_t HandleDNDPosition(Int_t, Int_t, Atom_t action, Int_t, Int_t)
Handle dragging position events.
TRootEmbeddedCanvas & operator=(const TRootEmbeddedCanvas &)
virtual Bool_t HandleContainerConfigure(Event_t *ev)
Handle configure (i.e. resize) event.
virtual Bool_t HandleDNDLeave()
Handle drag leave events.
void SetAutoFit(Bool_t fit=kTRUE)
void AdoptCanvas(TCanvas *c)
Canvas c is adopted from this embedded canvas.
TRootEmbeddedCanvas(const TRootEmbeddedCanvas &)
virtual Bool_t HandleContainerButton(Event_t *ev)
Handle mouse button events in the canvas container.
virtual Bool_t HandleContainerDoubleClick(Event_t *ev)
Handle mouse button double click events in the canvas container.
virtual Bool_t HandleDNDDrop(TDNDData *data)
Handle drop events.
TCanvas * GetCanvas() const
virtual Bool_t HandleContainerMotion(Event_t *ev)
Handle mouse motion event in the canvas container.
friend class TRootEmbeddedContainer
Bool_t GetAutoFit() const
virtual Bool_t HandleContainerKey(Event_t *ev)
Handle keyboard events in the canvas container.
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save an embedded canvas as a C++ statement(s) on output stream out.
TRootEmbeddedContainer * fCanvasContainer
Int_t GetCanvasWindowId() const
virtual Bool_t HandleContainerExpose(Event_t *ev)
Handle expose events.