NumeRe v1.1.4
NumeRe: Framework für Numerische Rechnungen
NumeReEditor Class Reference

The class of the editor window. More...

#include <editor.h>

Inheritance diagram for NumeReEditor:
Collaboration diagram for NumeReEditor:

Public Types

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 Member Functions

 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...
 

Public Attributes

bool defaultPage
 

Protected Attributes

Optionsm_options
 

Private Types

enum  StyleType {
  STYLE_DEFAULT , STYLE_COMMENT , STYLE_COMMENT_LINE , STYLE_COMMENT_BLOCK ,
  STYLE_COMMENT_SECTION_LINE , STYLE_COMMENT_SECTION_BLOCK , STYLE_COMMAND , STYLE_FUNCTION ,
  STYLE_CUSTOMFUNCTION , STYLE_OPERATOR , STYLE_PROCEDURE , STYLE_IDENTIFIER ,
  STYLE_DATAOBJECT , STYLE_NUMBER , STYLE_STRINGPARSER , STYLE_STRING
}
 

Private Member Functions

void FoldCurrentBlock (int nLine)
 Folds the block, to which the current line belongs. More...
 
void markSections (bool bForceRefresh=false)
 Adds markers to section headlines. More...
 
void markLocalVariables (bool bForceRefresh=false)
 This method wraps the detection of local variables. More...
 
void markLocalVariableOfType (const wxString &command, bool bForceRefresh)
 This method finds all local variables of the selected type and highlights their definitions. More...
 
bool isNoAutoIndentionKey (int keycode)
 This method is a simple helper for AsynchActions to determine, which key should not trigger the autoindention feature. More...
 
void AsynchActions ()
 Performs asynchronous actions and is called automatically. More...
 
void AsynchEvaluations ()
 Performs asynchronous evaluations and is called automatically. More...
 
void updateDefaultHighlightSettings ()
 Performs all general default syntax highlightings. More...
 
void applyStrikeThrough ()
 Applies the strike-through effect. More...
 
bool isStyleType (StyleType _type, int nPos)
 Determine the syntax style type at the selected position. More...
 
int countUmlauts (const std::string &sStr)
 Counts the german umlauts in the current string. More...
 
std::string realignLangString (std::string sLine, size_t &lastpos)
 Re-alignes the passed language string to fit into a call tip. More...
 
std::string addLinebreaks (const std::string &sLine, bool onlyDocumentation=false)
 Adds linebreaks to the call tip language strings. More...
 
void markModified (int nLine)
 Marks the selected line as modified. More...
 
void markSaved ()
 Marks the complete document as saved. More...
 
void OnEditorModified (wxStyledTextEvent &event)
 
void OnStartDrag (wxStyledTextEvent &event)
 Event handler for starting drag 'n drop. More...
 
void OnDragOver (wxStyledTextEvent &event)
 Event handler for stopping drag 'n drop. More...
 
void OnDrop (wxStyledTextEvent &event)
 Event handler for stopping drag 'n drop. (Actually does nothing) More...
 
void OnMouseMotion (wxMouseEvent &event)
 Event handler for moving while performing a drag 'n drop operation. More...
 
int GetLineForMarkerOperation ()
 Gets the line belonging to the last right mouse click or the current line of the caret. More...
 
void ResetRightClickLocation ()
 Invalidates the latest mouse right click position. More...
 
void ReplaceMatches (const std::vector< int > &vMatches, const wxString &sSymbol, const wxString &sNewSymbol)
 Replaces the matches with a new symbol. More...
 
void RenameSymbols (int nPos)
 Asks the user to supply a new name for the symbol at the passed position and replaces all occurences. More...
 
void AbstrahizeSection ()
 Extracts the marked selection into a new procedure. More...
 
void CreateProcedureFromSection (int nStartPos, int nEndPos, const wxString &sInputList, const wxString sOutputList)
 Creates a new procedure from the analysed code section. More...
 
bool IsModifiedInSection (int nSectionStart, int nSectionEnd, const wxString &sToken, const std::vector< int > &vMatch)
 Determines, whether sToken is modified in the section. More...
 
wxString getFunctionArgumentList (int nFunctionStartLine)
 Gets the argument list of a procedure. More...
 
wxString getMatlabReturnList (int nMatlabFunctionStartLine)
 Gets the return list of a MATLAB function. More...
 
wxString getTemplateContent (const wxString &sFileName)
 Returns the contents of a template file. More...
 
bool isValidAutoCompMatch (int nPos, bool findAll, bool searchMethod)
 Ensures that the current position follows all rules to be a valid autocompletion match. More...
 
wxString generateAutoCompList (int wordstartpos, int currpos, std::string sPreDefList)
 Generates an autocompletion list based upon the file's contents. More...
 
bool MarkerOnLine (int linenum, int nMarker)
 Checks, whether the passed marker is set on the passed line. More...
 
void detectCodeDuplicates (int startline, int endline, int nDuplicateFlags, int nNumDuplicatedLines)
 Starts the duplicated code analysis. More...
 
double compareCodeLines (int nLine1, int nLine2, int nDuplicateFlags)
 Performs a semantic code comparsion of the two selected lines. More...
 
std::string getSemanticLine (int nLine, int nDuplicateFlags)
 Returns the selected line as semantic code. More...
 
std::string getSemanticLineNSCR (int nLine, int nDuplicateFlags)
 Returns the selected line as semantic code. More...
 
std::string getSemanticLineMATLAB (int nLine, int nDuplicateFlags)
 Returns the selected line as semantic code. More...
 
std::string getSemanticLineCPP (int nLine, int nDuplicateFlags)
 Returns the selected line as semantic code. More...
 
std::map< int, int > getDifferences (int nStart1, int nEnd1, int nStart2, int nEnd2)
 Returns the actual word-wise differences in the selected lines. More...
 
wxString getNextToken (int &nPos)
 Returns the next syntax token starting from the selected position. More...
 
std::pair< int, int > getCurrentContext (int line)
 Returns the start and end line of the current code context (i.e. the first and the last line of the current procedure). More...
 

Private Attributes

NumeReWindowm_mainFrame
 
ProcedureViewerm_procedureViewer
 
CodeAnalyzerm_analyzer
 
SearchControllerm_search
 
CodeFormatterm_formatter
 
wxFileName m_fileNameAndPath
 
wxFileName m_executableFilename
 
wxString m_simpleFileName
 
wxString m_watchedString
 
wxString m_dblclkString
 
wxDateTime m_filetime
 
wxArrayInt m_breakpoints
 
wxPoint m_lastRightClick
 
wxString m_clickedWord
 
wxString m_clickedProcedure
 
wxString m_clickedInclude
 
size_t m_clickedWordLength
 
wxMenuItem * m_menuAddWatch
 
wxMenuItem * m_menuShowValue
 
wxMenuItem * m_menuFindProcedure
 
wxMenuItem * m_menuHelpOnSelection
 
wxMenuItem * m_menuFindInclude
 
wxMenuItem * m_menuRefactoring
 
NumeReSyntax_syntax
 
NumeReTerminalm_terminal
 
DuplicateCodeDialogm_duplicateCode
 
wxCriticalSection m_editorCS
 
std::vector< std::string > vDuplicateCodeResults
 
std::vector< std::string > vParsedSemanticCode
 
std::vector< wxString > vRenameSymbolsChangeLog
 
std::vector< SyntaxBlockDefinitionvBlockDefs
 
int m_nProcessValue
 
int m_nDuplicateCodeFlag
 
int m_nDuplicateCodeLines
 
int m_nFirstLine
 
int m_nLastLine
 
int m_nLastReleasedKey
 
int m_nCallTipStart
 
std::string m_sCallTipContent
 
bool m_bLoadingFile
 
bool m_bLastSavedRemotely
 
bool m_bHasBeenCompiled
 
bool m_bNewFile
 
bool m_bSetUnsaved
 
bool m_PopUpActive
 
bool m_dragging
 
bool m_modificationHappened
 
bool m_braceIndicatorActive
 
bool m_blockIndicatorActive
 
int m_nEditorSetting
 
FileFilterType m_fileType
 
wxMenu m_popupMenu
 
wxMenu * m_refactoringMenu
 
wxTimer * m_analyzerTimer
 

Friends

class CodeAnalyzer
 
class SearchController
 
class CodeFormatter
 

Detailed Description

The class of the editor window.

Definition at line 52 of file editor.h.

Member Enumeration Documentation

◆ EditorSettings

The possible per-editor settings.

Enumerator
SETTING_WRAPEOL 
SETTING_DISPCTRLCHARS 
SETTING_USETXTADV 
SETTING_USEANALYZER 
SETTING_INDENTONTYPE 
SETTING_USESECTIONS 

Definition at line 67 of file editor.h.

◆ StyleType

Enumerator
STYLE_DEFAULT 
STYLE_COMMENT 
STYLE_COMMENT_LINE 
STYLE_COMMENT_BLOCK 
STYLE_COMMENT_SECTION_LINE 
STYLE_COMMENT_SECTION_BLOCK 
STYLE_COMMAND 
STYLE_FUNCTION 
STYLE_CUSTOMFUNCTION 
STYLE_OPERATOR 
STYLE_PROCEDURE 
STYLE_IDENTIFIER 
STYLE_DATAOBJECT 
STYLE_NUMBER 
STYLE_STRINGPARSER 
STYLE_STRING 

Definition at line 316 of file editor.h.

Constructor & Destructor Documentation

◆ NumeReEditor()

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.

Parameters
mframeNumeReWindow*
optionsOptions*
parentwxWindow*
idwxWindowID
__syntaxNumeReSyntax*
__terminalwxTerm*
posconst wxPoint&
sizeconst wxSize&
stylelong
nameconst wxString&

Definition at line 146 of file editor.cpp.

References _guilang, _syntax, CodeAnalyzer, CodeFormatter, Options::COMMENT, defaultPage, FILE_NOTYPE, SyntaxStyles::foreground, Language::get(), Options::GetCaretBlinkTime(), Options::GetEditorFont(), NumeReSyntax::getFullBlockDefs(), Options::GetSyntaxStyle(), ID_ABSTRAHIZE_SECTION, ID_ANALYZERTIMER, ID_BOOKMARK_ADD, ID_BOOKMARK_CLEAR, ID_BOOKMARK_REMOVE, ID_DEBUG_ADD_BREAKPOINT, ID_DEBUG_CLEAR_ALL_BREAKPOINTS, ID_DEBUG_DISPLAY_SELECTION, ID_DEBUG_REMOVE_BREAKPOINT, ID_FIND_INCLUDE, ID_FIND_PROCEDURE, ID_FIX_TYPE, ID_FOLD_CURRENT_BLOCK, ID_HIDE_SELECTION, ID_LOWERCASE, ID_MENU_COPY, ID_MENU_CUT, ID_MENU_HELP_ON_ITEM, ID_MENU_PASTE, ID_REFACTORING_MENU, ID_RENAME_SYMBOLS, ID_UPPERCASE, m_analyzer, m_analyzerTimer, m_bHasBeenCompiled, m_bLastSavedRemotely, m_bLoadingFile, m_blockIndicatorActive, m_bNewFile, m_braceIndicatorActive, m_bSetUnsaved, m_dblclkString, m_dragging, m_duplicateCode, m_fileNameAndPath, m_fileType, m_formatter, m_lastRightClick, m_mainFrame, m_menuFindInclude, m_menuFindProcedure, m_menuHelpOnSelection, m_menuRefactoring, m_menuShowValue, m_modificationHappened, m_nCallTipStart, m_nDuplicateCodeFlag, m_nDuplicateCodeLines, m_nEditorSetting, m_nFirstLine, m_nLastLine, m_nLastReleasedKey, m_options, m_PopUpActive, m_popupMenu, m_procedureViewer, m_refactoringMenu, m_search, m_terminal, m_watchedString, MARKER_BOOKMARK, MARKER_BREAKPOINT, MARKER_DUPLICATEINDICATOR_ONE, MARKER_DUPLICATEINDICATOR_TWO, MARKER_FOCUSEDLINE, MARKER_HIDDEN, MARKER_HIDDEN_MARGIN, MARKER_MODIFIED, MARKER_SAVED, MARKER_SECTION, OnThreadUpdate(), SearchController, NumeReSyntax::SYNTAX_CLUSTER, NumeReSyntax::SYNTAX_COMMAND, NumeReSyntax::SYNTAX_CONSTANT, NumeReSyntax::SYNTAX_FUNCTION, NumeReSyntax::SYNTAX_METHODS, NumeReSyntax::SYNTAX_OPERATOR, NumeReSyntax::SYNTAX_OPTION, NumeReSyntax::SYNTAX_PROCEDURE, NumeReSyntax::SYNTAX_SPECIALVAL, NumeReSyntax::SYNTAX_STD, NumeReSyntax::SYNTAX_TABLE, UpdateIndicators(), UpdateSyntaxHighlighting(), and vBlockDefs.

Referenced by CreateProcedureFromSection().

Here is the call graph for this function:

◆ ~NumeReEditor()

NumeReEditor::~NumeReEditor ( )

public destructor ~ChameleonEditor Handles the pseudo-reference counting for the editor's project

Returns
void
Author
Mark Erikson
Date
04-22-2004

Definition at line 350 of file editor.cpp.

References m_analyzer, m_formatter, and m_search.

Member Function Documentation

◆ AbstrahizeSection()

void NumeReEditor::AbstrahizeSection ( )
private

Extracts the marked selection into a new procedure.

Returns
void

This member function extracts a selected code section into a new procedure. The interface is created depending upon the used variables inside of the selected block.

Definition at line 5783 of file editor.cpp.

References BlockMatch(), CreateProcedureFromSection(), FILE_MATLAB, FILE_NPRC, FILE_NSCR, SearchController::FindAll(), SearchController::FindCurrentProcedureHead(), getFunctionArgumentList(), getMatlabReturnList(), getNextArgument(), IsModifiedInSection(), isStyleType(), m_fileType, m_search, StripSpaces(), STYLE_DATAOBJECT, STYLE_FUNCTION, STYLE_IDENTIFIER, STYLE_OPERATOR, and STYLE_STRINGPARSER.

Referenced by OnAbstrahizeSection(), and OnAbstrahizeSectionFromMenu().

Here is the call graph for this function:

◆ AddBreakpoint()

void NumeReEditor::AddBreakpoint ( int  linenum)

Adds a breakpoint to the selected line.

Parameters
linenumint
Returns
void

This function checks in advance, whether the selected line is non-empty and not a comment- only line.

Definition at line 7450 of file editor.cpp.

References NumeReTerminal::addBreakpoint(), GetFileNameAndPath(), isStyleType(), m_breakpoints, m_terminal, MARKER_BREAKPOINT, STYLE_COMMENT_BLOCK, STYLE_COMMENT_LINE, STYLE_COMMENT_SECTION_BLOCK, and STYLE_COMMENT_SECTION_LINE.

Referenced by OnAddBreakpoint(), and OnMarginClick().

Here is the call graph for this function:

◆ addLinebreaks()

string NumeReEditor::addLinebreaks ( const std::string &  sLine,
bool  onlyDocumentation = false 
)
private

Adds linebreaks to the call tip language strings.

Parameters
sLineconst string&
onlyDocumentationbool
Returns
string

This member function adds linebreaks at the maximal line length of 100 characters. It is used for the tooltips of functions, commands and procedures

Definition at line 8483 of file editor.cpp.

Referenced by SearchController::CleanDocumentation(), and OnMouseDwell().

◆ AddProcedureDocumentation()

void NumeReEditor::AddProcedureDocumentation ( )

This member function handles the creation of documentation blocks in front of procedure heads.

Returns
void

Definition at line 7529 of file editor.cpp.

References FILE_NPRC, SearchController::FindCurrentProcedureHead(), SearchController::FindMarkedProcedure(), getFileType(), getFunctionArgumentList(), getNextArgument(), m_search, and replaceAll().

Referenced by NumeReWindow::OnMenuEvent().

Here is the call graph for this function:

◆ AdvCallTipCancel()

void NumeReEditor::AdvCallTipCancel ( )

Simply closes the calltip and resets its associated variables.

Returns
void

Definition at line 1282 of file editor.cpp.

References m_nCallTipStart, and m_sCallTipContent.

Referenced by HandleFunctionCallTip(), OnLoseFocus(), OnMouseDwell(), OnRightClick(), and NumeReWindow::PageHasChanged().

◆ AdvCallTipShow()

void NumeReEditor::AdvCallTipShow ( int  pos,
const wxString &  definition 
)

A more advanced calltip display routine.

Parameters
posint
definitionconst wxString&
Returns
void

Only updates the calltip, if the contents are different.

Definition at line 1259 of file editor.cpp.

References m_nCallTipStart, and m_sCallTipContent.

Referenced by HandleFunctionCallTip(), and OnMouseDwell().

◆ AnalyseCode()

void NumeReEditor::AnalyseCode ( )

Wrapper for the static code analyzer.

Returns
void

Definition at line 5443 of file editor.cpp.

References m_analyzer, and CodeAnalyzer::run().

Referenced by NumeReWindow::EvaluateOptions().

Here is the call graph for this function:

◆ ApplyAutoFormat()

void NumeReEditor::ApplyAutoFormat ( int  nFirstLine = 0,
int  nLastLine = -1 
)

Wrapper for CodeFormatter.

Parameters
nFirstLineint
nLastLineint
Returns
void

Definition at line 8579 of file editor.cpp.

References CodeFormatter::FormatCode(), and m_formatter.

Referenced by CreateProcedureFromSection(), and NumeReWindow::OnMenuEvent().

Here is the call graph for this function:

◆ ApplyAutoIndentation()

void NumeReEditor::ApplyAutoIndentation ( int  nFirstLine = 0,
int  nLastLine = -1 
)

Wrapper for CodeFormatter.

Parameters
nFirstLineint
nLastLineint
Returns
void

Definition at line 8230 of file editor.cpp.

References CodeFormatter::IndentCode(), and m_formatter.

Referenced by AsynchActions(), NumeReWindow::OnCreatePackage(), and NumeReWindow::OnMenuEvent().

Here is the call graph for this function:

◆ applyStrikeThrough()

void NumeReEditor::applyStrikeThrough ( )
private

Applies the strike-through effect.

Returns
void

This function is only used inf the advanced text mode of the editor.

Definition at line 4203 of file editor.cpp.

References FILE_DATAFILES, FILE_MATLAB, FILE_NPRC, FILE_NSCR, FILE_TEXSOURCE, FILE_XML, getEditorSetting(), HIGHLIGHT_STRIKETHROUGH, m_fileType, and SETTING_USETXTADV.

Referenced by MakeBraceCheck(), and UpdateSyntaxHighlighting().

Here is the call graph for this function:

◆ AsynchActions()

void NumeReEditor::AsynchActions ( )
private

Performs asynchronous actions and is called automatically.

Returns
void

The asynchronous actions include the following items:

  • Automatic code indentation
  • Display and update of function call tip

Definition at line 5007 of file editor.cpp.

References ApplyAutoIndentation(), FILE_CPP, FILE_MATLAB, FILE_NPRC, FILE_NSCR, getEditorSetting(), HandleFunctionCallTip(), isNoAutoIndentionKey(), isStyleType(), isWrappedLine(), m_fileType, m_nLastReleasedKey, max, SETTING_INDENTONTYPE, and STYLE_COMMENT.

Referenced by OnKeyRel(), and OnMouseUp().

Here is the call graph for this function:

◆ AsynchEvaluations()

void NumeReEditor::AsynchEvaluations ( )
private

Performs asynchronous evaluations and is called automatically.

Returns
void

The asynchronous evaluations include the following items:

  • static code analysis
  • update of sectioning markers

Definition at line 5057 of file editor.cpp.

References getEditorSetting(), m_analyzer, markLocalVariables(), markSections(), CodeAnalyzer::run(), and SETTING_USEANALYZER.

Referenced by OnAnalyzerTimer().

Here is the call graph for this function:

◆ BlockMatch()

vector< int > NumeReEditor::BlockMatch ( int  nPos)

Finds all matching flow control statements.

Parameters
nPosint
Returns
vector<int>

Returnes a vector. If first element is invalid, then the word at the position is no command. If the last one is invalid, then there's no matching partner. It returnes more than two elements for "if" and "switch" blocks. If there's no first "if" and if one currently is focusing on an "else...", the first element may be invalid, but more can be returned.

Definition at line 2994 of file editor.cpp.

References BlockMatchMATLAB(), BlockMatchNSCR(), FILE_MATLAB, FILE_NPRC, FILE_NSCR, and getFileType().

Referenced by AbstrahizeSection(), CodeAnalyzer::analyseCommands(), getCurrentContext(), getMatchingBlock(), and RenameSymbols().

Here is the call graph for this function:

◆ BlockMatchMATLAB()

vector< int > NumeReEditor::BlockMatchMATLAB ( int  nPos)

Finds all matching flow control statements for MATLAB command syntax.

Parameters
nPosint
Returns
vector<int>

See description of BlockMatch

Definition at line 3200 of file editor.cpp.

Referenced by BlockMatch().

◆ BlockMatchNSCR()

vector< int > NumeReEditor::BlockMatchNSCR ( int  nPos)

Finds all matching flow control statements for NumeRe command syntax.

Parameters
nPosint
Returns
vector<int>

See description of BlockMatch

Definition at line 3042 of file editor.cpp.

References getBlockEnd(), getBlockID(), getBlockStart(), hasBlockMiddle(), isBlockEnd(), isBlockMiddle(), isBlockStart(), isOnlyActiveBlock(), and vBlockDefs.

Referenced by BlockMatch().

Here is the call graph for this function:

◆ CallTipStartPos()

int NumeReEditor::CallTipStartPos ( )

Returns the starting position of the currently displayed calltip.

Returns
int

Definition at line 1243 of file editor.cpp.

References m_nCallTipStart.

Referenced by HandleFunctionCallTip().

◆ clearBookmarks()

void NumeReEditor::clearBookmarks ( )

Removes all bookmark markers from the current document.

Returns
void

Definition at line 2409 of file editor.cpp.

References MARKER_BOOKMARK.

Referenced by NumeReWindow::OnMenuEvent().

◆ ClearDblClkIndicator()

void NumeReEditor::ClearDblClkIndicator ( )

Removes the double-click occurence indicators from the document.

Returns
void

Definition at line 7368 of file editor.cpp.

References HIGHLIGHT_DBLCLK, and m_dblclkString.

Referenced by OnChar(), OnKeyDn(), and OnMouseDn().

◆ compareCodeLines()

double NumeReEditor::compareCodeLines ( int  nLine1,
int  nLine2,
int  nDuplicateFlags 
)
private

Performs a semantic code comparsion of the two selected lines.

Parameters
nLine1int
nLine2int
nDuplicateFlagsint
Returns
double

This function performs a semantic code comparison between two code lines. Will return a double representing a matching percentage. This value is constructed out of a semantic match. If the line lengths differ too much, the analysis is omitted.

Definition at line 7751 of file editor.cpp.

References getSemanticLine(), and max.

Referenced by Entry().

Here is the call graph for this function:

◆ countUmlauts()

int NumeReEditor::countUmlauts ( const std::string &  sStr)
private

Counts the german umlauts in the current string.

Parameters
sStrconst string&
Returns
int

Definition at line 8401 of file editor.cpp.

Referenced by CodeAnalyzer::addToAnnotation(), OnMouseDwell(), and SaveFile().

◆ CreateProcedureFromSection()

void NumeReEditor::CreateProcedureFromSection ( int  nStartPos,
int  nEndPos,
const wxString &  sInputList,
const wxString  sOutputList 
)
private

Creates a new procedure from the analysed code section.

Parameters
nStartPosint
nEndPosint
sInputListconst wxString&
sOutputListconst wxString
Returns
void

This member function is used to create a new procedure from the analysed code section (Done in AbstrahizeSection()). The new procedure will be displayed in a new window.

Definition at line 6062 of file editor.cpp.

References _guilang, _syntax, ApplyAutoFormat(), FILE_MATLAB, FILE_NPRC, FILE_NSCR, Language::get(), NumeReWindow::getStandardIcon(), m_fileType, m_mainFrame, m_options, m_terminal, NumeReEditor(), SetFilename(), SETTING_WRAPEOL, ToggleSettings(), and UpdateSyntaxHighlighting().

Referenced by AbstrahizeSection().

Here is the call graph for this function:

◆ detectCodeDuplicates()

void NumeReEditor::detectCodeDuplicates ( int  startline,
int  endline,
int  nDuplicateFlags,
int  nNumDuplicatedLines 
)
private

Starts the duplicated code analysis.

Parameters
startlineint
endlineint
nDuplicateFlagsint
nNumDuplicatedLinesint
Returns
void

This function starts the secondary thread, which will handle the actual analysis, because it is very time and resource consuming and would block the editor otherwise.

Definition at line 7720 of file editor.cpp.

References m_nDuplicateCodeFlag, m_nDuplicateCodeLines, m_nFirstLine, and m_nLastLine.

Referenced by OnFindDuplicateCode().

◆ EnsureLineVisibility()

void NumeReEditor::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.

Parameters
lineint
Returns
void

Definition at line 5367 of file editor.cpp.

References MARKER_HIDDEN, and MARKER_HIDDEN_MARGIN.

Referenced by NumeReWindow::FindString(), and FocusOnLine().

◆ Entry()

wxThread::ExitCode NumeReEditor::Entry ( )
virtual

Main thread loop for the duplicated code analysis.

Returns
wxThread::ExitCode

Definition at line 7604 of file editor.cpp.

References compareCodeLines(), FILE_CPP, getFileType(), m_duplicateCode, m_editorCS, m_nDuplicateCodeFlag, m_nDuplicateCodeLines, m_nFirstLine, m_nLastLine, m_nProcessValue, toString(), vDuplicateCodeResults, and vParsedSemanticCode.

Here is the call graph for this function:

◆ ExtractAsHTML()

wxString NumeReEditor::ExtractAsHTML ( int  nFirstLine = 0,
int  nLastLine = -1 
)

Extracts the selected lines as pre- formatted HTML and returns it.

Parameters
nFirstLineint
nLastLineint
Returns
wxString

Definition at line 8686 of file editor.cpp.

References toString().

Referenced by OnExtractAsHTML(), and OnExtractFormatted().

Here is the call graph for this function:

◆ FindAndOpenInclude()

void NumeReEditor::FindAndOpenInclude ( const wxString &  includename)

Finds the included script and displays it in the editor.

Parameters
includenameconst wxString&
Returns
void

This private member function searches for the included script as a global file and opens it, if it exists.

Definition at line 5601 of file editor.cpp.

References _guilang, FILE_NSCR, fileExists(), Language::get(), m_mainFrame, NumeReWindow::NewFile(), and NumeReWindow::OpenSourceFile().

Referenced by OnFindInclude(), and OnFindIncludeFromMenu().

Here is the call graph for this function:

◆ FindAndOpenProcedure()

void NumeReEditor::FindAndOpenProcedure ( const wxString &  procedurename)

Finds the procedure definition and displays it in the editor.

Parameters
procedurenameconst wxString&
Returns
void

This private member function searches for the procedure definition in the local or a global file (depending on the namespace) opens the procedure and goes to the corresponding position.

Definition at line 5461 of file editor.cpp.

References _guilang, FILE_NPRC, fileExists(), Language::get(), GetFileNameAndPath(), NumeReTerminal::getPathSettings(), getTemplateContent(), GotoPipe(), isStyleType(), m_analyzer, m_mainFrame, m_terminal, name, NumeReWindow::NewFile(), NumeReWindow::OpenSourceFile(), CodeAnalyzer::run(), STYLE_COMMENT_BLOCK, STYLE_COMMENT_LINE, and UpdateSyntaxHighlighting().

Referenced by NumeReWindow::FindAndOpenProcedure(), OnFindProcedure(), OnFindProcedureFromMenu(), and ProcedureViewer::OnItemClick().

Here is the call graph for this function:

◆ fixSymbolName()

void NumeReEditor::fixSymbolName ( int  pos)

Fixes the symbol's type depending on either the declaration point or the first assigned value.

Parameters
posint
Returns
void

Definition at line 2637 of file editor.cpp.

References _guilang, applyCommandHeuristics(), applyFunctionHeuristics(), applyValueHeuristics(), CodeAnalyzer::changeVariableType(), FILE_NPRC, FILE_NSCR, SearchController::FindAll(), Language::get(), getCurrentContext(), isStyleType(), m_fileType, m_search, ReplaceMatches(), STYLE_COMMAND, STYLE_FUNCTION, STYLE_IDENTIFIER, and STYLE_STRING.

Referenced by OnFixTypes().

Here is the call graph for this function:

◆ FocusOnLine()

void NumeReEditor::FocusOnLine ( int  linenumber,
bool  showMarker = true 
)

public FocusOnLine Moves the cursor to the given line number, optionally showing a highlight marker

Parameters
linenumberint The line to go to
showMarkerbool [=true] Whether or not to mark the line
Returns
void
Author
Mark Erikson
Date
04-22-2004

Definition at line 5343 of file editor.cpp.

References EnsureLineVisibility(), Options::GetDebuggerFocusLine(), m_options, and MARKER_FOCUSEDLINE.

Referenced by NumeReWindow::OpenSourceFile().

Here is the call graph for this function:

◆ FoldAll()

void NumeReEditor::FoldAll ( )

Folds all fold markers.

Folds the code completely.

Returns
void

Definition at line 2207 of file editor.cpp.

Referenced by NumeReWindow::OnMenuEvent(), NumeReWindow::OpenSourceFile(), and EditorNotebook::split().

◆ FoldCurrentBlock()

void NumeReEditor::FoldCurrentBlock ( int  nLine)
private

Folds the block, to which the current line belongs.

Parameters
nLineint
Returns
void

Definition at line 4627 of file editor.cpp.

Referenced by OnFoldCurrentBlock().

◆ generateAutoCompList()

wxString NumeReEditor::generateAutoCompList ( int  wordstartpos,
int  currpos,
std::string  sPreDefList 
)
private

Generates an autocompletion list based upon the file's contents.

Parameters
wordstartposint
currposint
sPreDefListstd::string
Returns
wxString

The function combines the passed predefined list of autocompletioon possibities (aka the actual syntax autocompletion list) with possible completion candidates found in the text of the current file.

Definition at line 6426 of file editor.cpp.

References SettingsValue::active(), SearchController::FindAll(), getCurrentContext(), Settings::getSetting(), isStyleType(), isValidAutoCompMatch(), m_options, m_search, SETTING_B_SMARTSENSE, STYLE_COMMENT, STYLE_CUSTOMFUNCTION, STYLE_DATAOBJECT, STYLE_IDENTIFIER, STYLE_STRING, NumeReSyntax::SYNTAX_CLUSTER, NumeReSyntax::SYNTAX_STD, NumeReSyntax::SYNTAX_TABLE, toString(), and toUpperCase().

Referenced by OnChar().

Here is the call graph for this function:

◆ getBlockAutoCompletion()

wxString NumeReEditor::getBlockAutoCompletion ( const wxString &  sWord)

This member function returns a the complete autocompletion block for the passed control flow statement block start.

Parameters
sWordconst wxString&
Returns
wxString

Definition at line 7281 of file editor.cpp.

References FILE_MATLAB, FILE_NPRC, FILE_NSCR, getBlockEnd(), and m_fileType.

Referenced by OnAutoCompletion().

Here is the call graph for this function:

◆ getBlockEnd()

wxString NumeReEditor::getBlockEnd ( const wxString &  sWord)

This member function returns the control flow statement block end, which corresponds to the passed word.

Parameters
sWordconst wxString&
Returns
wxString

Definition at line 7324 of file editor.cpp.

References FILE_MATLAB, isBlockStart(), m_fileType, and vBlockDefs.

Referenced by BlockMatchNSCR(), and getBlockAutoCompletion().

Here is the call graph for this function:

◆ getBlockID()

int NumeReEditor::getBlockID ( const wxString &  word)

This function returns the block ID.

Parameters
wordconst wxString&
Returns
int

Definition at line 7235 of file editor.cpp.

References FILE_MATLAB, FILE_NPRC, FILE_NSCR, isEqualIgnoreWhitespace(), m_fileType, and vBlockDefs.

Referenced by CodeFormatter::ApplyAutoFormatNSCR(), BlockMatchNSCR(), getBlockStart(), hasBlockMiddle(), isBlockEnd(), isBlockMiddle(), isBlockStart(), and OnMouseDwell().

Here is the call graph for this function:

◆ getBlockStart()

wxString NumeReEditor::getBlockStart ( const wxString &  sWord)

This member function returns the control flow statement block start, which corresponds to the passed word.

Parameters
sWordconst wxString&
Returns
wxString

Definition at line 7347 of file editor.cpp.

References FILE_MATLAB, getBlockID(), isEqualIgnoreWhitespace(), m_fileType, and vBlockDefs.

Referenced by BlockMatchNSCR().

Here is the call graph for this function:

◆ getBookmarks()

vector< int > NumeReEditor::getBookmarks ( )

Returns the line positions of the bookmarks.

Returns
vector<int>

This member function returns a vector containing the list of available bookmarks in the current file.

Definition at line 2287 of file editor.cpp.

References MARKER_BOOKMARK, and MarkerOnLine().

Referenced by NumeReWindow::CloseAllFiles().

Here is the call graph for this function:

◆ GetBreakpoints()

wxArrayInt NumeReEditor::GetBreakpoints ( )

public GetBreakpoints Gets a list of all breakpoint line numbers. Also clears out any invalid (removed) breakpoint IDs.

Returns
wxArrayInt The line numbers for all the breakpoints in this file
Author
Mark Erikson
Date
04-22-2004

Definition at line 5287 of file editor.cpp.

References CompareInts(), and m_breakpoints.

Referenced by OnClearBreakpoints(), and OnRightClick().

Here is the call graph for this function:

◆ GetCurrentArgument()

string NumeReEditor::GetCurrentArgument ( const std::string &  sCallTip,
int  nStartingBrace,
int &  nArgStartPos 
)

Finds the current argument below the cursor.

Parameters
sCallTipconst string&
nStartingBraceint
nArgStartPosint&
Returns
string

This member function identifies the current active argument of a function or a procedure, on which the cursor is currently located.

Definition at line 1141 of file editor.cpp.

References getMatchingParenthesis(), getNextArgument(), and isStyleType().

Referenced by HandleFunctionCallTip().

Here is the call graph for this function:

◆ getCurrentContext()

std::pair< int, int > NumeReEditor::getCurrentContext ( int  line)
private

Returns the start and end line of the current code context (i.e. the first and the last line of the current procedure).

Parameters
lineint
Returns
std::pair<int,int>

Definition at line 8199 of file editor.cpp.

References BlockMatch(), FILE_CPP, FILE_MATLAB, FILE_NPRC, and m_fileType.

Referenced by fixSymbolName(), generateAutoCompList(), markLocalVariableOfType(), and markLocalVariables().

Here is the call graph for this function:

◆ GetCurrentFunctionContext()

string NumeReEditor::GetCurrentFunctionContext ( int &  nStartingBrace)

Find the function, whose braces the cursor is currently located in.

Parameters
nStartingBraceint&
Returns
string

Definition at line 1096 of file editor.cpp.

References SearchController::FindMarkedProcedure(), and m_search.

Referenced by HandleFunctionCallTip().

Here is the call graph for this function:

◆ getDifferences()

map< int, int > NumeReEditor::getDifferences ( int  nStart1,
int  nEnd1,
int  nStart2,
int  nEnd2 
)
private

Returns the actual word-wise differences in the selected lines.

Parameters
nStart1int
nEnd1int
nStart2int
nEnd2int
Returns
map<int, int>

This function examines the selected blocks of code linewise and compares every syntax element using getNextToken. If they differ, their positions and lengths are stored in the returned map.

Definition at line 8087 of file editor.cpp.

References getNextToken().

Referenced by IndicateDuplicatedLine().

Here is the call graph for this function:

◆ getEditorSetting()

◆ GetExecutableFileName()

wxFileName NumeReEditor::GetExecutableFileName ( )
inline

Definition at line 151 of file editor.h.

References m_executableFilename.

◆ GetFileName()

◆ GetFileNameAndPath()

◆ GetFilenameString()

wxString NumeReEditor::GetFilenameString ( )

public GetFilenameString Gets the name of this file with no path

Returns
wxString The name of this file
Author
Mark Erikson
Date
04-22-2004

Definition at line 4314 of file editor.cpp.

References m_fileNameAndPath.

Referenced by NumeReWindow::GetPageNum(), NumeReWindow::OnCalculateDependencies(), CodeAnalyzer::run(), and NumeReWindow::SaveCurrentFile().

◆ GetFilePath()

wxString NumeReEditor::GetFilePath ( )

public GetFilePath Gets the path for this file

Returns
wxString The path for this file
Author
Mark Erikson
Date
04-22-2004

Definition at line 4342 of file editor.cpp.

References m_bLastSavedRemotely, and m_fileNameAndPath.

◆ getFileType()

◆ GetFileType()

FileFilterType NumeReEditor::GetFileType ( const wxString &  filename)

Returns the FileFilterType which corresponds to the passed file name.

Parameters
filenameconst wxString&
Returns
FileFilterType

Definition at line 4261 of file editor.cpp.

References FILE_CPP, FILE_DATAFILES, FILE_DIFF, FILE_MATLAB, FILE_NONSOURCE, FILE_NPRC, FILE_NSCR, FILE_TEXSOURCE, and FILE_XML.

Referenced by UpdateSyntaxHighlighting().

◆ getFunctionArgumentList()

wxString NumeReEditor::getFunctionArgumentList ( int  nFunctionStartLine)
private

Gets the argument list of a procedure.

Parameters
nFunctionStartLineint
Returns
wxString

This private member function extracts the argument list from procedures, which is necessary for correct function extraction.

Definition at line 6279 of file editor.cpp.

References FILE_MATLAB, FILE_NPRC, and m_fileType.

Referenced by AbstrahizeSection(), and AddProcedureDocumentation().

◆ GetLineForMarkerOperation()

int NumeReEditor::GetLineForMarkerOperation ( )
private

Gets the line belonging to the last right mouse click or the current line of the caret.

Returns
int

Definition at line 5407 of file editor.cpp.

References m_lastRightClick.

Referenced by OnAddBookmark(), OnAddBreakpoint(), OnRemoveBookmark(), and OnRemoveBreakpoint().

◆ getMatchingBlock()

void NumeReEditor::getMatchingBlock ( int  nPos)

Finds and highlights the matching flow control statements.

Parameters
nPosint
Returns
void

This function searches the matching flow control statement to the one at the selected position and performs the highlighting. If no matching statement or part of it is missing, then the remaining statements are highlighted correspondingly.

Definition at line 2948 of file editor.cpp.

References BlockMatch(), HIGHLIGHT_MATCHING_BLOCK, HIGHLIGHT_NOT_MATCHING_BLOCK, and m_blockIndicatorActive.

Referenced by MakeBlockCheck().

Here is the call graph for this function:

◆ getMatchingBrace()

void NumeReEditor::getMatchingBrace ( int  nPos)

Finds and highlights the matching brace.

Parameters
nPosint
Returns
void

This function searches the matching brace to the one at the selected position and performs the highlighting. If no matching brace is found, the single brace is highlighted correspondingly.

Definition at line 2904 of file editor.cpp.

References HIGHLIGHT_MATCHING_BRACE, and m_braceIndicatorActive.

Referenced by MakeBraceCheck().

◆ getMatlabReturnList()

wxString NumeReEditor::getMatlabReturnList ( int  nMatlabFunctionStartLine)
private

Gets the return list of a MATLAB function.

Parameters
nMatlabFunctionStartLineint
Returns
wxString

This private member function extracts the return list from MATLAB functions, which is necessary for correct function extraction.

Definition at line 6314 of file editor.cpp.

Referenced by AbstrahizeSection().

◆ getNextToken()

wxString NumeReEditor::getNextToken ( int &  nPos)
private

Returns the next syntax token starting from the selected position.

Parameters
nPosint&
Returns
wxString

Definition at line 8149 of file editor.cpp.

Referenced by getDifferences().

◆ getProceduresInFile()

vector< wxString > NumeReEditor::getProceduresInFile ( )

Wrapper for the search controller.

Returns
vector<wxString>

Definition at line 5631 of file editor.cpp.

References SearchController::getProceduresInFile(), and m_search.

Referenced by ProcedureViewer::getProcedureListFromEditor().

Here is the call graph for this function:

◆ getSemanticLine()

string NumeReEditor::getSemanticLine ( int  nLine,
int  nDuplicateFlags 
)
private

Returns the selected line as semantic code.

Parameters
nLineint
nDuplicateFlagsint
Returns
string

If the selected line was already transformed into semantic code, the semantic code is read from a buffer.

Definition at line 7794 of file editor.cpp.

References FILE_CPP, FILE_MATLAB, FILE_NPRC, FILE_NSCR, getFileType(), getSemanticLineCPP(), getSemanticLineMATLAB(), getSemanticLineNSCR(), and vParsedSemanticCode.

Referenced by compareCodeLines().

Here is the call graph for this function:

◆ getSemanticLineCPP()

string NumeReEditor::getSemanticLineCPP ( int  nLine,
int  nDuplicateFlags 
)
private

Returns the selected line as semantic code.

Parameters
nLineint
nDuplicateFlagsint
Returns
string

This function parses C++ code into semantic code and returns it. The degree of transformation is selected using a bit or in nDuplicateFlags:

  • 0 = direct comparison
  • 1 = use var semanticals
  • 2 = use string semanticals
  • 4 = use numeric semanticals

Definition at line 8004 of file editor.cpp.

References isStyleType(), SEMANTICS_NUM, SEMANTICS_STRING, SEMANTICS_VAR, STYLE_COMMENT_BLOCK, STYLE_COMMENT_LINE, and vParsedSemanticCode.

Referenced by getSemanticLine().

Here is the call graph for this function:

◆ getSemanticLineMATLAB()

string NumeReEditor::getSemanticLineMATLAB ( int  nLine,
int  nDuplicateFlags 
)
private

Returns the selected line as semantic code.

Parameters
nLineint
nDuplicateFlagsint
Returns
string

This function parses MATLAB code into semantic code and returns it. The degree of transformation is selected using a bit or in nDuplicateFlags:

  • 0 = direct comparison
  • 1 = use var semanticals
  • 2 = use string semanticals
  • 4 = use numeric semanticals

Definition at line 7921 of file editor.cpp.

References SEMANTICS_NUM, SEMANTICS_STRING, SEMANTICS_VAR, and vParsedSemanticCode.

Referenced by getSemanticLine().

◆ getSemanticLineNSCR()

string NumeReEditor::getSemanticLineNSCR ( int  nLine,
int  nDuplicateFlags 
)
private

Returns the selected line as semantic code.

Parameters
nLineint
nDuplicateFlagsint
Returns
string

This function parses NumeRe code into semantic code and returns it. The degree of transformation is selected using a bit or in nDuplicateFlags:

  • 0 = direct comparison
  • 1 = use var semanticals
  • 2 = use string semanticals
  • 4 = use numeric semanticals

Definition at line 7827 of file editor.cpp.

References isStyleType(), SEMANTICS_FUNCTION, SEMANTICS_NUM, SEMANTICS_STRING, SEMANTICS_VAR, STYLE_COMMENT_BLOCK, STYLE_COMMENT_LINE, and vParsedSemanticCode.

Referenced by getSemanticLine().

Here is the call graph for this function:

◆ getSettings()

int NumeReEditor::getSettings ( )
inline

◆ getTemplateContent()

wxString NumeReEditor::getTemplateContent ( const wxString &  sFileName)
private

Returns the contents of a template file.

Parameters
sFileNameconst wxString&
Returns
wxString

The contents of a template file are written to memory and the place holders are filled with target file name and timestamp.

Definition at line 6353 of file editor.cpp.

References NumeReWindow::GetFileContents(), NumeReTerminal::getKernelSettings(), NumeReWindow::getProgramFolder(), getTimeStamp(), m_mainFrame, m_terminal, and Settings::useCustomLangFiles().

Referenced by FindAndOpenProcedure().

Here is the call graph for this function:

◆ GotoPipe()

void NumeReEditor::GotoPipe ( int  nStartPos = 0)

Jumps to the predefined template caret position.

Parameters
nStartPosint
Returns
void

This member function jumps the caret to the predefined caret position (using a pipe "|") in the template and removes the character at the position

Definition at line 5144 of file editor.cpp.

References FILE_NPRC, FILE_NSCR, SearchController::FindAll(), m_fileType, and m_search.

Referenced by FindAndOpenProcedure(), and NumeReWindow::NewFile().

Here is the call graph for this function:

◆ HandleFunctionCallTip()

void NumeReEditor::HandleFunctionCallTip ( )

This function handles the descriptive function call tip.

Returns
void

The function searches for the corresponding procedure definition or function documentation, formats it correspondingly, searches for the current marked argument and displays the calltip with the current marked argument highlighted. This function is called asynchronously.

Definition at line 985 of file editor.cpp.

References AdvCallTipCancel(), AdvCallTipShow(), CallTipStartPos(), FILE_NPRC, FILE_NSCR, SearchController::FindProcedureDefinition(), GetCurrentArgument(), GetCurrentFunctionContext(), getFileType(), NumeRe::CallTipProvider::getFunction(), NumeRe::CallTipProvider::getMethod(), GenericTerminal::getProvider(), m_search, m_terminal, and NumeRe::CallTip::sDefinition.

Referenced by AsynchActions().

Here is the call graph for this function:

◆ HasBeenSaved()

bool NumeReEditor::HasBeenSaved ( )

public HasBeenSaved Checks if the editor has been saved

Returns
bool Whether or not the editor has been saved
Author
Mark Erikson
Date
04-22-2004

Definition at line 3543 of file editor.cpp.

References m_fileNameAndPath.

Referenced by NumeReWindow::EvaluateTab(), NumeReWindow::OnMenuEvent(), NumeReWindow::OpenSourceFile(), NumeReWindow::SaveAll(), and NumeReWindow::SaveCurrentFile().

◆ hasBlockMiddle()

bool NumeReEditor::hasBlockMiddle ( const wxString &  sWord)

This function returns, whether a block has block middle statements.

Parameters
sWordconst wxString&
Returns
bool

Definition at line 7205 of file editor.cpp.

References FILE_MATLAB, FILE_NPRC, FILE_NSCR, getBlockID(), m_fileType, and vBlockDefs.

Referenced by BlockMatchNSCR().

Here is the call graph for this function:

◆ IndicateDuplicatedLine()

void NumeReEditor::IndicateDuplicatedLine ( int  nStart1,
int  nEnd1,
int  nStart2,
int  nEnd2,
int  nSelectionLine 
)

Highlights differences between two blocks of code.

Parameters
nStart1int
nEnd1int
nStart2int
nEnd2int
nSelectionLineint
Returns
void

This function highlights the differences between two blocks of code including the wordwise differences in the lines.

Definition at line 7050 of file editor.cpp.

References date::abs(), getDifferences(), HIGHLIGHT_DIFFERENCE_SOURCE, HIGHLIGHT_DIFFERENCES, MARKER_DUPLICATEINDICATOR_ONE, and MARKER_DUPLICATEINDICATOR_TWO.

Referenced by DuplicateCodeDialog::highlightSelection(), and DuplicateCodeDialog::OnButtonOK().

Here is the call graph for this function:

◆ InitDuplicateCode()

bool NumeReEditor::InitDuplicateCode ( )

Displays the duplicated code dialog.

Returns
bool

Definition at line 6965 of file editor.cpp.

References _guilang, FILE_CPP, FILE_MATLAB, FILE_NPRC, FILE_NSCR, Language::get(), NumeReWindow::getStandardIcon(), m_duplicateCode, m_fileType, and m_mainFrame.

Referenced by NumeReWindow::OnMenuEvent().

Here is the call graph for this function:

◆ isBlockEnd()

int NumeReEditor::isBlockEnd ( const wxString &  sWord)

This function returns true, if a passed word corresponds to a control flow statement block end.

Parameters
sWordconst wxString&
Returns
int

Definition at line 7152 of file editor.cpp.

References FILE_MATLAB, FILE_NPRC, FILE_NSCR, getBlockID(), isEqualIgnoreWhitespace(), m_fileType, and vBlockDefs.

Referenced by CodeAnalyzer::analyseCommands(), CodeFormatter::ApplyAutoFormatNSCR(), BlockMatchNSCR(), CodeFormatter::determineIndentationLevelMATLAB(), CodeFormatter::determineIndentationLevelNSCR(), and MakeBlockCheck().

Here is the call graph for this function:

◆ isBlockMiddle()

int NumeReEditor::isBlockMiddle ( const wxString &  sWord)

This function returns, whether a word matches to a block middle statement (e.g. elseif).

Parameters
sWordconst wxString&
Returns
int

Definition at line 7180 of file editor.cpp.

References FILE_MATLAB, FILE_NPRC, FILE_NSCR, getBlockID(), isEqualIgnoreWhitespace(), m_fileType, and vBlockDefs.

Referenced by BlockMatchNSCR(), CodeFormatter::determineIndentationLevelMATLAB(), and CodeFormatter::determineIndentationLevelNSCR().

Here is the call graph for this function:

◆ isBlockStart()

int NumeReEditor::isBlockStart ( const wxString &  sWord,
bool  allowIntermediate = false 
)

This function returns true, if a passed word corresponds to a control flow statement block start.

Parameters
sWordconst wxString&
allowIntermediatebool
Returns
int

Definition at line 7109 of file editor.cpp.

References FILE_MATLAB, FILE_NPRC, FILE_NSCR, getBlockID(), isEqualIgnoreWhitespace(), m_fileType, and vBlockDefs.

Referenced by CodeAnalyzer::analyseCommands(), CodeFormatter::ApplyAutoFormatNSCR(), BlockMatchNSCR(), CodeFormatter::determineIndentationLevelMATLAB(), CodeFormatter::determineIndentationLevelNSCR(), getBlockEnd(), MakeBlockCheck(), and OnAutoCompletion().

Here is the call graph for this function:

◆ isCodeFile()

bool NumeReEditor::isCodeFile ( )
inline

Definition at line 301 of file editor.h.

References FILE_CPP, FILE_MATLAB, FILE_NPRC, FILE_NSCR, and m_fileType.

Referenced by OnRightClick().

◆ IsModifiedInSection()

bool NumeReEditor::IsModifiedInSection ( int  nSectionStart,
int  nSectionEnd,
const wxString &  sToken,
const std::vector< int > &  vMatch 
)
private

Determines, whether sToken is modified in the section.

Parameters
nSectionStartint
nSectionEndint
sTokenconst wxString&
vMatchconst vector<int>&
Returns
bool

This member function determines, whether a string token, which corresponds to a variable, is semantically modified in the code section (i.e. overwritten). This is used for variables, which are both input and possible output.

Definition at line 6178 of file editor.cpp.

References isStyleType(), STYLE_FUNCTION, STYLE_IDENTIFIER, and STYLE_OPERATOR.

Referenced by AbstrahizeSection().

Here is the call graph for this function:

◆ isNoAutoIndentionKey()

bool NumeReEditor::isNoAutoIndentionKey ( int  keycode)
private

This method is a simple helper for AsynchActions to determine, which key should not trigger the autoindention feature.

Parameters
keycodeint
Returns
bool

Definition at line 4952 of file editor.cpp.

Referenced by AsynchActions().

◆ isNumeReFileType()

bool NumeReEditor::isNumeReFileType ( )
inline

Definition at line 297 of file editor.h.

References FILE_NPRC, FILE_NSCR, and m_fileType.

Referenced by OnFindIncludeFromMenu(), OnFindProcedureFromMenu(), and OnRightClick().

◆ isStyleType()

bool NumeReEditor::isStyleType ( StyleType  _type,
int  nPos 
)
private

Determine the syntax style type at the selected position.

Parameters
_typeStyleType
nPosint
Returns
bool

This member function summarizes determining, which style type the selected character is using abstracting out the selection of the correct styling language.

Definition at line 8249 of file editor.cpp.

References FILE_CPP, FILE_MATLAB, FILE_NPRC, FILE_NSCR, getFileType(), STYLE_COMMAND, STYLE_COMMENT, STYLE_COMMENT_BLOCK, STYLE_COMMENT_LINE, STYLE_COMMENT_SECTION_BLOCK, STYLE_COMMENT_SECTION_LINE, STYLE_CUSTOMFUNCTION, STYLE_DATAOBJECT, STYLE_DEFAULT, STYLE_FUNCTION, STYLE_IDENTIFIER, STYLE_NUMBER, STYLE_OPERATOR, STYLE_PROCEDURE, STYLE_STRING, and STYLE_STRINGPARSER.

Referenced by AbstrahizeSection(), AddBreakpoint(), CodeAnalyzer::analyseFunctions(), CodeAnalyzer::analyseIdentifiers(), CodeAnalyzer::analyseNumbers(), CodeAnalyzer::analyseProcedures(), CodeFormatter::ApplyAutoFormatCPP(), CodeFormatter::ApplyAutoFormatNSCR(), AsynchActions(), CodeAnalyzer::calculateCyclomaticComplexity(), CodeAnalyzer::calculateLinesOfCode(), CodeAnalyzer::countNumberOfComments(), SearchController::FindAll(), FindAndOpenProcedure(), SearchController::FindProcedureDefinitionInLocalFile(), SearchController::FindProceduresInCurrentFile(), fixSymbolName(), generateAutoCompList(), GetCurrentArgument(), getSemanticLineCPP(), getSemanticLineNSCR(), CodeFormatter::IndentCode(), IsModifiedInSection(), isValidAutoCompMatch(), MakeBlockCheck(), markSections(), OnChar(), OnKeyDn(), OnRenameSymbolsFromMenu(), OnRightClick(), RenameSymbols(), and CodeAnalyzer::run().

Here is the call graph for this function:

◆ isValidAutoCompMatch()

bool NumeReEditor::isValidAutoCompMatch ( int  nPos,
bool  findAll,
bool  searchMethod 
)
private

Ensures that the current position follows all rules to be a valid autocompletion match.

Parameters
nPosint
findAllbool
searchMethodbool
Returns
bool

Definition at line 6389 of file editor.cpp.

References isStyleType(), STYLE_COMMENT, and STYLE_STRING.

Referenced by generateAutoCompList().

Here is the call graph for this function:

◆ isWrappedLine()

bool NumeReEditor::isWrappedLine ( int  line)

This member function checks, whether a line has been syntactically wrapped around.

Parameters
lineint
Returns
bool

Definition at line 4979 of file editor.cpp.

References FILE_MATLAB, FILE_NPRC, FILE_NSCR, and m_fileType.

Referenced by AsynchActions().

◆ JumpToBookmark()

void NumeReEditor::JumpToBookmark ( bool  down = true)

Jumps the cursor to the next bookmark in the current file.

Jumps the cursor to the next bookmark.

Parameters
downbool direction to jump
Returns
void
Parameters
downbool
Returns
void

This function uses bookmark markers and section markers as targets for its jumps.

Definition at line 2242 of file editor.cpp.

References MARKER_BOOKMARK, MARKER_SECTION, and MarkerOnLine().

Referenced by NumeReWindow::OnMenuEvent().

Here is the call graph for this function:

◆ LastSavedRemotely()

bool NumeReEditor::LastSavedRemotely ( )
inline

Definition at line 161 of file editor.h.

References m_bLastSavedRemotely.

◆ LoadFileText()

bool NumeReEditor::LoadFileText ( wxString  fileContents)

public LoadFileText Loads a file from the given string

Parameters
fileContentswxString The text of the file
Returns
bool Whether or not the load succeeded
Remarks
This isn't actually used right now... probably ought to be cleaned up
Author
Mark Erikson
Date
04-22-2004

Definition at line 576 of file editor.cpp.

References defaultPage, getEditorSetting(), m_bLoadingFile, m_bSetUnsaved, SETTING_USETXTADV, ToggleSettings(), and UpdateSyntaxHighlighting().

Referenced by NumeReWindow::DefaultPage(), NumeReWindow::OpenSourceFile(), and NumeReWindow::reloadFileIfOpen().

Here is the call graph for this function:

◆ LoadLocalFile()

bool NumeReEditor::LoadLocalFile ( const wxString &  filename)

◆ MakeBlockCheck()

void NumeReEditor::MakeBlockCheck ( )

Checks for corresponding flow control statements.

Returns
void

This function checks for corresponding flow control statements and handles the indicators correspondingly.

Definition at line 942 of file editor.cpp.

References FILE_MATLAB, FILE_NPRC, FILE_NSCR, getMatchingBlock(), HIGHLIGHT_MATCHING_BLOCK, HIGHLIGHT_NOT_MATCHING_BLOCK, isBlockEnd(), isBlockStart(), isStyleType(), m_blockIndicatorActive, m_fileType, and STYLE_COMMAND.

Referenced by OnKeyDn(), OnKeyRel(), OnMouseDn(), and OnMouseUp().

Here is the call graph for this function:

◆ MakeBraceCheck()

void NumeReEditor::MakeBraceCheck ( )

Checks for corresponding braces.

Returns
void

This function checks for corresponding braces and handles the indicators correspondingly.

Definition at line 897 of file editor.cpp.

References applyStrikeThrough(), getMatchingBrace(), HIGHLIGHT_MATCHING_BRACE, and m_braceIndicatorActive.

Referenced by OnKeyDn(), OnKeyRel(), OnMouseDn(), and OnMouseUp().

Here is the call graph for this function:

◆ MarkerOnLine()

bool NumeReEditor::MarkerOnLine ( int  linenum,
int  nMarker 
)
private

Checks, whether the passed marker is set on the passed line.

Parameters
linenumint
nMarkerint
Returns
bool

Definition at line 7590 of file editor.cpp.

Referenced by getBookmarks(), JumpToBookmark(), markSections(), OnMarginClick(), OnRightClick(), and toggleBookmark().

◆ markLocalVariableOfType()

void NumeReEditor::markLocalVariableOfType ( const wxString &  command,
bool  bForceRefresh 
)
private

This method finds all local variables of the selected type and highlights their definitions.

Parameters
commandconst wxString&
bForceRefreshbool
Returns
void

If the refresh flag is not set, then the alogrithm will only update the current edited line of the editor.

Definition at line 4833 of file editor.cpp.

References SearchController::FindAll(), getCurrentContext(), and m_search.

Referenced by markLocalVariables().

Here is the call graph for this function:

◆ markLocalVariables()

void NumeReEditor::markLocalVariables ( bool  bForceRefresh = false)
private

This method wraps the detection of local variables.

Parameters
bForceRefreshbool
Returns
void

Definition at line 4797 of file editor.cpp.

References FILE_NPRC, getCurrentContext(), Options::GetHighlightLocalVariables(), HIGHLIGHT_LOCALVARIABLES, m_fileType, m_options, and markLocalVariableOfType().

Referenced by AsynchEvaluations(), and UpdateSyntaxHighlighting().

Here is the call graph for this function:

◆ markModified()

void NumeReEditor::markModified ( int  nLine)
private

Marks the selected line as modified.

Parameters
nLineint
Returns
void

The modified bar on the left margin will be shown in yellow.

Definition at line 4546 of file editor.cpp.

References MARKER_MODIFIED, and MARKER_SAVED.

Referenced by OnChar(), and OnEditorModified().

◆ markSaved()

void NumeReEditor::markSaved ( )
private

Marks the complete document as saved.

Returns
void

The modified bar on the left margin will be shown on green, where it had been shown in yellow before.

Definition at line 4568 of file editor.cpp.

References MARKER_MODIFIED, and MARKER_SAVED.

Referenced by OnSavePointReached(), and SaveFile().

◆ markSections()

void NumeReEditor::markSections ( bool  bForceRefresh = false)
private

Adds markers to section headlines.

Parameters
bForceRefreshbool true to clear every marker first
Returns
void

Adds markers on the sidebar at the headline of every section of NumeRe, MATLAB, LaTeX and text files with advanced text highlighting active. The markers are used as automatic bookmarks, so the user may jump to the markers using the same short key.

Definition at line 4663 of file editor.cpp.

References FILE_MATLAB, FILE_NONSOURCE, FILE_NPRC, FILE_NSCR, FILE_TEXSOURCE, getEditorSetting(), isStyleType(), m_fileType, MARKER_SECTION, MarkerOnLine(), SETTING_USESECTIONS, SETTING_USETXTADV, STYLE_COMMENT_SECTION_BLOCK, and STYLE_COMMENT_SECTION_LINE.

Referenced by AsynchEvaluations(), and ToggleSettings().

Here is the call graph for this function:

◆ Modified()

bool NumeReEditor::Modified ( )

Returns whether the current file was modified after the last time saved.

Returns
bool

public Modified Checks whether or not the editor has been modified

Returns
bool Whether or not the editor has been modified
Author
Mark Erikson
Date
04-22-2004

Definition at line 634 of file editor.cpp.

References m_bSetUnsaved.

Referenced by NumeReWindow::CloseAllFiles(), NumeReWindow::EvaluateTab(), NumeReWindow::HandleModifiedFile(), NumeReWindow::OnClose(), NumeReWindow::OnMenuEvent(), NumeReWindow::OnUpdateSaveUI(), NumeReWindow::OpenSourceFile(), NumeReWindow::SaveAll(), SaveFile(), and NumeReWindow::UpdateLocationIfOpen().

◆ MoveSelection()

void NumeReEditor::MoveSelection ( bool  down = true)
inline

Definition at line 251 of file editor.h.

Referenced by NumeReWindow::OnMenuEvent().

◆ notifyDialogClose()

void NumeReEditor::notifyDialogClose ( )

Notifies the editor that the duplicated code dialog had been closed.

Returns
void

The notification is done by setting the corresponding pointer to al nullptr.

Definition at line 2786 of file editor.cpp.

References m_duplicateCode.

Referenced by DuplicateCodeDialog::OnClose().

◆ OnAbstrahizeSection()

void NumeReEditor::OnAbstrahizeSection ( wxCommandEvent &  event)

Private event handler for extracting the selected section.

Parameters
eventwxCommandEvent&
Returns
void

Definition at line 6820 of file editor.cpp.

References AbstrahizeSection().

Here is the call graph for this function:

◆ OnAbstrahizeSectionFromMenu()

void NumeReEditor::OnAbstrahizeSectionFromMenu ( )

Global event handler for extracting the selected section.

Returns
void

Definition at line 6833 of file editor.cpp.

References AbstrahizeSection().

Referenced by NumeReWindow::OnMenuEvent().

Here is the call graph for this function:

◆ OnAddBookmark()

void NumeReEditor::OnAddBookmark ( wxCommandEvent &  event)

Adds a bookmark at the selected line.

Parameters
eventwxCommandEvent&
Returns
void

Definition at line 5243 of file editor.cpp.

References GetLineForMarkerOperation(), MARKER_BOOKMARK, and ResetRightClickLocation().

Here is the call graph for this function:

◆ OnAddBreakpoint()

void NumeReEditor::OnAddBreakpoint ( wxCommandEvent &  event)

private OnAddBreakpoint Adds a breakpoint to this file

Parameters
eventwxCommandEvent & The generated menu event
Returns
void
Author
Mark Erikson
Date
04-22-2004

Definition at line 5179 of file editor.cpp.

References AddBreakpoint(), GetLineForMarkerOperation(), and ResetRightClickLocation().

Referenced by NumeReWindow::OnMenuEvent().

Here is the call graph for this function:

◆ OnAnalyzerTimer()

void NumeReEditor::OnAnalyzerTimer ( wxTimerEvent &  event)

This event handler fires, once the analyzer timer is finished and calls the time consuming analysis tasks.

Parameters
eventwxTimerEvent&
Returns
void

Definition at line 1845 of file editor.cpp.

References AsynchEvaluations().

Here is the call graph for this function:

◆ OnAutoCompletion()

void NumeReEditor::OnAutoCompletion ( wxStyledTextEvent &  event)

This event handler fires, if the user selects an entry in the autocompletion list or if he presses e.g. TAB.

Parameters
eventwxStyledTextEvent&
Returns
void

Definition at line 1896 of file editor.cpp.

References SettingsValue::active(), getBlockAutoCompletion(), Settings::getSetting(), isBlockStart(), m_options, SETTING_B_BLOCKAUTOCOMP, and SETTING_B_BRACEAUTOCOMP.

Here is the call graph for this function:

◆ OnChangeCase()

void NumeReEditor::OnChangeCase ( wxCommandEvent &  event)

Changes the letters in the selection.

Parameters
eventwxCommandEvent& Using GetId method to determine upper or lowercase
Returns
void

Definition at line 6702 of file editor.cpp.

References ID_UPPERCASE, toLowerCase(), and toUpperCase().

Here is the call graph for this function:

◆ OnChar()

void NumeReEditor::OnChar ( wxStyledTextEvent &  event)

◆ OnClearBookmarks()

void NumeReEditor::OnClearBookmarks ( wxCommandEvent &  event)

Removes all bookmarks from the whole file.

Parameters
eventwxCommandEvent&
Returns
void

Definition at line 5273 of file editor.cpp.

References MARKER_BOOKMARK.

◆ OnClearBreakpoints()

void NumeReEditor::OnClearBreakpoints ( wxCommandEvent &  event)

private OnClearBreakpoints Clears all breakpoints from this file

Parameters
eventwxCommandEvent & The generated menu event
Returns
void
Author
Mark Erikson
Date
04-22-2004

Definition at line 5219 of file editor.cpp.

References NumeReTerminal::clearBreakpoints(), GetBreakpoints(), GetFileNameAndPath(), m_breakpoints, m_terminal, and ResetRightClickLocation().

Referenced by NumeReWindow::OnMenuEvent().

Here is the call graph for this function:

◆ OnDisplayVariable()

void NumeReEditor::OnDisplayVariable ( wxCommandEvent &  event)

Highlights all word occurences permanently.

Parameters
eventwxCommandEvent&
Returns
void

This member function highlights the clicked word permanently or removes the highlighting, if the word was already selected

Definition at line 6571 of file editor.cpp.

References HIGHLIGHT, m_clickedWord, m_clickedWordLength, and m_watchedString.

◆ OnDragOver()

void NumeReEditor::OnDragOver ( wxStyledTextEvent &  event)
private

Event handler for stopping drag 'n drop.

Parameters
eventwxStyledTextEvent&
Returns
void

Definition at line 5095 of file editor.cpp.

◆ OnDrop()

void NumeReEditor::OnDrop ( wxStyledTextEvent &  event)
private

Event handler for stopping drag 'n drop. (Actually does nothing)

Parameters
eventwxStyledTextEvent&
Returns
void

Definition at line 5110 of file editor.cpp.

◆ OnEditorModified()

void NumeReEditor::OnEditorModified ( wxStyledTextEvent &  event)
private

private OnEditorModified Updates the editor's project when the editor is modified

Parameters
eventwxStyledTextEvent & The generated editor event
Returns
void
Author
Mark Erikson
Date
04-22-2004

Definition at line 4596 of file editor.cpp.

References m_bLoadingFile, m_modificationHappened, and markModified().

Here is the call graph for this function:

◆ OnEnter()

void NumeReEditor::OnEnter ( wxMouseEvent &  event)

Called, when the mouse enters the editor window.

Parameters
eventwxMouseEvent&
Returns
void

Focuses the editor, so that the user can start typing directly.

Definition at line 1612 of file editor.cpp.

References g_findReplace.

◆ OnExtractAsHTML()

void NumeReEditor::OnExtractAsHTML ( )

On MenuEvent handler for the extract as HTML functionality of the editor.

Returns
void

Definition at line 6897 of file editor.cpp.

References ExtractAsHTML().

Referenced by NumeReWindow::OnMenuEvent().

Here is the call graph for this function:

◆ OnExtractFormatted()

void NumeReEditor::OnExtractFormatted ( )

On MenuEvent handler for the extract as formatted text functionality of the editor.

Returns
void

Definition at line 6929 of file editor.cpp.

References ExtractAsHTML().

Referenced by NumeReWindow::OnMenuEvent().

Here is the call graph for this function:

◆ OnFindDuplicateCode()

void NumeReEditor::OnFindDuplicateCode ( int  nDuplicateFlag = 1,
int  nNumDuplicatedLines = 6 
)

Wrapper for detectCodeDuplicates.

Parameters
nDuplicateFlagint
nNumDuplicatedLinesint
Returns
void

Definition at line 6989 of file editor.cpp.

References detectCodeDuplicates().

Referenced by DuplicateCodeDialog::OnStart().

Here is the call graph for this function:

◆ OnFindInclude()

void NumeReEditor::OnFindInclude ( wxCommandEvent &  event)

Private event handler function for finding the included script.

Parameters
eventwxCommandEvent&
Returns
void

Definition at line 6668 of file editor.cpp.

References FindAndOpenInclude(), and m_clickedInclude.

Here is the call graph for this function:

◆ OnFindIncludeFromMenu()

void NumeReEditor::OnFindIncludeFromMenu ( )

Global event handler function for finding the included script.

Returns
void

Definition at line 6684 of file editor.cpp.

References FindAndOpenInclude(), SearchController::FindMarkedInclude(), isNumeReFileType(), m_clickedInclude, and m_search.

Referenced by NumeReWindow::OnMenuEvent().

Here is the call graph for this function:

◆ OnFindProcedure()

void NumeReEditor::OnFindProcedure ( wxCommandEvent &  event)

Private event handler function for finding the procedure definition.

Parameters
eventwxCommandEvent&
Returns
void

Definition at line 6634 of file editor.cpp.

References FindAndOpenProcedure(), and m_clickedProcedure.

Here is the call graph for this function:

◆ OnFindProcedureFromMenu()

void NumeReEditor::OnFindProcedureFromMenu ( )

Global event handler function for finding the procedure definition.

Returns
void

Definition at line 6650 of file editor.cpp.

References FindAndOpenProcedure(), SearchController::FindMarkedProcedure(), isNumeReFileType(), m_clickedProcedure, and m_search.

Referenced by NumeReWindow::OnMenuEvent().

Here is the call graph for this function:

◆ OnFixTypes()

void NumeReEditor::OnFixTypes ( wxCommandEvent &  event)

Event wrapper for fixSymbolName.

Parameters
eventwxCommandEvent&
Returns
void

Definition at line 6806 of file editor.cpp.

References fixSymbolName(), and m_lastRightClick.

Here is the call graph for this function:

◆ OnFoldCurrentBlock()

void NumeReEditor::OnFoldCurrentBlock ( wxCommandEvent &  event)

Event wrapper for FoldCurrentBlock.

Parameters
eventwxCommandEvent&
Returns
void

Definition at line 6726 of file editor.cpp.

References FoldCurrentBlock(), and m_lastRightClick.

Here is the call graph for this function:

◆ OnHelpOnSelection()

void NumeReEditor::OnHelpOnSelection ( wxCommandEvent &  event)

Triggers the main frame to show the documentation viewer concerning the selected command.

Parameters
eventwxCommandEvent&
Returns
void

Definition at line 6620 of file editor.cpp.

References m_clickedWord, m_mainFrame, and NumeReWindow::ShowHelp().

Here is the call graph for this function:

◆ OnHideSelection()

void NumeReEditor::OnHideSelection ( wxCommandEvent &  event)

Private event handling function for hiding the selection.

Parameters
eventwxCommandEvent&
Returns
void

Definition at line 6740 of file editor.cpp.

References MARKER_HIDDEN, and MARKER_HIDDEN_MARGIN.

◆ OnIdle()

void NumeReEditor::OnIdle ( wxIdleEvent &  event)

Called, when the editor idles, i.e. the user is not using it.

Parameters
eventwxIdleEvent&
Returns
void

Fires the analyzer timer, which will run for 750 msec and then fire another event. If the timer is started again in between, it is reset without firing the timer event.

Definition at line 1826 of file editor.cpp.

References m_analyzerTimer, and m_modificationHappened.

◆ OnKeyDn()

void NumeReEditor::OnKeyDn ( wxKeyEvent &  event)

Checks key input events, before they are typed into the editor.

Parameters
eventwxKeyEvent&
Returns
void

This member function checks the key input events before(!) they are typed into the editor. We catch here parentheses and quotation marks in the case that we have

  • either a selection (we then surround the selection)
  • or a already matching partner of the parenthesis (we then jump over the matching partner)

Definition at line 1305 of file editor.cpp.

References ClearDblClkIndicator(), Settings::isEnabled(), isStyleType(), m_options, MakeBlockCheck(), MakeBraceCheck(), SETTING_B_HOMEENDCANCELS, and STYLE_STRING.

Here is the call graph for this function:

◆ OnKeyRel()

void NumeReEditor::OnKeyRel ( wxKeyEvent &  event)

Called, when the user releases a key.

Parameters
eventwxKeyEvent&
Returns
void

Performs highlighting and asynchronous actions, which are time-consuming tasks.

Definition at line 1473 of file editor.cpp.

References AsynchActions(), m_nLastReleasedKey, MakeBlockCheck(), and MakeBraceCheck().

Here is the call graph for this function:

◆ OnLeave()

void NumeReEditor::OnLeave ( wxMouseEvent &  event)

Called, when the mouse leaves the editor window.

Parameters
eventwxMouseEvent&
Returns
void

Cancels all open call tips, if there are any.

Definition at line 1633 of file editor.cpp.

◆ OnLoseFocus()

void NumeReEditor::OnLoseFocus ( wxFocusEvent &  event)

Called, when the editor loses focus.

Parameters
eventwxFocusEvent&
Returns
void

Cancels all open call tips, if there are any.

Definition at line 1650 of file editor.cpp.

References AdvCallTipCancel().

Here is the call graph for this function:

◆ OnMarginClick()

void NumeReEditor::OnMarginClick ( wxStyledTextEvent &  event)

Event handler called when clicking on the editor margin.

Parameters
eventwxStyledTextEvent&
Returns
void

This event handler function toggles the folding, if one clicks on the fold margin, and handles the breakpoints or the hidden lines markers.

Definition at line 7392 of file editor.cpp.

References AddBreakpoint(), FILE_NPRC, FILE_NSCR, m_fileType, MARGIN_FOLD, MARKER_BREAKPOINT, MARKER_HIDDEN, MARKER_HIDDEN_MARGIN, MarkerOnLine(), and RemoveBreakpoint().

Here is the call graph for this function:

◆ OnMenuEvent()

void NumeReEditor::OnMenuEvent ( wxCommandEvent &  event)

OnMenu event handler.

Parameters
eventwxCommandEvent&
Returns
void

Definition at line 6847 of file editor.cpp.

References ID_MENU_COPY, ID_MENU_CUT, and ID_MENU_PASTE.

◆ OnMouseCaptureLost()

void NumeReEditor::OnMouseCaptureLost ( wxMouseCaptureLostEvent &  event)

Called, when the mouse leaves the editor screen, but the user keeps the mouse pressed.

Parameters
eventwxMouseCaptureLostEvent&
Returns
void

The capturing of the mouse is ended and the editor window is refreshed

Definition at line 1593 of file editor.cpp.

◆ OnMouseDblClk()

void NumeReEditor::OnMouseDblClk ( wxMouseEvent &  event)

Called, when the user double clicks.

Parameters
eventwxMouseEvent&
Returns
void

Searches automatically for all occurences of a string in the document and highlightes them

Definition at line 1535 of file editor.cpp.

References HIGHLIGHT_DBLCLK, m_dblclkString, and selection().

Here is the call graph for this function:

◆ OnMouseDn()

void NumeReEditor::OnMouseDn ( wxMouseEvent &  event)

Called, when the user presses the left mouse key.

Parameters
eventwxMouseEvent&
Returns
void

Performs highlighting and removes the double- click indicator.

Definition at line 1515 of file editor.cpp.

References ClearDblClkIndicator(), MakeBlockCheck(), and MakeBraceCheck().

Here is the call graph for this function:

◆ OnMouseDwell()

◆ OnMouseMotion()

void NumeReEditor::OnMouseMotion ( wxMouseEvent &  event)
private

Event handler for moving while performing a drag 'n drop operation.

Parameters
eventwxStyledTextEvent&
Returns
void

Definition at line 5124 of file editor.cpp.

References m_dragging.

◆ OnMouseUp()

void NumeReEditor::OnMouseUp ( wxMouseEvent &  event)

Called, when the user releases the mouse key.

Parameters
eventwxMouseEvent&
Returns
void

Performs highlighting and asynchronous actions, which are time-consuming tasks.

Definition at line 1495 of file editor.cpp.

References AsynchActions(), m_nLastReleasedKey, MakeBlockCheck(), and MakeBraceCheck().

Here is the call graph for this function:

◆ OnRemoveBookmark()

void NumeReEditor::OnRemoveBookmark ( wxCommandEvent &  event)

Removes a bookmark from the selected line.

Parameters
eventwxCommandEvent&
Returns
void

Definition at line 5258 of file editor.cpp.

References GetLineForMarkerOperation(), and MARKER_BOOKMARK.

Here is the call graph for this function:

◆ OnRemoveBreakpoint()

void NumeReEditor::OnRemoveBreakpoint ( wxCommandEvent &  event)

private OnRemoveBreakpoint Removes a breakpoint from this file

Parameters
eventwxCommandEvent & The generated menu event
Returns
void
Remarks
This doesn't clean out the marker handle that STC gives us,
since there's no way to check what marker handles are on a given line.
Orphaned marker handles are cleaned up in GetBreakpoints.
Author
Mark Erikson
Date
04-22-2004

Definition at line 5201 of file editor.cpp.

References GetLineForMarkerOperation(), RemoveBreakpoint(), and ResetRightClickLocation().

Referenced by NumeReWindow::OnMenuEvent().

Here is the call graph for this function:

◆ OnRenameSymbols()

void NumeReEditor::OnRenameSymbols ( wxCommandEvent &  event)

Event wrapper for RenameSymbols.

Parameters
eventwxCommandEvent&
Returns
void

Definition at line 6778 of file editor.cpp.

References m_lastRightClick, and RenameSymbols().

Here is the call graph for this function:

◆ OnRenameSymbolsFromMenu()

void NumeReEditor::OnRenameSymbolsFromMenu ( )

Global wrapper for RenameSymbols.

Returns
void

Definition at line 6790 of file editor.cpp.

References isStyleType(), RenameSymbols(), STYLE_DATAOBJECT, STYLE_DEFAULT, STYLE_FUNCTION, and STYLE_IDENTIFIER.

Referenced by NumeReWindow::OnMenuEvent().

Here is the call graph for this function:

◆ OnRightClick()

◆ OnSavePointLeft()

void NumeReEditor::OnSavePointLeft ( wxStyledTextEvent &  event)

Called, when the editor leaves the latest save point.

Parameters
eventwxStyledTextEvent&
Returns
void

The save point is left by undo and redo actions and actual modifications. The editor will be marked as containing unsaved parts.

Definition at line 1881 of file editor.cpp.

References SetUnsaved().

Here is the call graph for this function:

◆ OnSavePointReached()

void NumeReEditor::OnSavePointReached ( wxStyledTextEvent &  event)

Called, when the editor reaches the latest save point.

Parameters
eventwxStyledTextEvent&
Returns
void

The save point is reached by using undo and redo actions. The editor will mark all remaining modifications as saved.

Definition at line 1862 of file editor.cpp.

References m_bSetUnsaved, and markSaved().

Here is the call graph for this function:

◆ OnStartDrag()

void NumeReEditor::OnStartDrag ( wxStyledTextEvent &  event)
private

Event handler for starting drag 'n drop.

Parameters
eventwxStyledTextEvent&
Returns
void

Definition at line 5082 of file editor.cpp.

◆ OnThreadUpdate()

void NumeReEditor::OnThreadUpdate ( wxThreadEvent &  event)

Thread event handler function for the duplicated code detection functionality.

Parameters
eventwxThreadEvent&
Returns
void

This function simply updates the gauge in the duplicated code dialog and passes the results, once the detection is finished.

Definition at line 7006 of file editor.cpp.

References m_duplicateCode, m_editorCS, m_nProcessValue, DuplicateCodeDialog::SetProgress(), DuplicateCodeDialog::SetResult(), and vDuplicateCodeResults.

Referenced by NumeReEditor().

Here is the call graph for this function:

◆ OnTranspose()

void NumeReEditor::OnTranspose ( )

On MenuEvent handler for the transpose functionality of the editor.

Returns
void

Definition at line 6871 of file editor.cpp.

References Transpose().

Referenced by NumeReWindow::OnMenuEvent().

Here is the call graph for this function:

◆ OnUnhideAllFromMenu()

void NumeReEditor::OnUnhideAllFromMenu ( )

Global event handling function to unhide all lines from the main frame's menu.

Returns
void

Definition at line 6759 of file editor.cpp.

References MARKER_HIDDEN, and MARKER_HIDDEN_MARGIN.

Referenced by NumeReWindow::OnMenuEvent().

◆ realignLangString()

string NumeReEditor::realignLangString ( std::string  sLine,
size_t &  lastpos 
)
private

Re-alignes the passed language string to fit into a call tip.

Parameters
sLinestring
lastpossize_t&
Returns
string

Definition at line 8440 of file editor.cpp.

Referenced by OnMouseDwell().

◆ registerProcedureViewer()

void NumeReEditor::registerProcedureViewer ( ProcedureViewer viewer)

Registers the passed procedure viewer.

Parameters
viewerProcedureViewer*
Returns
void

Definition at line 5326 of file editor.cpp.

References m_procedureViewer.

Referenced by ProcedureViewer::setCurrentEditor().

◆ RemoveBreakpoint()

void NumeReEditor::RemoveBreakpoint ( int  linenum)

Removes a breakpoint from the selected line.

Parameters
linenumint
Returns
void

Definition at line 7487 of file editor.cpp.

References GetFileNameAndPath(), m_terminal, MARKER_BREAKPOINT, and NumeReTerminal::removeBreakpoint().

Referenced by OnMarginClick(), and OnRemoveBreakpoint().

Here is the call graph for this function:

◆ removeWhiteSpaces()

void NumeReEditor::removeWhiteSpaces ( int  nType = RM_WS_BOTH)

Removes whitespaces depending on the passed type.

Removes whitespaces in the document.

nType defines the type of whitespaces to be removed. This is either front, back or both. Either the selection (if any) is affected or the whole document.

Parameters
nTypeint Either RM_WS_BOTH, RM_WS_FRONT or RM_WS_BACK
Returns
void
Parameters
nTypeint Type of removal
Returns
void

The type of removal is selected using nType. RM_WS_FRONT removes leading, RM_WS_BACK removes trailing and RM_WS_BOTH removes leading and trailing whitespaces from each line.

Definition at line 2335 of file editor.cpp.

References RM_WS_BACK, RM_WS_BOTH, and RM_WS_FRONT.

Referenced by NumeReWindow::OnMenuEvent().

◆ RenameSymbols()

void NumeReEditor::RenameSymbols ( int  nPos)
private

Asks the user to supply a new name for the symbol at the passed position and replaces all occurences.

Parameters
nPosint
Returns
void

This member function replaces the selected symbol with a new name supplied by the user using a text input dialog. This method also supplies the needed user interaction.

Definition at line 5679 of file editor.cpp.

References _guilang, BlockMatch(), FILE_MATLAB, FILE_NPRC, SearchController::FindAll(), SearchController::FindCurrentProcedureHead(), Language::get(), RenameSymbolsDialog::GetValue(), isStyleType(), m_fileType, m_search, RenameSymbolsDialog::replaceAfterCursor(), RenameSymbolsDialog::replaceBeforeCursor(), RenameSymbolsDialog::replaceInComments(), RenameSymbolsDialog::replaceInWholeFile(), ReplaceMatches(), STYLE_COMMAND, STYLE_FUNCTION, and vRenameSymbolsChangeLog.

Referenced by OnRenameSymbols(), and OnRenameSymbolsFromMenu().

Here is the call graph for this function:

◆ ReplaceMatches()

void NumeReEditor::ReplaceMatches ( const std::vector< int > &  vMatches,
const wxString &  sSymbol,
const wxString &  sNewSymbol 
)
private

Replaces the matches with a new symbol.

Parameters
vMatchesconst vector<int>&
sSymbolconst wxString&
sNewSymbolconst wxString&
Returns
void

This member function replaces the found matches with a new symbol.

Definition at line 5648 of file editor.cpp.

Referenced by fixSymbolName(), and RenameSymbols().

◆ ResetEditor()

void NumeReEditor::ResetEditor ( )

public ResetEditor Clears out the editor's contents and resets it completely

Returns
void
Author
Mark Erikson
Date
04-22-2004

Definition at line 4356 of file editor.cpp.

References m_breakpoints, m_clickedInclude, m_clickedProcedure, m_clickedWord, m_clickedWordLength, m_fileNameAndPath, m_watchedString, MARKER_BREAKPOINT, MARKER_FOCUSEDLINE, MARKER_MODIFIED, MARKER_SAVED, and vRenameSymbolsChangeLog.

Referenced by NumeReWindow::CloseFile().

◆ ResetRightClickLocation()

void NumeReEditor::ResetRightClickLocation ( )
private

Invalidates the latest mouse right click position.

Returns
void

Definition at line 5430 of file editor.cpp.

References m_lastRightClick.

Referenced by OnAddBookmark(), OnAddBreakpoint(), OnClearBreakpoints(), and OnRemoveBreakpoint().

◆ SaveFile()

bool NumeReEditor::SaveFile ( const wxString &  filename)

public SaveFile Saves the editor's contents with the given filename

Parameters
filenameconst wxString & The filename to save to
Returns
bool Whether or not the save succeeded
Author
Mark Erikson
Date
04-22-2004

Definition at line 396 of file editor.cpp.

References countUmlauts(), FILE_NPRC, FILE_NSCR, Options::GetKeepBackupFile(), VersionControlSystemManager::getRevisions(), m_bSetUnsaved, m_filetime, m_fileType, m_mainFrame, m_options, m_simpleFileName, markSaved(), Modified(), SaveGeneralFile(), SaveNumeReFile(), SynchronizeBreakpoints(), and UpdateProcedureViewer().

Referenced by SaveFileLocal(), NumeReHistory::saveHistory(), and NumeReWindow::SaveTab().

Here is the call graph for this function:

◆ SaveFileLocal()

bool NumeReEditor::SaveFileLocal ( )

public SaveFileLocal Saves the editor's contents with the current filename

Returns
bool Whether or not the save succeeded
Author
Mark Erikson
Date
04-22-2004

Definition at line 380 of file editor.cpp.

References m_fileNameAndPath, and SaveFile().

Here is the call graph for this function:

◆ SaveGeneralFile()

bool NumeReEditor::SaveGeneralFile ( const wxString &  filename)

Saves a general file without touching the encoding.

Parameters
filenameconst wxString&
Returns
bool

Definition at line 539 of file editor.cpp.

Referenced by SaveFile().

◆ SaveNumeReFile()

bool NumeReEditor::SaveNumeReFile ( const wxString &  filename)

Saves a NumeRe-specific file and tries to stick to ASCII encoding.

Parameters
filenameconst wxString&
Returns
bool

Definition at line 509 of file editor.cpp.

References date::detail::trunc().

Referenced by SaveFile().

Here is the call graph for this function:

◆ setBookmarks()

void NumeReEditor::setBookmarks ( const std::vector< int > &  vBookmarks)

Set the bookmarks in the editor.

Parameters
vBookmarksconst vector<int>&
Returns
void

This member function overrides all bookmarks in the current file with the passed list of bookmarks.

Definition at line 2311 of file editor.cpp.

References MARKER_BOOKMARK.

Referenced by NumeReWindow::prepareSession().

◆ SetEditorFont()

void NumeReEditor::SetEditorFont ( const wxFont &  font)

Changes the editor's font face.

Parameters
fontconst wxFont& The new font face
Returns
void

The font face is changed globally and the syntax highlighing is recalculated. Called after the settings dialog was closed.

Definition at line 2802 of file editor.cpp.

References UpdateSyntaxHighlighting().

Referenced by NumeReWindow::OnOptions().

Here is the call graph for this function:

◆ SetExecutableFilename()

void NumeReEditor::SetExecutableFilename ( wxFileName  filename)

◆ SetFilename()

void NumeReEditor::SetFilename ( wxFileName  filename,
bool  fileIsRemote 
)

public SetFilename Sets the filename for the editor

Parameters
filenamewxFileName The filename for this editor
fileIsRemotebool Whether this file is remote or local
Returns
void
Author
Mark Erikson
Date
04-22-2004

Definition at line 4246 of file editor.cpp.

References m_bLastSavedRemotely, and m_fileNameAndPath.

Referenced by CreateProcedureFromSection(), NumeReWindow::NewFile(), NumeReWindow::OpenSourceFile(), NumeReWindow::SaveCurrentFile(), EditorNotebook::split(), and NumeReWindow::UpdateLocationIfOpen().

◆ SetSyntax()

void NumeReEditor::SetSyntax ( NumeReSyntax __syntax)
inline

Definition at line 209 of file editor.h.

References _syntax.

◆ SetTerminal()

void NumeReEditor::SetTerminal ( NumeReTerminal _terminal)
inline

Definition at line 216 of file editor.h.

References m_terminal.

◆ SetUnsaved()

void NumeReEditor::SetUnsaved ( )

Marks the editor as modified.

Returns
void

Definition at line 3556 of file editor.cpp.

References m_bSetUnsaved.

Referenced by NumeReWindow::NewFile(), OnSavePointLeft(), NumeReWindow::prepareSession(), and NumeReWindow::ShowRevision().

◆ sortSelection()

void NumeReEditor::sortSelection ( bool  ascending = true)

Sorts the lines de- or ascending.

Sorts the selected lines alphabetically.

Sorts the lines. Either the selection (if any) is affected or the whole document.

Parameters
ascendingbool if true, then ascending, else descending
Returns
void
Parameters
ascendingbool
Returns
void

This function sorts the user selected lines alphabetically in either ascending or descending order. The sorting algorithm is case-insensitive.

Definition at line 2425 of file editor.cpp.

References StripSpaces(), toLowerCase(), and toString().

Referenced by NumeReWindow::OnMenuEvent().

Here is the call graph for this function:

◆ SynchronizeBreakpoints()

void NumeReEditor::SynchronizeBreakpoints ( )

Synchronizes all breakpoints between editor and kernel.

Returns
void

This member function synchronizes all breakpoints in the current opened file after the file was modified and saved

Definition at line 7506 of file editor.cpp.

References NumeReTerminal::addBreakpoint(), NumeReTerminal::clearBreakpoints(), GetFileNameAndPath(), m_terminal, and MARKER_BREAKPOINT.

Referenced by SaveFile().

Here is the call graph for this function:

◆ toggleBookmark()

void NumeReEditor::toggleBookmark ( )

Toggles a bookmark marker on the current line.

Returns
void

Definition at line 2391 of file editor.cpp.

References MARKER_BOOKMARK, and MarkerOnLine().

Referenced by NumeReWindow::OnMenuEvent().

Here is the call graph for this function:

◆ ToggleCommentLine()

void NumeReEditor::ToggleCommentLine ( )

Toggles a line comment.

Returns
void

This function comments lines, which are not commented and uncomments lines, which are commented.

Definition at line 1968 of file editor.cpp.

References FILE_CPP, FILE_DATAFILES, FILE_MATLAB, FILE_NONSOURCE, FILE_NPRC, FILE_NSCR, FILE_TEXSOURCE, and m_fileType.

Referenced by NumeReWindow::OnMenuEvent(), and ToggleCommentSelection().

◆ ToggleCommentSelection()

void NumeReEditor::ToggleCommentSelection ( )

Toggles block comments in a selection.

Returns
void

This function comments selections, which are not commented and uncomments selections, which are commented. This function uses the block comment style for this feature.

Definition at line 2096 of file editor.cpp.

References FILE_CPP, FILE_NONSOURCE, FILE_NPRC, FILE_NSCR, FILE_XML, m_fileType, and ToggleCommentLine().

Referenced by NumeReWindow::OnMenuEvent().

Here is the call graph for this function:

◆ ToggleSettings()

void NumeReEditor::ToggleSettings ( int  _setting)

Enables or disables an editor setting.

Parameters
_settingint
Returns
void

The selected setting is enabled, if it was disabled and vice-versa. All necessary style calculations are applied afterwards.

Definition at line 2835 of file editor.cpp.

References HIGHLIGHT_STRIKETHROUGH, m_analyzer, m_nEditorSetting, MARKER_SECTION, markSections(), CodeAnalyzer::run(), SETTING_DISPCTRLCHARS, SETTING_USESECTIONS, SETTING_USETXTADV, SETTING_WRAPEOL, and UpdateSyntaxHighlighting().

Referenced by CreateProcedureFromSection(), NumeReWindow::DefaultPage(), LoadFileText(), NumeReWindow::NewFile(), NumeReWindow::OnCreatePackage(), NumeReWindow::OnMenuEvent(), NumeReWindow::OpenSourceFile(), NumeReWindow::prepareSession(), and EditorNotebook::split().

Here is the call graph for this function:

◆ Transpose()

void NumeReEditor::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.

Parameters
nFirstLineint
nLastLineint
Returns
void

Definition at line 8599 of file editor.cpp.

References GetFileName().

Referenced by OnTranspose().

Here is the call graph for this function:

◆ UnfoldAll()

void NumeReEditor::UnfoldAll ( )

Unfolds all fold markers.

Unfolds every folded section.

Returns
void

Definition at line 2223 of file editor.cpp.

Referenced by NumeReWindow::OnMenuEvent().

◆ updateDefaultHighlightSettings()

void NumeReEditor::updateDefaultHighlightSettings ( )
private

Performs all general default syntax highlightings.

Returns
void

Definition at line 4127 of file editor.cpp.

References SettingsValue::active(), Options::ACTIVE_LINE, ANNOTATION_ERROR, ANNOTATION_NOTE, ANNOTATION_WARN, SyntaxStyles::background, SyntaxStyles::defaultbackground, SyntaxStyles::foreground, Settings::getSetting(), Options::GetSyntaxStyle(), m_options, SETTING_B_LINELENGTH, and Options::STANDARD.

Referenced by UpdateSyntaxHighlighting().

Here is the call graph for this function:

◆ UpdateIndicators()

void NumeReEditor::UpdateIndicators ( )

◆ UpdateProcedureViewer()

void NumeReEditor::UpdateProcedureViewer ( )

Update the assigned procedure viewer.

Returns
void

This member function updates the procedure viewer, if it was registered in this editor

Definition at line 1079 of file editor.cpp.

References FILE_NPRC, SearchController::getProceduresInFile(), m_fileType, m_procedureViewer, m_search, and ProcedureViewer::updateProcedureList().

Referenced by SaveFile().

Here is the call graph for this function:

◆ UpdateSyntaxHighlighting()

void NumeReEditor::UpdateSyntaxHighlighting ( bool  forceUpdate = false)

public UpdateSyntaxHighlighting Sets up the editor's syntax highlighting

Returns
void
Remarks
Currently only called on creation. If syntax highlighting customization was
allowed, this is where the user's choices would be used
Author
Mark Erikson
Date
04-22-2004

Definition at line 3573 of file editor.cpp.

References _syntax, applyStrikeThrough(), SyntaxStyles::background, SyntaxStyles::bold, Options::CLUSTER, Options::COMMAND, Options::COMMENT, Options::CONSTANT, Options::CUSTOM_FUNCTION, Options::DEFAULT_VARS, SyntaxStyles::defaultbackground, Options::DOCCOMMENT, Options::DOCKEYWORD, FILE_CPP, FILE_DATAFILES, FILE_DIFF, FILE_MATLAB, FILE_NPRC, FILE_NSCR, FILE_TEXSOURCE, FILE_XML, SyntaxStyles::foreground, Options::FUNCTION, NumeReSyntax::getBlockDefs(), NumeReSyntax::getCommands(), NumeReSyntax::getConstants(), NumeReSyntax::getCpp(), NumeReSyntax::getCppFunctions(), NumeReSyntax::getDocKeyWords(), getEditorSetting(), GetFileNameAndPath(), GetFileType(), NumeReSyntax::getFunctions(), NumeReSyntax::getMatlab(), NumeReSyntax::getMatlabFunctions(), NumeReSyntax::getMethods(), NumeReSyntax::getNPRCCommands(), NumeReSyntax::getOperators(), NumeReSyntax::getOptions(), NumeReSyntax::getSpecial(), Options::GetSyntaxStyle(), Options::INCLUDES, Options::INSTALL, SyntaxStyles::italics, m_fileType, m_options, MARGIN_FOLD, markLocalVariables(), Options::METHODS, Options::NUMBER, Options::OPERATOR, Options::OPTION, Options::PROCEDURE, Options::PROCEDURE_COMMAND, SETTING_USETXTADV, Options::SPECIALVAL, Options::STANDARD, Options::STRING, Options::STRINGPARSER, SyntaxStyles::underline, and updateDefaultHighlightSettings().

Referenced by CreateProcedureFromSection(), NumeReWindow::EvaluateOptions(), FindAndOpenProcedure(), LoadFileText(), NumeReWindow::NewFile(), NumeReEditor(), NumeReWindow::OnCreatePackage(), NumeReWindow::OnOptions(), NumeReWindow::OpenSourceFile(), NumeReWindow::refreshFunctionTree(), NumeReWindow::SaveTab(), SetEditorFont(), NumeReWindow::ShowRevision(), EditorNotebook::split(), and ToggleSettings().

Here is the call graph for this function:

Friends And Related Function Documentation

◆ CodeAnalyzer

friend class CodeAnalyzer
friend

Definition at line 55 of file editor.h.

Referenced by NumeReEditor().

◆ CodeFormatter

friend class CodeFormatter
friend

Definition at line 57 of file editor.h.

Referenced by NumeReEditor().

◆ SearchController

friend class SearchController
friend

Definition at line 56 of file editor.h.

Referenced by NumeReEditor().

Member Data Documentation

◆ _syntax

◆ defaultPage

◆ m_analyzer

CodeAnalyzer* NumeReEditor::m_analyzer
private

◆ m_analyzerTimer

wxTimer* NumeReEditor::m_analyzerTimer
private

Definition at line 451 of file editor.h.

Referenced by NumeReEditor(), and OnIdle().

◆ m_bHasBeenCompiled

bool NumeReEditor::m_bHasBeenCompiled
private

Definition at line 436 of file editor.h.

Referenced by NumeReEditor().

◆ m_bLastSavedRemotely

bool NumeReEditor::m_bLastSavedRemotely
private

Definition at line 435 of file editor.h.

Referenced by GetFilePath(), LastSavedRemotely(), NumeReEditor(), and SetFilename().

◆ m_bLoadingFile

bool NumeReEditor::m_bLoadingFile
private

Definition at line 434 of file editor.h.

Referenced by LoadFileText(), NumeReEditor(), and OnEditorModified().

◆ m_blockIndicatorActive

bool NumeReEditor::m_blockIndicatorActive
private

Definition at line 443 of file editor.h.

Referenced by getMatchingBlock(), MakeBlockCheck(), and NumeReEditor().

◆ m_bNewFile

bool NumeReEditor::m_bNewFile
private

Definition at line 437 of file editor.h.

Referenced by NumeReEditor().

◆ m_braceIndicatorActive

bool NumeReEditor::m_braceIndicatorActive
private

Definition at line 442 of file editor.h.

Referenced by getMatchingBrace(), MakeBraceCheck(), and NumeReEditor().

◆ m_breakpoints

wxArrayInt NumeReEditor::m_breakpoints
private

Definition at line 403 of file editor.h.

Referenced by AddBreakpoint(), GetBreakpoints(), OnClearBreakpoints(), and ResetEditor().

◆ m_bSetUnsaved

bool NumeReEditor::m_bSetUnsaved
private

Definition at line 438 of file editor.h.

Referenced by LoadFileText(), Modified(), NumeReEditor(), OnSavePointReached(), SaveFile(), and SetUnsaved().

◆ m_clickedInclude

wxString NumeReEditor::m_clickedInclude
private

◆ m_clickedProcedure

wxString NumeReEditor::m_clickedProcedure
private

◆ m_clickedWord

wxString NumeReEditor::m_clickedWord
private

◆ m_clickedWordLength

size_t NumeReEditor::m_clickedWordLength
private

Definition at line 408 of file editor.h.

Referenced by SearchController::FindClickedWord(), OnDisplayVariable(), and ResetEditor().

◆ m_dblclkString

wxString NumeReEditor::m_dblclkString
private

Definition at line 400 of file editor.h.

Referenced by ClearDblClkIndicator(), NumeReEditor(), and OnMouseDblClk().

◆ m_dragging

bool NumeReEditor::m_dragging
private

Definition at line 440 of file editor.h.

Referenced by NumeReEditor(), and OnMouseMotion().

◆ m_duplicateCode

DuplicateCodeDialog* NumeReEditor::m_duplicateCode
private

Definition at line 419 of file editor.h.

Referenced by Entry(), InitDuplicateCode(), notifyDialogClose(), NumeReEditor(), and OnThreadUpdate().

◆ m_editorCS

wxCriticalSection NumeReEditor::m_editorCS
private

Definition at line 420 of file editor.h.

Referenced by Entry(), and OnThreadUpdate().

◆ m_executableFilename

wxFileName NumeReEditor::m_executableFilename
private

Definition at line 397 of file editor.h.

Referenced by GetExecutableFileName().

◆ m_fileNameAndPath

wxFileName NumeReEditor::m_fileNameAndPath
private

◆ m_filetime

wxDateTime NumeReEditor::m_filetime
private

Definition at line 401 of file editor.h.

Referenced by SaveFile().

◆ m_fileType

◆ m_formatter

CodeFormatter* NumeReEditor::m_formatter
private

Definition at line 394 of file editor.h.

Referenced by ApplyAutoFormat(), ApplyAutoIndentation(), NumeReEditor(), and ~NumeReEditor().

◆ m_lastRightClick

◆ m_mainFrame

◆ m_menuAddWatch

wxMenuItem* NumeReEditor::m_menuAddWatch
private

Definition at line 409 of file editor.h.

◆ m_menuFindInclude

wxMenuItem* NumeReEditor::m_menuFindInclude
private

Definition at line 413 of file editor.h.

Referenced by NumeReEditor(), and OnRightClick().

◆ m_menuFindProcedure

wxMenuItem* NumeReEditor::m_menuFindProcedure
private

Definition at line 411 of file editor.h.

Referenced by NumeReEditor(), and OnRightClick().

◆ m_menuHelpOnSelection

wxMenuItem* NumeReEditor::m_menuHelpOnSelection
private

Definition at line 412 of file editor.h.

Referenced by NumeReEditor(), and OnRightClick().

◆ m_menuRefactoring

wxMenuItem* NumeReEditor::m_menuRefactoring
private

Definition at line 414 of file editor.h.

Referenced by NumeReEditor(), and OnRightClick().

◆ m_menuShowValue

wxMenuItem* NumeReEditor::m_menuShowValue
private

Definition at line 410 of file editor.h.

Referenced by NumeReEditor(), and OnRightClick().

◆ m_modificationHappened

bool NumeReEditor::m_modificationHappened
private

Definition at line 441 of file editor.h.

Referenced by NumeReEditor(), OnEditorModified(), and OnIdle().

◆ m_nCallTipStart

int NumeReEditor::m_nCallTipStart
private

◆ m_nDuplicateCodeFlag

int NumeReEditor::m_nDuplicateCodeFlag
private

Definition at line 426 of file editor.h.

Referenced by detectCodeDuplicates(), Entry(), and NumeReEditor().

◆ m_nDuplicateCodeLines

int NumeReEditor::m_nDuplicateCodeLines
private

Definition at line 427 of file editor.h.

Referenced by detectCodeDuplicates(), Entry(), and NumeReEditor().

◆ m_nEditorSetting

int NumeReEditor::m_nEditorSetting
private

Definition at line 445 of file editor.h.

Referenced by getEditorSetting(), getSettings(), NumeReEditor(), and ToggleSettings().

◆ m_nFirstLine

int NumeReEditor::m_nFirstLine
private

Definition at line 428 of file editor.h.

Referenced by detectCodeDuplicates(), Entry(), and NumeReEditor().

◆ m_nLastLine

int NumeReEditor::m_nLastLine
private

Definition at line 429 of file editor.h.

Referenced by detectCodeDuplicates(), Entry(), and NumeReEditor().

◆ m_nLastReleasedKey

int NumeReEditor::m_nLastReleasedKey
private

Definition at line 430 of file editor.h.

Referenced by AsynchActions(), NumeReEditor(), OnKeyRel(), and OnMouseUp().

◆ m_nProcessValue

int NumeReEditor::m_nProcessValue
private

Definition at line 425 of file editor.h.

Referenced by Entry(), and OnThreadUpdate().

◆ m_options

◆ m_PopUpActive

bool NumeReEditor::m_PopUpActive
private

Definition at line 439 of file editor.h.

Referenced by NumeReEditor(), OnMouseDwell(), and OnRightClick().

◆ m_popupMenu

wxMenu NumeReEditor::m_popupMenu
private

Definition at line 449 of file editor.h.

Referenced by NumeReEditor(), and OnRightClick().

◆ m_procedureViewer

ProcedureViewer* NumeReEditor::m_procedureViewer
private

Definition at line 391 of file editor.h.

Referenced by NumeReEditor(), registerProcedureViewer(), and UpdateProcedureViewer().

◆ m_refactoringMenu

wxMenu* NumeReEditor::m_refactoringMenu
private

Definition at line 450 of file editor.h.

Referenced by NumeReEditor(), and OnRightClick().

◆ m_sCallTipContent

std::string NumeReEditor::m_sCallTipContent
private

Definition at line 432 of file editor.h.

Referenced by AdvCallTipCancel(), and AdvCallTipShow().

◆ m_search

◆ m_simpleFileName

wxString NumeReEditor::m_simpleFileName
private

Definition at line 398 of file editor.h.

Referenced by SaveFile().

◆ m_terminal

◆ m_watchedString

wxString NumeReEditor::m_watchedString
private

Definition at line 399 of file editor.h.

Referenced by NumeReEditor(), OnDisplayVariable(), OnRightClick(), and ResetEditor().

◆ vBlockDefs

std::vector<SyntaxBlockDefinition> NumeReEditor::vBlockDefs
private

◆ vDuplicateCodeResults

std::vector<std::string> NumeReEditor::vDuplicateCodeResults
private

Definition at line 421 of file editor.h.

Referenced by Entry(), and OnThreadUpdate().

◆ vParsedSemanticCode

std::vector<std::string> NumeReEditor::vParsedSemanticCode
private

◆ vRenameSymbolsChangeLog

std::vector<wxString> NumeReEditor::vRenameSymbolsChangeLog
private

Definition at line 423 of file editor.h.

Referenced by RenameSymbols(), and ResetEditor().


The documentation for this class was generated from the following files: