source: trunk/MagicSoft/Cosy/gui/MGEmbeddedCanvas.cc@ 914

Last change on this file since 914 was 913, checked in by tbretz, 24 years ago
*** empty log message ***
File size: 1.2 KB
Line 
1//
2// This File contains the definition of the MGCoordinates-class
3//
4// Author: Thomas Bretz
5// Version: V1.0 (1-8-2000)
6
7#include "MGEmbeddedCanvas.h"
8
9#include <TList.h>
10#include <TCanvas.h>
11
12MGEmbeddedCanvas::MGEmbeddedCanvas(const char *name, const TGWindow* p,
13 const UInt_t width, Float_t range)
14 : TRootEmbeddedCanvas(name, p, width, width, kRaisedFrame),//, 0) //234, 76, kFixedSize)
15 fModified(kFALSE), fWidth(width), fRange(range), fPix(2.*range/width)
16{
17 fCanvas = GetCanvas();
18
19 fCanvas->SetFillColor(39); // s. TAttFill
20 fCanvas->Range(-fRange, -fRange, fRange, fRange);
21
22 fList = new TList;
23 fList->SetOwner();
24}
25
26MGEmbeddedCanvas::~MGEmbeddedCanvas()
27{
28 delete fList;
29}
30
31void MGEmbeddedCanvas::InitCanvas()
32{
33 MapSubwindows();
34
35 Resize(fWidth-1, fWidth-1); //GetDefaultSize()); // ???
36 MapWindow();
37
38 fCanvas->SetEditable(kFALSE);
39}
40
41void MGEmbeddedCanvas::UpdateCanvas()
42{
43 if (!fModified)
44 return;
45
46 // FIXME: Sometimes (if the canvas couldn't be created correctly:
47 // X11 Pixmap error) Update hangs the Gui system.
48
49 fCanvas->Modified();
50 fCanvas->Update();
51
52 fModified = kFALSE;
53}
Note: See TracBrowser for help on using the repository browser.