Rich text editor

Post your Gambas programming questions here.
Post Reply
seany
Posts: 32
Joined: Friday 6th December 2019 3:09pm

Rich text editor

Post by seany »

Hi

Does gambas 3.14.1 pi has any way to render Rich Text?

I know that i can make it HTML and use a webview. But I want to have a text box with editable lines, where i can individually set the color/style of each character

I am trying to use gb.qt5.ext.textedit. But I can't find any information on this :( please help.
User avatar
cogier
Site Admin
Posts: 1118
Joined: Wednesday 21st September 2016 2:22pm
Location: Guernsey, Channel Islands

Re: Rich text editor

Post by cogier »

Hi seany and welcome to the forum.

Here is a small program I have put together that might help. If it's not what you are looking for can you please provide a little more detail as to the purpose of your program.
Test1.tar.gz
(12.69 KiB) Downloaded 462 times
cage
Posts: 123
Joined: Monday 2nd September 2019 5:47am
Location: Phoenix Arizona

Re: Rich text editor

Post by cage »

Unfortunately that text program no longer works with the latest version of Gambas 3.14.2. The property RichText no longer exists in the TextEditor(Use to be called TextEdit). Not even sure how to get the syntax Highlight to work with the new version since there as far as I can see no switch to turn on the highlighting. I may be missing something but am still investigating it. There is a property to set it to HTML or WebPage but still no highlighting.
seany
Posts: 32
Joined: Friday 6th December 2019 3:09pm

Re: Rich text editor

Post by seany »

Hello
this is failing with "component not found gb.qt4". I have enabled it in project properties:
Image

I am in qt5. So, I wonder what to do now?
User avatar
cogier
Site Admin
Posts: 1118
Joined: Wednesday 21st September 2016 2:22pm
Location: Guernsey, Channel Islands

Re: Rich text editor

Post by cogier »

I have tested the program with qt5 and it works OK.

Let us know if this works for you.

Image
seany
Posts: 32
Joined: Friday 6th December 2019 3:09pm

Re: Rich text editor

Post by seany »

Hi
Thank you
This happened after deselecting qt4 and selecting qt5:

Image

Thank you.
cage
Posts: 123
Joined: Monday 2nd September 2019 5:47am
Location: Phoenix Arizona

Re: Rich text editor

Post by cage »

seany I had the same problem, but that is because part of the QT4 stuff has been locked. What I did was create a new program and copy and paste the code. Still as I said above the program no longer works.
User avatar
cogier
Site Admin
Posts: 1118
Joined: Wednesday 21st September 2016 2:22pm
Location: Guernsey, Channel Islands

Re: Rich text editor

Post by cogier »

OK I have had another go with this. This version here uses a TextLabel but it only works with 'qt' and, for whatever reason, not with 'gtk'.
I am not sure that this is exactly what you were looking for as you have to edit in a different area, but I hope it helps :D

The commands you can use are shown here.
Test1.tar.gz
(12.75 KiB) Downloaded 399 times
Image
Post Reply