Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members

CHMHtmlWindow Class Reference

Custom HTML widget class. Needed for sychnronization between the topics tree control and the currently displayed page. More...

#include <chmhtmlwindow.h>

Inheritance diagram for CHMHtmlWindow:

wxHtmlWindow List of all members.

Public Member Functions

 CHMHtmlWindow (wxWindow *parent, wxTreeCtrl *tc, CHMFrame *frame)
 Initializes the widget.
 ~CHMHtmlWindow ()
 Destructor. Deletes heap objects allocated in the constructor.
bool LoadPage (const wxString &location)
 Override. Looks up the wanted page in the tree and selects it.
void SetSync (bool value)
 Dictates the behaviour of LoadPage(). If SetSync() has been called with a true parameter, the tree control will be updated by LoadPage(). Otherwise, it will not be updated.
bool IsCaller () const
void AbsoluteFollows ()
 Let the htmlWindow know the next param to LoadPage() will be an absolute path.
void OnForward (wxCommandEvent &event)
 Called when the user selects 'Forward' from the popup menu.
void OnBack (wxCommandEvent &event)
 Called when the user selects 'Back' from the popup menu.
void OnCopyLink (wxCommandEvent &event)
 Called when the user selects 'Copy link' from the popup menu.

Protected Member Functions

void OnRightClick (wxMouseEvent &event)
 Called when the user right clicks the HTML window.
wxHtmlOpeningStatus OnOpeningURL (wxHtmlURLType type, const wxString &url, wxString *redirect) const
 Overridden to correct relative images paths.
void OnLinkClicked (const wxHtmlLinkInfo &link)
 Overridden. Called when the user clicks on a link.

Private Member Functions

void Sync (wxTreeItemId root, const wxString &page)
 Helper. Recursively looks for the opened page in the tree.
wxString GetPrefix (const wxString &location) const
 Helper. Returns the prefix of the currently loaded page.
bool FixRelativePath (wxString &location, const wxString &prefix) const
 Helper. Fixes ../dir/file locations.

Private Attributes

wxTreeCtrl * _tcl
bool _syncTree
bool _found
wxMenu * _menu
wxString _prefix
bool _absolute
CHMFrame_frame
wxHtmlLinkInfo * _link

Detailed Description

Custom HTML widget class. Needed for sychnronization between the topics tree control and the currently displayed page.


Constructor & Destructor Documentation

CHMHtmlWindow::CHMHtmlWindow wxWindow *  parent,
wxTreeCtrl *  tc,
CHMFrame frame
 

Initializes the widget.

Parameters:
parent The parent widget.
tc Pointer to the tree control we want to synchronize with.
frame Outer frame.


Member Function Documentation

bool CHMHtmlWindow::IsCaller  )  const [inline]
 

Returns true if the tree control's EVT_TREE_SEL_CHANGED event happened as a result of the CHMHtmlWindow calling SelectItem() on it.

void CHMHtmlWindow::SetSync bool  value  )  [inline]
 

Dictates the behaviour of LoadPage(). If SetSync() has been called with a true parameter, the tree control will be updated by LoadPage(). Otherwise, it will not be updated.

Parameters:
value Synchronize the tree widget on load?


The documentation for this class was generated from the following files:
Generated on Mon Feb 21 11:08:38 2005 for xCHM by  doxygen 1.4.0