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 |
|
---|
38 | ClassImp(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 | //
|
---|
50 | MProgressBar::MProgressBar() : TGTransientFrame(gClient->GetRoot(), gClient->GetRoot(), 1, 1)
|
---|
51 | {
|
---|
52 | fList = new MGList;
|
---|
53 | fList->SetOwner();
|
---|
54 |
|
---|
55 | SetWMSizeHints(150, 15, 640, 480, 10, 10); // set the smallest and biggest size of the Main frame
|
---|
56 | Move(rand()%100+50, rand()%100+50);
|
---|
57 |
|
---|
58 | TGLayoutHints *laybar=new TGLayoutHints(kLHintsExpandX|kLHintsExpandY, 2,2,2,2);
|
---|
59 | fList->Add(laybar);
|
---|
60 |
|
---|
61 | fBar=new TGHProgressBar(this);
|
---|
62 | fBar->ShowPosition();
|
---|
63 | AddFrame(fBar, laybar);
|
---|
64 | fList->Add(fBar);
|
---|
65 |
|
---|
66 | Layout();
|
---|
67 |
|
---|
68 | MapSubwindows();
|
---|
69 |
|
---|
70 | SetWindowName("Progress");
|
---|
71 | SetIconName("Progress");
|
---|
72 |
|
---|
73 | MapWindow();
|
---|
74 | }
|
---|
75 |
|
---|
76 | // --------------------------------------------------------------------------
|
---|
77 | //
|
---|
78 | // Destruct the window with all its tiles. Also the Progress Bar object
|
---|
79 | // is deleted.
|
---|
80 | //
|
---|
81 | MProgressBar::~MProgressBar()
|
---|
82 | {
|
---|
83 | delete fList;
|
---|
84 | }
|
---|
85 |
|
---|