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

CHMFrame Class Reference

The frame, owner of the wxHtmlWindow, contents tree control and all the other nifty stuff. More...

#include <chmframe.h>

Inheritance diagram for CHMFrame:

wxFrame List of all members.

Public Member Functions

 CHMFrame (const wxString &title, const wxString &booksDir, const wxPoint &pos, const wxSize &size, const wxString &normalFont=wxEmptyString, const wxString &fixedFont=wxEmptyString, const int fontSize=CHM_DEFAULT_FONT_SIZE)
 Brings the frame into existence.

 ~CHMFrame ()
 Cleans up.

void LoadCHM (const wxString &archive)
 Attempts to load a .chm file and display it's home page, and if available, the contents tree. Otherwise an error message is issued.


Protected Member Functions

void OnQuit (wxCommandEvent &event)
 Called when the user closes the window.

void OnAbout (wxCommandEvent &event)
 Called when the user clicks on About.

void OnOpen (wxCommandEvent &event)
 Called when the user wants to open a file.

void OnChangeFonts (wxCommandEvent &event)
 Called when the user wants to change the fonts.

void OnHome (wxCommandEvent &event)
 Called when the user wants to see the default page.

void OnHistoryForward (wxCommandEvent &event)
 Called when the user wants to go forward in the history.

void OnHistoryBack (wxCommandEvent &event)
 Called when the user wants to go back in the history.

void OnShowContents (wxCommandEvent &event)
 Called when the user wants to either disable or enable the contents tree panel on the left.

void OnPrint (wxCommandEvent &event)
 Called when the user wants to print the displayed page.

void OnAddBookmark (wxCommandEvent &event)
 Called when the user clicks on the Add button.

void OnRemoveBookmark (wxCommandEvent &event)
 Called when the user clicks on the Remove button.

void OnBookmarkSel (wxCommandEvent &event)
 Called when the user chooses a bookmark from the wxChoice control.

void OnSelectionChanged (wxTreeEvent &event)
 Called when an item in the contents tree is clicked.

void OnCloseWindow (wxCloseEvent &event)
 Cleanup code. This saves the window position and last open dir.


Private Member Functions

wxMenuBar * CreateMenu ()
 Helper. Creates the menu.

bool InitToolBar (wxToolBar *toolbar)
 Helper. Initializes the frame toolbar.

wxPanelCreateContentsPanel ()
 Helper. Creates the contents panel.

void LoadBookmarks ()
 Helper. Loads the bookmarks for the currently opened CHM file.

void SaveBookmarks ()
 Helper. Saves the bookmarks for the currently opened CHM file.

wxFontEncoding GetFontEncFromCharSet (int cs)
 Helper. Translates from Win32 encodings to generic wxWindows ones.


Private Attributes

CHMHtmlWindow_html
wxTreeCtrl * _tcl
wxSplitterWindow * _sw
wxMenu * _menuFile
wxToolBar * _tb
wxHtmlEasyPrinting * _ep
wxNotebook * _nb
wxComboBox * _cb
CHMSearchPanel_csp
wxString _openPath
wxArrayString * _normalFonts
wxArrayString * _fixedFonts
wxString _normalFont
wxString _fixedFont
int _fontSize
bool _bookmarkSel
bool _bookmarksDeleted
int _sashPos
wxFont _font

Detailed Description

The frame, owner of the wxHtmlWindow, contents tree control and all the other nifty stuff.


Constructor & Destructor Documentation

CHMFrame::CHMFrame const wxString &  title,
const wxString &  booksDir,
const wxPoint &  pos,
const wxSize &  size,
const wxString &  normalFont = wxEmptyString,
const wxString &  fixedFont = wxEmptyString,
const int  fontSize = CHM_DEFAULT_FONT_SIZE
 

Brings the frame into existence.

Parameters:
title The text that shows up on the titlebar.
booksDir Where to go when you click Open.. on the toolbar. This is used to remember the last directory where a book was sucessfully opened. For the current working directory just pass the empty string.
pos The upper left corner of the frame.
normalFont Name of the font face to use for normal text.
fixedFont Name of the font face to use for fixed text.
fontSize The font size.
size The size of the frame.


Member Function Documentation

void CHMFrame::LoadCHM const wxString &  archive  ) 
 

Attempts to load a .chm file and display it's home page, and if available, the contents tree. Otherwise an error message is issued.

Parameters:
archive The .chm file name on disk.


The documentation for this class was generated from the following files:
Generated on Thu Oct 2 11:15:00 2003 for xCHM by doxygen 1.3.3