50 m_lastPosition(wxSCI_INVALID_POSITION),
54 m_braceShortcutState =
false;
65 while(GetEventHandler() !=
this)
66 RemoveEventHandler(GetEventHandler());
72 cbThrow(
_T(
"Can't assign an cbStyledTextCtrl* !!!"));
118 if (platform::gtk ==
false)
144 bool emulateDwellStart =
false;
179 if (!(event.
ControlDown() ||
event.ShiftDown() ||
event.AltDown()))
211 emulateDwellStart =
true;
236 const int keyCode =
event.GetKeyCode();
253 if (keyCode ==
_T(
'\''))
255 else if (keyCode ==
_T(
'9'))
257 else if (keyCode ==
_T(
'['))
271 else if (keyCode ==
_T(
'\''))
342 if (ch ==
wxT(
'\'') || ch ==
wxT(
'"'))
357 const wxString opBraces(
wxT(
"([{"));
const int opBraceIdx = opBraces.
Find(ch);
358 const wxString clBraces(
wxT(
")]}"));
const int clBraceIdx = clBraces.
Find(ch);
388 const int braceAIdx = braces.
Find(ch,
true);
391 const int braceBIdx = (braceAIdx + (braces.
Length() / 2)) % braces.
Length();
394 if (braceAIdx < braceBIdx)
460 #ifndef wxHAVE_RAW_BITMAP 493 event.SetEditor(editor);
494 event.SetExtraLong(0);
528 if (dist >= 0 && dist < 2)
void EnableTabSmartJump(bool enable=true)
void IndicatorFillRange(int start, int lengthFill)
Turn a indicator on over a range.
void IndicatorSetForeground(int indicator, const wxColour &fore)
Set the foreground colour of an indicator.
~cbStyledTextCtrl() override
wxPoint wxGetMousePosition()
bool CallTipActive()
Is there an active call tip?
void SetSelectionVoid(int startPos, int endPos)
Select a range of text.
PluginManager * GetPluginManager() const
wxString GetLastSelectedText() const
bool AutoCompActive()
Is there an auto-completion list visible?
bool wxIsspace(const wxUniChar &c)
void OnMouseLeftUp(wxMouseEvent &event)
bool HaveMouseCapture() const
void OnKeyDown(wxKeyEvent &event)
static Manager * Get()
Use Manager::Get() to get a pointer to its instance Manager::Get() is guaranteed to never return an i...
void SetIndicatorCurrent(int indicator)
Set the indicator used for IndicatorFillRange and IndicatorClearRange.
bool m_braceShortcutState
bool DoSelectionBraceCompletion(const wxChar &ch)
Put braces/quotes around the current selection in the editor.
int GetLineIndentPosition(int line) const
Retrieve the position before the first non indentation character on a line.
static const int s_indicHighlight(20)
void SetCaretForeground(const wxColour &fore)
Set the foreground colour of the caret.
int VisibleFromDocLine(int docLine)
Find the display line of a document line taking hidden lines into account.
static const wxString s_leftBrace(_T("([{'\))
void AddText(const wxString &text)
Generated method declaration section {{{.
int GetSelectionStart() const
Returns the position at the start of the selection.
void IndicatorSetUnder(int indicator, bool under)
Set an indicator to draw under text or over(default).
void DoBraceCompletion(const wxChar &ch)
Automated braces/quotes completion.
#define wxSCI_INDIC_ROUNDBOX
int GetLexer() const
Retrieve the lexing language of the document.
void IndicatorSetStyle(int indicator, int indicatorStyle)
Set an indicator to plain, squiggle or TT.
A generic Code::Blocks event.
int GetLineEndPosition(int line) const
Get the position after the last visible characters on a line.
void SetMouseCapture(bool on)
wxLongLong wxGetLocalTimeMillis()
wxUSE_UNICODE_dependent wxChar
static std::map< int, std::set< int > > CharacterLexerStyles
static std::map< int, std::set< int > > & GetCharacterLexerStyles()
wxString GetSelectedText()
Retrieve the selected text.
static std::map< int, std::set< int > > PreprocessorLexerStyles
bool Contains(const wxString &str) const
void OnKillFocus(wxFocusEvent &event)
wxLongLong m_lastFocusTime
int GetCurrentLine()
Manually declared methods.
void HighlightRightBrace()
void CallTipCancel()
Cancel calltip only if not jumping braces via tab.
CCManager * GetCCManager() const
const wxPoint wxDefaultPosition
void AutoCompCancel()
Remove the auto-completion list from the screen.
bool IsCharacter(int style)
Is style classified as character for current language?
Base class that all "editors" should inherit from.
static std::map< int, std::set< int > > & GetStringLexerStyles()
int GetCurrentPos() const
Returns the position of the caret.
bool IsString(int style)
Is style classified as string for current language?
static std::map< int, std::set< int > > & GetPreprocessorLexerStyles()
int GetLength() const
Returns the number of bytes in the document.
void IndicatorClearRange(int start, int lengthClear)
Turn a indicator off over a range.
void OnKeyUp(wxKeyEvent &event)
void OnSetFocus(wxFocusEvent &event)
void NotifyPlugins(CodeBlocksEvent &event)
wxColour GetCaretForeground() const
Get the foreground colour of the caret.
int GetSelectionEnd() const
Returns the position at the end of the selection.
static const wxString s_rightBrace(_T(")]}'\))
void MakeNearbyLinesVisible(int line)
Scroll minimum amount such that 2 lines above and below line are shown.
int PositionFromPoint(wxPoint pt) const
Find the position from a point within the window.
int BraceMatch(int pos, int maxReStyle=0)
Find the position of a matching brace or wxSCI_INVALID_POSITION if no match.
void CharRight()
Move caret right one character.
void InsertText(int pos, const wxString &text)
Insert string at a position.
int GetCharAt(int pos) const
Returns the character byte at the position.
void EndUndoAction()
End a sequence of actions that is undone and redone as a unit.
void GotoPos(int caret)
Set caret to a position and ensure it is visible.
#define wxSCI_INVALID_POSITION
bool IsBraceShortcutActive()
void CallTipCancel()
Remove the call tip from the screen.
void DeleteBack()
Delete the selection or if no selection, the character before the caret.
int GetStyleAt(int pos) const
Returns the style byte at the position.
int GetCaretWidth() const
Returns the width of the insert mode caret.
int LineFromPosition(int pos) const
Retrieve the line containing a position.
int LinesOnScreen() const
Retrieves the number of lines completely visible.
int Find(wxUniChar ch, bool fromEnd=false) const
wxUniChar GetChar(size_t n) const
static std::map< int, std::set< int > > StringLexerStyles
void BeginUndoAction()
Start a sequence of actions that is undone and redone as a unit.
bool ProcessArrow(int key)
Used by cbStyledTextCtrl to process ArrowUp and ArrowDown key press.
void OnMouseMiddleDown(wxMouseEvent &event)
void SetCaretWidth(int pixelWidth)
Set the width of the insert mode caret.
int GetSelections() const
How many selections are there?
bool IsPreprocessor(int style)
Is style classified as preprocessor for current language?
void operator=(const cbStyledTextCtrl &)
Don't use this.
wxString m_lastSelectedText
int GetFirstVisibleLine() const
Retrieve the display line at the top of the display.