BOSS 7.0.8
BESIII Offline Software System
Loading...
Searching...
No Matches
BesAboutHelp.cxx File Reference
#include "BesVisClient/BesAboutHelp.h"
#include <iostream>
#include <TGLabel.h>
#include <TList.h>
#include <TEnv.h>
#include <TVirtualX.h>
#include <TGButton.h>
#include <TGClient.h>
#include <TGTab.h>
#include <TGLayout.h>
#include <TGListBox.h>
#include <TString.h>
#include <TGIcon.h>
#include <TGPicture.h>
#include <TASImage.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 30 of file BesAboutHelp.cxx.

39 :
40 TGTransientFrame(p, main, 360, 750) {
41 //
42 // BesAboutHelp normal constructor
43
44 fWidgets = new TList();
45
46 this->SetBackgroundPixmap(GetPic("AboutBckgnd.gif"));
47
48 // Create title frame
49 fTitleFrame = new TGHorizontalFrame(this, 10, 10);
50 fTitleFrame->SetBackgroundPixmap(GetPic("AboutGrey.gif"));
51
52 // Add icon
53 //const TGPicture *icon = fClient->GetPicture("mb_asterisk_s.xpm");
54 //fIcon = new TGIcon(fTitleFrame, icon, icon->GetWidth(), icon->GetHeight());
55 //fLayout = new TGLayoutHints(kLHintsLeft | kLHintsCenterY, 5, 5, 5);
56 //fWidgets->Add(fLayout);
57 //fTitleFrame->AddFrame(fIcon, fLayout);
58
59 // Create title
60 FontStruct_t titlefont;
61 titlefont = gClient->GetFontByName(gEnv->GetValue("Gui.BoldFont",
62 "-adobe-helvetica-bold-r-*-*-12-*-*-*-*-*-iso8859-1"));
63
64 GCValues_t gval;
65 gval.fMask = kGCFont;
66 gval.fFont = gVirtualX->GetFontHandle(titlefont);
67 GContext_t titlegc = gVirtualX->CreateGC(gClient->GetRoot()->GetId(), &gval);
68
69 TString title("BesVis ");
70 title.Append(TString(TString(rcsname).Strip(TString::kBoth, '$')).Remove(0,5).Data());
71 fTitle = new TGLabel(fTitleFrame, title.Data(), titlegc);
72 fLayout = new TGLayoutHints(kLHintsLeft | kLHintsCenterY, 10, 5, 5, 5);
73 fWidgets->Add(fLayout);
74 //fTitleFrame->AddFrame(fTitle, fLayout);
75
76 fLayout = new TGLayoutHints(kLHintsTop | kLHintsLeft, 0, 0, 75, 0);
77 fWidgets->Add(fLayout);
78 AddFrame(fTitleFrame, fLayout);
79
80 // Create tabs
81 fMain = new TGTab(this, 300, 650);
82 fMain->SetBackgroundPixmap(GetPic("AboutGrey.gif"));
83
84 TGCompositeFrame *tf;
85
86 // About
87 tf = fMain->AddTab("About");
88 tf->SetBackgroundPixmap(GetPic("AboutGrey.gif"));
89
90 fAbout = new TGVerticalFrame(tf, 200, 750);
91 fAbout->SetBackgroundPixmap(GetPic("AboutGrey.gif"));
92 fLayout = new TGLayoutHints(kLHintsExpandX | kLHintsCenterY);
93 fWidgets->Add(fLayout);
94 tf->AddFrame(fAbout, fLayout);
95
96 fDescription1 = new TGLabel(fAbout, "BESIII Visualizaion Software");
97 fDescription1->SetBackgroundPixmap(GetPic("AboutGrey.gif"));
98 fLayout = new TGLayoutHints(kLHintsCenterX | kLHintsCenterY);
99 fWidgets->Add(fLayout);
100 fAbout->AddFrame(fDescription1, fLayout);
101
102 TString date((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: [email protected]");
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
133 fVersion->AddEntry("2005-12-23", 0);
134 fVersion->AddEntry(" V 1.0.0", 0);
135 //Long Peixun's update: Add about information
136 fVersion->AddEntry("2018-4-28", 0);
137 fVersion->AddEntry(" V 2.0.0.B, contains MRPC", 0);
138 fVersion->AddEntry("", 0);
139 //for (Int_t iEntry = 0; iEntry < fVersion->GetNumberOfEntries(); iEntry++) {
140 //fVersion->GetEntry(iEntry)->SetBackgroundPixmap(GetPic("AboutGrey.gif"));
141 //}
142 fVersion->Resize(80, 80);
143
144 for (Int_t iTab = 0; iTab < fMain->GetNumberOfTabs(); iTab++) {
145 fMain->GetTabTab(iTab)->SetBackgroundPixmap(GetPic("AboutGrey.gif"));
146 }
147
148 fLayout = new TGLayoutHints(kLHintsTop | kLHintsExpandX | kLHintsExpandY, 5, 5, 5, 5);
149 fWidgets->Add(fLayout);
150 AddFrame(fMain, fLayout);
151
152 // Create bottom frame
153 fBottomFrame = new TGHorizontalFrame(this, 10, 10);
154 fBottomFrame->SetBackgroundPixmap(GetPic("AboutGrey.gif"));
155
156 // Close button
157 fCloseBtn = new TGTextButton(fBottomFrame, " &Close ", 1);
158 fCloseBtn->Associate(this);
159 fCloseBtn->SetBackgroundPixmap(GetPic("AboutGrey.gif"));
160 fLayout = new TGLayoutHints(kLHintsRight | kLHintsCenterY, 2, 2, 2, 2);
161 fWidgets->Add(fLayout);
162 fBottomFrame->AddFrame(fCloseBtn, fLayout);
163
164 fLayout = new TGLayoutHints(kLHintsBottom | kLHintsExpandX, 5, 5, 0, 5);
165 fWidgets->Add(fLayout);
166 AddFrame(fBottomFrame, fLayout);
167
168 // Palette
169 tf = fMain->AddTab("Palette");
170 tf->SetBackgroundPixmap(GetPic("AboutGrey.gif"));
171
172 fMdcPaletteFrame= new TGVerticalFrame(tf, 200, 700);
173 fMdcPaletteFrame->SetBackgroundPixmap(GetPic("MdcPalette.gif"));
174 fLayout = new TGLayoutHints(kLHintsExpandX | kLHintsCenterY);
175 fWidgets->Add(fLayout);
176 //// Create Mdc Palette frame
177 //fMdcPaletteFrame = new TGHorizontalFrame(this, 10, 10);
178 //fMdcPaletteFrame->SetBackgroundPixmap(GetPic("MdcPalette.gif"));
179 //fLayout = new TGLayoutHints(kLHintsRight | kLHintsCenterY, 2, 2, 2, 2);
180 //fWidgets->Add(fLayout);
181 //fBottomFrame->AddFrame(fMdcPaletteFrame, fLayout);
182
183 //fLayout = new TGLayoutHints(kLHintsBottom | kLHintsExpandX, 5, 5, 0, 5);
184
185 // Widget layout
186 SetWindowName("About BesVis");
187 MapSubwindows();
188
189 // position relative to the parent's window
190 Int_t ax, ay;
191 Window_t wdum;
192 gVirtualX->TranslateCoordinates(main->GetId(), GetParent()->GetId(),
193 (Int_t)(((TGFrame *) main)->GetWidth() - fWidth) >> 1,
194 (Int_t)(((TGFrame *) main)->GetHeight() - fHeight) >> 1,
195 ax, ay, wdum);
196 Move(ax, ay);
197 SetWMPosition(ax, ay);
198
199 Resize(GetDefaultSize());
200 Resize(360,750);
201 MapWindow();
202}
titledef title[20]
int main()
Definition: test_IFile.cxx:11