(UNKNOWN PRODUCT) » HELPBROWSER » TMrbHelpBrowser

class TMrbHelpBrowser: public TNamed


 This class implements a simple HelpBrowser typically used in an interactive
 application where a standard browser like Netscape appears to be too clumpsy
 and takes away too much resources especially space on the screen.
 It does n o t support internet references (e.g. http:) but only file refs.
 It does n o t support display of the Web documentation of ROOT.

It accepts input in HTML format but does not recognize all possible tags.
 urrently only the following tags are recognized (others are just ignored):

<Hn> 					  Heading i.e. highlight line
<B>, <I> 				  bold, italic
<a NAME=xxx> 			  an anchor
<a href=yyy>text</a> 	  a reference (may not be http:)
<img SRC=pict.canvas.gif>  insert a gif picture

The constructor is normally called with the name of a directory containing
html-files to be included into the documention.
NB: A file index.html containing the entry level hrefs should be
    part of this directory.
If the complete documentation is in one htmlfile the name of
this file may be given instead.
Also a ROOT-file containing ready made documentation can be given
(see method ToRootFile below);
More files / directories may be added using the method: AddHtml

It chops text between references (<a href=..) into help items.
Text before the the first anchor gets the name of the the file
as name of the help item. This is useful to construct an index which
works also for a normal browser like netscape.
If a reference is clicked on only the text for this item is displayed.
The window size is adjusted to the number of lines.
It is assumed that the help text is preformatted, so no formatting
is done except optionally breaking lines at fMaxLineLength.
A possible image is displayed in a separate window.

To display the helptext the method: DrawText(anchor_name, xpos, ypos)
should be used.
When help items should be added to a popup menu the method
DrawText(index, xpos, ypos)

As an extension ROOT-files containing canvases may be
defined. If an image with name "pict.canvas.gif" appears
in the documentation a root-file with name "pict.canvas.root"
is searched for in the same directory.
i.e. the convention is to replace the suffix .gif by .root
If not found xv is invoked for the gif-file.
Otherwise the the canvas contained in the root-file is drawn.
This allows a standard browser to be used and still have the possiblity
to exploit the interactive features of root when showing a canvas.

An example (for HistPresent) can be found here.
Use View Page source to see how it is done.

Function Members (Methods)

public:
TMrbHelpBrowser(const char* InputFile = 0)
TMrbHelpBrowser(const TMrbHelpBrowser&)
virtual~TMrbHelpBrowser()
voidTObject::AbstractMethod(const char* method) const
voidAddCanvas(const char* RootFile)
voidAddGifFile(const char* GifFile)
Int_tAddGifToRoot(const char* Input)
Int_tAddHtml(const char* InputFile)
Int_tAddHtmlDir(const char* HtmlDir)
Int_tAddHtmlFile(const char* HtmlFile, Bool_t keep_references = kTRUE)
virtual voidTObject::AppendPad(Option_t* option = "")
virtual voidTObject::Browse(TBrowser* b)
static TClass*Class()
virtual const char*TObject::ClassName() const
voidClear()
virtual voidClear(Option_t* Option)
virtual TObject*TNamed::Clone(const char* newname = "") const
virtual Int_tTNamed::Compare(const TObject* obj) const
virtual voidTNamed::Copy(TObject& named) const
virtual voidTObject::Delete(Option_t* option = "")MENU
Int_tDisplayMenu(TGPopupMenu* menu, const char* pattern = "")
virtual Int_tTObject::DistancetoPrimitive(Int_t px, Int_t py)
virtual voidTObject::Draw(Option_t* option = "")
virtual voidTObject::DrawClass() constMENU
virtual TObject*TObject::DrawClone(Option_t* option = "") constMENU
voidDrawText(const char* hname, Int_t xoff = 0, Int_t yoff = 0)
voidDrawText(const Int_t ind, Int_t xoff = 0, Int_t yoff = 0)
virtual voidTObject::Dump() constMENU
virtual voidTObject::Error(const char* method, const char* msgfmt) const
virtual voidTObject::Execute(const char* method, const char* params, Int_t* error = 0)
virtual voidTObject::Execute(TMethod* method, TObjArray* params, Int_t* error = 0)
virtual voidTObject::ExecuteEvent(Int_t event, Int_t px, Int_t py)
virtual voidTObject::Fatal(const char* method, const char* msgfmt) const
virtual voidTNamed::FillBuffer(char*& buffer)
virtual TObject*TObject::FindObject(const char* name) const
virtual TObject*TObject::FindObject(const TObject* obj) const
virtual Option_t*TObject::GetDrawOption() const
static Long_tTObject::GetDtorOnly()
virtual const char*TObject::GetIconName() const
virtual const char*TNamed::GetName() const
Int_tGetNofItems()
virtual char*TObject::GetObjectInfo(Int_t px, Int_t py) const
static Bool_tTObject::GetObjectStat()
virtual Option_t*TObject::GetOption() const
TFile*GetRootFile()
virtual const char*TNamed::GetTitle() const
virtual UInt_tTObject::GetUniqueID() const
static voidHandleMouseClicks()
virtual Bool_tTObject::HandleTimer(TTimer* timer)
virtual ULong_tTNamed::Hash() const
virtual voidTObject::Info(const char* method, const char* msgfmt) const
virtual Bool_tTObject::InheritsFrom(const char* classname) const
virtual Bool_tTObject::InheritsFrom(const TClass* cl) const
virtual voidTObject::Inspect() constMENU
voidTObject::InvertBit(UInt_t f)
virtual TClass*IsA() const
virtual Bool_tTObject::IsEqual(const TObject* obj) const
virtual Bool_tTObject::IsFolder() const
Bool_tTObject::IsOnHeap() const
virtual Bool_tTNamed::IsSortable() const
Bool_tTObject::IsZombie() const
virtual voidTNamed::ls(Option_t* option = "") const
voidTObject::MayNotUse(const char* method) const
virtual Bool_tTObject::Notify()
voidTObject::Obsolete(const char* method, const char* asOfVers, const char* removedFromVers) const
static voidTObject::operator delete(void* ptr)
static voidTObject::operator delete(void* ptr, void* vp)
static voidTObject::operator delete[](void* ptr)
static voidTObject::operator delete[](void* ptr, void* vp)
void*TObject::operator new(size_t sz)
void*TObject::operator new(size_t sz, void* vp)
void*TObject::operator new[](size_t sz)
void*TObject::operator new[](size_t sz, void* vp)
TMrbHelpBrowser&operator=(const TMrbHelpBrowser&)
virtual voidTObject::Paint(Option_t* option = "")
virtual voidTObject::Pop()
virtual voidPrint(Option_t* Option) const
voidPrint(TString* Option = NULL) const
virtual Int_tTObject::Read(const char* name)
virtual voidRecursiveRemove(TObject*)
voidTObject::ResetBit(UInt_t f)
virtual voidTObject::SaveAs(const char* filename = "", Option_t* option = "") constMENU
virtual voidTObject::SavePrimitive(ostream& out, Option_t* option = "")
voidTObject::SetBit(UInt_t f)
voidTObject::SetBit(UInt_t f, Bool_t set)
virtual voidTObject::SetDrawOption(Option_t* option = "")MENU
static voidTObject::SetDtorOnly(void* obj)
voidSetGifViewer(const char* viewer)
voidSetMaxLineLength(Int_t len)
virtual voidTNamed::SetName(const char* name)MENU
virtual voidTNamed::SetNameTitle(const char* name, const char* title)
static voidTObject::SetObjectStat(Bool_t stat)
TFile*SetRootFile(const char* RootFile)
voidSetTextFont(Int_t font)
voidSetTextSize(Int_t size)
virtual voidTNamed::SetTitle(const char* title = "")MENU
virtual voidTObject::SetUniqueID(UInt_t uid)
virtual voidShowMembers(TMemberInspector& insp)
virtual Int_tTNamed::Sizeof() const
virtual voidStreamer(TBuffer& b)
voidStreamerNVirtual(TBuffer& b)
virtual voidTObject::SysError(const char* method, const char* msgfmt) const
Bool_tTObject::TestBit(UInt_t f) const
Int_tTObject::TestBits(UInt_t f) const
Bool_tToRootFile(const char* Input, const char* RootFile, const char* option = "UPDATE")
virtual voidTObject::UseCurrentStyle()
virtual voidTObject::Warning(const char* method, const char* msgfmt) const
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0)
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0) const
protected:
virtual voidTObject::DoError(int level, const char* location, const char* fmt, va_list va) const
voidTObject::MakeZombie()
private:
Int_tAddTagAtEOL(TString& s)
voidDisplayImage(TString& img_name)
Int_tLineCount(TString& str, Int_t* longest_line, Int_t* nof_heads)
voidMoveOrigin()
Int_tNextAnchor(TString& text, TString& anchor, Int_t search_from)
Int_tNextHeading(TString& text, TString& heading, Int_t search_from)
Int_tNextLine(TString& text, TString& line, Bool_t start)
Int_tNextTag(TString& text, TString& tag, Int_t search_from)
voidPreScan(TString& text, Bool_t keep_references = kTRUE)
Bool_tSqueeze_EOL(TString& s)
Bool_tSqueeze_White_Space(TString& s)

Data Members

public:
enum TObject::EStatusBits { kCanDelete
kMustCleanup
kObjInCanvas
kIsReferenced
kHasUUID
kCannotPick
kNoContextMenu
kInvalidObject
};
enum TObject::[unnamed] { kIsOnHeap
kNotDeleted
kZombie
kBitMask
kSingleKey
kOverwrite
kWriteDelete
};
protected:
TStringTNamed::fNameobject identifier
TStringTNamed::fTitleobject title
private:
TList*fCanvasList
TStringfGifViewer
TList*fHelpList
TStringfHtmlDir
Int_tfMaxLineLength
TFile*fRootFile
Int_tfScreen_h
Int_tfScreen_w
Int_tfTextFont
Int_tfTextSizesize in pixels
Int_tfWwX
Int_tfWwY
Int_tfX0
Int_tfY0

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

~TMrbHelpBrowser()
TMrbHelpBrowser(const char* InputFile = 0)
void SetTextSize(Int_t size)
  set character size (in pixels), supported are 8, 10, 12, 14, 16, 18, 24
void SetMaxLineLength(Int_t len)
  if > 0 lines will be broken at fMaxLineLength
  however the result is nomally quite mediocre
void SetTextFont(Int_t font)
  set text font (see root doc) recommended are only courier fonts (80, 100),
  proportional fonts like helvetica are not very useful
void SetGifViewer(const char* viewer)
 set a viewer for gif files, the default is xv
Int_t AddHtml(const char* InputFile)
Int_t AddHtmlFile(const char* HtmlFile, Bool_t keep_references = kTRUE)
Int_t AddHtmlDir(const char* HtmlDir)
Int_t AddGifToRoot(const char* Input)
  look in GifDir for files ending with .gif  or .root
  and add to fRootFile
void AddGifFile(const char* GifFile)
void AddCanvas(const char* RootFile)
  extract canvas object from a ROOT file and add to doc file

void RecursiveRemove(TObject* )
	cout << "TMrbHelpBrowser::RecursiveRemove " << obj << endl;
void Clear()
 remove all help - canvases from screen
Bool_t ToRootFile(const char* Input, const char* RootFile, const char* option = "UPDATE")
  add html and gif files in directory InputDir to a ROOT file.
  In this way a single root file containing a complete documentation
  may be constructed
void Print(TString* Option = NULL) const
  print a list of currently known help entries
Bool_t Squeeze_White_Space(TString& s)
  Squeeze out tabs and blanks from TString
Bool_t Squeeze_EOL(TString& s)
  Squeeze out end_of_lines from TString
Int_t NextLine(TString& text, TString& line, Bool_t start)
Int_t NextTag(TString& text, TString& tag, Int_t search_from)
Int_t NextAnchor(TString& text, TString& anchor, Int_t search_from)
Int_t NextHeading(TString& text, TString& heading, Int_t search_from)
Int_t AddTagAtEOL(TString& s)
Int_t LineCount(TString& str, Int_t* longest_line, Int_t* nof_heads)
  find Number of lines and length of longest line
void MoveOrigin()
void PreScan(TString& text, Bool_t keep_references = kTRUE)
void DisplayImage(TString& img_name)
void DrawText(const Int_t ind, Int_t xoff = 0, Int_t yoff = 0)
Retrieve and display helptext by index, this is used when the help item are
automatically added to a popup menu
void DrawText(const char* hname, Int_t xoff = 0, Int_t yoff = 0)
void HandleMouseClicks()
Int_t DisplayMenu(TGPopupMenu* menu, const char* pattern = "")
Add an entry to a popup menu, pattern may contain wildcards,
The menu text is taken from a <TITLE> entry in the helptext if found
otherwise it is the anchor name with a possible extension .html replaced
by _help
in the ProcessMessage method for the TGPopupMenu the corresponding code
should be as e.g. follows (assume hbrowser points to a TMrbHelpBrowser:

Bool_t HTRootCanvas::ProcessMessage(Long_t msg, Long_t parm1, Long_t)

   switch (GET_MSG(msg)) {
      case kC_COMMAND:
         switch (GET_SUBMSG(msg)) {
            case kCM_MENU:

               if(parm1 >= 100000){
                  Int_t ind = parm1 - 100000;
                  if( hbrowser && ind >= 0 && ind < hbrowser->GetNofItems())
                     hbrowser->DrawText(ind);
                  break;
               }
TMrbHelpBrowser(const char* InputFile = 0)
void Clear(Option_t* Option)
{ TObject::Clear(Option); }
TFile * SetRootFile(const char* RootFile)
TFile * GetRootFile()
{return fRootFile;}
void Print(Option_t* Option) const
{ TObject::Print(Option); }
Int_t GetNofItems()
{return fHelpList->GetSize();}



Revision: Fri Sep 16 19:04:13 2011

ROOT page - Home page - Class index - Top of the page

This page has been automatically generated by use of ROOT's THtml class. If you have any comments or suggestions about the page layout send a mail to Marabou Support.