22#include "../common/datastructures.h"
26#include "../kernel/core/ui/language.hpp"
29#include <wx/artprov.h>
54 wxString programPath = mainwindow->getProgramFolder();
58 this->CreateStatusBar();
60 wxSplitterWindow* splitter =
new wxSplitterWindow(
this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSP_3D | wxBORDER_THEME);
65 m_doctree =
new wxTreeCtrl(treePanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTR_SINGLE | wxTR_FULL_ROW_HIGHLIGHT | wxTR_NO_LINES | wxTR_TWIST_BUTTONS);
66 m_doctree->SetImageList(m_manager->GetImageList());
73 treePanel->
AddWindows(treeSearchCtrl, m_doctree);
79 wxAUI_NB_CLOSE_ON_ACTIVE_TAB | wxAUI_NB_MIDDLE_CLICK_CLOSE | wxAUI_NB_SCROLL_BUTTONS | wxAUI_NB_WINDOWLIST_BUTTON);
84 m_titleTemplate = titletemplate;
87 this->SetSize(1050, 800);
88 this->SetIcon(mainwindow->getStandardIcon());
91 splitter->SplitVertically(treePanel, m_docTabs, 150);
94 fillDocTree(mainwindow);
134 wxToolBar* tb = this->CreateToolBar();
162 std::vector<std::string> vIndex = mainwindow->
GetDocIndex();
169 for (
size_t i = 0; i < vIndex.size(); i++)
171 vIndex[i].substr(0, vIndex[i].find(
' ')),
190 for (
size_t i = 0; i <
m_docTabs->GetPageCount(); i++)
241 switch (event.GetId())
277 if (docId.substr(0, 15) !=
"<!DOCTYPE html>")
283 title.erase(title.find(
"</title>"));
284 title.erase(0, title.find(
"<title>")+7);
293 viewer->SetRelatedStatusBar(0);
This represents the main frame of the documentation browser, which contains the tabbed layout,...
void onPageClose(wxAuiNotebookEvent &event)
Event handler called, when the user closes the tab in some way.
void onPageChange(wxAuiNotebookEvent &event)
Event handler function called, when the user switches the tabs.
void OnToolbarEvent(wxCommandEvent &event)
Event handler function for clicks on the toolbar of the current window. Redirects all clicks to the H...
bool createNewPage(const wxString &docId)
Create a new viewer in a new page.
bool findAndSelectPage(const wxString &title)
Finds and selects the page with the passed title or returns false.
void prepareToolbar()
Private member function to prepare the toolbar of the main frame.
~DocumentationBrowser()
Documentation browser destructor. Removes the created IconManager object.
bool SetStartPage(const wxString &docId)
Public interface to set the start page.
void OnTreeClick(wxTreeEvent &event)
Event handler function to load the documentation article describing the clicked item.
void fillDocTree(NumeReWindow *mainwindow)
This private member function prepares the index tree of the documentation browser.
void setCurrentTabText(const wxString &text)
Change the text displayed on the current tab.
This class renders the contents of a single page on the DocumentationBrowser. It also governs the bro...
bool GoIndex()
Public member function to display the index page.
bool Print()
Public member function to open the print preview page.
bool ShowPageOnItem(wxString docID)
Public member function to display a content in the viewer window. The type of the content is determin...
bool HistoryGoForward()
Public member function to go one step forward in the history.
bool GoHome()
Public member function to return to the home page.
bool HistoryGoBack()
Public member function to go one step back in the history.
int GetIconIndex(wxString iconInfo)
This class handles the internal language system and returns the language strings of the selected lang...
std::string get(const std::string &sMessage, const std::vector< std::string > &vTokens) const
This member function returns the language string for the passed language identifier and replaces all ...
This class is the actual NumeRe main frame. The application's logic is implemented here.
std::vector< std::string > GetDocIndex()
This member function returns the documentation index as a vector.
wxString GetDocContent(wxString docid)
This member function returns the HTML string containing the documentation for the selected topic/doc ...
void AddWindows(wxWindow *searchbar, wxWindow *tree)
This class specializes the generic search control to interact with a wxTreeCtrl.
This class generalizes a set of basic floating window functionalities like being closable by pressing...