NumeRe v1.1.4
NumeRe: Framework für Numerische Rechnungen
|
This class represents the notebook containing all editors of one main pane. More...
#include <NumeReNotebook.h>
Public Member Functions | |
EditorNotebook (wxWindow *parent, wxWindowID id, IconManager *icons, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=0) | |
Constructor. More... | |
~EditorNotebook () | |
Empty destructor. More... | |
void | SetTopParent (NumeReWindow *window) |
void | SetShowPathsOrIconsOnTabs (bool showText, bool showIcons) |
This member function enables/disables the relative paths or icons on the tab and refreshes the tab texts automatically. More... | |
void | SetTabText (size_t nTab, const wxString &text) |
Set a text for the selected editor tab. Note that this function expects a filepath. More... | |
NumeReEditor * | createEditor (const wxString &text) |
Create a new editor and add it to a new tab automatically. The passed text is used for the tab name. More... | |
NumeReEditor * | getEditor (size_t pageNum, bool secondary=false) |
Returns a pointer to the embedded editor instance. Will return the left or top editor pointer or the secondary editor, if the boolean is set to true. The return value might be a nullptr. More... | |
NumeReEditor * | getCurrentEditor (bool secondary=false) |
Returns a pointer to the current viewed editor in this notebook. Will return the left or top editor or the secondary one, if the boolean is set to true. The return value might be a nullptr. This is a convenience wrapper around EditorNotebook::getEditor. More... | |
NumeReEditor * | getFocusedEditor () |
Returns a pointer to the current focused editor. This will automatically return the secondary editor, it that is the focused one. This handling might be weak. In doubt, the primary editor is returned. More... | |
void | split (size_t pageNum, bool horizontal) |
Split the current editor horizontally or vertically (depending on the flag), if it is not already splitted. More... | |
void | unsplit (size_t pageNum) |
Remove the splitted view. More... | |
bool | isSplit (size_t pageNum) const |
Check, whether the editor is currently splitted. More... | |
void | OnUnsplit (wxSplitterEvent &event) |
Event handler, if the user drags the sash to the outermost edge. More... | |
int | FindPagePosition (wxNotebookPage *page) |
void | OnButtonClicked (wxAuiNotebookEvent &event) |
Executes the closing command, if the user clickes with the middle mouse button on a tab. More... | |
void | OnTabRightClicked (wxAuiNotebookEvent &event) |
Shows the context menu for the current tab. More... | |
void | OnTabMove (wxAuiNotebookEvent &event) |
This event handler fixes the issue that the control does not correctly update the selected page during moving a page. More... | |
void | OnTabMiddleClicked (wxAuiNotebookEvent &event) |
Executes the closing command, if the user clickes on the button of a tab. More... | |
void | OnTabScroll (wxMouseEvent &event) |
Scrolls through the notebook pages, if the user hovers over the tabs and uses the mouse wheel. More... | |
void | OnEnter (wxMouseEvent &event) |
Focuses the tabs, if the user hovers over them. More... | |
void | OnLeave (wxMouseEvent &event) |
Deactivates the internal mouse focus state. More... | |
void | OnSize (wxSizeEvent &event) |
Size event handling function. More... | |
bool | GetMouseFocus () |
int | GetTabFromPoint (const wxPoint &pt) |
Returns the tab at the defined absolute coordinates. Actually more or less the same than the generic HitTest() member functions. More... | |
Private Attributes | |
IconManager * | m_manager |
NumeReWindow * | m_top_parent |
bool | m_mouseFocus |
bool | m_showPathsOnTabs |
bool | m_showIconsOnTabs |
This class represents the notebook containing all editors of one main pane.
Definition at line 19 of file NumeReNotebook.h.
EditorNotebook::EditorNotebook | ( | wxWindow * | parent, |
wxWindowID | id, | ||
IconManager * | icons, | ||
const wxPoint & | pos = wxDefaultPosition , |
||
const wxSize & | size = wxDefaultSize , |
||
long | style = 0 |
||
) |
Constructor.
parent | wxWindow* |
id | wxWindowID |
icons | IconManager* |
pos | const wxPoint& |
size | const wxSize& |
style | long |
Definition at line 42 of file NumeReNotebook.cpp.
EditorNotebook::~EditorNotebook | ( | ) |
Empty destructor.
Definition at line 56 of file NumeReNotebook.cpp.
NumeReEditor * EditorNotebook::createEditor | ( | const wxString & | text | ) |
Create a new editor and add it to a new tab automatically. The passed text is used for the tab name.
text | const wxString& |
Definition at line 151 of file NumeReNotebook.cpp.
References NumeReWindow::getOptions(), GenericTerminal::getSyntax(), NumeReWindow::getTerminal(), and m_top_parent.
Referenced by NumeReWindow::DefaultPage(), NumeReWindow::NewFile(), and NumeReWindow::OpenSourceFile().
int EditorNotebook::FindPagePosition | ( | wxNotebookPage * | page | ) |
public FindPagePosition Finds the index of a given notebook page
page | wxNotebookPage * The generated notebook event |
Definition at line 537 of file NumeReNotebook.cpp.
References getEditor().
NumeReEditor * EditorNotebook::getCurrentEditor | ( | bool | secondary = false | ) |
Returns a pointer to the current viewed editor in this notebook. Will return the left or top editor or the secondary one, if the boolean is set to true. The return value might be a nullptr. This is a convenience wrapper around EditorNotebook::getEditor.
secondary | bool |
Definition at line 203 of file NumeReNotebook.cpp.
References getEditor().
Referenced by NumeReWindow::CloseFile(), NumeReWindow::compileLaTeX(), NumeReWindow::CopyEditorSettings(), NumeReWindow::createLaTeXFile(), NumeReWindow::GetCurrentEditor(), getFocusedEditor(), NumeReWindow::HandleModifiedFile(), NumeReWindow::NumeReWindow(), NumeReWindow::OnCalculateDependencies(), NumeReWindow::OnClose(), NumeReWindow::OnCreatePackage(), NumeReWindow::OnMenuEvent(), NumeReWindow::OnOptions(), NumeReWindow::OnPrintPage(), NumeReWindow::OnPrintPreview(), NumeReWindow::OnTreeItemActivated(), NumeReWindow::OnUpdateSaveUI(), NumeReWindow::OpenFile(), NumeReWindow::OpenSourceFile(), NumeReWindow::PageHasChanged(), NumeReWindow::prepareSession(), NumeReWindow::reloadFileIfOpen(), NumeReWindow::runLaTeX(), NumeReWindow::SaveCurrentFile(), NumeReWindow::setEditorFocus(), NumeReWindow::ShowRevision(), NumeReWindow::ToolbarStatusUpdate(), NumeReWindow::UpdateMenuBar(), and NumeReWindow::UpdateStatusBar().
NumeReEditor * EditorNotebook::getEditor | ( | size_t | pageNum, |
bool | secondary = false |
||
) |
Returns a pointer to the embedded editor instance. Will return the left or top editor pointer or the secondary editor, if the boolean is set to true. The return value might be a nullptr.
pageNum | size_t |
secondary | bool |
Definition at line 174 of file NumeReNotebook.cpp.
Referenced by NumeReWindow::CloseAllFiles(), NumeReWindow::EvaluateOptions(), NumeReWindow::EvaluateTab(), FindPagePosition(), getCurrentEditor(), NumeReWindow::GetPageNum(), NumeReWindow::HandleModifiedFile(), NumeReWindow::OnOptions(), NumeReWindow::OnShowRevisionsFromTab(), OnTabRightClicked(), NumeReWindow::OpenContainingFolder(), NumeReWindow::OpenSourceFile(), NumeReWindow::PageHasChanged(), NumeReWindow::Ready(), NumeReWindow::refreshFunctionTree(), NumeReWindow::reloadFileIfOpen(), NumeReWindow::SaveAll(), NumeReWindow::SaveTab(), SetShowPathsOrIconsOnTabs(), and NumeReWindow::UpdateLocationIfOpen().
NumeReEditor * EditorNotebook::getFocusedEditor | ( | ) |
Returns a pointer to the current focused editor. This will automatically return the secondary editor, it that is the focused one. This handling might be weak. In doubt, the primary editor is returned.
Definition at line 219 of file NumeReNotebook.cpp.
References getCurrentEditor().
Referenced by NumeReWindow::FindAndOpenProcedure(), NumeReWindow::FindString(), NumeReWindow::gotoLine(), NumeReWindow::OnFileEventTimer(), NumeReWindow::OnFindEvent(), NumeReWindow::OnFindReplace(), NumeReWindow::OnMenuEvent(), NumeReWindow::OnTreeItemActivated(), NumeReWindow::OpenSourceFile(), NumeReWindow::reloadFileIfOpen(), NumeReWindow::ReplaceAllStrings(), and NumeReWindow::UpdateStatusBar().
|
inline |
Definition at line 55 of file NumeReNotebook.h.
References m_mouseFocus.
int EditorNotebook::GetTabFromPoint | ( | const wxPoint & | pt | ) |
Returns the tab at the defined absolute coordinates. Actually more or less the same than the generic HitTest() member functions.
pt | const wxPoint& |
Definition at line 504 of file NumeReNotebook.cpp.
References DetachedLogger::debug(), g_logger, and toString().
Referenced by OnButtonClicked(), OnTabMiddleClicked(), OnTabMove(), and OnTabRightClicked().
bool EditorNotebook::isSplit | ( | size_t | pageNum | ) | const |
Check, whether the editor is currently splitted.
pageNum | size_t |
Definition at line 311 of file NumeReNotebook.cpp.
Referenced by OnTabRightClicked().
void EditorNotebook::OnButtonClicked | ( | wxAuiNotebookEvent & | event | ) |
Executes the closing command, if the user clickes with the middle mouse button on a tab.
event | wxAuiNotebookEvent& |
Definition at line 557 of file NumeReNotebook.cpp.
References GetTabFromPoint(), ID_MENU_CLOSETAB, ID_MENU_CLOSETABFORCE, m_top_parent, NumeReWindow::SetIntVar(), and VN_CLICKEDTAB.
void EditorNotebook::OnEnter | ( | wxMouseEvent & | event | ) |
Focuses the tabs, if the user hovers over them.
event | wxMouseEvent& |
Definition at line 458 of file NumeReNotebook.cpp.
References m_mouseFocus.
void EditorNotebook::OnLeave | ( | wxMouseEvent & | event | ) |
Deactivates the internal mouse focus state.
event | wxMouseEvent& |
Definition at line 474 of file NumeReNotebook.cpp.
References m_mouseFocus.
void EditorNotebook::OnSize | ( | wxSizeEvent & | event | ) |
Size event handling function.
event | wxSizeEvent& |
Definition at line 488 of file NumeReNotebook.cpp.
void EditorNotebook::OnTabMiddleClicked | ( | wxAuiNotebookEvent & | event | ) |
Executes the closing command, if the user clickes on the button of a tab.
event | wxAuiNotebookEvent& |
Definition at line 586 of file NumeReNotebook.cpp.
References GetTabFromPoint(), ID_MENU_CLOSETAB, ID_MENU_CLOSETABFORCE, m_top_parent, NumeReWindow::SetIntVar(), and VN_CLICKEDTAB.
void EditorNotebook::OnTabMove | ( | wxAuiNotebookEvent & | event | ) |
This event handler fixes the issue that the control does not correctly update the selected page during moving a page.
event | wxAuiNotebookEvent& |
Definition at line 399 of file NumeReNotebook.cpp.
References GetTabFromPoint().
void EditorNotebook::OnTabRightClicked | ( | wxAuiNotebookEvent & | event | ) |
Shows the context menu for the current tab.
event | wxAuiNotebookEvent& |
Definition at line 344 of file NumeReNotebook.cpp.
References _guilang, DetachedLogger::debug(), g_logger, Language::get(), getEditor(), NumeReEditor::GetFileNameAndPath(), GetTabFromPoint(), VersionControlSystemManager::hasRevisions(), ID_MENU_CLOSEALL, ID_MENU_CLOSEOTHERS, ID_MENU_CLOSETAB, ID_MENU_OPEN_FOLDER, ID_MENU_RUN_FROM_TAB, ID_MENU_SHOW_REVISIONS_FROM_TAB, ID_MENU_SPLIT_TAB_H, ID_MENU_SPLIT_TAB_V, ID_MENU_UNSPLIT_TAB, isSplit(), m_top_parent, NumeReWindow::SetIntVar(), toString(), and VN_CLICKEDTAB.
void EditorNotebook::OnTabScroll | ( | wxMouseEvent & | event | ) |
Scrolls through the notebook pages, if the user hovers over the tabs and uses the mouse wheel.
event | wxMouseEvent& |
Definition at line 419 of file NumeReNotebook.cpp.
void EditorNotebook::OnUnsplit | ( | wxSplitterEvent & | event | ) |
Event handler, if the user drags the sash to the outermost edge.
event | wxSplitterEvent& |
Definition at line 330 of file NumeReNotebook.cpp.
void EditorNotebook::SetShowPathsOrIconsOnTabs | ( | bool | showText, |
bool | showIcons | ||
) |
This member function enables/disables the relative paths or icons on the tab and refreshes the tab texts automatically.
showText | bool |
showIcons | bool |
Definition at line 71 of file NumeReNotebook.cpp.
References getEditor(), NumeReEditor::GetFileNameAndPath(), m_showIconsOnTabs, m_showPathsOnTabs, and SetTabText().
Referenced by NumeReWindow::EvaluateOptions().
void EditorNotebook::SetTabText | ( | size_t | nTab, |
const wxString & | text | ||
) |
Set a text for the selected editor tab. Note that this function expects a filepath.
nTab | size_t |
text | const wxString& |
Definition at line 96 of file NumeReNotebook.cpp.
References _guilang, Language::get(), IconManager::GetIconIndex(), NumeReWindow::getPathDefs(), LOADPATH, m_manager, m_showIconsOnTabs, m_showPathsOnTabs, m_top_parent, PATH_LAST, replacePathSeparator(), shortenFileName(), and toUpperCase().
Referenced by NumeReWindow::NewFile(), NumeReWindow::OpenSourceFile(), NumeReWindow::SaveTab(), SetShowPathsOrIconsOnTabs(), and NumeReWindow::UpdateLocationIfOpen().
|
inline |
Definition at line 28 of file NumeReNotebook.h.
References m_top_parent.
Referenced by NumeReWindow::NumeReWindow().
void EditorNotebook::split | ( | size_t | pageNum, |
bool | horizontal | ||
) |
Split the current editor horizontally or vertically (depending on the flag), if it is not already splitted.
pageNum | size_t |
horizontal | bool |
Definition at line 241 of file NumeReNotebook.cpp.
References NumeReDropTarget::EDITOR, NumeReEditor::FoldAll(), NumeReEditor::GetFileName(), Options::GetFoldDuringLoading(), NumeReWindow::getOptions(), NumeReEditor::getSettings(), GenericTerminal::getSyntax(), NumeReWindow::getTerminal(), m_top_parent, NumeReEditor::SetFilename(), NumeReEditor::ToggleSettings(), and NumeReEditor::UpdateSyntaxHighlighting().
Referenced by NumeReWindow::OnMenuEvent().
void EditorNotebook::unsplit | ( | size_t | pageNum | ) |
Remove the splitted view.
pageNum | size_t |
Definition at line 286 of file NumeReNotebook.cpp.
Referenced by NumeReWindow::OnMenuEvent().
|
private |
Definition at line 59 of file NumeReNotebook.h.
Referenced by SetTabText().
|
private |
Definition at line 61 of file NumeReNotebook.h.
Referenced by GetMouseFocus(), OnEnter(), and OnLeave().
|
private |
Definition at line 63 of file NumeReNotebook.h.
Referenced by SetShowPathsOrIconsOnTabs(), and SetTabText().
|
private |
Definition at line 62 of file NumeReNotebook.h.
Referenced by SetShowPathsOrIconsOnTabs(), and SetTabText().
|
private |
Definition at line 60 of file NumeReNotebook.h.
Referenced by createEditor(), OnButtonClicked(), OnTabMiddleClicked(), OnTabRightClicked(), SetTabText(), SetTopParent(), and split().