source: trunk/MagicSoft/Cosy/gui/MGCoordinates.cc@ 1110

Last change on this file since 1110 was 921, checked in by tbretz, 24 years ago
*** empty log message ***
File size: 1.4 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 "MGCoordinates.h"
8
9#include <iostream.h> // cout
10
11#include "MGCoordinate.h"
12
13MGCoordinates::MGCoordinates(const TGWindow* p,
14 const Int_t type,
15 const Bool_t flag,
16 const Int_t deg1, const UInt_t min1, const UInt_t sec1,
17 const Int_t deg2, const UInt_t min2, const UInt_t sec2)
18: TGFrame(p, 244, 76, kFixedSize)
19{
20 const Int_t t = type==kETypeZdAz ? kETypeDeg : kETypeH;
21 const char *txt1 = type==kETypeZdAz ? "Zenith Dist [\xb0]:" : "Right Ascension [h]:";
22 const char *txt2 = type==kETypeZdAz ? "Azimuth [\xb0]:" : "Declination [\xb0]:";
23
24 // p = pointer to MainFrame (not owner)
25 fX = new MGCoordinate(this, t, flag, txt1, deg1, min1, sec1);
26 fX->Move(0, 0);
27
28 fY = new MGCoordinate(this, kETypeDeg, flag, txt2, deg2, min2, sec2);
29 fY->Move(125, 0);
30
31 MapWindow();
32}
33
34MGCoordinates::~MGCoordinates()
35{
36 delete fY;
37 delete fX;
38
39 cout << "MGCoordinates destroyed." << endl;
40}
41
42XY MGCoordinates::GetCoordinates() const
43{
44 return XY(fX->GetVal(), fY->GetVal());
45}
46
47void MGCoordinates::SetCoordinates(const XY &xy)
48{
49 fX->SetVal(xy.X());
50 fY->SetVal(xy.Y());
51}
52
53void MGCoordinates::Print()
54{
55 fX->Print();
56 fY->Print();
57}
Note: See TracBrowser for help on using the repository browser.