typing on Canvas

Drag the plugin (under plugin controls) onto your project from the IDE. Then you can see all of the Event Handlers.

and make sure you then RESTART Xojo :slight_smile:

OK… so far, so good… but how to capture keystrokes?

drag an instance onto a window

implement the DoCommand event and you’ll find there are a LOT of commands that get sent to you to insert text, move the cursor (with or without altering the selection), etc

how you represent the text that is being edited is up to you - same as in a canvas

Ok, thanks Norman.

I’ve been revising the CustomEditField to introduce Background Image as well as inline images… I will keep you updated, and if you’d like to get the recent (non-complete…but working) version just let me know. It also features RTFToHTML and HTMLToRTF. I have seen a lot of people requesting such features in a basic Text control… Here’s a Screenshot:

The background image has 2 options, static (as you scroll the scrollbars…the image moves with text) or scrolling(image stays put and text moves).

Just FYI that text input methods on OS X won’t work if you’re basing this off a canvas.

That is what the old Carbon IDE used and under Carbon input methods were something you could declare into & make work (we did)
Under Cocoa it’s a completely different beast - hence why we wrote the TextInputCanvas in the first place - we needed it for the IDE’s code editor.

[quote=55486:@Norman Palardy]As Bob already alluded to IF you want to handle text input properly under Cocoa you REALLY need to start with the text input canvas

Cocoa’s text input system is wildly different from Carbons so making it work right really requires starting with the free TextInput plugin[/quote]
Where is that plugin? (I saw source code on https://github.com/xojo/TextInputCanvas, but is there a built plugin download somewhere?)

Nevermind, it is in the plugin folder …

See : http://www.bkeeneybriefs.com/2013/06/formatted-text-control-3-1-0-alpha-1/

Now we really should write up some docs for it …. plop that on the TO DO list :slight_smile:
How you represent the text is up to you
But the plugin and the input methods conceptually things like its one long line perhaps with end of lines embedded in it.
There’s a “DoCommand” event that you will get passed an EVENT to respond to (like inputText etc, lots of constants defined for the event types) and you handle the commands
There are TONS of commands (like moving by paragraph forward backward extending the selection or not etc etc etc)

[quote=58097:@Matthew Combatti]I’ve been revising the CustomEditField to introduce Background Image as well as inline images… I will keep you updated, and if you’d like to get the recent (non-complete…but working) version just let me know. It also features RTFToHTML and HTMLToRTF. I have seen a lot of people requesting such features in a basic Text control… Here’s a Screenshot:

https://www.dropbox.com/s/eg8tdf139w97mrp/Screenshot%202014-01-09%2000.56.51.png

The background image has 2 options, static (as you scroll the scrollbars…the image moves with text) or scrolling(image stays put and text moves).[/quote]

me being one of those person.

[quote=58097:@Matthew Combatti]I’ve been revising the CustomEditField to introduce Background Image as well as inline images… I will keep you updated, and if you’d like to get the recent (non-complete…but working) version just let me know. It also features RTFToHTML and HTMLToRTF. I have seen a lot of people requesting such features in a basic Text control… Here’s a Screenshot:

https://www.dropbox.com/s/eg8tdf139w97mrp/Screenshot%202014-01-09%2000.56.51.png

The background image has 2 options, static (as you scroll the scrollbars…the image moves with text) or scrolling(image stays put and text moves).[/quote]

I’d love to see it!!

Does anyone have link to a compiled plugin for OS X?

Thanks in advance.

Jan

TIC Plugin

Thank you Axel :slight_smile: