BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
BesAboutHelp.cxx File Reference
#include "BesAboutHelp.h"
#include <iostream>
#include <TASImage.h>
#include <TEnv.h>
#include <TGButton.h>
#include <TGClient.h>
#include <TGIcon.h>
#include <TGLabel.h>
#include <TGLayout.h>
#include <TGListBox.h>
#include <TGPicture.h>
#include <TGTab.h>
#include <TList.h>
#include <TString.h>
#include <TVirtualX.h>
#include <stdio.h>
#include <stdlib.h>

Go to the source code of this file.

Functions

 ClassImp (BesAboutHelp) BesAboutHelp

Function Documentation

◆ ClassImp()

ClassImp ( BesAboutHelp )

Definition at line 29 of file BesAboutHelp.cxx.

38 : TGTransientFrame( p, main, 360, 750 ) {
39 //
40 // BesAboutHelp normal constructor
41
42 fWidgets = new TList();
43
44 this->SetBackgroundPixmap( GetPic( "AboutBckgnd.gif" ) );
45
46 // Create title frame
47 fTitleFrame = new TGHorizontalFrame( this, 10, 10 );
48 fTitleFrame->SetBackgroundPixmap( GetPic( "AboutGrey.gif" ) );
49
50 // Add icon
51 // const TGPicture *icon = fClient->GetPicture("mb_asterisk_s.xpm");
52 // fIcon = new TGIcon(fTitleFrame, icon, icon->GetWidth(), icon->GetHeight());
53 // fLayout = new TGLayoutHints(kLHintsLeft | kLHintsCenterY, 5, 5, 5);
54 // fWidgets->Add(fLayout);
55 // fTitleFrame->AddFrame(fIcon, fLayout);
56
57 // Create title
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 " );
68 title.Append(
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 // fTitleFrame->AddFrame(fTitle, fLayout);
74
75 fLayout = new TGLayoutHints( kLHintsTop | kLHintsLeft, 0, 0, 75, 0 );
76 fWidgets->Add( fLayout );
77 AddFrame( fTitleFrame, fLayout );
78
79 // Create tabs
80 fMain = new TGTab( this, 300, 650 );
81 fMain->SetBackgroundPixmap( GetPic( "AboutGrey.gif" ) );
82
83 TGCompositeFrame* tf;
84
85 // About
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, "" /*date.Data()*/ );
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 // Version
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 // Long Peixun's update: Add about information
135 fVersion->AddEntry( "2018-4-28", 0 );
136 fVersion->AddEntry( " V 2.0.0.B, contains MRPC", 0 );
137 fVersion->AddEntry( "", 0 );
138 // for (Int_t iEntry = 0; iEntry < fVersion->GetNumberOfEntries(); iEntry++) {
139 // fVersion->GetEntry(iEntry)->SetBackgroundPixmap(GetPic("AboutGrey.gif"));
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 // Create bottom frame
151 fBottomFrame = new TGHorizontalFrame( this, 10, 10 );
152 fBottomFrame->SetBackgroundPixmap( GetPic( "AboutGrey.gif" ) );
153
154 // Close button
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 // Palette
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 //// Create Mdc Palette frame
175 // fMdcPaletteFrame = new TGHorizontalFrame(this, 10, 10);
176 // fMdcPaletteFrame->SetBackgroundPixmap(GetPic("MdcPalette.gif"));
177 // fLayout = new TGLayoutHints(kLHintsRight | kLHintsCenterY, 2, 2, 2, 2);
178 // fWidgets->Add(fLayout);
179 // fBottomFrame->AddFrame(fMdcPaletteFrame, fLayout);
180
181 // fLayout = new TGLayoutHints(kLHintsBottom | kLHintsExpandX, 5, 5, 0, 5);
182
183 // Widget layout
184 SetWindowName( "About BesVis" );
185 MapSubwindows();
186
187 // position relative to the parent's window
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}
titledef title[20]