Logo Search packages:      
Sourcecode: xchm version File versions

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,
const int  sashPosition = CONTENTS_MARGIN 
)

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.
size The size 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.
sashPosition Distance from the left of the frame to the end of the contents / search panel.

Definition at line 93 of file chmframe.cpp.

References CreateContentsPanel(), CreateMenu(), and InitToolBar().

      : wxFrame(NULL, -1, title, pos, size), _html(NULL),
        _tcl(NULL), _sw(NULL), _menuFile(NULL), _tb(NULL), _ep(NULL),
        _nb(NULL), _cb(NULL), _csp(NULL), _cip(NULL), _openPath(booksDir), 
        _normalFonts(NULL), _fixedFonts(NULL), _normalFont(normalFont), 
        _fixedFont(fixedFont), _fontSize(fontSize), _bookmarkSel(true),
        _bookmarksDeleted(false), _sashPos(sashPosition)
{
#ifdef _ENABLE_COPY_AND_FIND
#     ifdef wxUSE_ACCEL
      wxAcceleratorEntry entries[1];
      entries[0].Set(wxACCEL_CTRL, (int) 'F', ID_FindInPage);
      wxAcceleratorTable accel(1, entries);
      SetAcceleratorTable(accel);
#     endif
#endif

      int sizes[7];
      for(int i = -3; i <= 3; ++i)
            sizes[i+3] = _fontSize + i * 2;

      SetIcon(wxIcon(xchm_32_xpm));
      SetMenuBar(CreateMenu());

      _tb = CreateToolBar(wxTB_FLAT | wxTB_DOCKABLE
                      | wxTB_HORIZONTAL | wxTB_TEXT);
      InitToolBar(_tb);

      CreateStatusBar();
      SetStatusText(_("Ready."));

      _ep = new wxHtmlEasyPrinting(wxT("Printing"), this);

      _sw = new wxSplitterWindow(this);
      _sw->SetMinimumPaneSize(CONTENTS_MARGIN);

      _nb = new wxNotebook(_sw, ID_Notebook);
      _nb->Show(FALSE);

      wxPanel* temp = CreateContentsPanel();

      _html = new CHMHtmlWindow(_sw, _tcl, this);
      _html->SetRelatedFrame(this, wxT("xCHM v. " VERSION));
      _html->SetRelatedStatusBar(0);

      _html->SetFonts(_normalFont, _fixedFont, sizes);      
      _html->SetPage(greeting);

      _csp = new CHMSearchPanel(_nb, _tcl, _html);
      _font = _tcl->GetFont();

      _cip = new CHMIndexPanel(_nb, _html);

      _nb->AddPage(temp, _("Contents"));
      _nb->AddPage(_cip, _("Index"));
      _nb->AddPage(_csp, _("Search"));

      _sw->Initialize(_html);
      _html->SetFocusFromKbd();
}


Generated by  Doxygen 1.6.0   Back to index