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

Last change on this file since 5124 was 3586, 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 Resize(150, 30);
62
63 TGLayoutHints *laybar=new TGLayoutHints(kLHintsExpandX|kLHintsExpandY, 2,2,2,2);
64 fList->Add(laybar);
65
66 fBar=new TGHProgressBar(this);
67 fBar->ShowPosition();
68 AddFrame(fBar, laybar);
69 fList->Add(fBar);
70
71 Layout();
72
73 MapSubwindows();
74
75 SetWindowName("Progress");
76 SetIconName("Progress");
77
78 MapWindow();
79}
80
81// --------------------------------------------------------------------------
82//
83// Destruct the window with all its tiles. Also the Progress Bar object
84// is deleted.
85//
86MProgressBar::~MProgressBar()
87{
88 delete fList;
89}
90
Note: See TracBrowser for help on using the repository browser.