NumeRe v1.1.4
NumeRe: Framework für Numerische Rechnungen
|
#include <history.hpp>
Public Member Functions | |
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. More... | |
~NumeReHistory () | |
Empty destructor. More... | |
void | UpdateSyntaxHighlighting (bool forceUpdate=false) |
Update the syntax highlighting to represent the selected syntax colors. More... | |
void | AddToHistory (const wxString &commandstring) |
Add the passed string at the end of the input history. More... | |
wxString | getLastLine () |
Return the last line of the input history. More... | |
void | OnMarginClick (wxStyledTextEvent &event) |
Event handler for folding. More... | |
void | OnMouseDblClk (wxMouseEvent &event) |
Double clicking event handler. Will re-execute the selected line or fold the session, if the user clicked on a header. More... | |
void | OnMouseDn (wxMouseEvent &event) |
Select the whole line, if the user clicks on a line. More... | |
void | OnRightClick (wxMouseEvent &event) |
Event handler to display the context menu, if the user clicks right on a line. More... | |
void | OnMenuEvent (wxCommandEvent &event) |
Event handler for the context menu. More... | |
void | OnMouseCaptureLost (wxMouseCaptureLostEvent &event) |
Ensure that the drag'n drop is handled consistently. More... | |
void | saveHistory () |
Save the history to the corresponding file. More... | |
Public Member Functions inherited from NumeReEditor | |
NumeReEditor (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) | |
Editor constructor. More... | |
~NumeReEditor () | |
bool | LoadLocalFile (const wxString &filename) |
bool | LoadFileText (wxString fileContents) |
bool | SaveFile (const wxString &filename) |
bool | SaveNumeReFile (const wxString &filename) |
Saves a NumeRe-specific file and tries to stick to ASCII encoding. More... | |
bool | SaveGeneralFile (const wxString &filename) |
Saves a general file without touching the encoding. More... | |
bool | SaveFileLocal () |
bool | Modified () |
Returns whether the current file was modified after the last time saved. More... | |
bool | HasBeenSaved () |
void | registerProcedureViewer (ProcedureViewer *viewer) |
Registers the passed procedure viewer. More... | |
void | OnChar (wxStyledTextEvent &event) |
void | OnRightClick (wxMouseEvent &event) |
void | OnMarginClick (wxStyledTextEvent &event) |
Event handler called when clicking on the editor margin. More... | |
void | OnKeyDn (wxKeyEvent &event) |
Checks key input events, before they are typed into the editor. More... | |
void | OnKeyRel (wxKeyEvent &event) |
Called, when the user releases a key. More... | |
void | OnMouseUp (wxMouseEvent &event) |
Called, when the user releases the mouse key. More... | |
void | OnMouseDn (wxMouseEvent &event) |
Called, when the user presses the left mouse key. More... | |
void | OnMouseDblClk (wxMouseEvent &event) |
Called, when the user double clicks. More... | |
void | OnMouseCaptureLost (wxMouseCaptureLostEvent &event) |
Called, when the mouse leaves the editor screen, but the user keeps the mouse pressed. More... | |
void | OnEnter (wxMouseEvent &event) |
Called, when the mouse enters the editor window. More... | |
void | OnLeave (wxMouseEvent &event) |
Called, when the mouse leaves the editor window. More... | |
void | OnLoseFocus (wxFocusEvent &event) |
Called, when the editor loses focus. More... | |
void | OnMouseDwell (wxStyledTextEvent &event) |
Called, when the mouse dwells for some time. More... | |
void | OnSavePointReached (wxStyledTextEvent &event) |
Called, when the editor reaches the latest save point. More... | |
void | OnSavePointLeft (wxStyledTextEvent &event) |
Called, when the editor leaves the latest save point. More... | |
void | OnAutoCompletion (wxStyledTextEvent &event) |
This event handler fires, if the user selects an entry in the autocompletion list or if he presses e.g. TAB. More... | |
void | OnIdle (wxIdleEvent &event) |
Called, when the editor idles, i.e. the user is not using it. More... | |
int | isBlockStart (const wxString &sWord, bool allowIntermediate=false) |
This function returns true, if a passed word corresponds to a control flow statement block start. More... | |
int | isBlockEnd (const wxString &sWord) |
This function returns true, if a passed word corresponds to a control flow statement block end. More... | |
int | isBlockMiddle (const wxString &sWord) |
This function returns, whether a word matches to a block middle statement (e.g. elseif). More... | |
bool | hasBlockMiddle (const wxString &sWord) |
This function returns, whether a block has block middle statements. More... | |
int | getBlockID (const wxString &word) |
This function returns the block ID. More... | |
wxString | getBlockAutoCompletion (const wxString &sWord) |
This member function returns a the complete autocompletion block for the passed control flow statement block start. More... | |
wxString | getBlockEnd (const wxString &sWord) |
This member function returns the control flow statement block end, which corresponds to the passed word. More... | |
wxString | getBlockStart (const wxString &sWord) |
This member function returns the control flow statement block start, which corresponds to the passed word. More... | |
void | ClearDblClkIndicator () |
Removes the double-click occurence indicators from the document. More... | |
void | MakeBraceCheck () |
Checks for corresponding braces. More... | |
void | MakeBlockCheck () |
Checks for corresponding flow control statements. More... | |
bool | isWrappedLine (int line) |
This member function checks, whether a line has been syntactically wrapped around. More... | |
void | HandleFunctionCallTip () |
This function handles the descriptive function call tip. More... | |
void | UpdateProcedureViewer () |
Update the assigned procedure viewer. More... | |
std::string | GetCurrentFunctionContext (int &nStartingBrace) |
Find the function, whose braces the cursor is currently located in. More... | |
std::string | GetCurrentArgument (const std::string &sCallTip, int nStartingBrace, int &nArgStartPos) |
Finds the current argument below the cursor. More... | |
int | CallTipStartPos () |
Returns the starting position of the currently displayed calltip. More... | |
void | AdvCallTipShow (int pos, const wxString &definition) |
A more advanced calltip display routine. More... | |
void | AdvCallTipCancel () |
Simply closes the calltip and resets its associated variables. More... | |
void | getMatchingBrace (int nPos) |
Finds and highlights the matching brace. More... | |
void | getMatchingBlock (int nPos) |
Finds and highlights the matching flow control statements. More... | |
std::vector< int > | BlockMatch (int nPos) |
Finds all matching flow control statements. More... | |
std::vector< int > | BlockMatchNSCR (int nPos) |
Finds all matching flow control statements for NumeRe command syntax. More... | |
std::vector< int > | BlockMatchMATLAB (int nPos) |
Finds all matching flow control statements for MATLAB command syntax. More... | |
void | UpdateSyntaxHighlighting (bool forceUpdate=false) |
void | UpdateIndicators () |
Defines and applies styles to all needed indicators. More... | |
void | FocusOnLine (int linenumber, bool showMarker=true) |
void | EnsureLineVisibility (int line) |
Ensures that the selected line is visible and not hidden bei either a code fold or a explicit line hiding. Does not move the cursor to the selected line. More... | |
FileFilterType | GetFileType (const wxString &filename) |
Returns the FileFilterType which corresponds to the passed file name. More... | |
wxString | GetFileNameAndPath () |
wxString | GetFilenameString () |
wxFileName | GetFileName () |
wxFileName | GetExecutableFileName () |
wxString | GetFilePath () |
wxArrayInt | GetBreakpoints () |
void | SetFilename (wxFileName filename, bool fileIsRemote) |
void | SetExecutableFilename (wxFileName filename) |
void | ResetEditor () |
bool | LastSavedRemotely () |
void | GotoPipe (int nStartPos=0) |
Jumps to the predefined template caret position. More... | |
void | OnAddBreakpoint (wxCommandEvent &event) |
void | OnRemoveBreakpoint (wxCommandEvent &event) |
void | OnClearBreakpoints (wxCommandEvent &event) |
void | OnAddBookmark (wxCommandEvent &event) |
Adds a bookmark at the selected line. More... | |
void | OnRemoveBookmark (wxCommandEvent &event) |
Removes a bookmark from the selected line. More... | |
void | OnClearBookmarks (wxCommandEvent &event) |
Removes all bookmarks from the whole file. More... | |
void | OnDisplayVariable (wxCommandEvent &event) |
Highlights all word occurences permanently. More... | |
void | OnHelpOnSelection (wxCommandEvent &event) |
Triggers the main frame to show the documentation viewer concerning the selected command. More... | |
void | OnFindProcedure (wxCommandEvent &event) |
Private event handler function for finding the procedure definition. More... | |
void | OnFindProcedureFromMenu () |
Global event handler function for finding the procedure definition. More... | |
void | OnFindInclude (wxCommandEvent &event) |
Private event handler function for finding the included script. More... | |
void | OnFindIncludeFromMenu () |
Global event handler function for finding the included script. More... | |
void | OnChangeCase (wxCommandEvent &event) |
Changes the letters in the selection. More... | |
void | OnFoldCurrentBlock (wxCommandEvent &event) |
Event wrapper for FoldCurrentBlock . More... | |
void | OnHideSelection (wxCommandEvent &event) |
Private event handling function for hiding the selection. More... | |
void | OnUnhideAllFromMenu () |
Global event handling function to unhide all lines from the main frame's menu. More... | |
void | OnRenameSymbols (wxCommandEvent &event) |
Event wrapper for RenameSymbols . More... | |
void | OnRenameSymbolsFromMenu () |
Global wrapper for RenameSymbols . More... | |
void | OnFixTypes (wxCommandEvent &event) |
Event wrapper for fixSymbolName . More... | |
void | OnAbstrahizeSection (wxCommandEvent &event) |
Private event handler for extracting the selected section. More... | |
void | OnAbstrahizeSectionFromMenu () |
Global event handler for extracting the selected section. More... | |
void | OnMenuEvent (wxCommandEvent &event) |
OnMenu event handler. More... | |
void | OnTranspose () |
On MenuEvent handler for the transpose functionality of the editor. More... | |
void | OnExtractAsHTML () |
On MenuEvent handler for the extract as HTML functionality of the editor. More... | |
void | OnExtractFormatted () |
On MenuEvent handler for the extract as formatted text functionality of the editor. More... | |
void | OnAnalyzerTimer (wxTimerEvent &event) |
This event handler fires, once the analyzer timer is finished and calls the time consuming analysis tasks. More... | |
bool | InitDuplicateCode () |
Displays the duplicated code dialog. More... | |
void | OnFindDuplicateCode (int nDuplicateFlag=1, int nNumDuplicatedLines=6) |
Wrapper for detectCodeDuplicates . More... | |
void | IndicateDuplicatedLine (int nStart1, int nEnd1, int nStart2, int nEnd2, int nSelectionLine) |
Highlights differences between two blocks of code. More... | |
virtual wxThread::ExitCode | Entry () |
Main thread loop for the duplicated code analysis. More... | |
void | OnThreadUpdate (wxThreadEvent &event) |
Thread event handler function for the duplicated code detection functionality. More... | |
void | AddBreakpoint (int linenum) |
Adds a breakpoint to the selected line. More... | |
void | RemoveBreakpoint (int linenum) |
Removes a breakpoint from the selected line. More... | |
void | SynchronizeBreakpoints () |
Synchronizes all breakpoints between editor and kernel. More... | |
void | AddProcedureDocumentation () |
This member function handles the creation of documentation blocks in front of procedure heads. More... | |
void | SetSyntax (NumeReSyntax *__syntax) |
void | SetTerminal (NumeReTerminal *_terminal) |
void | SetUnsaved () |
Marks the editor as modified. More... | |
void | ApplyAutoIndentation (int nFirstLine=0, int nLastLine=-1) |
Wrapper for CodeFormatter . More... | |
void | ApplyAutoFormat (int nFirstLine=0, int nLastLine=-1) |
Wrapper for CodeFormatter . More... | |
void | Transpose (int nFirstLine=0, int nLastLine=-1) |
This method transposes tabular data in between (including) starting and last line. If the current file is a CSV, heuristics are applied to determine the separator character, otherwise all usual whitespace characters are used to sparate the different cells of the tabular data. More... | |
wxString | ExtractAsHTML (int nFirstLine=0, int nLastLine=-1) |
Extracts the selected lines as pre- formatted HTML and returns it. More... | |
void | ToggleSettings (int _setting) |
Enables or disables an editor setting. More... | |
bool | getEditorSetting (EditorSettings _setting) |
Returns true, if the selected setting is active. More... | |
int | getSettings () |
void | ToggleCommentLine () |
Toggles a line comment. More... | |
void | ToggleCommentSelection () |
Toggles block comments in a selection. More... | |
void | FoldAll () |
Folds all fold markers. More... | |
void | UnfoldAll () |
Unfolds all fold markers. More... | |
void | MoveSelection (bool down=true) |
void | JumpToBookmark (bool down=true) |
Jumps the cursor to the next bookmark in the current file. More... | |
std::vector< int > | getBookmarks () |
Returns the line positions of the bookmarks. More... | |
void | setBookmarks (const std::vector< int > &vBookmarks) |
Set the bookmarks in the editor. More... | |
void | removeWhiteSpaces (int nType=RM_WS_BOTH) |
Removes whitespaces depending on the passed type. More... | |
void | toggleBookmark () |
Toggles a bookmark marker on the current line. More... | |
void | clearBookmarks () |
Removes all bookmark markers from the current document. More... | |
void | sortSelection (bool ascending=true) |
Sorts the lines de- or ascending. More... | |
void | fixSymbolName (int pos) |
Fixes the symbol's type depending on either the declaration point or the first assigned value. More... | |
FileFilterType | getFileType () |
void | notifyDialogClose () |
Notifies the editor that the duplicated code dialog had been closed. More... | |
void | SetEditorFont (const wxFont &font) |
Changes the editor's font face. More... | |
bool | isNumeReFileType () |
bool | isCodeFile () |
void | AnalyseCode () |
Wrapper for the static code analyzer. More... | |
void | FindAndOpenProcedure (const wxString &procedurename) |
Finds the procedure definition and displays it in the editor. More... | |
void | FindAndOpenInclude (const wxString &includename) |
Finds the included script and displays it in the editor. More... | |
std::vector< wxString > | getProceduresInFile () |
Wrapper for the search controller. More... | |
Private Member Functions | |
void | deleteLine () |
Delete the previously selected line. More... | |
void | copyLine () |
Copy the selected line to the clipboard. More... | |
void | loadHistory () |
Load the history from the corresponding file. More... | |
void | addHeader () |
Add the history header presenting the current date and time. More... | |
void | applyFoldPoints () |
Add fold points to hide previous sessions. More... | |
Private Attributes | |
NumeReSyntax * | _syntax |
NumeReTerminal * | m_terminal |
NumeReWindow * | m_mainframe |
int | m_clickedLine |
Additional Inherited Members | |
Public Types inherited from NumeReEditor | |
enum | EditorSettings { SETTING_WRAPEOL = 1 , SETTING_DISPCTRLCHARS = 2 , SETTING_USETXTADV = 4 , SETTING_USEANALYZER = 8 , SETTING_INDENTONTYPE = 16 , SETTING_USESECTIONS = 32 } |
The possible per-editor settings. More... | |
Public Attributes inherited from NumeReEditor | |
bool | defaultPage |
Protected Attributes inherited from NumeReEditor | |
Options * | m_options |
Definition at line 36 of file history.hpp.
NumeReHistory::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.
mframe | NumeReWindow* |
options | Options* |
parent | wxWindow* |
id | wxWindowID |
__syntax | NumeReSyntax* |
__terminal | wxTerm* |
pos | const wxPoint& |
size | const wxSize& |
style | long |
name | const wxString& |
Definition at line 64 of file history.cpp.
References SETTING_S_HISTORYFONT.
NumeReHistory::~NumeReHistory | ( | ) |
Empty destructor.
Definition at line 109 of file history.cpp.
|
private |
Add the history header presenting the current date and time.
Definition at line 409 of file history.cpp.
References getTimeStamp(), and HISTORYHEADERSTART.
Referenced by loadHistory().
void NumeReHistory::AddToHistory | ( | const wxString & | commandstring | ) |
Add the passed string at the end of the input history.
commandstring | const wxString& |
Definition at line 453 of file history.cpp.
References applyFoldPoints(), and getLastLine().
Referenced by NumeReWindow::AddToHistory().
|
private |
Add fold points to hide previous sessions.
Definition at line 422 of file history.cpp.
References HISTORYHEADERSTART.
Referenced by AddToHistory(), deleteLine(), and loadHistory().
|
private |
Copy the selected line to the clipboard.
Definition at line 327 of file history.cpp.
References m_clickedLine.
Referenced by OnMenuEvent().
|
private |
Delete the previously selected line.
Definition at line 310 of file history.cpp.
References applyFoldPoints(), and m_clickedLine.
Referenced by OnMenuEvent().
wxString NumeReHistory::getLastLine | ( | ) |
Return the last line of the input history.
Definition at line 496 of file history.cpp.
Referenced by AddToHistory(), and saveHistory().
|
private |
Load the history from the corresponding file.
Definition at line 344 of file history.cpp.
References addHeader(), applyFoldPoints(), fileExists(), NumeReWindow::getProgramFolder(), HISTORYHEADERSTART, and m_mainframe.
void NumeReHistory::OnMarginClick | ( | wxStyledTextEvent & | event | ) |
Event handler for folding.
event | wxStyledTextEvent& |
Definition at line 512 of file history.cpp.
References MARGIN_FOLD.
void NumeReHistory::OnMenuEvent | ( | wxCommandEvent & | event | ) |
Event handler for the context menu.
event | wxCommandEvent& |
Definition at line 272 of file history.cpp.
References copyLine(), deleteLine(), ID_COPY_FROM_HISTORY, and ID_DELETE_FROM_HISTORY.
void NumeReHistory::OnMouseCaptureLost | ( | wxMouseCaptureLostEvent & | event | ) |
Ensure that the drag'n drop is handled consistently.
event | wxMouseCaptureLostEvent& |
Definition at line 294 of file history.cpp.
void NumeReHistory::OnMouseDblClk | ( | wxMouseEvent & | event | ) |
Double clicking event handler. Will re-execute the selected line or fold the session, if the user clicked on a header.
event | wxMouseEvent& |
Definition at line 536 of file history.cpp.
References m_terminal, and NumeReTerminal::pass_command().
void NumeReHistory::OnMouseDn | ( | wxMouseEvent & | event | ) |
Select the whole line, if the user clicks on a line.
event | wxMouseEvent& |
Definition at line 562 of file history.cpp.
void NumeReHistory::OnRightClick | ( | wxMouseEvent & | event | ) |
Event handler to display the context menu, if the user clicks right on a line.
event | wxMouseEvent& |
Definition at line 580 of file history.cpp.
References _guilang, Language::get(), ID_COPY_FROM_HISTORY, ID_DELETE_FROM_HISTORY, and m_clickedLine.
void NumeReHistory::saveHistory | ( | ) |
Save the history to the corresponding file.
Definition at line 390 of file history.cpp.
References getLastLine(), NumeReWindow::getProgramFolder(), HISTORYHEADERSTART, m_mainframe, and NumeReEditor::SaveFile().
Referenced by NumeReWindow::OnClose().
void NumeReHistory::UpdateSyntaxHighlighting | ( | bool | forceUpdate = false | ) |
Update the syntax highlighting to represent the selected syntax colors.
forceUpdate | bool |
Definition at line 122 of file history.cpp.
References _syntax, SyntaxStyles::background, SyntaxStyles::bold, Options::CLUSTER, Options::COMMAND, Options::COMMENT, Options::CONSTANT, Options::CUSTOM_FUNCTION, Options::DEFAULT_VARS, SyntaxStyles::defaultbackground, SyntaxStyles::foreground, Options::FUNCTION, NumeReSyntax::getCommands(), NumeReSyntax::getConstants(), NumeReSyntax::getFunctions(), NumeReSyntax::getMethods(), NumeReSyntax::getNPRCCommands(), NumeReSyntax::getOperators(), NumeReSyntax::getOptions(), Settings::getSetting(), NumeReSyntax::getSpecial(), Options::GetSyntaxStyle(), Options::INCLUDES, Options::INSTALL, SyntaxStyles::italics, NumeReEditor::m_options, MARGIN_FOLD, Options::METHODS, Options::NUMBER, Options::OPERATOR, Options::OPTION, Options::PROCEDURE, Options::PROCEDURE_COMMAND, SETTING_S_HISTORYFONT, Options::SPECIALVAL, Options::STANDARD, Options::STRING, Options::STRINGPARSER, SettingsValue::stringval(), Options::toFont(), and SyntaxStyles::underline.
Referenced by NumeReWindow::OnOptions(), and NumeReWindow::refreshFunctionTree().
|
private |
Definition at line 63 of file history.hpp.
Referenced by UpdateSyntaxHighlighting().
|
private |
Definition at line 66 of file history.hpp.
Referenced by copyLine(), deleteLine(), and OnRightClick().
|
private |
Definition at line 65 of file history.hpp.
Referenced by loadHistory(), and saveHistory().
|
private |
Definition at line 64 of file history.hpp.
Referenced by OnMouseDblClk().