Platforms to show: All Mac Windows Linux Cross-Platform

Back to DesktopScintillaControlMBS control.

Previous items

DesktopScintillaControlMBS.ModifyAttemptReadOnly

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Scintilla MBS Scintilla Plugin 22.0 ✅ Yes ✅ Yes ✅ Yes ❌ No
When in read-only mode, this notification is sent to the container if the user tries to change the text.

This can be used to check the document out of a version control system. You can set the read-only state of a document with ReadOnly property.

DesktopScintillaControlMBS.NeedsShown(Position as Integer, length as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Scintilla MBS Scintilla Plugin 22.0 ✅ Yes ✅ Yes ✅ Yes ❌ No
Scintilla has determined that a range of lines that is currently invisible should be made visible.
Example
sub NeedsShown(Position as Integer)
dim firstLine as Integer = LineFromPosition(me.position)
dim lastLine as Integer = LineFromPosition(me.position+me.length-1)
for line as integer = firstLine to lastLine
me.EnsureVisible(line)
next
end sub

An example of where this may be needed is if the end of line of a contracted fold point is deleted. This message is sent to the container in case it wants to make the line visible in some unusual way such as making the whole document visible. Most containers will just ensure each line in the range is visible by calling EnsureVisible. The position and length fields of SCNotification indicate the range of the document that should be made visible.

The container code will be similar to the following code skeleton in the example above.
If the event is not implemented, we do similar automatically.

DesktopScintillaControlMBS.Opening

Type Topic Version
event Scintilla 22.0

The control is about to was created and you can initialize it.
In older Xojo versions, this event is named Open.

DesktopScintillaControlMBS.Painted

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Scintilla MBS Scintilla Plugin 22.0 ✅ Yes ✅ Yes ✅ Yes ❌ No
Painting has just been done.

Useful when you want to update some other widgets based on a change in Scintilla, but want to have the paint occur first to appear more responsive.

DesktopScintillaControlMBS.Prepare

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Scintilla MBS Scintilla Plugin 22.4 ✅ Yes ✅ Yes ✅ Yes ❌ No
The prepare event.

Called before we create the control, so you can change properties like HasBorder.

DesktopScintillaControlMBS.SavePointLeft

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Scintilla MBS Scintilla Plugin 22.0 ✅ Yes ✅ Yes ✅ Yes ❌ No
Sent to the container when the save point is entered or left, allowing the container to display a "document dirty" indicator and change its menus.

DesktopScintillaControlMBS.SavePointReached

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Scintilla MBS Scintilla Plugin 22.0 ✅ Yes ✅ Yes ✅ Yes ❌ No
Sent to the container when the save point is entered or left, allowing the container to display a "document dirty" indicator and change its menus.

DesktopScintillaControlMBS.ScaleFactorChanged(NewFactor as double)

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Scintilla MBS Scintilla Plugin 22.0 ✅ Yes ✅ Yes ✅ Yes ❌ No
The backing store scale factor has changed.

Please invalidate any cached bitmaps or other relevant state.

DesktopScintillaControlMBS.SelectionChanged(updated as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Scintilla MBS Scintilla Plugin 22.0 ✅ Yes ✅ Yes ✅ Yes ❌ No
Selection changed.

If content is changed or selection, this event is fired.

The UpdateUI event will also be called.

DesktopScintillaControlMBS.StyleNeeded(Position as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Scintilla MBS Scintilla Plugin 22.0 ✅ Yes ✅ Yes ✅ Yes ❌ No
Queries you to provide style information.
Example
// sample event to color digits

Sub StyleNeeded(Position as Integer) Handles StyleNeeded
#pragma BackgroundTasks false

Dim startPos As Integer = Me.EndStyled
Dim lineNumber As Integer = Me.LineFromPosition(startPos)
Dim LineStartPos As Integer = Me.PositionFromLine(lineNumber)

System.DebugLog "Style at "+Position.ToString+" from "+LineStartPos.ToString+" to "+position.ToString

Dim t As String = Me.Text
Dim pos As Integer = LineStartPos

While pos < position

Dim ch As Integer = t.Middle(pos, 1).Asc

If ch >= 48 And ch <= 57 Then
// digit
Me.SetStyling(pos, 1, Me.Style(2))
end if

pos = pos + 1
Wend
End Sub

If you used no explicit lexer to make the container act as the lexer, you will receive this notification when Scintilla is about to display or print text that requires styling.

You are required to style the text from the line that contains the position returned by EndStyled up to the position passed in position. Symbolically, you need code of the form:

startPos = me.EndStyled
lineNumber = LineFromPosition(startPos)
startPos = PositionFromLine(lineNumber)
ApplyStyles(startPos, position)

DesktopScintillaControlMBS.TextChanged(Position as Integer, modificationType as Integer, Text as String, length as Integer, linesAdded as Integer, line as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Scintilla MBS Scintilla Plugin 22.0 ✅ Yes ✅ Yes ✅ Yes ❌ No
Text changed.

Our plugin calls this to inform you about a text change.
No modifications may be performed while in a Modified event.
Modified event will also be raised.

DesktopScintillaControlMBS.UpdateUI(updated as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Scintilla MBS Scintilla Plugin 22.0 ✅ Yes ✅ Yes ✅ Yes ❌ No
Either the text or styling of the document has changed or the selection range or scroll position may have changed.

Now would be a good time to update any container UI elements that depend on document or view state. As it is sometimes difficult to determine whether a change has occurred, these events may also fire when there has been no actual change. The updated field is set to the bit set of things changed since the previous notification.

See kUpdate* constants.

DesktopScintillaControlMBS.URIDropped(text as String)

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Scintilla MBS Scintilla Plugin 22.0 ✅ Yes ✅ Yes ✅ Yes ❌ No
Indicates that the user has dragged a URI such as a file name or Web address onto Scintilla.

The container could interpret this as a request to open the file.

DesktopScintillaControlMBS.UserListSelection(Position as Integer, Character as Integer, Text as String, listType as Integer, listCompletionMethod as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Scintilla MBS Scintilla Plugin 22.0 ✅ Yes ✅ Yes ✅ Yes ❌ No
The user has selected an item in a user list.

FieldUsage
listTypeThis is set to the listType parameter from the UserListShow message that initiated the list.
textThe text of the selection.
positionThe position the list was displayed at.
CharacterIf a fillup character was the method of selection, the used character, otherwise 0.
listCompletionMethodA value indicating the way in which the completion occurred.

DesktopScintillaControlMBS.Zoom

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Scintilla MBS Scintilla Plugin 22.0 ✅ Yes ✅ Yes ✅ Yes ❌ No
This event is generated when the user zooms the display using the keyboard or the Zoom method is called.

This event can be used to recalculate positions, such as the width of the line number margin to maintain sizes in terms of characters rather than pixels.

See also:

Previous items

The items on this page are in the following plugins: MBS Scintilla Plugin.


💬 Ask a question or report a problem
The biggest plugin in space...