SyntaxHighlightEditField

Does anyone know where I can download Alex Restrepo’s SyntaxHighlightEditField. I have Googled and dug around but cannot find any working links. Is this still in circulation?

I think you’re looking for the CustomEditField. It can be found at http://code.google.com/p/custom-editfield/

Thanks Bob, is this yours? I have run and got an error with a text encoding Encodings.UCS4 not existing. Any ideas? Thanks

Nope. Mine is the Formatted Text Control at https://www.bkeeney.com/formatted-text-control/.

I have seen that error in the CustomEditField and I think all I did was comment out that line of code. No ill effects in my projects but your mileage may vary.

After google’ing UCS4 it was AKA UTF32 so I chanced it and changed it. Again no ill effects.

Be aware that for keyboard handling on OS X and edit field handling “keydown” etc WON’T be sufficient

its why we went so far as to create the TextInputCanvas plugin that you can use to base controls that do text editing off of

Sorry to hijack the thread, but are there any docs for this plugin? All I found was the code repo.

I don’t honestly know whats even in the repo :stuck_out_tongue:
I just got to be the guinea pig as we used it first for the IDE before we open sourced it.
Not sure if Joe ever wrote anything up or if Paul did
Joe’s offline for a couple days so I cant ask him at all

Load CustomEditField.rbp, in the Folder ‘CustomEditField’ is a module named ‘Info’.
Duble click on ‘Info’ opens a tab with the docs (Info, Docs, SyntaxDefinitions …)

I use it in my Python Editor , I have made to test code with different versions of Python.

it is not quite finished yet (save bookmarks not working actually),but you can already work with.

PythOSX
copy the folder PythOSX somewhere

Hi Mike,

I put the SyntaxHighlightEditField into my dropbox - you can get it from there:

https://dl.dropboxusercontent.com/u/992591/REALbasic/Classes/SyntaxHighlightEditField.zip

Thanks, but I meant docs for the TextInputCanvas plugin @Norman Palardy mentioned.

The only documentation they have is the source code at https://github.com/xojo/TextInputCanvas

Good thing I’ve been planning to learn C++ :wink:

is there a plugin for textinputcanvas ready to use??

To use TextInputCanvas you really DON’T need C++ :stuck_out_tongue:

True, but if the source code is the only documentation I ought to learn how to read it.

The events are basically all commented in TextInputCanvas.cpp. There’s not much more for documentation, since very few people need this (Bob’s the only one up until now).

I’ll see if we can include this in the git hub stuff once I add more detail to it

The comment at the beginning of the list of constants is the protocol / class in Apples documentation where you will find more information about this command / constant

Events
	BaselineAtIndex( index as integer ) as integer
	CharacterAtPoint( x as integer, y as integer ) as integer
	DiscardIncompleteText()	
	DoCommand( command as string ) as boolean	
	FontNameAtLocation( location as integer ) as string	
	FontSizeAtLocation( location as integer ) as integer	
	IncompleteTextRange() as TextRange	
	SetIncompleteText( text as string, replacementRange as TextRange, relativeSelection as TextRange )	
	InsertText( text as string, range as TextRange )	
	IsEditable() as boolean	
	KeyFallsThrough( key as string ) as boolean	
	Paint( g as Graphics, areas() as object )	
	RectForRange( byref range as TextRange ) as REALbasic.Rect	
	SelectedRange() as TextRange	
	TextForRange( range as TextRange ) as string 	
	TextLength() as integer	
	MouseDown(x as Integer, y as Integer) as Boolean	
	MouseDrag(x as Integer, y as Integer)	
	MouseUp(x as Integer, y as Integer)	
	GotFocus()	
	LostFocus()	
	EnableMenuItems()

Constants (most used in DoCommand as the command )
	// NSResponder: Selection movement and scrolling
	moveForward:
	moveRight:
	moveBackward:
	moveLeft:
	moveUp:
	moveDown:
	moveWordForward:
	moveWordBackward:
	moveToBeginningOfLine:
	moveToEndOfLine:
	moveToBeginningOfParagraph:
	moveToEndOfParagraph:
	moveToEndOfDocument:
	moveToBeginningOfDocument:
	pageDown:
	pageUp:
	centerSelectionInVisibleArea:
	
	// NSResponder: Selection movement and scrolling
	moveBackwardAndModifySelection:
	moveForwardAndModifySelection:
	moveWordForwardAndModifySelection:
	moveWordBackwardAndModifySelection:
	moveUpAndModifySelection:
	moveDownAndModifySelection:
	
	// NSResponder: Selection movement and scrolling
	moveToBeginningOfLineAndModifySelection:
	moveToEndOfLineAndModifySelection:
	moveToBeginningOfParagraphAndModifySelection:
	moveToEndOfParagraphAndModifySelection:
	moveToEndOfDocumentAndModifySelection:
	moveToBeginningOfDocumentAndModifySelection:
	pageDownAndModifySelection:
	pageUpAndModifySelection:
	moveParagraphForwardAndModifySelection:
	moveParagraphBackwardAndModifySelection:

	// NSResponder: Selection movement and scrolling (added in 10.3)
	moveWordRight:
	moveWordLeft:
	moveRightAndModifySelection:
	moveLeftAndModifySelection:
	moveWordRightAndModifySelection:
	moveWordLeftAndModifySelection:

	// NSResponder: Selection movement and scrolling (added in 10.6)
	moveToLeftEndOfLine:
	moveToRightEndOfLine:
	moveToLeftEndOfLineAndModifySelection:
	moveToRightEndOfLineAndModifySelection:
	
	// NSResponder: Selection movement and scrolling
	scrollPageUp:
	scrollPageDown:
	scrollLineUp:
	scrollLineDown:

	// NSResponder: Selection movement and scrolling
	scrollToBeginningOfDocument:
	scrollToEndOfDocument:

	// NSResponder: Graphical Element transposition
	transpose:
	transposeWords:

	// NSResponder: Selections
	selectAll:
	selectParagraph:
	selectLine:
	selectWord:
	
	// NSResponder: Insertions and Indentations
	indent:
	insertTab:
	insertBacktab:
	insertNewline:
	insertParagraphSeparator:
	insertNewlineIgnoringFieldEditor:
	insertTabIgnoringFieldEditor:
	insertLineBreak:
	insertContainerBreak:
	insertSingleQuoteIgnoringSubstitution:
	insertDoubleQuoteIgnoringSubstitution:
	
	// NSResponder: Case changes
	changeCaseOfLetter
	uppercaseWord:
	lowercaseWord:
	capitalizeWord:
	
	// NSResponder: Deletions
	deleteForward:
	deleteBackward:
	deleteBackwardByDecomposingPreviousCharacter:
	deleteWordForward:
	deleteWordBackward:
	deleteToBeginningOfLine:
	deleteToEndOfLine:
	deleteToBeginningOfParagraph:
	deleteToEndOfParagraph:
	yank:
	
	// NSResponder: Completion
	complete:
	
	// NSResponder: Mark/Point manipulation
	setMark:
	deleteToMark:
	selectToMark:
	swapWithMark:
	
	// NSResponder: Cancellation
	cancelOperation:

	// NSResponder: Writing Direction
	makeBaseWritingDirectionNatural:
	makeBaseWritingDirectionLeftToRight:
	makeBaseWritingDirectionRightToLeft:
	makeTextWritingDirectionNatural:
	makeTextWritingDirectionLeftToRight:
	makeTextWritingDirectionRightToLeft:

	// Not part of NSResponder, something custom we need for Windows
	rbToggleOverwriteMode
	rbCopy
	rbCut
	rbPaste
	rbUndo

TextRanges
 Text ranges assume that the body of text is one long block of text

Properties
	Location as Integer
	Length as Integer
	EndLocation as Integer

Methods
	Constructor()
	Constructor( location as integer, length as integer )

Now you dont have to read C++