source: trunk/MagicSoft/Mars/mbase/MProgressBar.cc@ 3492

Last change on this file since 3492 was 2494, checked in by tbretz, 21 years ago
*** empty log message ***
File size: 2.6 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-2003
21!
22!
23\* ======================================================================== */
24
25/////////////////////////////////////////////////////////////////////////////
26//
27// MProgressBar
28//
29// Simple window with progress bar. Can be used in an eventloop.
30//
31/////////////////////////////////////////////////////////////////////////////
32
33#include "MProgressBar.h"
34
35#include <TSystem.h> // gSystem
36#include <TGProgressBar.h> // TGHProgressBar
37
38#include "MGList.h"
39
40ClassImp(MProgressBar);
41
42// --------------------------------------------------------------------------
43//
44// Default constructor. Opens a window with a progress bar. Get a pointer
45// to the bar by calling GetBar. This pointer can be used for the
46// eventloop.
47//
48// Be carefull: killing or closing the window while the progress meter
49// is still in use may cause segmentation faults. Please kill the window
50// always by deleting the corresponding object.
51//
52MProgressBar::MProgressBar() : TGTransientFrame(gClient->GetRoot(), gClient->GetRoot(), 1, 1)
53{
54 fList = new MGList;
55 fList->SetOwner();
56
57 //SetMWMHints(0, 0, 0);
58
59 SetWMSizeHints(150, 15, 640, 480, 10, 10); // set the smallest and biggest size of the Main frame
60 Move(rand()%100+50, rand()%100+50);
61
62 TGLayoutHints *laybar=new TGLayoutHints(kLHintsExpandX|kLHintsExpandY, 2,2,2,2);
63 fList->Add(laybar);
64
65 fBar=new TGHProgressBar(this);
66 fBar->ShowPosition();
67 AddFrame(fBar, laybar);
68 fList->Add(fBar);
69
70 Layout();
71
72 MapSubwindows();
73
74 SetWindowName("Progress");
75 SetIconName("Progress");
76
77 MapWindow();
78}
79
80// --------------------------------------------------------------------------
81//
82// Destruct the window with all its tiles. Also the Progress Bar object
83// is deleted.
84//
85MProgressBar::~MProgressBar()
86{
87 delete fList;
88}
89
Note: See TracBrowser for help on using the repository browser.