Code::Blocks  SVN r11506
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | Friends | List of all members
cbEditor Class Reference

A file editor. More...

#include <cbeditor.h>

Inheritance diagram for cbEditor:
Collaboration diagram for cbEditor:

Public Types

enum  SplitType { stNoSplit = 0, stHorizontal, stVertical }
 

Public Member Functions

void operator= (cb_unused const cbEditor &rhs)
 Don't use this. More...
 
cbStyledTextCtrlGetControl () const
 Returns a pointer to the underlying cbStyledTextCtrl object (which itself is the wxWindows implementation of Scintilla). More...
 
cbStyledTextCtrlGetLeftSplitViewControl () const
 Returns a pointer to the left (or top) split-view cbStyledTextCtrl. More...
 
cbStyledTextCtrlGetRightSplitViewControl () const
 Returns a pointer to the right (or bottom) split-view cbStyledTextCtrl. More...
 
SplitType GetSplitType () const
 Returns the state of split-view for this editor. More...
 
bool IsOK () const
 Returns true if editor is OK, i.e. More...
 
void SetEditorTitle (const wxString &title)
 Sets the editor title. More...
 
bool GetModified () const override
 Returns true if editor is modified, false otherwise. More...
 
void SetModified (bool modified=true) override
 Set the editor's modification state to modified. More...
 
void SetProjectFile (ProjectFile *project_file, bool preserve_modified=false)
 Set the ProjectFile pointer associated with this editor. More...
 
ProjectFileGetProjectFile () const
 Read the ProjectFile pointer associated with this editor. More...
 
void UpdateProjectFile ()
 Updates the associated ProjectFile object with the editor's caret position, top visible line and its open state. More...
 
bool Save () override
 Save editor contents. More...
 
bool SaveAs () override
 Save editor contents under a different filename. More...
 
bool SaveFoldState ()
 Save fold states within a new cbStyledTextCtrl. More...
 
bool FixFoldState ()
 Fix fold states by comparing foldBackup with m_pControl. More...
 
void FoldAll ()
 Fold all editor folds (hides blocks of code). More...
 
void UnfoldAll ()
 Unfold all editor folds (shows blocks of code). More...
 
void ToggleAllFolds ()
 Toggle all editor folds (inverts the show/hide state of blocks of code). More...
 
void SetFoldingIndicator (int id)
 Sets the type of folding indicator where id is one of the following: 0->Arrow, 1->Circle, 2->Square, 3->simple. More...
 
void FoldBlockFromLine (int line=-1)
 Folds the block containing line. More...
 
void UnfoldBlockFromLine (int line=-1)
 Unfolds the block containing line. More...
 
void ToggleFoldBlockFromLine (int line=-1)
 Toggles folding of the block containing line. More...
 
void SetColourSet (EditorColourSet *theme)
 Set the colour set to use. More...
 
EditorColourSetGetColourSet () const
 Get the colour set in use. More...
 
void GotoMatchingBrace ()
 Jumps to the matching brace (if there is one). More...
 
void HighlightBraces ()
 Highlights the brace pair (one of the braces must be under the cursor) More...
 
int GetLineIndentInSpaces (int line=-1) const
 Returns the specified line's (0-based) indentation (whitespace) in spaces. More...
 
wxString GetLineIndentString (int line=-1) const
 Returns the specified line's (0-based) indentation (whitespace) string. More...
 
wxDateTime GetLastModificationTime () const
 Returns the last modification time for the file. More...
 
void Touch ()
 Sets the last modification time for the file to 'now'. More...
 
bool Reload (bool detectEncoding=true)
 Reloads the file from disk. More...
 
void Print (bool selectionOnly, PrintColourMode pcm, bool line_numbers)
 Print the file. More...
 
void AutoComplete ()
 This method is obsolete, use the abbreviations plugin instead. More...
 
void GotoLine (int line, bool centerOnScreen=true) override
 Move the caret at the specified line. More...
 
bool GotoTokenPosition (int line, const wxString &tokenName)
 Move the caret at the specified line. More...
 
bool AddBreakpoint (int line=-1, bool notifyDebugger=true)
 Add debugger breakpoint at specified line. More...
 
bool RemoveBreakpoint (int line=-1, bool notifyDebugger=true)
 Remove debugger breakpoint at specified line. More...
 
virtual void ToggleBreakpoint (int line=-1, bool notifyDebugger=true)
 Toggle debugger breakpoint at specified line. More...
 
virtual bool HasBreakpoint (int line) const
 Does line has debugger breakpoint? If line is -1, use current line. More...
 
virtual void GotoNextBreakpoint ()
 Go to next debugger breakpoint. More...
 
virtual void GotoPreviousBreakpoint ()
 Go to previous debugger breakpoint. More...
 
virtual void RefreshBreakpointMarkers ()
 Refresh all markers for the breakpoints (only the markers for the current debugger will be shown) More...
 
virtual void ClearAllBookmarks ()
 Clear all bookmarks. More...
 
virtual void ToggleBookmark (int line=-1)
 Toggle bookmark at specified line. More...
 
virtual bool HasBookmark (int line) const
 Does line has bookmark? More...
 
virtual void GotoNextBookmark ()
 Go to next bookmark. More...
 
virtual void GotoPreviousBookmark ()
 Go to previous bookmark. More...
 
virtual void SetDebugLine (int line)
 Highlight the line the debugger will execute next. More...
 
virtual void SetErrorLine (int line)
 Highlight the specified line as error. More...
 
void Split (SplitType split)
 Split the editor window. More...
 
void Unsplit ()
 Unsplit the editor window. More...
 
void Undo () override
 Undo changes. More...
 
void Redo () override
 Redo changes. More...
 
void ClearHistory () override
 Clear Undo- (and Changebar-) history. More...
 
void GotoNextChanged () override
 Goto next changed line. More...
 
void GotoPreviousChanged () override
 Goto previous changed line. More...
 
void SetChangeCollection (bool collectChange) override
 
void Cut () override
 Cut selected text/object to clipboard. More...
 
void Copy () override
 Copy selected text/object to clipboard. More...
 
void Paste () override
 Paste selected text/object from clipboard. More...
 
bool CanUndo () const override
 Is there something to undo? More...
 
bool CanRedo () const override
 Is there something to redo? More...
 
bool HasSelection () const override
 Is there a selection? More...
 
bool CanPaste () const override
 Is there something to paste? More...
 
bool IsReadOnly () const override
 Is the editor read-only? More...
 
void SetReadOnly (bool readonly=true) override
 Set the editor read-only. More...
 
bool CanSelectAll () const override
 Can the editor select everything? More...
 
void SelectAll () override
 Select everything in the editor. More...
 
void DoIndent ()
 Indents current line/block. More...
 
void DoUnIndent ()
 UnIndents current line/block. More...
 
wxMenuCreateContextSubMenu (long id) override
 Creates context submenus. More...
 
void AddToContextMenu (wxMenu *popup, ModuleType type, bool pluginsdone) override
 
HighlightLanguage GetLanguage () const
 
void SetLanguage (HighlightLanguage lang, bool colourise)
 Sets the language for this editor. More...
 
wxFontEncoding GetEncoding () const
 
wxString GetEncodingName () const
 
void SetEncoding (wxFontEncoding encoding)
 
bool GetUseBom () const
 
void SetUseBom (bool bom)
 
void SetZoom (int zoom, bool both=true)
 
void AutoIndentDone ()
 
void SetEditorStyle ()
 Applies the styles that match the filename of the editor. More...
 
- Public Member Functions inherited from EditorBase
 EditorBase (wxWindow *parent, const wxString &filename)
 
 ~EditorBase () override
 
void operator= (cb_optional const EditorBase &rhs)
 Don't use this. More...
 
virtual const wxStringGetFilename () const
 Get the editor's filename (if applicable). More...
 
virtual void SetFilename (const wxString &filename)
 Sets the editor's filename. More...
 
virtual const wxStringGetShortName () const
 Returns the editor's short name. More...
 
virtual const wxStringGetTitle ()
 The editor's title. More...
 
virtual void SetTitle (const wxString &newTitle)
 Set the editor's title. More...
 
virtual void Activate ()
 Activate this editor. More...
 
virtual bool QueryClose ()
 Can this be closed (destroyed)? More...
 
virtual bool Close ()
 Close this editor. More...
 
virtual bool IsBuiltinEditor () const
 Is this a built-in editor? More...
 
virtual bool ThereAreOthers () const
 Are there other editors besides this? More...
 
virtual void DisplayContextMenu (const wxPoint &position, ModuleType type=mtUnknown)
 Display context menu. More...
 
virtual bool VisibleToTree () const
 Should this kind of editor be visible in the open files tree? More...
 
virtual void SetChangeCollection (cb_optional bool collectChange)
 Enable or disable changebar. More...
 
virtual bool IsContextMenuOpened () const
 Is there a context (right click) menu open. More...
 

Static Public Member Functions

static void ApplyStyles (cbStyledTextCtrl *control)
 Apply the editor defaults to any (possibly foreign) cbStyledTextCtrl. More...
 

Protected Member Functions

 cbEditor (wxWindow *parent, const wxString &filename, EditorColourSet *theme)
 cbEditor constructor. More...
 
 cbEditor (wxWindow *parent, LoaderBase *fileLdr, const wxString &filename, EditorColourSet *theme)
 
 ~cbEditor () override
 cbEditor destructor. More...
 
- Protected Member Functions inherited from EditorBase
virtual void InitFilename (const wxString &filename)
 Initializes filename data. More...
 
virtual void AddToContextMenu (cb_optional wxMenu *popup, cb_optional ModuleType type, cb_optional bool pluginsdone)
 Creates context menu items, both before and after creating plugins menu items. More...
 
virtual wxString CreateUniqueFilename ()
 Creates unique filename when asking to save the file. More...
 
virtual bool OnBeforeBuildContextMenu (cb_optional const wxPoint &position, cb_optional ModuleType type)
 Informs the editor we 're just about to create a context menu. More...
 
virtual void OnAfterBuildContextMenu (cb_optional ModuleType type)
 Informs the editor we 're done creating the context menu (just about to display it). More...
 

Private Types

enum  FoldMode : int { FoldMode::contract = 0, FoldMode::expand = 1, FoldMode::toggle = 2 }
 
enum  FoldFlags : unsigned { none = 0x0, ensureVisible = 0x2 }
 

Private Member Functions

 cbEditor (cb_unused const cbEditor &rhs)
 
bool LineHasMarker (int marker, int line=-1) const
 
void MarkerToggle (int marker, int line=-1)
 
void MarkerNext (int marker)
 
void MarkerPrevious (int marker)
 
void MarkLine (int marker, int line)
 
void DoFoldAll (FoldMode fold)
 
void DoFoldBlockFromLine (int line, FoldMode fold, unsigned foldFlags)
 
void SetMarkerStyle (int marker, int markerType, wxColor fore, wxColor back)
 
void UnderlineFoldedLines (bool underline)
 
cbStyledTextCtrlCreateEditor ()
 
void ConnectEvents (cbStyledTextCtrl *stc)
 
void SetEditorStyleBeforeFileOpen ()
 
void SetEditorStyleAfterFileOpen ()
 
bool Open (bool detectEncoding=true)
 
void DoAskForCodeCompletion ()
 
void SetLanguageDependentColours (cbStyledTextCtrl &control)
 
void NotifyPlugins (wxEventType type, int intArg=0, const wxString &strArg=wxEmptyString, int xArg=0, int yArg=0)
 
void OnMarginClick (wxScintillaEvent &event)
 
void OnEditorUpdateUI (wxScintillaEvent &event)
 
void OnEditorChange (wxScintillaEvent &event)
 
void OnEditorCharAdded (wxScintillaEvent &event)
 
void OnEditorDwellStart (wxScintillaEvent &event)
 
void OnEditorDwellEnd (wxScintillaEvent &event)
 
void OnEditorModified (wxScintillaEvent &event)
 
void OnUserListSelection (wxScintillaEvent &event)
 
void OnZoom (wxScintillaEvent &event)
 
void OnScintillaEvent (wxScintillaEvent &event)
 notify all the registered EditorHook functions More...
 
void OnClose (wxCloseEvent &event)
 
void OnContextMenuEntry (wxCommandEvent &event)
 
bool OnBeforeBuildContextMenu (const wxPoint &position, ModuleType type) override
 
void OnAfterBuildContextMenu (ModuleType type) override
 
void DestroySplitView ()
 
void DoInitializations (const wxString &filename, LoaderBase *fileLdr=nullptr)
 
void BreakpointMarkerToggle (int line)
 

Static Private Member Functions

static void InternalSetEditorStyleBeforeFileOpen (cbStyledTextCtrl *control)
 
static void InternalSetEditorStyleAfterFileOpen (cbStyledTextCtrl *control)
 

Private Attributes

bool m_IsOK
 
wxSplitterWindowm_pSplitter
 
wxBoxSizerm_pSizer
 
cbStyledTextCtrlm_pControl
 
cbStyledTextCtrlm_pControl2
 
cbStyledTextCtrlm_foldBackup
 
SplitType m_SplitType
 
bool m_Modified
 
int m_Index
 
wxTimer m_timerWait
 
ProjectFilem_pProjectFile
 
EditorColourSetm_pTheme
 
HighlightLanguage m_lang
 
wxDateTime m_LastModified
 
bool m_autoIndentDone
 
cbEditorInternalDatam_pData
 

Friends

class EditorManager
 
struct cbEditorInternalData
 

Additional Inherited Members

- Protected Attributes inherited from EditorBase
bool m_IsBuiltinEditor
 
wxString m_Shortname
 
wxString m_Filename
 
EditorBaseInternalDatam_pData
 Use this to add new vars/functions w/out breaking the ABI. More...
 

Detailed Description

A file editor.

This class represents one builtin editor in Code::Blocks. It holds all the necessary information about an editor. When you want to access a Code::Blocks editor, this is the class you want to get at ;)
To do this, use Manager::Get()->GetEditorManager() functions.

The actual editor component used is Scintilla and it can be accessed through the member function GetControl().

Definition at line 43 of file cbeditor.h.

Member Enumeration Documentation

◆ FoldFlags

enum cbEditor::FoldFlags : unsigned
private
Enumerator
none 
ensureVisible 

Definition at line 333 of file cbeditor.h.

◆ FoldMode

enum cbEditor::FoldMode : int
strongprivate
Enumerator
contract 
expand 
toggle 

Definition at line 327 of file cbeditor.h.

◆ SplitType

Enumerator
stNoSplit 
stHorizontal 
stVertical 

Definition at line 62 of file cbeditor.h.

Constructor & Destructor Documentation

◆ cbEditor() [1/3]

cbEditor::cbEditor ( wxWindow parent,
const wxString filename,
EditorColourSet theme 
)
protected

cbEditor constructor.

Parameters
parentthe parent notebook - you should use EditorManager::Get()
filenamethe filename to open. If filename is empty, it creates a new, empty, editor.
themethe initial colour set to use
Note: you cannot create a cbEditor object directly. Instead use EditorManager's methods to do it...

Definition at line 689 of file cbeditor.cpp.

References DoInitializations().

◆ cbEditor() [2/3]

cbEditor::cbEditor ( wxWindow parent,
LoaderBase fileLdr,
const wxString filename,
EditorColourSet theme 
)
protected

Definition at line 707 of file cbeditor.cpp.

References DoInitializations().

◆ ~cbEditor()

cbEditor::~cbEditor ( )
overrideprotected

◆ cbEditor() [3/3]

cbEditor::cbEditor ( cb_unused const cbEditor rhs)
private

Member Function Documentation

◆ AddBreakpoint()

bool cbEditor::AddBreakpoint ( int  line = -1,
bool  notifyDebugger = true 
)

◆ AddToContextMenu()

void cbEditor::AddToContextMenu ( wxMenu popup,
ModuleType  type,
bool  pluginsdone 
)
override

◆ ApplyStyles()

void cbEditor::ApplyStyles ( cbStyledTextCtrl control)
static

Apply the editor defaults to any (possibly foreign) cbStyledTextCtrl.

Definition at line 1309 of file cbeditor.cpp.

References InternalSetEditorStyleAfterFileOpen(), and InternalSetEditorStyleBeforeFileOpen().

Referenced by SaveFoldState(), and CodeRefactoring::VerifyResult().

◆ AutoComplete()

void cbEditor::AutoComplete ( )

This method is obsolete, use the abbreviations plugin instead.

Definition at line 1983 of file cbeditor.cpp.

References _T, Manager::Get(), Manager::GetLogManager(), and LogManager::Log().

Referenced by ScriptBindings::RegisterBindings().

◆ AutoIndentDone()

void cbEditor::AutoIndentDone ( )

Definition at line 3322 of file cbeditor.cpp.

References m_autoIndentDone.

◆ BreakpointMarkerToggle()

void cbEditor::BreakpointMarkerToggle ( int  line)
private

◆ CanPaste()

bool cbEditor::CanPaste ( ) const
overridevirtual

Is there something to paste?

Returns
True if there is something to paste, false if not.

Reimplemented from EditorBase.

Definition at line 2559 of file cbeditor.cpp.

References wxScintilla::CanPaste(), cbAssert, GetControl(), and IsReadOnly().

◆ CanRedo()

bool cbEditor::CanRedo ( ) const
overridevirtual

Is there something to redo?

Returns
True if there is something to redo, false if not.

Reimplemented from EditorBase.

Definition at line 2546 of file cbeditor.cpp.

References wxScintilla::CanRedo(), cbAssert, GetControl(), and IsReadOnly().

Referenced by MainFrame::OnSearchMenuUpdateUI().

◆ CanSelectAll()

bool cbEditor::CanSelectAll ( ) const
overridevirtual

Can the editor select everything?

Returns
True if the editor can select all content, false if not.

Reimplemented from EditorBase.

Definition at line 3536 of file cbeditor.cpp.

References GetControl(), and wxScintilla::GetLength().

◆ CanUndo()

bool cbEditor::CanUndo ( ) const
overridevirtual

Is there something to undo?

Returns
True if there is something to undo, false if not.

Reimplemented from EditorBase.

Definition at line 2540 of file cbeditor.cpp.

References wxScintilla::CanUndo(), cbAssert, GetControl(), and IsReadOnly().

Referenced by MainFrame::OnSearchMenuUpdateUI().

◆ ClearAllBookmarks()

void cbEditor::ClearAllBookmarks ( )
virtual

Clear all bookmarks.

Definition at line 2441 of file cbeditor.cpp.

References BOOKMARK_MARKER, GetControl(), and wxScintilla::MarkerDeleteAll().

Referenced by ScriptBindings::RegisterBindings().

◆ ClearHistory()

void cbEditor::ClearHistory ( )
overridevirtual

Clear Undo- (and Changebar-) history.

Reimplemented from EditorBase.

Definition at line 2472 of file cbeditor.cpp.

References _T, cbAssert, wxScintilla::EmptyUndoBuffer(), Manager::Get(), and GetControl().

Referenced by EditorConfigurationDlg::EndModal().

◆ ConnectEvents()

void cbEditor::ConnectEvents ( cbStyledTextCtrl stc)
private

◆ Copy()

void cbEditor::Copy ( )
overridevirtual

Copy selected text/object to clipboard.

Reimplemented from EditorBase.

Definition at line 2528 of file cbeditor.cpp.

References cbAssert, wxScintilla::Copy(), and GetControl().

◆ CreateContextSubMenu()

wxMenu * cbEditor::CreateContextSubMenu ( long  id)
overridevirtual

◆ CreateEditor()

cbStyledTextCtrl * cbEditor::CreateEditor ( )
private

◆ Cut()

void cbEditor::Cut ( )
overridevirtual

Cut selected text/object to clipboard.

Reimplemented from EditorBase.

Definition at line 2522 of file cbeditor.cpp.

References cbAssert, wxScintilla::Cut(), and GetControl().

◆ DestroySplitView()

void cbEditor::DestroySplitView ( )
private

Definition at line 828 of file cbeditor.cpp.

References m_pControl2, and m_pSplitter.

Referenced by Unsplit(), and ~cbEditor().

◆ DoAskForCodeCompletion()

void cbEditor::DoAskForCodeCompletion ( )
private

◆ DoFoldAll()

void cbEditor::DoFoldAll ( FoldMode  fold)
private

◆ DoFoldBlockFromLine()

void cbEditor::DoFoldBlockFromLine ( int  line,
FoldMode  fold,
unsigned  foldFlags 
)
private

◆ DoIndent()

void cbEditor::DoIndent ( )

Indents current line/block.

Definition at line 3443 of file cbeditor.cpp.

References GetControl(), wxScintilla::SendMsg(), and wxSCI_CMD_TAB.

◆ DoInitializations()

void cbEditor::DoInitializations ( const wxString filename,
LoaderBase fileLdr = nullptr 
)
private

◆ DoUnIndent()

void cbEditor::DoUnIndent ( )

UnIndents current line/block.

Definition at line 3450 of file cbeditor.cpp.

References GetControl(), wxScintilla::SendMsg(), and wxSCI_CMD_BACKTAB.

Referenced by MainFrame::OnShiftTab().

◆ FixFoldState()

bool cbEditor::FixFoldState ( )

◆ FoldAll()

void cbEditor::FoldAll ( )

Fold all editor folds (hides blocks of code).

Definition at line 2137 of file cbeditor.cpp.

References contract, and DoFoldAll().

Referenced by DoInitializations(), OnContextMenuEntry(), MainFrame::OnEditFoldAll(), and ScriptBindings::RegisterBindings().

◆ FoldBlockFromLine()

void cbEditor::FoldBlockFromLine ( int  line = -1)

Folds the block containing line.

If line is -1, folds the block containing the caret.

Definition at line 2202 of file cbeditor.cpp.

References contract, DoFoldBlockFromLine(), GetControl(), and wxScintilla::GetCurrentLine().

Referenced by OnContextMenuEntry(), MainFrame::OnEditFoldBlock(), and ScriptBindings::RegisterBindings().

◆ GetColourSet()

EditorColourSet* cbEditor::GetColourSet ( ) const
inline

Get the colour set in use.

Definition at line 170 of file cbeditor.h.

Referenced by CodeCompletion::DoCodeComplete(), CodeCompletion::GetProviderStatusFor(), and MainFrame::OnEditMenuUpdateUI().

◆ GetControl()

cbStyledTextCtrl * cbEditor::GetControl ( ) const

Returns a pointer to the underlying cbStyledTextCtrl object (which itself is the wxWindows implementation of Scintilla).

If you want to mess with the actual contents of an editor, this is the object you want to get.

Remarks
If the editor is split, this function returns the control which currently has the keyboard focus. Don't save this pointer because it might be invalid at any later time...

Definition at line 842 of file cbeditor.cpp.

References cbStyledTextCtrl::GetLastFocusTime(), m_pControl, and m_pControl2.

Referenced by AddBreakpoint(), AddToContextMenu(), CanPaste(), CanRedo(), CanSelectAll(), CanUndo(), ScriptBindings::cbEditor_SetText(), EditorManager::CheckForExternallyModifiedFiles(), ClearAllBookmarks(), ClearHistory(), EditorManager::CollectDefines(), Copy(), CrashHandlerSaveEditorFiles(), CreateContextSubMenu(), Cut(), CompilerGCC::Dispatcher(), EditorBase::DisplayContextMenu(), CodeCompletion::DoAllMethodsImpl(), CodeCompletion::DoAutocomplete(), CodeCompletion::DoClassMethodDeclImpl(), CodeCompletion::DoCodeComplete(), CodeCompletion::DoCodeCompleteIncludes(), CodeCompletion::DoCodeCompletePreprocessor(), CodeRefactoring::DoFindReferences(), DoFoldAll(), DoFoldBlockFromLine(), DoIndent(), CodeRefactoring::DoRenameSymbols(), CCManager::DoShowDocumentation(), DoUnIndent(), CCManager::DoUpdateCallTip(), MainFrame::DoUpdateStatusBar(), CodeCompletion::EditorEventHook(), NewFromTemplateDlg::EditScript(), cbEditorInternalData::EnsureConsistentLineEnds(), cbEditorInternalData::EnsureFinalLineEnd(), FindReplace::FindInFiles(), FindReplace::FindNext(), FindReplace::FindSelectedText(), FoldBlockFromLine(), CodeCompletion::GetAutocompList(), NativeParser::GetCallTips(), cbDebuggerPlugin::GetEditorWordAtCaret(), cbSmartIndentPlugin::GetLastNonCommentWord(), cbSmartIndentPlugin::GetLastNonWhitespaceChars(), GetLineIndentInSpaces(), GetLineIndentString(), GetSelectedText(), CodeRefactoring::GetSymbolUnderCursor(), CodeCompletion::GetTokenAt(), cbEditorInternalData::GetUrl(), CodeCompletion::GotoFunctionPrevNext(), GotoLine(), GotoMatchingBrace(), GotoNextChanged(), GotoPreviousChanged(), GotoTokenPosition(), HasBreakpoint(), HasSelection(), HighlightBraces(), CCManager::InjectAutoCompShow(), InsertNewLine(), IsReadOnly(), LineHasMarker(), FileManager::Load(), MarkerNext(), MarkerPrevious(), MarkerToggle(), NativeParser::MarkItemsByAI(), MarkLine(), EditorManager::New(), CodeBlocksApp::OnAppActivate(), CCManager::OnAutocompleteSelect(), CCManager::OnCompleteCode(), OnContextMenuEntry(), CCManager::OnDeactivateApp(), CCManager::OnDeactivateEd(), CCManager::OnDeferredCallTipCancel(), MainFrame::OnEditBoxCommentSelected(), MainFrame::OnEditCommentSelected(), MainFrame::OnEditEOLMode(), MainFrame::OnEditGotoLineEnd(), MainFrame::OnEditInsertNewLine(), MainFrame::OnEditLineCopy(), MainFrame::OnEditLineCut(), MainFrame::OnEditLineDelete(), MainFrame::OnEditLineDuplicate(), MainFrame::OnEditLineMove(), MainFrame::OnEditLinePaste(), MainFrame::OnEditLineTranspose(), MainFrame::OnEditLowerCase(), MainFrame::OnEditMenuUpdateUI(), OnEditorCharAdded(), CCManager::OnEditorClose(), OnEditorDwellStart(), CCManager::OnEditorHook(), OnEditorModified(), CCManager::OnEditorOpen(), CCManager::OnEditorTooltip(), MainFrame::OnEditParaDown(), MainFrame::OnEditParaDownExtend(), MainFrame::OnEditParaUp(), MainFrame::OnEditParaUpExtend(), MainFrame::OnEditStreamCommentSelected(), MainFrame::OnEditToggleCommentSelected(), MainFrame::OnEditUncommentSelected(), MainFrame::OnEditUndo(), MainFrame::OnEditUpperCase(), MainFrame::OnEditWordPartLeft(), MainFrame::OnEditWordPartLeftExtend(), MainFrame::OnEditWordPartRight(), MainFrame::OnEditWordPartRightExtend(), MainFrame::OnEditZoomIn(), MainFrame::OnEditZoomOut(), MainFrame::OnEditZoomReset(), MainFrame::OnFileNewWhat(), CodeCompletion::OnGotoDeclaration(), CodeCompletion::OnGotoFunction(), CompilerGCC::OnJobEnd(), OnMarginClick(), CCManager::OnMenuSelect(), CodeCompletion::OnRealtimeParsingTimer(), DebuggerMenuHandler::OnRunToCursor(), MainFrame::OnSearchGotoLine(), DebuggerMenuHandler::OnSetNextStatement(), CCManager::OnShowCallTip(), CCManager::OnTimer(), EditorManager::OnUpdateUI(), OnZoom(), EditorManager::Open(), CodeRefactoring::Parse(), CodeCompletion::ParseFunctionsAndFillToolbar(), Paste(), Print(), PrintDialog::PrintDialog(), CCManager::ProcessArrow(), cbDebuggerPlugin::ProcessValueTooltip(), MacrosManager::RecalcVars(), Redo(), RefreshBreakpointMarkers(), RemoveBreakpoint(), FindReplace::ReplaceInFiles(), CodeRefactoring::SearchInFiles(), SelectAll(), SetChangeCollection(), SetDebugLine(), cbEditorInternalData::SetFoldingColWidth(), cbEditorInternalData::SetLineNumberColWidth(), SetReadOnly(), setupColours(), SetZoom(), FindReplace::ShowFindDialog(), DebugInterfaceFactory::ShowValueTooltip(), cbEditorInternalData::StripTrailingSpaces(), cbSearchResultsLog::SyncEditor(), ToggleBreakpoint(), ToggleFoldBlockFromLine(), Undo(), UnfoldBlockFromLine(), Unsplit(), CodeCompletion::UpdateEditorSyntax(), UpdateProjectFile(), and CodeRefactoring::VerifyResult().

◆ GetEncoding()

wxFontEncoding cbEditor::GetEncoding ( ) const

◆ GetEncodingName()

wxString cbEditor::GetEncodingName ( ) const

Definition at line 1634 of file cbeditor.cpp.

References GetEncoding(), and wxFontMapper::GetEncodingName().

Referenced by MainFrame::DoUpdateStatusBar().

◆ GetLanguage()

HighlightLanguage cbEditor::GetLanguage ( ) const
inline

◆ GetLastModificationTime()

wxDateTime cbEditor::GetLastModificationTime ( ) const
inline

◆ GetLeftSplitViewControl()

cbStyledTextCtrl* cbEditor::GetLeftSplitViewControl ( ) const
inline

Returns a pointer to the left (or top) split-view cbStyledTextCtrl.

This function always returns a valid pointer.

Definition at line 87 of file cbeditor.h.

Referenced by EditorColourSet::Apply().

◆ GetLineIndentInSpaces()

int cbEditor::GetLineIndentInSpaces ( int  line = -1) const

Returns the specified line's (0-based) indentation (whitespace) in spaces.

If line is -1, it uses the current line

Definition at line 2751 of file cbeditor.cpp.

References _T, GetControl(), wxScintilla::GetCurrentPos(), wxScintilla::GetLine(), wxScintilla::GetTabWidth(), wxString::Length(), and wxScintilla::LineFromPosition().

Referenced by ScriptBindings::RegisterBindings().

◆ GetLineIndentString()

wxString cbEditor::GetLineIndentString ( int  line = -1) const

Returns the specified line's (0-based) indentation (whitespace) string.

If line is -1, it uses the current line

Definition at line 2778 of file cbeditor.cpp.

References GetControl(), and cbEditorInternalData::GetLineIndentString().

Referenced by CodeCompletion::DoAllMethodsImpl(), CodeCompletion::DoClassMethodDeclImpl(), OnEditorCharAdded(), CCManager::OnEditorTooltip(), and ScriptBindings::RegisterBindings().

◆ GetModified()

bool cbEditor::GetModified ( ) const
overridevirtual

Returns true if editor is modified, false otherwise.

Reimplemented from EditorBase.

Definition at line 856 of file cbeditor.cpp.

References wxScintilla::GetModify(), m_Modified, and m_pControl.

Referenced by EditorManager::CheckForExternallyModifiedFiles(), MainFrame::DoUpdateStatusBar(), FileManager::Load(), cbProject::QueryCloseAllFiles(), Save(), and SetProjectFile().

◆ GetProjectFile()

ProjectFile* cbEditor::GetProjectFile ( ) const
inline

◆ GetRightSplitViewControl()

cbStyledTextCtrl* cbEditor::GetRightSplitViewControl ( ) const
inline

Returns a pointer to the right (or bottom) split-view cbStyledTextCtrl.

This function may return NULL if the editor is not split.

Definition at line 92 of file cbeditor.h.

Referenced by EditorColourSet::Apply().

◆ GetSplitType()

SplitType cbEditor::GetSplitType ( ) const
inline

Returns the state of split-view for this editor.

Definition at line 95 of file cbeditor.h.

Referenced by EditorManager::OnPageContextMenu().

◆ GetUseBom()

bool cbEditor::GetUseBom ( ) const

◆ GotoLine()

void cbEditor::GotoLine ( int  line,
bool  centerOnScreen = true 
)
overridevirtual

Move the caret at the specified line.

Parameters
lineLine to move caret to.
centerOnScreenIf true (default), tries to bring the specified line to the centre of the editor.

Reimplemented from EditorBase.

Definition at line 2223 of file cbeditor.cpp.

References DoFoldBlockFromLine(), wxScintilla::EnsureVisible(), expand, GetControl(), and wxScintilla::GotoLine().

Referenced by CompilerErrors::DoGotoError(), CodeCompletion::GotoFunctionPrevNext(), GotoTokenPosition(), MarkerNext(), MarkerPrevious(), CCDebugInfo::OnGoDeclClick(), CCDebugInfo::OnGoImplClick(), BreakpointsDlg::OnOpen(), MainFrame::OnSearchGotoLine(), cbSearchResultsLog::SyncEditor(), and cbDebuggerPlugin::SyncEditor().

◆ GotoMatchingBrace()

void cbEditor::GotoMatchingBrace ( )

◆ GotoNextBookmark()

void cbEditor::GotoNextBookmark ( )
virtual

Go to next bookmark.

Definition at line 2431 of file cbeditor.cpp.

References BOOKMARK_MARKER, and MarkerNext().

Referenced by ScriptBindings::RegisterBindings().

◆ GotoNextBreakpoint()

void cbEditor::GotoNextBreakpoint ( )
virtual

Go to next debugger breakpoint.

Definition at line 2364 of file cbeditor.cpp.

References BREAKPOINT_MARKER, and MarkerNext().

Referenced by ScriptBindings::RegisterBindings().

◆ GotoNextChanged()

void cbEditor::GotoNextChanged ( )
overridevirtual

◆ GotoPreviousBookmark()

void cbEditor::GotoPreviousBookmark ( )
virtual

Go to previous bookmark.

Definition at line 2436 of file cbeditor.cpp.

References BOOKMARK_MARKER, and MarkerPrevious().

Referenced by ScriptBindings::RegisterBindings().

◆ GotoPreviousBreakpoint()

void cbEditor::GotoPreviousBreakpoint ( )
virtual

Go to previous debugger breakpoint.

Definition at line 2369 of file cbeditor.cpp.

References BREAKPOINT_MARKER, and MarkerPrevious().

Referenced by ScriptBindings::RegisterBindings().

◆ GotoPreviousChanged()

void cbEditor::GotoPreviousChanged ( )
overridevirtual

◆ GotoTokenPosition()

bool cbEditor::GotoTokenPosition ( int  line,
const wxString tokenName 
)

◆ HasBookmark()

bool cbEditor::HasBookmark ( int  line) const
virtual

Does line has bookmark?

Definition at line 2426 of file cbeditor.cpp.

References BOOKMARK_MARKER, and LineHasMarker().

Referenced by ScriptBindings::RegisterBindings().

◆ HasBreakpoint()

bool cbEditor::HasBreakpoint ( int  line) const
virtual

Does line has debugger breakpoint? If line is -1, use current line.

Definition at line 2357 of file cbeditor.cpp.

References BREAKPOINT_DISABLED_MARKER, BREAKPOINT_MARKER, GetControl(), wxScintilla::GetCurrentLine(), and LineHasMarker().

Referenced by AddBreakpoint(), ScriptBindings::RegisterBindings(), RemoveBreakpoint(), and ToggleBreakpoint().

◆ HasSelection()

bool cbEditor::HasSelection ( ) const
overridevirtual

Is there a selection?

Returns
True if there is text/object selected, false if not.

Reimplemented from EditorBase.

Definition at line 2552 of file cbeditor.cpp.

References cbAssert, GetControl(), wxScintilla::GetSelectionEnd(), and wxScintilla::GetSelectionStart().

◆ HighlightBraces()

void cbEditor::HighlightBraces ( )

◆ InternalSetEditorStyleAfterFileOpen()

void cbEditor::InternalSetEditorStyleAfterFileOpen ( cbStyledTextCtrl control)
staticprivate

◆ InternalSetEditorStyleBeforeFileOpen()

void cbEditor::InternalSetEditorStyleBeforeFileOpen ( cbStyledTextCtrl control)
staticprivate

Definition at line 1319 of file cbeditor.cpp.

References _T, BOOKMARK_MARKER, BOOKMARK_STYLE, BREAKPOINT_DISABLED_MARKER, BREAKPOINT_MARKER, BREAKPOINT_OTHER_MARKER, BREAKPOINT_STYLE, C_CHANGEBAR_MARGIN, C_MARKER_MARGIN, cbLoadBitmap(), wxScintilla::CmdKeyAssign(), DEBUG_MARKER, DEBUG_MARKER_HIGHLIGHT, DEBUG_STYLE, DEBUG_STYLE_HIGHLIGHT, ERROR_MARKER, ERROR_STYLE, wxNativeFontInfo::FromString(), Manager::Get(), ColourManager::GetColour(), Manager::GetColourManager(), Manager::GetConfigManager(), ConfigManager::GetDataFolder(), wxScintilla::GetMarginMask(), wxString::IsEmpty(), wxBitmap::IsOk(), wxScintilla::MarkerDefine(), wxScintilla::MarkerDefineBitmap(), wxScintilla::MarkerSetBackground(), ConfigManager::Read(), ConfigManager::ReadBool(), ConfigManager::ReadInt(), wxScintilla::SetAdditionalSelectionTyping(), wxScintilla::SetBackSpaceUnIndents(), wxScintilla::SetCaretForeground(), wxScintilla::SetCaretLineVisible(), wxScintilla::SetCaretPeriod(), wxScintilla::SetCaretStyle(), wxScintilla::SetCaretWidth(), wxScintilla::SetEdgeColour(), wxScintilla::SetEdgeColumn(), wxScintilla::SetEdgeMode(), wxScintilla::SetFoldMarginColour(), wxScintilla::SetFoldMarginHiColour(), wxScintilla::SetIndentationGuides(), wxScintilla::SetMarginMask(), wxScintilla::SetMarginSensitive(), wxScintilla::SetMarginType(), wxScintilla::SetMarginWidth(), wxScintilla::SetMouseDwellTime(), wxScintilla::SetMultiPaste(), wxScintilla::SetMultipleSelection(), wxFont::SetNativeFontInfo(), wxScintilla::SetScrollWidthTracking(), wxScintilla::SetTabIndents(), wxScintilla::SetTabWidth(), wxScintilla::SetUseTabs(), wxScintilla::SetViewEOL(), wxScintilla::SetViewWhiteSpace(), wxScintilla::SetVirtualSpaceOptions(), wxScintilla::SetVisiblePolicy(), wxScintilla::SetWhitespaceForeground(), wxScintilla::SetWrapMode(), wxScintilla::SetYCaretPolicy(), wxScintilla::StyleClearAll(), wxScintilla::StyleSetFont(), wxBITMAP_TYPE_PNG, wxEmptyString, wxFONTFAMILY_MODERN, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, wxSCI_CARET_EVEN, wxSCI_CARET_SLOP, wxSCI_CARET_STRICT, wxSCI_CARETSTYLE_LINE, wxSCI_CMD_HOME, wxSCI_CMD_HOMEEXTEND, wxSCI_CMD_HOMEWRAP, wxSCI_CMD_HOMEWRAPEXTEND, wxSCI_CMD_LINEEND, wxSCI_CMD_LINEENDEXTEND, wxSCI_CMD_LINEENDWRAP, wxSCI_CMD_LINEENDWRAPEXTEND, wxSCI_CMD_VCHOME, wxSCI_CMD_VCHOMEEXTEND, wxSCI_CMD_VCHOMEWRAP, wxSCI_CMD_VCHOMEWRAPEXTEND, wxSCI_CMD_WORDLEFT, wxSCI_CMD_WORDLEFTEXTEND, wxSCI_CMD_WORDPARTLEFT, wxSCI_CMD_WORDPARTLEFTEXTEND, wxSCI_CMD_WORDPARTRIGHT, wxSCI_CMD_WORDPARTRIGHTEXTEND, wxSCI_CMD_WORDRIGHT, wxSCI_CMD_WORDRIGHTEXTEND, wxSCI_IV_LOOKBOTH, wxSCI_IV_NONE, wxSCI_KEY_END, wxSCI_KEY_HOME, wxSCI_KEY_LEFT, wxSCI_KEY_RIGHT, wxSCI_KEYMOD_ALT, wxSCI_KEYMOD_CTRL, wxSCI_KEYMOD_NORM, wxSCI_KEYMOD_SHIFT, wxSCI_MARGIN_SYMBOL, wxSCI_MARK_LEFTRECT, wxSCI_MARKNUM_CHANGESAVED, wxSCI_MARKNUM_CHANGEUNSAVED, wxSCI_STYLE_DEFAULT, wxSCI_VS_NONE, wxSCI_VS_RECTANGULARSELECTION, wxSCI_VS_USERACCESSIBLE, and wxT.

Referenced by ApplyStyles(), SetEditorStyleBeforeFileOpen(), and Split().

◆ IsOK()

bool cbEditor::IsOK ( ) const
inline

Returns true if editor is OK, i.e.

constructor was called with a filename parameter and file was opened successfully. If it returns false, you should delete the editor...

Definition at line 101 of file cbeditor.h.

References EditorBase::GetModified(), and EditorBase::SetModified().

Referenced by EditorManager::CheckForExternallyModifiedFiles(), and EditorManager::Open().

◆ IsReadOnly()

bool cbEditor::IsReadOnly ( ) const
overridevirtual

Is the editor read-only?

Returns
True if the editor is read-only, false if not.

Reimplemented from EditorBase.

Definition at line 2568 of file cbeditor.cpp.

References cbAssert, GetControl(), and wxScintilla::GetReadOnly().

Referenced by CanPaste(), CanRedo(), and CanUndo().

◆ LineHasMarker()

bool cbEditor::LineHasMarker ( int  marker,
int  line = -1 
) const
private

◆ MarkerNext()

void cbEditor::MarkerNext ( int  marker)
private

◆ MarkerPrevious()

void cbEditor::MarkerPrevious ( int  marker)
private

◆ MarkerToggle()

void cbEditor::MarkerToggle ( int  marker,
int  line = -1 
)
private

◆ MarkLine()

void cbEditor::MarkLine ( int  marker,
int  line 
)
private

Definition at line 2635 of file cbeditor.cpp.

References GetControl(), wxScintilla::MarkerAdd(), and wxScintilla::MarkerDeleteAll().

Referenced by SetDebugLine(), and SetErrorLine().

◆ NotifyPlugins()

void cbEditor::NotifyPlugins ( wxEventType  type,
int  intArg = 0,
const wxString strArg = wxEmptyString,
int  xArg = 0,
int  yArg = 0 
)
private

◆ OnAfterBuildContextMenu()

void cbEditor::OnAfterBuildContextMenu ( ModuleType  type)
overrideprivate

Definition at line 3005 of file cbeditor.cpp.

◆ OnBeforeBuildContextMenu()

bool cbEditor::OnBeforeBuildContextMenu ( const wxPoint position,
ModuleType  type 
)
overrideprivate

◆ OnClose()

void cbEditor::OnClose ( wxCloseEvent event)
private

◆ OnContextMenuEntry()

void cbEditor::OnContextMenuEntry ( wxCommandEvent event)
private

Definition at line 3084 of file cbeditor.cpp.

References _T, AddBreakpoint(), BOOKMARK_MARKER, wxScintilla::Copy(), wxScintilla::Cut(), cbBreakpointsDlg::EditBreakpoint(), wxScintilla::EmptyUndoBuffer(), cbBreakpointsDlg::EnableBreakpoint(), FoldAll(), FoldBlockFromLine(), Manager::Get(), ProjectManager::GetActiveProject(), DebuggerManager::GetBreakpointDialog(), GetControl(), Manager::GetDebuggerManager(), Manager::GetEditorManager(), cbProject::GetFileByFilename(), EditorBase::GetFilename(), ProjectFile::GetParentProject(), Manager::GetProjectManager(), ProjectManager::GetUI(), cbEditorInternalData::GetUrl(), idAddFileToProject, idBookmarkAdd, idBookmarkRemove, idBookmarkRemoveAll, idBookmarksClearAll, idBookmarksNext, idBookmarksPrevious, idBookmarksToggle, idBreakpointAdd, idBreakpointDisable, idBreakpointEdit, idBreakpointEnable, idBreakpointRemove, idClearHistory, idCopy, idCut, idDelete, idFoldingFoldAll, idFoldingFoldCurrent, idFoldingToggleAll, idFoldingToggleCurrent, idFoldingUnfoldAll, idFoldingUnfoldCurrent, idLowerCase, idOpenContainingFolder, idOpenUrl, idPaste, idProperties, idRedo, idRemoveFileFromProject, idSelectAll, idShowFileInProject, idSplitHorz, idSplitVert, idSwapHeaderSource, idUndo, idUnsplit, idUpperCase, wxScintilla::LowerCase(), EditorBase::m_Filename, cbEditorInternalData::m_LastMarginMenuLine, m_pData, m_pProjectFile, wxScintilla::MarkerAdd(), wxScintilla::MarkerDelete(), wxScintilla::MarkerDeleteAll(), MarkerNext(), MarkerPrevious(), MarkerToggle(), EditorManager::OpenContainingFolder(), wxScintilla::Paste(), PlaceWindow(), cbProjectManagerUI::RebuildTree(), wxScintilla::Redo(), RemoveBreakpoint(), ProjectManager::RemoveFileFromProject(), wxScintilla::ReplaceSelection(), wxScintilla::SelectAll(), SetProjectFile(), cbProjectManagerUI::ShowFileInTree(), wxDialog::ShowModal(), ProjectFile::ShowOptions(), Split(), stHorizontal, stVertical, EditorManager::SwapActiveHeaderSource(), cbProjectManagerUI::SwitchToProjectsPage(), ToggleAllFolds(), ToggleFoldBlockFromLine(), wxScintilla::Undo(), UnfoldAll(), UnfoldBlockFromLine(), Unsplit(), wxScintilla::UpperCase(), wxEmptyString, and wxLaunchDefaultBrowser().

◆ OnEditorChange()

void cbEditor::OnEditorChange ( wxScintillaEvent event)
private

Definition at line 3251 of file cbeditor.cpp.

References wxScintilla::GetModify(), m_pControl, OnScintillaEvent(), and SetModified().

Referenced by ConnectEvents().

◆ OnEditorCharAdded()

void cbEditor::OnEditorCharAdded ( wxScintillaEvent event)
private

◆ OnEditorDwellEnd()

void cbEditor::OnEditorDwellEnd ( wxScintillaEvent event)
private

Definition at line 3356 of file cbeditor.cpp.

References cbEVT_EDITOR_TOOLTIP_CANCEL, NotifyPlugins(), and OnScintillaEvent().

Referenced by ConnectEvents().

◆ OnEditorDwellStart()

void cbEditor::OnEditorDwellStart ( wxScintillaEvent event)
private

◆ OnEditorModified()

void cbEditor::OnEditorModified ( wxScintillaEvent event)
private

◆ OnEditorUpdateUI()

void cbEditor::OnEditorUpdateUI ( wxScintillaEvent event)
private

◆ OnMarginClick()

void cbEditor::OnMarginClick ( wxScintillaEvent event)
private

◆ OnScintillaEvent()

void cbEditor::OnScintillaEvent ( wxScintillaEvent event)
private

notify all the registered EditorHook functions

Parameters
eventindicates which event is received by the cbEditor You should bind OnScintillaEvent to every wxScintillaEvent events, either directly or indirectly, see cbEditor::ConnectEvents() for more details.

Definition at line 3495 of file cbeditor.cpp.

References EditorHooks::CallHooks(), EditorHooks::HasRegisteredHooks(), and ProjectManager::IsBusy().

Referenced by ConnectEvents(), OnEditorChange(), OnEditorCharAdded(), OnEditorDwellEnd(), OnEditorDwellStart(), OnEditorModified(), OnEditorUpdateUI(), OnMarginClick(), OnUserListSelection(), and OnZoom().

◆ OnUserListSelection()

void cbEditor::OnUserListSelection ( wxScintillaEvent event)
private

Definition at line 3433 of file cbeditor.cpp.

References OnScintillaEvent().

Referenced by ConnectEvents().

◆ OnZoom()

void cbEditor::OnZoom ( wxScintillaEvent event)
private

◆ Open()

bool cbEditor::Open ( bool  detectEncoding = true)
private

◆ operator=()

void cbEditor::operator= ( cb_unused const cbEditor rhs)
inline

Don't use this.

It throws an exception if you do.

Definition at line 70 of file cbeditor.h.

References _T, and cbThrow.

◆ Paste()

void cbEditor::Paste ( )
overridevirtual

Paste selected text/object from clipboard.

Reimplemented from EditorBase.

Definition at line 2534 of file cbeditor.cpp.

References cbAssert, GetControl(), and wxScintilla::Paste().

◆ Print()

void cbEditor::Print ( bool  selectionOnly,
PrintColourMode  pcm,
bool  line_numbers 
)

◆ Redo()

void cbEditor::Redo ( )
overridevirtual

Redo changes.

Reimplemented from EditorBase.

Definition at line 2466 of file cbeditor.cpp.

References cbAssert, GetControl(), and wxScintilla::Redo().

◆ RefreshBreakpointMarkers()

void cbEditor::RefreshBreakpointMarkers ( )
virtual

◆ Reload()

bool cbEditor::Reload ( bool  detectEncoding = true)

Reloads the file from disk.

Returns
True on success, False on failure.

Definition at line 1673 of file cbeditor.cpp.

References wxScintilla::GetCurrentPos(), wxScintilla::GotoPos(), m_pControl, m_pControl2, Open(), and SetEditorStyleAfterFileOpen().

Referenced by EditorManager::CheckForExternallyModifiedFiles(), and ScriptBindings::RegisterBindings().

◆ RemoveBreakpoint()

bool cbEditor::RemoveBreakpoint ( int  line = -1,
bool  notifyDebugger = true 
)

◆ Save()

bool cbEditor::Save ( )
overridevirtual

◆ SaveAs()

bool cbEditor::SaveAs ( )
overridevirtual

◆ SaveFoldState()

bool cbEditor::SaveFoldState ( )

Save fold states within a new cbStyledTextCtrl.

This saves the whole document, thus saving the fold states before the Fold Options Change

Definition at line 1920 of file cbeditor.cpp.

References ApplyStyles(), CreateEditor(), wxScintilla::GetFoldLevel(), wxScintilla::GetLineCount(), wxScintilla::GetText(), m_foldBackup, m_pControl, wxScintilla::SetFoldLevel(), and wxScintilla::SetText().

Referenced by EditorManager::RecreateOpenEditorStyles().

◆ SelectAll()

void cbEditor::SelectAll ( )
overridevirtual

Select everything in the editor.

Reimplemented from EditorBase.

Definition at line 3545 of file cbeditor.cpp.

References GetControl(), and wxScintilla::SelectAll().

◆ SetChangeCollection()

void cbEditor::SetChangeCollection ( bool  collectChange)
override

◆ SetColourSet()

void cbEditor::SetColourSet ( EditorColourSet theme)

Set the colour set to use.

Definition at line 1620 of file cbeditor.cpp.

References m_lang, m_pTheme, and SetLanguage().

Referenced by EditorManager::New(), and EditorManager::SetColourSet().

◆ SetDebugLine()

void cbEditor::SetDebugLine ( int  line)
virtual

◆ SetEditorStyle()

void cbEditor::SetEditorStyle ( )

Applies the styles that match the filename of the editor.

Should be called after new file is created. Calling SaveAs does the same thing.

Definition at line 1230 of file cbeditor.cpp.

References SetEditorStyleAfterFileOpen(), and SetEditorStyleBeforeFileOpen().

Referenced by EditorManager::RecreateOpenEditorStyles().

◆ SetEditorStyleAfterFileOpen()

void cbEditor::SetEditorStyleAfterFileOpen ( )
private

◆ SetEditorStyleBeforeFileOpen()

void cbEditor::SetEditorStyleBeforeFileOpen ( )
private

◆ SetEditorTitle()

void cbEditor::SetEditorTitle ( const wxString title)

Sets the editor title.

For tabbed interface, it sets the corresponding tab text, while for MDI interface it sets the MDI window title...

Definition at line 877 of file cbeditor.cpp.

References m_Modified, and EditorBase::SetTitle().

Referenced by ScriptBindings::RegisterBindings(), SaveAs(), SetEditorStyleBeforeFileOpen(), SetModified(), and SetProjectFile().

◆ SetEncoding()

void cbEditor::SetEncoding ( wxFontEncoding  encoding)

◆ SetErrorLine()

void cbEditor::SetErrorLine ( int  line)
virtual

Highlight the specified line as error.

Definition at line 2455 of file cbeditor.cpp.

References ERROR_MARKER, and MarkLine().

Referenced by CompilerErrors::DoClearErrorMarkFromAllEditors(), and CompilerErrors::DoGotoError().

◆ SetFoldingIndicator()

void cbEditor::SetFoldingIndicator ( int  id)

◆ SetLanguage()

void cbEditor::SetLanguage ( HighlightLanguage  lang,
bool  colourise 
)

Sets the language for this editor.

Parameters
langThe language for the editor. If you pass HL_AUTO the language would be autodetected.
colourisePass true if you want to apply the style. If you intend to do more operations which would affect styling pass false.

Definition at line 1704 of file cbeditor.cpp.

References EditorColourSet::Apply(), HL_AUTO, m_lang, m_pControl, m_pControl2, m_pTheme, and SetLanguageDependentColours().

Referenced by MainFrame::OnEditHighlightMode(), SaveAs(), SetColourSet(), and SetEditorStyleBeforeFileOpen().

◆ SetLanguageDependentColours()

void cbEditor::SetLanguageDependentColours ( cbStyledTextCtrl control)
private

◆ SetMarkerStyle()

void cbEditor::SetMarkerStyle ( int  marker,
int  markerType,
wxColor  fore,
wxColor  back 
)
private

◆ SetModified()

void cbEditor::SetModified ( bool  modified = true)
overridevirtual

◆ SetProjectFile()

void cbEditor::SetProjectFile ( ProjectFile project_file,
bool  preserve_modified = false 
)

Set the ProjectFile pointer associated with this editor.

All editors which belong to a project file, should have this set. All others should return NULL. Optionally you can preserve the "modified" flag of the file.

Definition at line 885 of file cbeditor.cpp.

References _T, wxFile::Access(), wxString::c_str(), LogManager::DebugLog(), ProjectFile::editorFoldLinesArray, ProjectFile::editorOpen, ProjectFile::editorPos, ProjectFile::editorPos_2, ProjectFile::editorSplit, ProjectFile::editorSplitPos, ProjectFile::editorTopLine, ProjectFile::editorTopLine_2, ProjectFile::editorZoom, ProjectFile::editorZoom_2, ProjectFile::file, fvsMissing, fvsReadOnly, Manager::Get(), EditorBase::GetFilename(), wxFileName::GetFullName(), wxFileName::GetFullPath(), Manager::GetLogManager(), GetModified(), EditorBase::GetShortName(), CompileTargetBase::GetTitle(), wxScintilla::GotoPos(), EditorBase::m_Filename, m_pControl, m_pControl2, m_pData, m_pProjectFile, m_pSplitter, EditorBase::m_Shortname, ProjectFile::project, ProjectFile::relativeFilename, ProjectFile::relativeToCommonTopLevelPath, wxScintilla::ScrollToColumn(), wxScintilla::ScrollToLine(), SetEditorTitle(), ProjectFile::SetFileState(), cbEditorInternalData::SetLineNumberColWidth(), SetModified(), wxSplitterWindow::SetSashPosition(), wxScintilla::SetZoom(), Split(), stNoSplit, wxScintilla::ToggleFold(), UnixFilename(), wxFile::write, and wxFileExists().

Referenced by CompilerErrors::DoGotoError(), cbProject::LoadLayout(), OnContextMenuEntry(), EditorManager::Open(), SaveAs(), EditorManager::SwapActiveHeaderSource(), and cbDebuggerPlugin::SyncEditor().

◆ SetReadOnly()

void cbEditor::SetReadOnly ( bool  = true)
overridevirtual

Set the editor read-only.

Parameters
readonlyIf true, mark as readonly. If false, mark as read-write.

Reimplemented from EditorBase.

Definition at line 2574 of file cbeditor.cpp.

References cbAssert, GetControl(), and wxScintilla::SetReadOnly().

Referenced by EditorManager::CheckForExternallyModifiedFiles(), and Open().

◆ SetUseBom()

void cbEditor::SetUseBom ( bool  bom)

◆ SetZoom()

void cbEditor::SetZoom ( int  zoom,
bool  both = true 
)

◆ Split()

void cbEditor::Split ( cbEditor::SplitType  split)

◆ ToggleAllFolds()

void cbEditor::ToggleAllFolds ( )

Toggle all editor folds (inverts the show/hide state of blocks of code).

Definition at line 2147 of file cbeditor.cpp.

References DoFoldAll(), and toggle.

Referenced by OnContextMenuEntry(), MainFrame::OnEditToggleAllFolds(), and ScriptBindings::RegisterBindings().

◆ ToggleBookmark()

void cbEditor::ToggleBookmark ( int  line = -1)
virtual

Toggle bookmark at specified line.

If line is -1, use current line.

Definition at line 2374 of file cbeditor.cpp.

References BOOKMARK_MARKER, and MarkerToggle().

Referenced by ScriptBindings::RegisterBindings().

◆ ToggleBreakpoint()

void cbEditor::ToggleBreakpoint ( int  line = -1,
bool  notifyDebugger = true 
)
virtual

◆ ToggleFoldBlockFromLine()

void cbEditor::ToggleFoldBlockFromLine ( int  line = -1)

Toggles folding of the block containing line.

If line is -1, toggles folding of the block containing the caret.

Definition at line 2216 of file cbeditor.cpp.

References DoFoldBlockFromLine(), GetControl(), wxScintilla::GetCurrentLine(), and toggle.

Referenced by OnContextMenuEntry(), MainFrame::OnEditToggleFoldBlock(), and ScriptBindings::RegisterBindings().

◆ Touch()

void cbEditor::Touch ( )

Sets the last modification time for the file to 'now'.

Used to detect modifications outside the editor.

Definition at line 1699 of file cbeditor.cpp.

References m_LastModified, and wxDateTime::Now().

Referenced by EditorManager::CheckForExternallyModifiedFiles(), and ScriptBindings::RegisterBindings().

◆ UnderlineFoldedLines()

void cbEditor::UnderlineFoldedLines ( bool  underline)
private

Definition at line 995 of file cbeditor.cpp.

References m_pControl, m_pControl2, and wxScintilla::SetFoldFlags().

Referenced by SetEditorStyleAfterFileOpen(), and Split().

◆ Undo()

void cbEditor::Undo ( )
overridevirtual

Undo changes.

Reimplemented from EditorBase.

Definition at line 2460 of file cbeditor.cpp.

References cbAssert, GetControl(), and wxScintilla::Undo().

◆ UnfoldAll()

void cbEditor::UnfoldAll ( )

Unfold all editor folds (shows blocks of code).

Definition at line 2142 of file cbeditor.cpp.

References DoFoldAll(), and expand.

Referenced by EditorConfigurationDlg::EndModal(), OnContextMenuEntry(), MainFrame::OnEditUnfoldAll(), and ScriptBindings::RegisterBindings().

◆ UnfoldBlockFromLine()

void cbEditor::UnfoldBlockFromLine ( int  line = -1)

Unfolds the block containing line.

If line is -1, unfolds the block containing the caret.

Definition at line 2209 of file cbeditor.cpp.

References DoFoldBlockFromLine(), expand, GetControl(), and wxScintilla::GetCurrentLine().

Referenced by CompilerErrors::DoGotoError(), OnContextMenuEntry(), MainFrame::OnEditUnfoldBlock(), MainFrame::OnSearchGotoLine(), and ScriptBindings::RegisterBindings().

◆ Unsplit()

void cbEditor::Unsplit ( )

◆ UpdateProjectFile()

void cbEditor::UpdateProjectFile ( )

Friends And Related Function Documentation

◆ cbEditorInternalData

friend struct cbEditorInternalData
friend

Definition at line 403 of file cbeditor.h.

Referenced by DoInitializations().

◆ EditorManager

friend class EditorManager
friend

Definition at line 46 of file cbeditor.h.

Member Data Documentation

◆ m_autoIndentDone

bool cbEditor::m_autoIndentDone
private

Definition at line 398 of file cbeditor.h.

Referenced by AutoIndentDone(), and OnEditorCharAdded().

◆ m_foldBackup

cbStyledTextCtrl* cbEditor::m_foldBackup
private

Definition at line 389 of file cbeditor.h.

Referenced by FixFoldState(), and SaveFoldState().

◆ m_Index

int cbEditor::m_Index
private

Definition at line 392 of file cbeditor.h.

◆ m_IsOK

bool cbEditor::m_IsOK
private

Definition at line 384 of file cbeditor.h.

Referenced by DoInitializations(), Save(), and SaveAs().

◆ m_lang

HighlightLanguage cbEditor::m_lang
private

Definition at line 396 of file cbeditor.h.

Referenced by SetColourSet(), SetLanguage(), and Split().

◆ m_LastModified

wxDateTime cbEditor::m_LastModified
private

Definition at line 397 of file cbeditor.h.

Referenced by Open(), Save(), and Touch().

◆ m_Modified

bool cbEditor::m_Modified
private

Definition at line 391 of file cbeditor.h.

Referenced by GetModified(), SetEditorTitle(), and SetModified().

◆ m_pControl

cbStyledTextCtrl* cbEditor::m_pControl
private

◆ m_pControl2

cbStyledTextCtrl* cbEditor::m_pControl2
private

◆ m_pData

cbEditorInternalData* cbEditor::m_pData
private

◆ m_pProjectFile

ProjectFile* cbEditor::m_pProjectFile
private

◆ m_pSizer

wxBoxSizer* cbEditor::m_pSizer
private

Definition at line 386 of file cbeditor.h.

Referenced by DoInitializations(), Split(), and Unsplit().

◆ m_pSplitter

wxSplitterWindow* cbEditor::m_pSplitter
private

Definition at line 385 of file cbeditor.h.

Referenced by DestroySplitView(), SetProjectFile(), Split(), Unsplit(), and UpdateProjectFile().

◆ m_pTheme

EditorColourSet* cbEditor::m_pTheme
private

Definition at line 395 of file cbeditor.h.

Referenced by SetColourSet(), SetLanguage(), and Split().

◆ m_SplitType

SplitType cbEditor::m_SplitType
private

Definition at line 390 of file cbeditor.h.

Referenced by DoFoldAll(), DoFoldBlockFromLine(), Split(), Unsplit(), and UpdateProjectFile().

◆ m_timerWait

wxTimer cbEditor::m_timerWait
private

Definition at line 393 of file cbeditor.h.


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