Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:11:33

0001 #include <stdexcept>
0002 #include <cassert>
0003 #include "TGClient.h"
0004 #include "TGHtml.h"
0005 #include "TGText.h"
0006 #include "TSystem.h"
0007 #include "Fireworks/Core/interface/CmsShowHelpPopup.h"
0008 #include "Fireworks/Core/interface/fwPaths.h"
0009 
0010 CmsShowHelpPopup::CmsShowHelpPopup(
0011     const std::string &filename, const std::string &windowname, const TGWindow *p, UInt_t w, UInt_t h)
0012     : TGTransientFrame(gClient->GetDefaultRoot(), p, w, h), m_helpHtml(new TGHtml(this, w, h)) {
0013   AddFrame(m_helpHtml, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsExpandX | kLHintsExpandY));
0014   SetWindowName(windowname.c_str());
0015 
0016   TString dirPath = "data/";
0017   fireworks::setPath(dirPath);
0018   m_helpHtml->SetBaseUri(dirPath.Data());
0019   // printf("%s ... %s\n",  m_helpHtml->GetBaseUri(), dirPath.Data());
0020 
0021   TGText text;
0022   TString filePath = dirPath + filename;
0023   text.Load(filePath.Data());
0024 
0025   m_helpHtml->ParseText((char *)text.AsString().Data());
0026 
0027   MapSubwindows();
0028   m_helpHtml->Layout();
0029 }
0030 
0031 CmsShowHelpPopup::~CmsShowHelpPopup() { delete m_helpHtml; }