38 : TGTransientFrame( p,
main, 360, 750 ) {
39
40
41
42 fWidgets = new TList();
43
44 this->SetBackgroundPixmap( GetPic( "AboutBckgnd.gif" ) );
45
46
47 fTitleFrame = new TGHorizontalFrame( this, 10, 10 );
48 fTitleFrame->SetBackgroundPixmap( GetPic( "AboutGrey.gif" ) );
49
50
51
52
53
54
55
56
57
58 FontStruct_t titlefont;
59 titlefont = gClient->GetFontByName(
60 gEnv->GetValue( "Gui.BoldFont", "-adobe-helvetica-bold-r-*-*-12-*-*-*-*-*-iso8859-1" ) );
61
62 GCValues_t gval;
63 gval.fMask = kGCFont;
64 gval.fFont = gVirtualX->GetFontHandle( titlefont );
65 GContext_t titlegc = gVirtualX->CreateGC( gClient->GetRoot()->GetId(), &gval );
66
67 TString
title(
"BesVis " );
69 TString( TString( rcsname ).Strip( TString::kBoth, '$' ) ).Remove( 0, 5 ).Data() );
70 fTitle =
new TGLabel( fTitleFrame,
title.Data(), titlegc );
71 fLayout = new TGLayoutHints( kLHintsLeft | kLHintsCenterY, 10, 5, 5, 5 );
72 fWidgets->Add( fLayout );
73
74
75 fLayout = new TGLayoutHints( kLHintsTop | kLHintsLeft, 0, 0, 75, 0 );
76 fWidgets->Add( fLayout );
77 AddFrame( fTitleFrame, fLayout );
78
79
80 fMain = new TGTab( this, 300, 650 );
81 fMain->SetBackgroundPixmap( GetPic( "AboutGrey.gif" ) );
82
83 TGCompositeFrame* tf;
84
85
86 tf = fMain->AddTab( "About" );
87 tf->SetBackgroundPixmap( GetPic( "AboutGrey.gif" ) );
88
89 fAbout = new TGVerticalFrame( tf, 200, 750 );
90 fAbout->SetBackgroundPixmap( GetPic( "AboutGrey.gif" ) );
91 fLayout = new TGLayoutHints( kLHintsExpandX | kLHintsCenterY );
92 fWidgets->Add( fLayout );
93 tf->AddFrame( fAbout, fLayout );
94
95 fDescription1 = new TGLabel( fAbout, "BESIII Visualizaion Software" );
96 fDescription1->SetBackgroundPixmap( GetPic( "AboutGrey.gif" ) );
97 fLayout = new TGLayoutHints( kLHintsCenterX | kLHintsCenterY );
98 fWidgets->Add( fLayout );
99 fAbout->AddFrame( fDescription1, fLayout );
100
101 TString date(
102 ( TString( TString( rcsdate ).Strip( TString::kBoth, '$' ) ).Remove( 0, 5 ) ).Data() );
103 fDescription2 = new TGLabel( fAbout, "" );
104 fDescription2->SetBackgroundPixmap( GetPic( "AboutGrey.gif" ) );
105 fLayout = new TGLayoutHints( kLHintsCenterX | kLHintsCenterY );
106 fWidgets->Add( fLayout );
107
108 fAbout->AddFrame( fDescription2, fLayout );
109 fDescription3 = new TGLabel( fAbout, "Developed by Zhengyun YOU in Peking University" );
110 fDescription3->SetBackgroundPixmap( GetPic( "AboutGrey.gif" ) );
111 fLayout = new TGLayoutHints( kLHintsCenterX | kLHintsCenterY );
112 fWidgets->Add( fLayout );
113 fAbout->AddFrame( fDescription3, fLayout );
114
115 fDescription4 = new TGLabel( fAbout, "Emai: youzy@hep.pku.cn" );
116 fDescription4->SetBackgroundPixmap( GetPic( "AboutGrey.gif" ) );
117 fLayout = new TGLayoutHints( kLHintsCenterX | kLHintsCenterY );
118 fWidgets->Add( fLayout );
119 fAbout->AddFrame( fDescription4, fLayout );
120
121
122 tf = fMain->AddTab( "Version" );
123 tf->SetBackgroundPixmap( GetPic( "AboutGrey.gif" ) );
124
125 fVersion = new TGListBox( tf );
126 fVersion->SetBackgroundPixmap( GetPic( "AboutGrey.gif" ) );
127
128 fLayout = new TGLayoutHints( kLHintsExpandX | kLHintsExpandY, 2, 2, 2, 2 );
129 fWidgets->Add( fLayout );
130 tf->AddFrame( fVersion, fLayout );
131
132 fVersion->AddEntry( "2005-12-23", 0 );
133 fVersion->AddEntry( " V 1.0.0", 0 );
134
135 fVersion->AddEntry( "2018-4-28", 0 );
136 fVersion->AddEntry( " V 2.0.0.B, contains MRPC", 0 );
137 fVersion->AddEntry( "", 0 );
138
139
140
141 fVersion->Resize( 80, 80 );
142
143 for ( Int_t iTab = 0; iTab < fMain->GetNumberOfTabs(); iTab++ )
144 { fMain->GetTabTab( iTab )->SetBackgroundPixmap( GetPic( "AboutGrey.gif" ) ); }
145
146 fLayout = new TGLayoutHints( kLHintsTop | kLHintsExpandX | kLHintsExpandY, 5, 5, 5, 5 );
147 fWidgets->Add( fLayout );
148 AddFrame( fMain, fLayout );
149
150
151 fBottomFrame = new TGHorizontalFrame( this, 10, 10 );
152 fBottomFrame->SetBackgroundPixmap( GetPic( "AboutGrey.gif" ) );
153
154
155 fCloseBtn = new TGTextButton( fBottomFrame, " &Close ", 1 );
156 fCloseBtn->Associate( this );
157 fCloseBtn->SetBackgroundPixmap( GetPic( "AboutGrey.gif" ) );
158 fLayout = new TGLayoutHints( kLHintsRight | kLHintsCenterY, 2, 2, 2, 2 );
159 fWidgets->Add( fLayout );
160 fBottomFrame->AddFrame( fCloseBtn, fLayout );
161
162 fLayout = new TGLayoutHints( kLHintsBottom | kLHintsExpandX, 5, 5, 0, 5 );
163 fWidgets->Add( fLayout );
164 AddFrame( fBottomFrame, fLayout );
165
166
167 tf = fMain->AddTab( "Palette" );
168 tf->SetBackgroundPixmap( GetPic( "AboutGrey.gif" ) );
169
170 fMdcPaletteFrame = new TGVerticalFrame( tf, 200, 700 );
171 fMdcPaletteFrame->SetBackgroundPixmap( GetPic( "MdcPalette.gif" ) );
172 fLayout = new TGLayoutHints( kLHintsExpandX | kLHintsCenterY );
173 fWidgets->Add( fLayout );
174
175
176
177
178
179
180
181
182
183
184 SetWindowName( "About BesVis" );
185 MapSubwindows();
186
187
188 Int_t ax, ay;
189 Window_t wdum;
190 gVirtualX->TranslateCoordinates(
main->GetId(), GetParent()->GetId(),
191 (Int_t)( ( (TGFrame*)
main )->GetWidth() - fWidth ) >> 1,
192 (Int_t)( ( (TGFrame*)
main )->GetHeight() - fHeight ) >> 1,
193 ax, ay, wdum );
194 Move( ax, ay );
195 SetWMPosition( ax, ay );
196
197 Resize( GetDefaultSize() );
198 Resize( 360, 750 );
199 MapWindow();
200}
int main(int argc, char *argv[])