1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
#include <stdexcept>
#include <cassert>
#include "TGClient.h"
#include "TGHtml.h"
#include "TGText.h"
#include "TSystem.h"
#include "Fireworks/Core/interface/CmsShowHelpPopup.h"
#include "Fireworks/Core/interface/fwPaths.h"
CmsShowHelpPopup::CmsShowHelpPopup(
const std::string &filename, const std::string &windowname, const TGWindow *p, UInt_t w, UInt_t h)
: TGTransientFrame(gClient->GetDefaultRoot(), p, w, h), m_helpHtml(new TGHtml(this, w, h)) {
AddFrame(m_helpHtml, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsExpandX | kLHintsExpandY));
SetWindowName(windowname.c_str());
TString dirPath = "data/";
fireworks::setPath(dirPath);
m_helpHtml->SetBaseUri(dirPath.Data());
// printf("%s ... %s\n", m_helpHtml->GetBaseUri(), dirPath.Data());
TGText text;
TString filePath = dirPath + filename;
text.Load(filePath.Data());
m_helpHtml->ParseText((char *)text.AsString().Data());
MapSubwindows();
m_helpHtml->Layout();
}
CmsShowHelpPopup::~CmsShowHelpPopup() { delete m_helpHtml; }
|