Word Processor/ RTF Editor

I would like to include a text editor in my desktop app, nothing too fancy, I just want to be able to make some text bold, a different size/colour etc.

I’ve tried gHTML editor (demo) , but the editor doesnt display on my mac (tried info.plist file as well).

Is there any other comntrol avaiable, or info on how toio embed say tinymce/quill etc on a desktop app ?.

New to Xojo and struggling to find the info I need (but in my spare time managed in a week to develop a cross platform app that took 3 months in Lazarus and still wasn’t truly cross platform).

TextArea Styles support those features, but I expect you will want more. Some people have been able to connect to the online CKEditor/gHTML editor successfully.

Your choices include TextArea, CKEditor/gHTML, Scintilla by MBS and SyntaxEditor/GraffitiEditor by GraffitiSuite.

Another option is to find your favorite editor in HTML/JS and embed it in a DesktopHTMLViewer, making sure to include all the dependency files with your application. You can use Javascript to set or extract the existing data. It takes some work (and adds some filesize on Windows since Chromium is now bundled with your application), but I find myself building more and more UI elements for Xojo in HTML these days.

I’m using Quill in an HTMLViewer. It works but is not ideal. It required a few changes, and figuring out where they are needed in 12k lines of opaque javascript was not easy.

I needed that specifically as I needed the end result to be HTML, rather than RTF.

David :- TextArea may well be enough, I used a similar control in Lazarus and (a RichMemo) and had enough controil over text size, colour, font etc for my basic needs, however this took a fair amount of work and I was hoping for a quicker solution. I cannot get CKeditor to work, on a mac the editor does not display in the window and on Windows i get a message informing me that the required ckeditor files cannot be found (this is an unregistered version of Xojo and I’m wondering if i will have to have a egistered version).

Christian, do you know of any examples to get me started ?

Tim, I too would prefer html, any pointers on how yo use quill ?.

Thanks for all your help, appreciated,

I made one using summernote and desktophtmlviewer, and it was easier than quill.
but quill is better at moving pictures around the text…
I also made one for toast markdown. not finished as all the events and buttons are not implemented.
all with a desktophtmlviewer
I’m still searching on how to open word documents with them …



I’ve fought with most of them. Used Quill for a number of years after purchasing the original HTMLEdit from @Tim_Parnell , and eventually determined that it was just the wrong way to go moving forward. It felt largely abandoned and was missing many basic implementation details and advanced features.

Likewise, I’ve tried many other JavaScript editors over the years and been less than impressed. GraffitiEditor now uses SunEditor. It’s not perfect, but it’s the best I’ve found to build around after spending far more hours than I’ll ever admit on researching and evaluating these solutions.

If you’re not fluent in JavaScript, I’d stick to either the built-in TextArea with StyleRuns or use another solution that’s available rather than fight with getting this right in JavaScript. Save a lot of time and headache.

3 Likes

Does the GraffitiEditor need an understanding of the underlying technology to use? OP mentioned they would prefer HTML, and I would recommend the GraffitiSuite route over one of the knockoffs.

2 Likes

It does not. You don’t need to know JavaScript, CSS, HTML, RTF, or anything else. It is a full Xojo API on the JavaScript component. There are some parts you can access to modify with CSS or JavaScript, but users should theoretically never need to.

The input and output are HTML content.

1 Like

Have you tried the TextArea? It is pretty limited, but it may be enough if your needs are simple as you suggested.

@Christian_Schmitz’s Monkeybread Plugin (MBS) has an example text editor in Examples\DynaPDF\StyledText Editor.xojo_binary_project

You can download and install the plugins to try them out. The download has a ton of examples.

https://www.monkeybreadsoftware.de/xojo/

Edit: You don’t need the MBS plugins for editing text using his example.

Hi, I was also trying this solution. But to then obtain the html.
How did you get DesktopHtmlViewer to return the HTML of the text written without the Summernote code?

I can only think of a very banal replace a me.
Have you found a better solution?

Thank you

on a desktophtmlviewer method :
having defined the summernote element as

<div id="summernote"></div>

I get the summernote content using

Dim js As String = "$('#summernote').summernote('code');"
Dim r As String = Me.ExecuteJavaScriptSync( js)
1 Like

Oh. Easy. Many Thanks Jean