CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_0/src/Fireworks/Core/src/CmsShowHelpPopup.cc

Go to the documentation of this file.
00001 #include <stdexcept>
00002 #include <cassert>
00003 #include "TGClient.h"
00004 #include "TGHtml.h"
00005 #include "TGText.h"
00006 #include "TSystem.h"
00007 #include "Fireworks/Core/interface/CmsShowHelpPopup.h"
00008 #include "Fireworks/Core/interface/fwPaths.h"
00009 
00010 CmsShowHelpPopup::CmsShowHelpPopup (const std::string &filename,
00011                                     const std::string &windowname,
00012                                     const TGWindow* p, UInt_t w, UInt_t h)
00013    : TGTransientFrame(gClient->GetDefaultRoot(), p, w, h),
00014      m_helpHtml(new TGHtml(this, w, h))
00015 {
00016    AddFrame(m_helpHtml, new TGLayoutHints(kLHintsTop | kLHintsLeft |
00017                                           kLHintsExpandX | kLHintsExpandY));
00018    SetWindowName(windowname.c_str()); 
00019    TGText text;
00020 
00021    TString filePath =  "data/" + filename;
00022    text.Load(filePath.Data());
00023 
00024    TString dirPath =  "data/";
00025    fireworks::setPath(dirPath); 
00026    m_helpHtml->SetBaseUri(dirPath.Data());
00027    // printf("%s ... \n",  m_helpHtml->GetBaseUri());
00028   
00029    m_helpHtml->ParseText((char *)text.AsString().Data());
00030 
00031    MapSubwindows();
00032    m_helpHtml->Layout();
00033 }
00034 
00035 CmsShowHelpPopup::~CmsShowHelpPopup()
00036 {
00037    delete m_helpHtml;
00038 }