source: trunk/MagicSoft/Mars/mmain/MProgressBar.cc@ 1941

Last change on this file since 1941 was 1540, checked in by tbretz, 22 years ago
*** empty log message ***
File size: 2.5 KB
Line 
1/* ======================================================================== *\
2!
3! *
4! * This file is part of MARS, the MAGIC Analysis and Reconstruction
5! * Software. It is distributed to you in the hope that it can be a useful
6! * and timesaving tool in analysing Data of imaging Cerenkov telescopes.
7! * It is distributed WITHOUT ANY WARRANTY.
8! *
9! * Permission to use, copy, modify and distribute this software and its
10! * documentation for any purpose is hereby granted without fee,
11! * provided that the above copyright notice appear in all copies and
12! * that both that copyright notice and this permission notice appear
13! * in supporting documentation. It is provided "as is" without express
14! * or implied warranty.
15! *
16!
17!
18! Author(s): Thomas Bretz 9/2002 <mailto:tbretz@astro-uni-wuerzburg.de>
19!
20! Copyright: MAGIC Software Development, 2000-2002
21!
22!
23\* ======================================================================== */
24
25/////////////////////////////////////////////////////////////////////////////
26//
27// MHillasSrc
28//
29/////////////////////////////////////////////////////////////////////////////
30
31#include "MProgressBar.h"
32
33#include <TSystem.h> // gSystem
34#include <TGProgressBar.h> // TGHProgressBar
35
36#include "MGList.h"
37
38ClassImp(MProgressBar);
39
40// --------------------------------------------------------------------------
41//
42// Default constructor. Opens a window with a progress bar. Get a pointer
43// to the bar by calling GetBar. This pointer can be used for the
44// eventloop.
45//
46// Be carefull: killing or closing the window while the progress meter
47// is still in use may cause segmentation faults. Please kill the window
48// always by deleting the corresponding object.
49//
50MProgressBar::MProgressBar() : TGTransientFrame(gClient->GetRoot(), gClient->GetRoot(), 1, 1)
51{
52 fList = new MGList;
53 fList->SetOwner();
54
55 //SetMWMHints(0, 0, 0);
56
57 SetWMSizeHints(150, 15, 640, 480, 10, 10); // set the smallest and biggest size of the Main frame
58 Move(rand()%100+50, rand()%100+50);
59
60 TGLayoutHints *laybar=new TGLayoutHints(kLHintsExpandX|kLHintsExpandY, 2,2,2,2);
61 fList->Add(laybar);
62
63 fBar=new TGHProgressBar(this);
64 fBar->ShowPosition();
65 AddFrame(fBar, laybar);
66 fList->Add(fBar);
67
68 Layout();
69
70 MapSubwindows();
71
72 SetWindowName("Progress");
73 SetIconName("Progress");
74
75 MapWindow();
76}
77
78// --------------------------------------------------------------------------
79//
80// Destruct the window with all its tiles. Also the Progress Bar object
81// is deleted.
82//
83MProgressBar::~MProgressBar()
84{
85 delete fList;
86}
87
Note: See TracBrowser for help on using the repository browser.