NumeRe v1.1.4
NumeRe: Framework für Numerische Rechnungen
NumeReNotebook.h
Go to the documentation of this file.
1#ifndef CHAMELEON_NOTEBOOK__H
2#define CHAMELEON_NOTEBOOK__H
3
4
5
6//#include <wx/notebook.h>
7#include <wx/aui/auibook.h>
8
9
10
11class NumeReWindow;
12class NumeReEditor;
13class IconManager;
14
19class EditorNotebook : public wxAuiNotebook
20{
21 public:
22 EditorNotebook(wxWindow* parent, wxWindowID id,
23 IconManager* icons,
24 const wxPoint& pos = wxDefaultPosition,
25 const wxSize& size = wxDefaultSize, long style = 0);
27
29 {m_top_parent = window;}
30
31 void SetShowPathsOrIconsOnTabs(bool showText, bool showIcons);
32 void SetTabText(size_t nTab, const wxString& text);
33 NumeReEditor* createEditor(const wxString& text);
34 NumeReEditor* getEditor(size_t pageNum, bool secondary = false);
35 NumeReEditor* getCurrentEditor(bool secondary = false);
37 void split(size_t pageNum, bool horizontal);
38 void unsplit(size_t pageNum);
39 bool isSplit(size_t pageNum) const;
40
41 void OnUnsplit(wxSplitterEvent& event);
42
43 int FindPagePosition(wxNotebookPage* page);
44
45 void OnButtonClicked (wxAuiNotebookEvent& event);
46 void OnTabRightClicked (wxAuiNotebookEvent& event);
47 void OnTabMove(wxAuiNotebookEvent& event);
48 void OnTabMiddleClicked(wxAuiNotebookEvent& event);
49 void OnTabScroll(wxMouseEvent& event);
50 void OnEnter(wxMouseEvent& event);
51 void OnLeave(wxMouseEvent& event);
52
53 void OnSize(wxSizeEvent &event);
54
55 bool GetMouseFocus() {return m_mouseFocus;}
56 int GetTabFromPoint(const wxPoint& pt);
57
58 private:
64
65
66 DECLARE_EVENT_TABLE()
67};
68
69#endif
This class represents the notebook containing all editors of one main pane.
void SetTabText(size_t nTab, const wxString &text)
Set a text for the selected editor tab. Note that this function expects a filepath.
void OnTabScroll(wxMouseEvent &event)
Scrolls through the notebook pages, if the user hovers over the tabs and uses the mouse wheel.
void OnSize(wxSizeEvent &event)
Size event handling function.
void OnUnsplit(wxSplitterEvent &event)
Event handler, if the user drags the sash to the outermost edge.
void OnLeave(wxMouseEvent &event)
Deactivates the internal mouse focus state.
void OnTabRightClicked(wxAuiNotebookEvent &event)
Shows the context menu for the current tab.
void split(size_t pageNum, bool horizontal)
Split the current editor horizontally or vertically (depending on the flag), if it is not already spl...
void OnEnter(wxMouseEvent &event)
Focuses the tabs, if the user hovers over them.
bool isSplit(size_t pageNum) const
Check, whether the editor is currently splitted.
void OnButtonClicked(wxAuiNotebookEvent &event)
Executes the closing command, if the user clickes with the middle mouse button on a tab.
bool GetMouseFocus()
void SetShowPathsOrIconsOnTabs(bool showText, bool showIcons)
This member function enables/disables the relative paths or icons on the tab and refreshes the tab te...
void OnTabMiddleClicked(wxAuiNotebookEvent &event)
Executes the closing command, if the user clickes on the button of a tab.
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 ...
void unsplit(size_t pageNum)
Remove the splitted view.
NumeReWindow * m_top_parent
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.
NumeReEditor * getCurrentEditor(bool secondary=false)
Returns a pointer to the current viewed editor in this notebook. Will return the left or top editor o...
~EditorNotebook()
Empty destructor.
int FindPagePosition(wxNotebookPage *page)
void OnTabMove(wxAuiNotebookEvent &event)
This event handler fixes the issue that the control does not correctly update the selected page durin...
void SetTopParent(NumeReWindow *window)
int GetTabFromPoint(const wxPoint &pt)
Returns the tab at the defined absolute coordinates. Actually more or less the same than the generic ...
IconManager * m_manager
EditorNotebook(wxWindow *parent, wxWindowID id, IconManager *icons, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=0)
Constructor.
NumeReEditor * getFocusedEditor()
Returns a pointer to the current focused editor. This will automatically return the secondary editor,...
The class of the editor window.
Definition: editor.h:53
This class is the actual NumeRe main frame. The application's logic is implemented here.
Definition: NumeReWindow.h:177