Code::Blocks
SVN r11506
|
A file editor. More...
#include <cbeditor.h>
Public Types | |
enum | SplitType { stNoSplit = 0, stHorizontal, stVertical } |
Public Member Functions | |
void | operator= (cb_unused const cbEditor &rhs) |
Don't use this. More... | |
cbStyledTextCtrl * | GetControl () const |
Returns a pointer to the underlying cbStyledTextCtrl object (which itself is the wxWindows implementation of Scintilla). More... | |
cbStyledTextCtrl * | GetLeftSplitViewControl () const |
Returns a pointer to the left (or top) split-view cbStyledTextCtrl. More... | |
cbStyledTextCtrl * | GetRightSplitViewControl () 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... | |
ProjectFile * | GetProjectFile () 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... | |
EditorColourSet * | GetColourSet () 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... | |
wxMenu * | CreateContextSubMenu (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 wxString & | GetFilename () const |
Get the editor's filename (if applicable). More... | |
virtual void | SetFilename (const wxString &filename) |
Sets the editor's filename. More... | |
virtual const wxString & | GetShortName () const |
Returns the editor's short name. More... | |
virtual const wxString & | GetTitle () |
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 } |
Static Private Member Functions | |
static void | InternalSetEditorStyleBeforeFileOpen (cbStyledTextCtrl *control) |
static void | InternalSetEditorStyleAfterFileOpen (cbStyledTextCtrl *control) |
Friends | |
class | EditorManager |
struct | cbEditorInternalData |
Additional Inherited Members | |
Protected Attributes inherited from EditorBase | |
bool | m_IsBuiltinEditor |
wxString | m_Shortname |
wxString | m_Filename |
EditorBaseInternalData * | m_pData |
Use this to add new vars/functions w/out breaking the ABI. More... | |
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.
|
private |
Enumerator | |
---|---|
none | |
ensureVisible |
Definition at line 333 of file cbeditor.h.
|
strongprivate |
Enumerator | |
---|---|
contract | |
expand | |
toggle |
Definition at line 327 of file cbeditor.h.
enum cbEditor::SplitType |
Enumerator | |
---|---|
stNoSplit | |
stHorizontal | |
stVertical |
Definition at line 62 of file cbeditor.h.
|
protected |
cbEditor constructor.
parent | the parent notebook - you should use EditorManager::Get() |
filename | the filename to open. If filename is empty, it creates a new, empty, editor. |
theme | the 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().
|
protected |
Definition at line 707 of file cbeditor.cpp.
References DoInitializations().
|
overrideprotected |
cbEditor destructor.
Definition at line 725 of file cbeditor.cpp.
References DestroySplitView(), ProjectFile::editorOpen, m_pControl, m_pData, m_pProjectFile, and UpdateProjectFile().
|
private |
bool cbEditor::AddBreakpoint | ( | int | line = -1 , |
bool | notifyDebugger = true |
||
) |
Add debugger breakpoint at specified line.
If line
is -1, use current line.
Definition at line 2276 of file cbeditor.cpp.
References cbBreakpointsDlg::AddBreakpoint(), BreakpointMarkerToggle(), Manager::Get(), DebuggerManager::GetActiveDebugger(), DebuggerManager::GetBreakpointDialog(), GetControl(), wxScintilla::GetCurrentLine(), Manager::GetDebuggerManager(), HasBreakpoint(), and EditorBase::m_Filename.
Referenced by OnContextMenuEntry(), and ScriptBindings::RegisterBindings().
|
override |
Definition at line 2843 of file cbeditor.cpp.
References _(), _T, wxMenu::Append(), wxMenu::AppendSeparator(), wxScintilla::CanPaste(), CreateContextSubMenu(), wxMenu::Delete(), wxMenu::Enable(), wxMenu::FindItem(), Manager::Get(), GetControl(), wxMenu::GetMenuItemCount(), Manager::GetPluginManager(), wxScintilla::GetReadOnly(), wxScintilla::GetSelectionEmpty(), wxMenuItem::GetSubMenu(), cbEditorInternalData::GetUrl(), idBookmarks, idCopy, idCut, idEdit, idEmptyMenu, idFolding, idInsert, idOpenUrl, idPaste, wxMenu::Insert(), wxMenu::InsertSeparator(), wxString::IsEmpty(), m_pData, mtEditorManager, PluginManager::RegisterFindMenuItems(), and PluginManager::RegisterLastNonPluginMenuItem().
|
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().
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().
void cbEditor::AutoIndentDone | ( | ) |
Definition at line 3322 of file cbeditor.cpp.
References m_autoIndentDone.
|
private |
Definition at line 2265 of file cbeditor.cpp.
References BREAKPOINT_DISABLED_MARKER, BREAKPOINT_MARKER, m_pControl, wxScintilla::MarkerAdd(), wxScintilla::MarkerDelete(), and wxScintilla::MarkerGet().
Referenced by AddBreakpoint(), RemoveBreakpoint(), and ToggleBreakpoint().
|
overridevirtual |
Is there something to paste?
Reimplemented from EditorBase.
Definition at line 2559 of file cbeditor.cpp.
References wxScintilla::CanPaste(), cbAssert, GetControl(), and IsReadOnly().
|
overridevirtual |
Is there something to redo?
Reimplemented from EditorBase.
Definition at line 2546 of file cbeditor.cpp.
References wxScintilla::CanRedo(), cbAssert, GetControl(), and IsReadOnly().
Referenced by MainFrame::OnSearchMenuUpdateUI().
|
overridevirtual |
Can the editor select everything?
Reimplemented from EditorBase.
Definition at line 3536 of file cbeditor.cpp.
References GetControl(), and wxScintilla::GetLength().
|
overridevirtual |
Is there something to undo?
Reimplemented from EditorBase.
Definition at line 2540 of file cbeditor.cpp.
References wxScintilla::CanUndo(), cbAssert, GetControl(), and IsReadOnly().
Referenced by MainFrame::OnSearchMenuUpdateUI().
|
virtual |
Clear all bookmarks.
Definition at line 2441 of file cbeditor.cpp.
References BOOKMARK_MARKER, GetControl(), and wxScintilla::MarkerDeleteAll().
Referenced by ScriptBindings::RegisterBindings().
|
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().
|
private |
Definition at line 1024 of file cbeditor.cpp.
References OnEditorChange(), OnEditorCharAdded(), OnEditorDwellEnd(), OnEditorDwellStart(), OnEditorModified(), OnEditorUpdateUI(), OnMarginClick(), OnScintillaEvent(), OnUserListSelection(), and wxScintillaEventHandler.
Referenced by DoInitializations(), and Split().
|
overridevirtual |
Copy selected text/object to clipboard.
Reimplemented from EditorBase.
Definition at line 2528 of file cbeditor.cpp.
References cbAssert, wxScintilla::Copy(), and GetControl().
|
overridevirtual |
Creates context submenus.
See cbEditor code for details.
id | An event handler's ID. |
Reimplemented from EditorBase.
Definition at line 2784 of file cbeditor.cpp.
References _(), wxMenu::Append(), wxMenu::AppendSeparator(), wxScintilla::CanRedo(), wxScintilla::CanUndo(), EditorBase::CreateContextSubMenu(), wxMenu::Enable(), GetControl(), wxScintilla::GetReadOnly(), wxScintilla::GetSelectionEmpty(), idBookmarks, idBookmarksClearAll, idBookmarksNext, idBookmarksPrevious, idBookmarksToggle, idClearHistory, idDelete, idEdit, idEmptyMenu, idFolding, idFoldingFoldAll, idFoldingFoldCurrent, idFoldingToggleAll, idFoldingToggleCurrent, idFoldingUnfoldAll, idFoldingUnfoldCurrent, idInsert, idLowerCase, idRedo, idSelectAll, idUndo, and idUpperCase.
Referenced by AddToContextMenu().
|
private |
Definition at line 1002 of file cbeditor.cpp.
References _T, Manager::Get(), Manager::GetConfigManager(), wxFont::GetDefaultEncoding(), wxFontMapper::GetEncodingFromName(), cbEditorInternalData::m_encoding, m_pControl, m_pData, wxScintilla::MarkerDefine(), ConfigManager::Read(), wxScintilla::UsePopUp(), wxDefaultPosition, wxDefaultSize, wxEmptyString, wxFONTENCODING_MAX, wxNewId(), wxSCI_MARK_EMPTY, wxSCI_MARKNUM_LASTUNUSED, and wxT.
Referenced by DoInitializations(), SaveFoldState(), and Split().
|
overridevirtual |
Cut selected text/object to clipboard.
Reimplemented from EditorBase.
Definition at line 2522 of file cbeditor.cpp.
References cbAssert, wxScintilla::Cut(), and GetControl().
|
private |
Definition at line 828 of file cbeditor.cpp.
References m_pControl2, and m_pSplitter.
Referenced by Unsplit(), and ~cbEditor().
|
private |
|
private |
Definition at line 1988 of file cbeditor.cpp.
References cbAssert, wxScintilla::Colourise(), contract, wxScintilla::FoldLine(), GetControl(), wxScintilla::GetFoldExpanded(), wxScintilla::GetFoldLevel(), wxScintilla::GetLastChild(), wxScintilla::GetLineCount(), wxScintilla::HideLines(), m_pControl, m_pControl2, m_pData, m_SplitType, cbEditorInternalData::mFoldingLimit, cbEditorInternalData::mFoldingLimitLevel, wxScintilla::SetFoldExpanded(), wxScintilla::ShowLines(), stNoSplit, toggle, wxSCI_FOLDLEVELBASE, wxSCI_FOLDLEVELHEADERFLAG, and wxSCI_FOLDLEVELNUMBERMASK.
Referenced by FoldAll(), ToggleAllFolds(), and UnfoldAll().
|
private |
Definition at line 2096 of file cbeditor.cpp.
References cbAssert, wxScintilla::Colourise(), contract, wxScintilla::EnsureVisibleEnforcePolicy(), expand, wxScintilla::FoldLine(), GetControl(), wxScintilla::GetFoldExpanded(), wxScintilla::GetFoldLevel(), wxScintilla::GetFoldParent(), m_pControl, m_pControl2, m_SplitType, stNoSplit, toggle, wxSCI_FOLDACTION_CONTRACT, wxSCI_FOLDACTION_EXPAND, wxSCI_FOLDACTION_TOGGLE, and wxSCI_FOLDLEVELHEADERFLAG.
Referenced by FoldBlockFromLine(), GotoLine(), ToggleFoldBlockFromLine(), and UnfoldBlockFromLine().
void cbEditor::DoIndent | ( | ) |
Indents current line/block.
Definition at line 3443 of file cbeditor.cpp.
References GetControl(), wxScintilla::SendMsg(), and wxSCI_CMD_TAB.
|
private |
Definition at line 745 of file cbeditor.cpp.
References _(), _T, wxBoxSizer::Add(), C_CHANGEBAR_MARGIN, C_FOLDING_MARGIN, C_LINE_MARGIN, C_MARKER_MARGIN, wxString::c_str(), cbEditorInternalData, ConnectEvents(), CreateEditor(), FoldAll(), Manager::Get(), ProjectManager::GetActiveProject(), CompileTargetBase::GetBasePath(), wxFileName::GetFullPath(), Manager::GetProjectManager(), EditorBase::InitFilename(), wxString::IsEmpty(), EditorBase::m_Filename, EditorBase::m_IsBuiltinEditor, m_IsOK, m_pControl, m_pData, cbEditorInternalData::m_pFileLoader, m_pSizer, NormalizePath(), Open(), wxString::Printf(), SetEditorStyleAfterFileOpen(), SetEditorStyleBeforeFileOpen(), wxBoxSizer::SetItemMinSize(), wxScintilla::SetMarginMask(), SetModified(), wxEmptyString, wxEXPAND, and wxVERTICAL.
Referenced by cbEditor().
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().
bool cbEditor::FixFoldState | ( | ) |
Fix fold states by comparing foldBackup with m_pControl.
This is a temp fix for the Scintilla bug
Definition at line 1935 of file cbeditor.cpp.
References _T, Manager::Get(), Manager::GetConfigManager(), wxScintilla::GetFoldLevel(), wxScintilla::GetFoldParent(), wxScintilla::GetLineCount(), wxScintilla::GetLineVisible(), m_foldBackup, m_pControl, ConfigManager::ReadBool(), wxScintilla::SetFoldExpanded(), wxScintilla::ShowLines(), and wxScintilla::ToggleFold().
Referenced by EditorManager::RecreateOpenEditorStyles().
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().
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().
|
inline |
Get the colour set in use.
Definition at line 170 of file cbeditor.h.
Referenced by CodeCompletion::DoCodeComplete(), CodeCompletion::GetProviderStatusFor(), and MainFrame::OnEditMenuUpdateUI().
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.
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().
wxFontEncoding cbEditor::GetEncoding | ( | ) | const |
Definition at line 1626 of file cbeditor.cpp.
References cbEditorInternalData::m_encoding, m_pData, and wxFONTENCODING_SYSTEM.
Referenced by CrashHandlerSaveEditorFiles(), GetEncodingName(), MainFrame::OnEditMenuUpdateUI(), and Save().
wxString cbEditor::GetEncodingName | ( | ) | const |
Definition at line 1634 of file cbeditor.cpp.
References GetEncoding(), and wxFontMapper::GetEncodingName().
Referenced by MainFrame::DoUpdateStatusBar().
|
inline |
Definition at line 292 of file cbeditor.h.
Referenced by EditorManager::CollectDefines(), CodeCompletion::DoCodeComplete(), MainFrame::DoUpdateStatusBar(), CodeCompletion::GetProviderStatusFor(), MainFrame::OnEditBoxCommentSelected(), MainFrame::OnEditCommentSelected(), MainFrame::OnEditMenuUpdateUI(), MainFrame::OnEditStreamCommentSelected(), MainFrame::OnEditToggleCommentSelected(), MainFrame::OnEditUncommentSelected(), CodeCompletion::UpdateEditorSyntax(), and CodeRefactoring::VerifyResult().
|
inline |
Returns the last modification time for the file.
Used to detect modifications outside the editor.
Definition at line 185 of file cbeditor.h.
References EditorBase::AddToContextMenu(), EditorBase::CanPaste(), EditorBase::CanRedo(), EditorBase::CanSelectAll(), EditorBase::CanUndo(), EditorBase::ClearHistory(), EditorBase::Copy(), EditorBase::CreateContextSubMenu(), EditorBase::Cut(), EditorBase::GotoLine(), EditorBase::GotoNextChanged(), EditorBase::GotoPreviousChanged(), HasBreakpoint(), EditorBase::HasSelection(), EditorBase::IsReadOnly(), EditorBase::Paste(), EditorBase::Redo(), EditorBase::SelectAll(), EditorBase::SetChangeCollection(), EditorBase::SetReadOnly(), and EditorBase::Undo().
Referenced by EditorManager::CheckForExternallyModifiedFiles().
|
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().
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().
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().
|
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().
|
inline |
Read the ProjectFile pointer associated with this editor.
All editors which belong to a project file, have this set. All others return NULL.
Definition at line 123 of file cbeditor.h.
References EditorBase::Save(), and EditorBase::SaveAs().
Referenced by EditorManager::CheckForExternallyModifiedFiles(), CompilerErrors::DoGotoError(), NativeParser::GetProjectByEditor(), EditorManager::OnPageContextMenu(), EditorManager::OnProperties(), EditorManager::Open(), CompilerGCC::PrepareCompileFile(), ScriptBindings::RegisterBindings(), ProjectLayoutLoader::Save(), EditorManager::SwapActiveHeaderSource(), cbDebuggerPlugin::SyncEditor(), and EditorManager::UpdateProjectFiles().
|
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().
|
inline |
Returns the state of split-view for this editor.
Definition at line 95 of file cbeditor.h.
Referenced by EditorManager::OnPageContextMenu().
bool cbEditor::GetUseBom | ( | ) | const |
Definition at line 1654 of file cbeditor.cpp.
References m_pData, and cbEditorInternalData::m_useByteOrderMark.
Referenced by CrashHandlerSaveEditorFiles(), MainFrame::OnEditEncoding(), MainFrame::OnEditMenuUpdateUI(), Save(), and SetUseBom().
|
overridevirtual |
Move the caret at the specified line.
line | Line to move caret to. |
centerOnScreen | If 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().
void cbEditor::GotoMatchingBrace | ( | ) |
Jumps to the matching brace (if there is one).
Definition at line 2643 of file cbeditor.cpp.
References wxScintilla::BraceMatch(), wxScintilla::ChooseCaretX(), wxString::Find(), GetControl(), wxScintilla::GetCurLine(), wxScintilla::GetCurrentLine(), wxScintilla::GetCurrentPos(), wxScintilla::GetLine(), wxScintilla::GetLineCount(), wxRegEx::GetMatch(), wxScintilla::GotoPos(), cbStyledTextCtrl::MakeNearbyLinesVisible(), wxRegEx::Matches(), wxScintilla::PositionFromLine(), wxNOT_FOUND, wxSCI_INVALID_POSITION, and wxT.
Referenced by MainFrame::OnEditGotoMatchingBrace().
|
virtual |
Go to next bookmark.
Definition at line 2431 of file cbeditor.cpp.
References BOOKMARK_MARKER, and MarkerNext().
Referenced by ScriptBindings::RegisterBindings().
|
virtual |
Go to next debugger breakpoint.
Definition at line 2364 of file cbeditor.cpp.
References BREAKPOINT_MARKER, and MarkerNext().
Referenced by ScriptBindings::RegisterBindings().
|
overridevirtual |
Goto next changed line.
Reimplemented from EditorBase.
Definition at line 2478 of file cbeditor.cpp.
References cbAssert, wxScintilla::FindChangedLine(), GetControl(), wxScintilla::GetCurrentLine(), wxScintilla::GetCurrentPos(), wxScintilla::GetLineCount(), wxScintilla::GotoLine(), wxScintilla::LineFromPosition(), cbStyledTextCtrl::MakeNearbyLinesVisible(), and wxSCI_INVALID_POSITION.
Referenced by MainFrame::OnSearchGotoNextChanged().
|
virtual |
Go to previous bookmark.
Definition at line 2436 of file cbeditor.cpp.
References BOOKMARK_MARKER, and MarkerPrevious().
Referenced by ScriptBindings::RegisterBindings().
|
virtual |
Go to previous debugger breakpoint.
Definition at line 2369 of file cbeditor.cpp.
References BREAKPOINT_MARKER, and MarkerPrevious().
Referenced by ScriptBindings::RegisterBindings().
|
overridevirtual |
Goto previous changed line.
Reimplemented from EditorBase.
Definition at line 2497 of file cbeditor.cpp.
References cbAssert, wxScintilla::FindChangedLine(), GetControl(), wxScintilla::GetCurrentLine(), wxScintilla::GetCurrentPos(), wxScintilla::GetLineCount(), wxScintilla::GotoLine(), wxScintilla::LineFromPosition(), cbStyledTextCtrl::MakeNearbyLinesVisible(), and wxSCI_INVALID_POSITION.
Referenced by MainFrame::OnSearchGotoPrevChanged().
bool cbEditor::GotoTokenPosition | ( | int | line, |
const wxString & | tokenName | ||
) |
Move the caret at the specified line.
line | Line to move caret to (where the token is). |
tokenName | Token name (string) to highlight, if found |
Definition at line 2240 of file cbeditor.cpp.
References wxScintilla::FindText(), GetControl(), wxScintilla::GetCurrentPos(), wxScintilla::GetLineCount(), GotoLine(), wxScintilla::GotoPos(), wxString::Len(), wxScintilla::LineLength(), wxScintilla::SetSelectionInt(), wxSCI_FIND_MATCHCASE, wxSCI_FIND_WHOLEWORD, and wxSCI_INVALID_POSITION.
Referenced by DocumentationHelper::OnDocumentationLink(), CodeCompletion::OnFunction(), CodeCompletion::OnGotoDeclaration(), CodeCompletion::OnGotoFunction(), ClassBrowser::OnJumpTo(), and ClassBrowser::OnTreeItemDoubleClick().
|
virtual |
Does line
has bookmark?
Definition at line 2426 of file cbeditor.cpp.
References BOOKMARK_MARKER, and LineHasMarker().
Referenced by ScriptBindings::RegisterBindings().
|
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().
|
overridevirtual |
Is there a selection?
Reimplemented from EditorBase.
Definition at line 2552 of file cbeditor.cpp.
References cbAssert, GetControl(), wxScintilla::GetSelectionEnd(), and wxScintilla::GetSelectionStart().
void cbEditor::HighlightBraces | ( | ) |
Highlights the brace pair (one of the braces must be under the cursor)
Definition at line 2716 of file cbeditor.cpp.
References _T, wxScintilla::BraceBadLight(), wxScintilla::BraceHighlight(), wxScintilla::BraceMatch(), wxScintilla::GetCharAt(), wxScintilla::GetColumn(), GetControl(), wxScintilla::GetCurrentPos(), wxScintilla::SetHighlightGuide(), and wxSCI_INVALID_POSITION.
Referenced by OnEditorUpdateUI().
|
staticprivate |
Definition at line 1551 of file cbeditor.cpp.
References _T, C_FOLDING_MARGIN, C_LINE_MARGIN, wxScintilla::Colourise(), cbEditorInternalData::DetectIndentStyle(), DetectLineEnds(), Manager::Get(), Manager::GetConfigManager(), wxScintilla::GetMarginMask(), ConfigManager::ReadBool(), ConfigManager::ReadInt(), wxScintilla::SetEOLMode(), wxScintilla::SetFoldFlags(), wxScintilla::SetMarginMask(), wxScintilla::SetMarginSensitive(), wxScintilla::SetMarginType(), wxScintilla::SetMarginWidth(), wxScintilla::SetProperty(), wxScintilla::SetTabWidth(), wxScintilla::SetUseTabs(), wxSCI_EOL_CRLF, wxSCI_EOL_LF, wxSCI_MARGIN_NUMBER, wxSCI_MARGIN_SYMBOL, wxSCI_MARKNUM_CHANGESAVED, wxSCI_MARKNUM_CHANGEUNSAVED, and wxSCI_MASK_FOLDERS.
Referenced by ApplyStyles(), and SetEditorStyleAfterFileOpen().
|
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().
|
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().
|
overridevirtual |
Is the editor read-only?
Reimplemented from EditorBase.
Definition at line 2568 of file cbeditor.cpp.
References cbAssert, GetControl(), and wxScintilla::GetReadOnly().
Referenced by CanPaste(), CanRedo(), and CanUndo().
|
private |
Definition at line 2580 of file cbeditor.cpp.
References GetControl(), wxScintilla::GetCurrentLine(), m_pControl, and wxScintilla::MarkerGet().
Referenced by HasBookmark(), HasBreakpoint(), MarkerToggle(), and OnBeforeBuildContextMenu().
|
private |
Definition at line 2597 of file cbeditor.cpp.
References _(), InfoWindow::Display(), GetControl(), wxScintilla::GetCurrentLine(), GotoLine(), and wxScintilla::MarkerNext().
Referenced by GotoNextBookmark(), GotoNextBreakpoint(), and OnContextMenuEntry().
|
private |
Definition at line 2616 of file cbeditor.cpp.
References _(), InfoWindow::Display(), GetControl(), wxScintilla::GetCurrentLine(), wxScintilla::GetLineCount(), GotoLine(), and wxScintilla::MarkerPrevious().
Referenced by GotoPreviousBookmark(), GotoPreviousBreakpoint(), and OnContextMenuEntry().
|
private |
Definition at line 2587 of file cbeditor.cpp.
References GetControl(), wxScintilla::GetCurrentLine(), LineHasMarker(), wxScintilla::MarkerAdd(), and wxScintilla::MarkerDelete().
Referenced by OnContextMenuEntry(), RefreshBreakpointMarkers(), and ToggleBookmark().
|
private |
Definition at line 2635 of file cbeditor.cpp.
References GetControl(), wxScintilla::MarkerAdd(), and wxScintilla::MarkerDeleteAll().
Referenced by SetDebugLine(), and SetErrorLine().
|
private |
Definition at line 812 of file cbeditor.cpp.
References Manager::Get(), ProjectFile::GetParentProject(), Manager::GetPluginManager(), m_pProjectFile, and PluginManager::NotifyPlugins().
Referenced by OnEditorDwellEnd(), OnEditorDwellStart(), OnEditorUpdateUI(), Open(), Save(), SetModified(), Split(), and Unsplit().
|
overrideprivate |
Definition at line 3005 of file cbeditor.cpp.
|
overrideprivate |
Definition at line 2918 of file cbeditor.cpp.
References _(), wxMenu::Append(), wxMenu::AppendSeparator(), BOOKMARK_MARKER, BREAKPOINT_DISABLED_MARKER, BREAKPOINT_MARKER, cbDebuggerFeature::Breakpoints, C_CHANGEBAR_MARGIN, C_FOLDING_MARGIN, C_LINE_MARGIN, C_MARKER_MARGIN, wxRect::Contains(), Manager::Get(), DebuggerManager::GetActiveDebugger(), Manager::GetDebuggerManager(), wxScintilla::GetMarginWidth(), wxScintilla::GetSelectionEnd(), wxScintilla::GetSelectionStart(), wxScintilla::GotoPos(), idBookmarkAdd, idBookmarkRemove, idBookmarkRemoveAll, idBreakpointAdd, idBreakpointDisable, idBreakpointEdit, idBreakpointEnable, idBreakpointRemove, wxScintilla::LineFromPosition(), LineHasMarker(), cbEditorInternalData::m_LastMarginMenuLine, m_pControl, m_pControl2, m_pData, mtEditorManager, EditorBase::OnBeforeBuildContextMenu(), wxScintilla::PositionFromPoint(), cbDebuggerPlugin::SupportsFeature(), wxDefaultPosition, wxGetMousePosition(), and wxPoint::x.
|
private |
Definition at line 3438 of file cbeditor.cpp.
References EditorManager::Close(), Manager::Get(), and Manager::GetEditorManager().
|
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().
|
private |
Definition at line 3251 of file cbeditor.cpp.
References wxScintilla::GetModify(), m_pControl, OnScintillaEvent(), and SetModified().
Referenced by ConnectEvents().
|
private |
Definition at line 3257 of file cbeditor.cpp.
References _T, wxScintilla::BeginUndoAction(), wxScintilla::ChooseCaretX(), cbStyledTextCtrl::DoBraceCompletion(), cbStyledTextCtrl::DoSelectionBraceCompletion(), wxScintilla::EndUndoAction(), Manager::Get(), Manager::GetConfigManager(), GetControl(), wxScintilla::GetCurLine(), wxScintilla::GetCurrentPos(), wxScintilla::GetEOLMode(), wxScintilla::GetLine(), GetLineIndentString(), wxScintilla::GotoPos(), wxScintilla::InsertText(), cbStyledTextCtrl::IsBraceShortcutActive(), wxString::IsEmpty(), wxString::Length(), wxScintilla::LineFromPosition(), m_autoIndentDone, OnScintillaEvent(), ConfigManager::ReadBool(), wxString::Trim(), and wxSCI_EOL_CR.
Referenced by ConnectEvents().
|
private |
Definition at line 3356 of file cbeditor.cpp.
References cbEVT_EDITOR_TOOLTIP_CANCEL, NotifyPlugins(), and OnScintillaEvent().
Referenced by ConnectEvents().
|
private |
Definition at line 3327 of file cbeditor.cpp.
References cbEVT_EDITOR_TOOLTIP, wxRect::Contains(), GetControl(), wxScintilla::GetStyleAt(), wxScintillaEvent::GetX(), wxApp::IsActive(), NotifyPlugins(), OnScintillaEvent(), wxScintilla::PositionFromPoint(), wxScintillaEvent::SetX(), wxScintillaEvent::SetY(), wxEmptyString, wxGetMousePosition(), wxTheApp, wxPoint::x, and wxPoint::y.
Referenced by ConnectEvents().
|
private |
Definition at line 3362 of file cbeditor.cpp.
References cbDebuggerPlugin::EditorLinesAddedOrRemoved(), Manager::Get(), DebuggerManager::GetActiveDebugger(), DebuggerManager::GetAllDebuggers(), DebuggerManager::GetBreakpointDialog(), GetControl(), Manager::GetDebuggerManager(), wxScintilla::GetFoldExpanded(), wxScintillaEvent::GetFoldLevelPrev(), wxScintilla::GetLastChild(), wxScintillaEvent::GetModificationType(), wxScintillaEvent::GetPosition(), wxScintilla::LineFromPosition(), m_pControl, m_pData, OnScintillaEvent(), RefreshBreakpointMarkers(), cbBreakpointsDlg::Reload(), wxScintilla::SetFoldExpanded(), cbEditorInternalData::SetLineNumberColWidth(), wxScintilla::ShowLines(), wxSCI_FOLDLEVELHEADERFLAG, wxSCI_MOD_CHANGEFOLD, wxSCI_MOD_DELETETEXT, and wxSCI_MOD_INSERTTEXT.
Referenced by ConnectEvents().
|
private |
Definition at line 3241 of file cbeditor.cpp.
References cbEVT_EDITOR_UPDATE_UI, Manager::Get(), HighlightBraces(), NotifyPlugins(), and OnScintillaEvent().
Referenced by ConnectEvents().
|
private |
Definition at line 3215 of file cbeditor.cpp.
References C_FOLDING_MARGIN, C_MARKER_MARGIN, GetControl(), wxScintillaEvent::GetMargin(), wxScintilla::LineFromPosition(), OnScintillaEvent(), ToggleBreakpoint(), and wxScintilla::ToggleFold().
Referenced by ConnectEvents().
|
private |
notify all the registered EditorHook functions
event | indicates 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().
|
private |
Definition at line 3433 of file cbeditor.cpp.
References OnScintillaEvent().
Referenced by ConnectEvents().
|
private |
Definition at line 3457 of file cbeditor.cpp.
References _T, Manager::Get(), Manager::GetConfigManager(), GetControl(), Manager::GetEditorManager(), EditorManager::GetNotebook(), wxScintilla::GetZoom(), m_pData, OnScintillaEvent(), ConfigManager::ReadBool(), cbEditorInternalData::SetFoldingColWidth(), cbEditorInternalData::SetLineNumberColWidth(), EditorManager::SetZoom(), and cbAuiNotebook::SetZoom().
|
private |
Definition at line 1718 of file cbeditor.cpp.
References _T, wxFile::Access(), wxString::c_str(), cbEVT_EDITOR_OPEN, wxScintilla::ClearAll(), LogManager::DebugLog(), wxScintilla::EmptyUndoBuffer(), F(), fvsMissing, fvsReadOnly, Manager::Get(), Manager::GetConfigManager(), LoaderBase::GetData(), Manager::GetFileManager(), LoaderBase::GetLength(), Manager::GetLogManager(), wxFileName::GetModificationTime(), wxScintilla::InsertText(), FileManager::Load(), cbEditorInternalData::m_byteOrderMarkLength, cbEditorInternalData::m_encoding, EditorBase::m_Filename, m_LastModified, m_pControl, m_pData, cbEditorInternalData::m_pFileLoader, m_pProjectFile, cbEditorInternalData::m_useByteOrderMark, NotifyPlugins(), ConfigManager::ReadBool(), SetEncoding(), ProjectFile::SetFileState(), wxScintilla::SetModEventMask(), SetModified(), SetReadOnly(), SetUseBom(), wxStopWatch::Start(), wxStopWatch::Time(), wxFile::write, wxFileExists(), and wxSCI_MODEVENTMASKALL.
Referenced by DoInitializations(), and Reload().
|
inline |
|
overridevirtual |
Paste selected text/object from clipboard.
Reimplemented from EditorBase.
Definition at line 2534 of file cbeditor.cpp.
References cbAssert, GetControl(), and wxScintilla::Paste().
void cbEditor::Print | ( | bool | selectionOnly, |
PrintColourMode | pcm, | ||
bool | line_numbers | ||
) |
Print the file.
selectionOnly | Should the selected text be printed only? |
pcm | The colour mode to use when printing |
line_numbers | Print the line numbers of file, too. |
Definition at line 3010 of file cbeditor.cpp.
References _(), _T, C_LINE_MARGIN, cbMessageBox(), DeInitPrinting(), g_printer, Manager::Get(), Manager::GetConfigManager(), GetControl(), wxScintilla::GetEdgeMode(), wxPrinter::GetLastError(), wxScintilla::GetMarginType(), wxScintilla::GetMarginWidth(), wxPrintData::GetOrientation(), wxPrintData::GetPaperId(), wxPrintDialogData::GetPrintData(), wxPrinter::GetPrintDialogData(), InitPrinting(), EditorBase::m_Filename, m_pControl, m_pControl2, m_pData, pcmAsIs, pcmBlackAndWhite, pcmColourOnWhite, pcmInvertColours, wxPrinter::Print(), wxScintilla::SetEdgeMode(), cbEditorInternalData::SetLineNumberColWidth(), wxScintilla::SetMarginType(), wxScintilla::SetMarginWidth(), wxScintilla::SetPrintColourMode(), wxScintilla::SetPrintMagnification(), ConfigManager::Write(), wxICON_ERROR, wxPRINTER_ERROR, wxSCI_EDGE_NONE, wxSCI_MARGIN_NUMBER, wxSCI_PRINT_BLACKONWHITE, wxSCI_PRINT_COLOURONWHITE, wxSCI_PRINT_INVERTLIGHT, and wxSCI_PRINT_NORMAL.
Referenced by EditorManager::Print(), and ScriptBindings::RegisterBindings().
|
overridevirtual |
Redo changes.
Reimplemented from EditorBase.
Definition at line 2466 of file cbeditor.cpp.
References cbAssert, GetControl(), and wxScintilla::Redo().
|
virtual |
Refresh all markers for the breakpoints (only the markers for the current debugger will be shown)
Definition at line 2379 of file cbeditor.cpp.
References BREAKPOINT_DISABLED_MARKER, BREAKPOINT_MARKER, BREAKPOINT_OTHER_MARKER, Manager::Get(), DebuggerManager::GetActiveDebugger(), DebuggerManager::GetAllDebuggers(), cbDebuggerPlugin::GetBreakpoint(), cbDebuggerPlugin::GetBreakpointsCount(), GetControl(), Manager::GetDebuggerManager(), EditorBase::GetFilename(), wxScintilla::MarkerNext(), and MarkerToggle().
Referenced by BreakpointsDlg::BreakpointProperties(), BreakpointsDlg::EnableBreakpoint(), OnEditorModified(), and cbDebuggerPlugin::OnEditorOpened().
bool cbEditor::Reload | ( | bool | detectEncoding = true | ) |
Reloads the file from disk.
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().
bool cbEditor::RemoveBreakpoint | ( | int | line = -1 , |
bool | notifyDebugger = true |
||
) |
Remove debugger breakpoint at specified line.
If line
is -1, use current line.
Definition at line 2299 of file cbeditor.cpp.
References BreakpointMarkerToggle(), Manager::Get(), DebuggerManager::GetActiveDebugger(), DebuggerManager::GetBreakpointDialog(), GetControl(), wxScintilla::GetCurrentLine(), Manager::GetDebuggerManager(), HasBreakpoint(), EditorBase::m_Filename, and cbBreakpointsDlg::RemoveBreakpoint().
Referenced by OnContextMenuEntry(), and ScriptBindings::RegisterBindings().
|
overridevirtual |
Save editor contents.
Returns true on success, false otherwise.
Reimplemented from EditorBase.
Definition at line 1789 of file cbeditor.cpp.
References _(), wxScintilla::BeginUndoAction(), cbEVT_EDITOR_BEFORE_SAVE, cbEVT_EDITOR_SAVE, cbMessageBox(), cbSaveToFile(), wxScintilla::EndUndoAction(), cbEditorInternalData::EnsureConsistentLineEnds(), cbEditorInternalData::EnsureFinalLineEnd(), wxScintilla::GetAnchor(), wxScintilla::GetColumn(), wxScintilla::GetCurrentPos(), GetEncoding(), EditorBase::GetFilename(), wxFileName::GetModificationTime(), GetModified(), wxScintilla::GetText(), GetUseBom(), cbEditorInternalData::m_ensure_consistent_line_ends, cbEditorInternalData::m_ensure_final_line_end, EditorBase::m_Filename, m_IsOK, m_LastModified, m_pControl, m_pData, cbEditorInternalData::m_strip_trailing_spaces, NotifyPlugins(), wxString::Printf(), SaveAs(), SetModified(), wxScintilla::SetSavePoint(), wxScintilla::SetSelectionNAnchorVirtualSpace(), wxScintilla::SetSelectionNCaretVirtualSpace(), cbEditorInternalData::StripTrailingSpaces(), and wxICON_ERROR.
Referenced by CompilerGCC::PrepareCompileFile(), ScriptBindings::RegisterBindings(), and SaveAs().
|
overridevirtual |
Save editor contents under a different filename.
Returns true on success, false otherwise.
Reimplemented from EditorBase.
Definition at line 1846 of file cbeditor.cpp.
References _(), _T, wxFileName::Assign(), wxString::Empty(), wxString::find(), Manager::Get(), Manager::GetConfigManager(), wxFileName::GetExt(), FileFilters::GetFilterIndexFromName(), FileFilters::GetFilterNameFromIndex(), FileFilters::GetFilterString(), wxFileName::GetFullName(), Manager::GetLogManager(), wxFileName::GetPath(), HL_AUTO, wxString::IsEmpty(), LogManager::Log(), EditorBase::m_Filename, m_IsOK, m_pControl, m_pControl2, EditorBase::m_Shortname, OverrideUseTabsPerLanguage(), PlaceWindow(), wxString::Prepend(), ConfigManager::Read(), Save(), HTMLTags::sep, SetEditorStyleAfterFileOpen(), SetEditorTitle(), SetLanguage(), SetModified(), SetProjectFile(), wxFileDialog::SetWildcard(), wxString::Truncate(), ConfigManager::Write(), wxEmptyString, wxFD_OVERWRITE_PROMPT, wxFD_SAVE, wxID_OK, and wxNOT_FOUND.
Referenced by ScriptBindings::RegisterBindings(), and Save().
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().
|
overridevirtual |
Select everything in the editor.
Reimplemented from EditorBase.
Definition at line 3545 of file cbeditor.cpp.
References GetControl(), and wxScintilla::SelectAll().
|
override |
Definition at line 2516 of file cbeditor.cpp.
References cbAssert, GetControl(), and wxScintilla::SetChangeCollection().
Referenced by EditorConfigurationDlg::EndModal().
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().
|
virtual |
Highlight the line the debugger will execute next.
Definition at line 2447 of file cbeditor.cpp.
References DEBUG_MARKER, DEBUG_MARKER_HIGHLIGHT, GetControl(), cbEditorInternalData::m_LastDebugLine, m_pData, and MarkLine().
Referenced by cbDebuggerPlugin::ClearActiveMarkFromAllEditors(), cbDebuggerPlugin::OnEditorOpened(), and cbDebuggerPlugin::SyncEditor().
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().
|
private |
Definition at line 1293 of file cbeditor.cpp.
References _T, Manager::Get(), Manager::GetConfigManager(), InternalSetEditorStyleAfterFileOpen(), m_pControl, m_pControl2, m_pData, ConfigManager::ReadBool(), cbEditorInternalData::SetLineNumberColWidth(), and UnderlineFoldedLines().
Referenced by DoInitializations(), Reload(), SaveAs(), SetEditorStyle(), and Split().
|
private |
Definition at line 1257 of file cbeditor.cpp.
References _T, ProjectFile::file, Manager::Get(), Manager::GetConfigManager(), wxFileName::GetFullName(), HL_AUTO, InternalSetEditorStyleBeforeFileOpen(), cbEditorInternalData::m_ensure_consistent_line_ends, cbEditorInternalData::m_ensure_final_line_end, m_pControl, m_pControl2, m_pData, m_pProjectFile, EditorBase::m_Shortname, cbEditorInternalData::m_strip_trailing_spaces, cbEditorInternalData::mFoldingLimit, cbEditorInternalData::mFoldingLimitLevel, OverrideUseTabsPerLanguage(), ConfigManager::ReadBool(), ConfigManager::ReadInt(), ProjectFile::relativeToCommonTopLevelPath, SetEditorTitle(), SetFoldingIndicator(), and SetLanguage().
Referenced by DoInitializations(), and SetEditorStyle().
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().
void cbEditor::SetEncoding | ( | wxFontEncoding | encoding | ) |
Definition at line 1639 of file cbeditor.cpp.
References wxLocale::GetSystemEncoding(), cbEditorInternalData::m_encoding, m_pData, SetModified(), and wxFONTENCODING_SYSTEM.
Referenced by MainFrame::OnEditEncoding(), and Open().
|
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().
void cbEditor::SetFoldingIndicator | ( | int | id | ) |
Sets the type of folding indicator where id is one of the following: 0->Arrow, 1->Circle, 2->Square, 3->simple.
Definition at line 2152 of file cbeditor.cpp.
References SetMarkerStyle(), wxSCI_MARK_ARROW, wxSCI_MARK_ARROWDOWN, wxSCI_MARK_BACKGROUND, wxSCI_MARK_BOXMINUS, wxSCI_MARK_BOXMINUSCONNECTED, wxSCI_MARK_BOXPLUS, wxSCI_MARK_BOXPLUSCONNECTED, wxSCI_MARK_CIRCLEMINUS, wxSCI_MARK_CIRCLEMINUSCONNECTED, wxSCI_MARK_CIRCLEPLUS, wxSCI_MARK_CIRCLEPLUSCONNECTED, wxSCI_MARK_LCORNER, wxSCI_MARK_LCORNERCURVE, wxSCI_MARK_MINUS, wxSCI_MARK_PLUS, wxSCI_MARK_TCORNER, wxSCI_MARK_VLINE, wxSCI_MARKNUM_FOLDER, wxSCI_MARKNUM_FOLDEREND, wxSCI_MARKNUM_FOLDERMIDTAIL, wxSCI_MARKNUM_FOLDEROPEN, wxSCI_MARKNUM_FOLDEROPENMID, wxSCI_MARKNUM_FOLDERSUB, and wxSCI_MARKNUM_FOLDERTAIL.
Referenced by SetEditorStyleBeforeFileOpen(), and Split().
void cbEditor::SetLanguage | ( | HighlightLanguage | lang, |
bool | colourise | ||
) |
Sets the language for this editor.
lang | The language for the editor. If you pass HL_AUTO the language would be autodetected. |
colourise | Pass 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().
|
private |
Definition at line 1225 of file cbeditor.cpp.
References DEBUG_MARKER_HIGHLIGHT, wxScintilla::GetCaretLineBackground(), and wxScintilla::MarkerSetBackground().
Referenced by SetLanguage(), and Split().
|
private |
Definition at line 981 of file cbeditor.cpp.
References m_pControl, m_pControl2, wxScintilla::MarkerDefine(), wxScintilla::MarkerSetBackground(), and wxScintilla::MarkerSetForeground().
Referenced by SetFoldingIndicator().
|
overridevirtual |
Set the editor's modification state to modified
.
Reimplemented from EditorBase.
Definition at line 861 of file cbeditor.cpp.
References cbEVT_EDITOR_MODIFIED, fvsModified, fvsNormal, fvsReadOnly, wxScintilla::GetReadOnly(), m_Modified, m_pControl, m_pProjectFile, EditorBase::m_Shortname, NotifyPlugins(), SetEditorTitle(), ProjectFile::SetFileState(), and wxScintilla::SetSavePoint().
Referenced by EditorManager::CheckForExternallyModifiedFiles(), DoInitializations(), NewFromTemplateDlg::EditScript(), OnEditorChange(), Open(), Save(), SaveAs(), SetEncoding(), SetProjectFile(), and SetUseBom().
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().
|
overridevirtual |
Set the editor read-only.
readonly | If 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().
void cbEditor::SetUseBom | ( | bool | bom | ) |
Definition at line 1661 of file cbeditor.cpp.
References GetUseBom(), m_pData, cbEditorInternalData::m_useByteOrderMark, and SetModified().
Referenced by MainFrame::OnEditEncoding(), and Open().
void cbEditor::SetZoom | ( | int | zoom, |
bool | both = true |
||
) |
Definition at line 3478 of file cbeditor.cpp.
References GetControl(), wxScintilla::GetZoom(), m_pControl, m_pControl2, and wxScintilla::SetZoom().
void cbEditor::Split | ( | cbEditor::SplitType | split | ) |
Split the editor window.
split | The type of split: horizontal or vertical. |
Definition at line 1084 of file cbeditor.cpp.
References _T, wxBoxSizer::Add(), EditorColourSet::Apply(), C_LINE_MARGIN, cbEVT_EDITOR_SPLIT, ConnectEvents(), CreateEditor(), wxBoxSizer::Detach(), Manager::Get(), Manager::GetConfigManager(), wxScintilla::GetDocPointer(), wxScintilla::GetMarginWidth(), wxScintilla::GetZoom(), wxScintilla::IndicatorGetForeground(), wxScintilla::IndicatorGetStyle(), wxScintilla::IndicatorGetUnder(), wxScintilla::IndicatorSetForeground(), wxScintilla::IndicatorSetStyle(), wxScintilla::IndicatorSetUnder(), InternalSetEditorStyleBeforeFileOpen(), wxBoxSizer::Layout(), m_lang, m_pControl, m_pControl2, m_pSizer, m_pSplitter, m_pTheme, m_SplitType, NotifyPlugins(), ConfigManager::ReadBool(), ConfigManager::ReadInt(), wxBoxSizer::SetDimension(), wxScintilla::SetDocPointer(), SetEditorStyleAfterFileOpen(), SetFoldingIndicator(), SetLanguageDependentColours(), wxScintilla::SetMarginWidth(), wxSplitterWindow::SetMinimumPaneSize(), wxScintilla::SetZoom(), wxSplitterWindow::SplitHorizontally(), wxSplitterWindow::SplitVertically(), stHorizontal, stNoSplit, stVertical, UnderlineFoldedLines(), Unsplit(), wxDefaultPosition, wxDefaultSize, wxEXPAND, wxNewId(), wxSCI_INDIC_MAX, wxSP_LIVE_UPDATE, wxSP_NOBORDER, and Manager::Yield().
Referenced by OnContextMenuEntry(), EditorManager::OnGenericContextMenuHandler(), and SetProjectFile().
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().
|
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().
|
virtual |
Toggle debugger breakpoint at specified line.
If line
is -1, use current line.
Definition at line 2322 of file cbeditor.cpp.
References cbBreakpointsDlg::AddBreakpoint(), BreakpointMarkerToggle(), cbDebuggerFeature::Breakpoints, Manager::Get(), DebuggerManager::GetActiveDebugger(), DebuggerManager::GetBreakpointDialog(), GetControl(), wxScintilla::GetCurrentLine(), Manager::GetDebuggerManager(), HasBreakpoint(), EditorBase::m_Filename, cbBreakpointsDlg::Reload(), cbBreakpointsDlg::RemoveBreakpoint(), and cbDebuggerPlugin::SupportsFeature().
Referenced by OnMarginClick(), DebuggerMenuHandler::OnToggleBreakpoint(), and ScriptBindings::RegisterBindings().
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().
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().
|
private |
Definition at line 995 of file cbeditor.cpp.
References m_pControl, m_pControl2, and wxScintilla::SetFoldFlags().
Referenced by SetEditorStyleAfterFileOpen(), and Split().
|
overridevirtual |
Undo changes.
Reimplemented from EditorBase.
Definition at line 2460 of file cbeditor.cpp.
References cbAssert, GetControl(), and wxScintilla::Undo().
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().
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().
void cbEditor::Unsplit | ( | ) |
Unsplit the editor window.
Definition at line 1185 of file cbeditor.cpp.
References wxBoxSizer::Add(), cbEVT_EDITOR_UNSPLIT, DestroySplitView(), wxBoxSizer::Detach(), GetControl(), wxBoxSizer::Layout(), m_pControl, m_pControl2, m_pSizer, m_pSplitter, m_SplitType, NotifyPlugins(), stNoSplit, and wxEXPAND.
Referenced by OnContextMenuEntry(), EditorManager::OnGenericContextMenuHandler(), and Split().
void cbEditor::UpdateProjectFile | ( | ) |
Updates the associated ProjectFile object with the editor's caret position, top visible line and its open state.
Used in devProject layout information, so that each time the user opens a project file in the IDE, it opens exactly in the same state it was when last closed.
Definition at line 952 of file cbeditor.cpp.
References wxScintilla::ContractedFoldNext(), ProjectFile::editorFoldLinesArray, ProjectFile::editorOpen, ProjectFile::editorPos, ProjectFile::editorPos_2, ProjectFile::editorSplit, ProjectFile::editorSplitActive, ProjectFile::editorSplitPos, ProjectFile::editorTopLine, ProjectFile::editorTopLine_2, ProjectFile::editorZoom, ProjectFile::editorZoom_2, GetControl(), wxScintilla::GetCurrentPos(), wxScintilla::GetFirstVisibleLine(), wxSplitterWindow::GetSashPosition(), wxScintilla::GetZoom(), m_pControl, m_pControl2, m_pProjectFile, m_pSplitter, and m_SplitType.
Referenced by EditorManager::UpdateProjectFiles(), and ~cbEditor().
|
friend |
Definition at line 403 of file cbeditor.h.
Referenced by DoInitializations().
|
friend |
Definition at line 46 of file cbeditor.h.
|
private |
Definition at line 398 of file cbeditor.h.
Referenced by AutoIndentDone(), and OnEditorCharAdded().
|
private |
Definition at line 389 of file cbeditor.h.
Referenced by FixFoldState(), and SaveFoldState().
|
private |
Definition at line 392 of file cbeditor.h.
|
private |
Definition at line 384 of file cbeditor.h.
Referenced by DoInitializations(), Save(), and SaveAs().
|
private |
Definition at line 396 of file cbeditor.h.
Referenced by SetColourSet(), SetLanguage(), and Split().
|
private |
Definition at line 397 of file cbeditor.h.
|
private |
Definition at line 391 of file cbeditor.h.
Referenced by GetModified(), SetEditorTitle(), and SetModified().
|
private |
Definition at line 387 of file cbeditor.h.
Referenced by BreakpointMarkerToggle(), CreateEditor(), DoFoldAll(), DoFoldBlockFromLine(), DoInitializations(), FixFoldState(), GetControl(), GetModified(), LineHasMarker(), OnBeforeBuildContextMenu(), OnEditorChange(), OnEditorModified(), Open(), Print(), Reload(), Save(), SaveAs(), SaveFoldState(), SetEditorStyleAfterFileOpen(), SetEditorStyleBeforeFileOpen(), cbEditorInternalData::SetFoldingColWidth(), SetLanguage(), cbEditorInternalData::SetLineNumberColWidth(), SetMarkerStyle(), SetModified(), SetProjectFile(), SetZoom(), Split(), UnderlineFoldedLines(), Unsplit(), UpdateProjectFile(), and ~cbEditor().
|
private |
Definition at line 388 of file cbeditor.h.
Referenced by DestroySplitView(), DoFoldAll(), DoFoldBlockFromLine(), GetControl(), OnBeforeBuildContextMenu(), Print(), Reload(), SaveAs(), SetEditorStyleAfterFileOpen(), SetEditorStyleBeforeFileOpen(), cbEditorInternalData::SetFoldingColWidth(), SetLanguage(), cbEditorInternalData::SetLineNumberColWidth(), SetMarkerStyle(), SetProjectFile(), SetZoom(), Split(), UnderlineFoldedLines(), Unsplit(), and UpdateProjectFile().
|
private |
Definition at line 404 of file cbeditor.h.
Referenced by AddToContextMenu(), CreateEditor(), DoFoldAll(), DoInitializations(), GetEncoding(), GetUseBom(), OnBeforeBuildContextMenu(), OnContextMenuEntry(), OnEditorModified(), OnZoom(), Open(), Print(), Save(), SetDebugLine(), SetEditorStyleAfterFileOpen(), SetEditorStyleBeforeFileOpen(), SetEncoding(), SetProjectFile(), SetUseBom(), and ~cbEditor().
|
private |
Definition at line 394 of file cbeditor.h.
Referenced by NotifyPlugins(), OnContextMenuEntry(), Open(), SetEditorStyleBeforeFileOpen(), SetModified(), SetProjectFile(), UpdateProjectFile(), and ~cbEditor().
|
private |
Definition at line 386 of file cbeditor.h.
Referenced by DoInitializations(), Split(), and Unsplit().
|
private |
Definition at line 385 of file cbeditor.h.
Referenced by DestroySplitView(), SetProjectFile(), Split(), Unsplit(), and UpdateProjectFile().
|
private |
Definition at line 395 of file cbeditor.h.
Referenced by SetColourSet(), SetLanguage(), and Split().
|
private |
Definition at line 390 of file cbeditor.h.
Referenced by DoFoldAll(), DoFoldBlockFromLine(), Split(), Unsplit(), and UpdateProjectFile().
|
private |
Definition at line 393 of file cbeditor.h.