CMS 3D CMS Logo

Public Member Functions | Static Public Member Functions | Protected Attributes

CmsShowHelpPopup Class Reference

#include <Fireworks/Core/interface/CmsShowHelpPopup.h>

List of all members.

Public Member Functions

virtual void CloseWindow ()
 CmsShowHelpPopup (const std::string &filename, const std::string &windowname, const TGWindow *p=0, UInt_t w=1, UInt_t h=1)
virtual ~CmsShowHelpPopup ()

Static Public Member Functions

static std::string helpFileName (const std::string &)

Protected Attributes

TGHtml * m_helpHtml

Detailed Description

Description: <one line="" class="" summary>="">

Usage: <usage>

Definition at line 30 of file CmsShowHelpPopup.h.


Constructor & Destructor Documentation

CmsShowHelpPopup::CmsShowHelpPopup ( const std::string &  filename,
const std::string &  windowname,
const TGWindow *  p = 0,
UInt_t  w = 1,
UInt_t  h = 1 
)

Definition at line 9 of file CmsShowHelpPopup.cc.

References helpFileName(), m_helpHtml, path(), and runonSM::text.

   : 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());
   TGText text;
   text.Load(helpFileName(filename).c_str());
  
   static TString path = Form("%s/src/Fireworks/Core/data/",gSystem->Getenv("CMSSW_BASE"));
   if ( gSystem->AccessPathName(path.Data()) ){ // cannot find directory   
      assert(gSystem->Getenv("CMSSW_RELEASE_BASE"));
      path = Form("%s/src/Fireworks/Core/data/",gSystem->Getenv("CMSSW_RELEASE_BASE"));
   }
   m_helpHtml->SetBaseUri(path.Data());
   // printf("%s ... \n",  m_helpHtml->GetBaseUri());
   
   m_helpHtml->ParseText((char *)text.AsString().Data());

   MapSubwindows();
   m_helpHtml->Layout();
}
CmsShowHelpPopup::~CmsShowHelpPopup ( ) [virtual]

Definition at line 35 of file CmsShowHelpPopup.cc.

References m_helpHtml.

{
   delete m_helpHtml;
}

Member Function Documentation

virtual void CmsShowHelpPopup::CloseWindow ( ) [inline, virtual]

Definition at line 36 of file CmsShowHelpPopup.h.

{ UnmapWindow(); }
std::string CmsShowHelpPopup::helpFileName ( const std::string &  filename) [static]

Definition at line 40 of file CmsShowHelpPopup.cc.

References lut2db_cfg::filename.

Referenced by CmsShowHelpPopup().

{
   const char* cmspath = gSystem->Getenv("CMSSW_BASE");
   if(0 == cmspath) {
      throw std::runtime_error("CMSSW_BASE environment variable not set");
   }
   return std::string(cmspath) + "/src/Fireworks/Core/data/" + filename;
}

Member Data Documentation

TGHtml* CmsShowHelpPopup::m_helpHtml [protected]

Definition at line 41 of file CmsShowHelpPopup.h.

Referenced by CmsShowHelpPopup(), and ~CmsShowHelpPopup().