NumeRe v1.1.4
NumeRe: Framework für Numerische Rechnungen
history.hpp
Go to the documentation of this file.
1/*****************************************************************************
2 NumeRe: Framework fuer Numerische Rechnungen
3 Copyright (C) 2017 Erik Haenel et al.
4
5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17******************************************************************************/
18
19
20#ifndef HISTORY_HPP
21#define HISTORY_HPP
22
23#include <wx/wx.h>
24#include <wx/stc/stc.h>
25#include <wx/menu.h>
26#include <wx/dynarray.h>
27#include "editor.h"
28#include "../terminal/terminal.hpp"
29#include "../../common/datastructures.h"
30#include "../../kernel/syntax.hpp"
31
32#define RM_WS_BOTH 0
33#define RM_WS_FRONT 1
34#define RM_WS_BACK 2
35
37{
38public:
39 NumeReHistory(NumeReWindow* mframe, Options* options,
40 wxWindow *parent, wxWindowID id, NumeReSyntax* __syntax, NumeReTerminal* __terminal, const wxPoint& pos = wxDefaultPosition,
41 const wxSize& size = wxDefaultSize, long style = 0,
42 const wxString& name = wxSTCNameStr);
44
45 void UpdateSyntaxHighlighting(bool forceUpdate = false);
46 void AddToHistory(const wxString& commandstring);
47 wxString getLastLine();
48 void OnMarginClick(wxStyledTextEvent &event);
49 void OnMouseDblClk(wxMouseEvent& event);
50 void OnMouseDn(wxMouseEvent &event);
51 void OnRightClick(wxMouseEvent &event);
52 void OnMenuEvent(wxCommandEvent& event);
53 void OnMouseCaptureLost(wxMouseCaptureLostEvent& event);
54 void saveHistory();
55
56private:
57 void deleteLine();
58 void copyLine();
59 void loadHistory();
60 void addHeader();
61 void applyFoldPoints();
62
67
68 DECLARE_EVENT_TABLE()
69};
70
71
72//BEGIN_EVENT_TABLE(ChameleonEditor, wxStyledTextCtrl)
73
74#endif
The class of the editor window.
Definition: editor.h:53
NumeReTerminal * m_terminal
Definition: history.hpp:64
NumeReWindow * m_mainframe
Definition: history.hpp:65
NumeReSyntax * _syntax
Definition: history.hpp:63
void OnMenuEvent(wxCommandEvent &event)
Event handler for the context menu.
Definition: history.cpp:272
void OnMouseDblClk(wxMouseEvent &event)
Double clicking event handler. Will re-execute the selected line or fold the session,...
Definition: history.cpp:536
wxString getLastLine()
Return the last line of the input history.
Definition: history.cpp:496
NumeReHistory(NumeReWindow *mframe, Options *options, wxWindow *parent, wxWindowID id, NumeReSyntax *__syntax, NumeReTerminal *__terminal, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=0, const wxString &name=wxSTCNameStr)
History constructor.
Definition: history.cpp:64
void applyFoldPoints()
Add fold points to hide previous sessions.
Definition: history.cpp:422
~NumeReHistory()
Empty destructor.
Definition: history.cpp:109
void UpdateSyntaxHighlighting(bool forceUpdate=false)
Update the syntax highlighting to represent the selected syntax colors.
Definition: history.cpp:122
void OnMouseDn(wxMouseEvent &event)
Select the whole line, if the user clicks on a line.
Definition: history.cpp:562
void AddToHistory(const wxString &commandstring)
Add the passed string at the end of the input history.
Definition: history.cpp:453
void saveHistory()
Save the history to the corresponding file.
Definition: history.cpp:390
void addHeader()
Add the history header presenting the current date and time.
Definition: history.cpp:409
void OnMarginClick(wxStyledTextEvent &event)
Event handler for folding.
Definition: history.cpp:512
void copyLine()
Copy the selected line to the clipboard.
Definition: history.cpp:327
void OnRightClick(wxMouseEvent &event)
Event handler to display the context menu, if the user clicks right on a line.
Definition: history.cpp:580
void loadHistory()
Load the history from the corresponding file.
Definition: history.cpp:344
void OnMouseCaptureLost(wxMouseCaptureLostEvent &event)
Ensure that the drag'n drop is handled consistently.
Definition: history.cpp:294
void deleteLine()
Delete the previously selected line.
Definition: history.cpp:310
int m_clickedLine
Definition: history.hpp:66
This class contains all needed keywords to highlight their occurences correspondingly....
Definition: syntax.hpp:55
The terminal class for the GUI. It's a specialisation of the GenericTerminal.
Definition: terminal.hpp:46
This class is the actual NumeRe main frame. The application's logic is implemented here.
Definition: NumeReWindow.h:177
This class implements an interface of the internal Settings object adapted to be usable from the GUI.
Definition: Options.h:178
char name[32]
Definition: resampler.cpp:371