1 | // $Id: OutputRenameDlg.cc 2218 2005-10-18 23:17:30Z thea $ |
---|
2 | // dialog to allow user to change detector |
---|
3 | // parameters |
---|
4 | // 15-03-2002 M. Pallavicini created |
---|
5 | |
---|
6 | #include "OutputRenameDlg.hh" |
---|
7 | #include "SimuApplication.hh" |
---|
8 | #include "TGButton.h" |
---|
9 | #include "Config.hh" |
---|
10 | #include "TGLabel.h" |
---|
11 | |
---|
12 | ClassImp(OutputRenameDlg) |
---|
13 | |
---|
14 | //______________________________________________________________________________ |
---|
15 | OutputRenameDlg::OutputRenameDlg(const TGWindow* p, const TGWindow *main) |
---|
16 | : TGTransientFrame( p, main, 500,350) { |
---|
17 | |
---|
18 | fFrame = new TGHorizontalFrame(this,60,20,kFixedWidth); |
---|
19 | fOK = new TGTextButton(fFrame,"&OK",1); |
---|
20 | fOK->Associate( this ); |
---|
21 | fCancel = new TGTextButton(fFrame,"&Cancel",2); |
---|
22 | fCancel->Associate( this ); |
---|
23 | |
---|
24 | fL1 = new TGLayoutHints(kLHintsTop|kLHintsLeft|kLHintsExpandX,2,2,2,2); |
---|
25 | fL2 = new TGLayoutHints(kLHintsBottom|kLHintsRight,2,2,5,1); |
---|
26 | |
---|
27 | fFrame->AddFrame( fOK, fL1 ); |
---|
28 | fFrame->AddFrame( fCancel, fL1 ); |
---|
29 | fFrame->Resize(150,fOK->GetDefaultHeight()); |
---|
30 | |
---|
31 | AddFrame( fFrame, fL2 ); |
---|
32 | |
---|
33 | MapSubwindows(); |
---|
34 | Resize( 400,300 ); |
---|
35 | Window_t wd; |
---|
36 | int ax,ay; |
---|
37 | gVirtualX->TranslateCoordinates( main->GetId(), GetParent()->GetId(), |
---|
38 | (((TGFrame*)main)->GetWidth()-500)>>1, |
---|
39 | (((TGFrame*)main)->GetWidth()-350)>>1, ax, ay, wd ); |
---|
40 | Move(ax,ay); |
---|
41 | SetWindowName("Output files names"); |
---|
42 | MapWindow(); |
---|
43 | } |
---|
44 | |
---|
45 | //______________________________________________________________________________ |
---|
46 | OutputRenameDlg::~OutputRenameDlg() { |
---|
47 | delete fL1; |
---|
48 | delete fL2; |
---|
49 | delete fFrame; |
---|
50 | delete fOK; |
---|
51 | delete fCancel; |
---|
52 | } |
---|
53 | |
---|
54 | //______________________________________________________________________________ |
---|
55 | void OutputRenameDlg::CloseWindow() { |
---|
56 | delete this; |
---|
57 | } |
---|
58 | |
---|
59 | //______________________________________________________________________________ |
---|
60 | Bool_t OutputRenameDlg::ProcessMessage( Long_t msg, Long_t p1, Long_t p2 ) { |
---|
61 | switch (GET_MSG(msg ) ) { |
---|
62 | case kC_COMMAND: |
---|
63 | switch (GET_SUBMSG(msg)) { |
---|
64 | case kCM_BUTTON: |
---|
65 | switch(p1) { |
---|
66 | case 1: // OK button pressed |
---|
67 | RetrieveData(); |
---|
68 | printf("\nTerminating dialog: %s pressed\n", (p1 == 1) ? "OK" : "Cancel"); |
---|
69 | CloseWindow(); |
---|
70 | break; |
---|
71 | case 2: // cancel button pressed |
---|
72 | printf("\nTerminating dialog: %s pressed\n", (p1 == 1) ? "OK" : "Cancel"); |
---|
73 | CloseWindow(); |
---|
74 | break; |
---|
75 | default: |
---|
76 | break; |
---|
77 | } |
---|
78 | break; |
---|
79 | default: |
---|
80 | break; |
---|
81 | } |
---|
82 | break; |
---|
83 | default: |
---|
84 | break; |
---|
85 | } |
---|
86 | |
---|
87 | return kTRUE; |
---|
88 | } |
---|
89 | |
---|
90 | //______________________________________________________________________________ |
---|
91 | void OutputRenameDlg::RetrieveData() { |
---|
92 | } |
---|
93 | |
---|
94 | |
---|
95 | |
---|