Recent

Author Topic: RTF ability  (Read 6312 times)

katronix

  • Jr. Member
  • **
  • Posts: 54
RTF ability
« on: May 21, 2018, 06:45:20 am »
Hey all,

Doesn't Lazarus have an RTF Editor that it comes with? If not which one is considered the 'best' to use?
If it 'depends on use' why would you pick one over the other?

Thanks,

Chris

taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: RTF ability
« Reply #1 on: May 21, 2018, 07:17:16 am »
Hey all,

Doesn't Lazarus have an RTF Editor that it comes with?
No, its not cross platform.
If not which one is considered the 'best' to use?
the one that fits my needs but that doesn't say much about yours though.
If it 'depends on use' why would you pick one over the other?
You have things backwards, you specify your requirements and we try to recommend a suite closer to them, as far as I know there isn't a single package that supports 100% of the rtf features.
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

Thaddy

  • Hero Member
  • *****
  • Posts: 14169
  • Probably until I exterminate Putin.
Re: RTF ability
« Reply #2 on: May 21, 2018, 09:24:58 am »
as far as I know there isn't a single package that supports 100% of the rtf features.
Indeed, not even the MS RichEdit control supports full RTF.... (funny and true)
Specialize a type, not a var.

tverweij

  • Guest
Re: RTF ability
« Reply #3 on: May 21, 2018, 09:43:15 am »

dbannon

  • Hero Member
  • *****
  • Posts: 2778
    • tomboy-ng, a rewrite of the classic Tomboy
Re: RTF ability
« Reply #4 on: May 21, 2018, 02:09:54 pm »
Both of these are / have Memo like components capable of dealing with RTF
http://wiki.freepascal.org/KControls
http://wiki.freepascal.org/RichMemo

In KControls/Kmemo for example, you can load an RTF file, it displays most (?) of the markup and you can save a file from its contents. Out of the box, you can edit the content but if you want to play with the markup, you need to implement that yourself.
There is an example of doing so. It (the example) does most things nicely but sucks at bullets.

KMemo is 'cross platform' Linux, Windows and Mac, I have not tried to go beyond that.

I have build a medium sort of project (~7K lines of .pas) on kcontrols because of its cross platform credentials. I suspect RichMemo would be faster but for my purpose, it has a number of incomplete bits.

When I started, the author of KControls seemed quite keen to help but perhaps not as active now.

Davo
Lazarus 2, Linux (and reluctantly Win10, OSX)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

katronix

  • Jr. Member
  • **
  • Posts: 54
Re: RTF ability
« Reply #5 on: May 21, 2018, 04:03:08 pm »
Okay basically I'm looking for an editor where someone could do some typing, and then I want to be able to convert that into HTML, with the correct tags.

I'll look at the KControls, thanks :)

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11352
  • FPC developer.
Re: RTF ability
« Reply #6 on: May 21, 2018, 04:24:40 pm »
Download the sourcecode of wordpad  to see how Microsoft does it: http://download.microsoft.com/download/4/0/9/40946FEC-EE5C-48C2-8750-B0F8DA1C99A8/MFC/ole/wordpad.zip.exe

The fact that it has "ole" in the path, probably means it instantiates the richedit control. IOW those sources don't contain the actual core RTF editor.

Thaddy

  • Hero Member
  • *****
  • Posts: 14169
  • Probably until I exterminate Putin.
Re: RTF ability
« Reply #7 on: May 21, 2018, 06:05:11 pm »
The fact it has exe in that link means a troll. Plz remove that!
wordpaddotzipdotexe

My - almost - ten year old knows why......
Specialize a type, not a var.

HeavyUser

  • Sr. Member
  • ****
  • Posts: 397
Re: RTF ability
« Reply #8 on: May 21, 2018, 06:21:36 pm »
The fact it has exe in that link means a troll. Plz remove that!
wordpaddotzipdotexe

My - almost - ten year old knows why......
And he would be wrong. Its a simple self extracting zip, download and test it for your self before you start pointing fingers, or just because you are a bit dusty around the ears you thing you earned the right to accuse with out proof?

katronix

  • Jr. Member
  • **
  • Posts: 54
Re: RTF ability
« Reply #9 on: May 22, 2018, 02:58:49 am »
So I'm looking at KControls, and while compiling the package it had a compiler error in KMemoRTF at line 4030, which says

C := UTF8Copy(AText, I, 1);

Is there something else I need to install before I install KControls? I've checked the readme files and was unable to locate anything.

Chris

dbannon

  • Hero Member
  • *****
  • Posts: 2778
    • tomboy-ng, a rewrite of the classic Tomboy
Re: RTF ability
« Reply #10 on: May 22, 2018, 05:36:10 am »
Chris, you are installing it as a package into Lazarus ?

Did you get the bitbucket version ?  He has stopped formal releases, just get the latest bitbucket revision.

What was the actual compiler message ?

Davo
Lazarus 2, Linux (and reluctantly Win10, OSX)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

katronix

  • Jr. Member
  • **
  • Posts: 54
Re: RTF ability
« Reply #11 on: May 22, 2018, 06:34:31 am »
Chris, you are installing it as a package into Lazarus ?

Did you get the bitbucket version ?  He has stopped formal releases, just get the latest bitbucket revision.

What was the actual compiler message ?

Davo

I'd actually gotten it from his site as there was no mention of a BitBucket version :) Getting that version now https://bitbucket.org/tkweb/kcontrols for anyone who finds this later on :)

katronix

  • Jr. Member
  • **
  • Posts: 54
Re: RTF ability
« Reply #12 on: May 22, 2018, 06:47:01 am »
After looking again, I see it does have a link to BitBucket, I just missed it the first few times :)

Thaddy

  • Hero Member
  • *****
  • Posts: 14169
  • Probably until I exterminate Putin.
Re: RTF ability
« Reply #13 on: May 22, 2018, 06:51:46 am »
The fact it has exe in that link means a troll. Plz remove that!
wordpaddotzipdotexe

My - almost - ten year old knows why......
And he would be wrong. Its a simple self extracting zip, download and test it for your self before you start pointing fingers, or just because you are a bit dusty around the ears you thing you earned the right to accuse with out proof?
It is not done (anymore) and you should know that. My ears are perfectly OK. I wonder why MS still has this on their websites. It should be considered a security risk. I filed a report against it. It will disappear shortly because of that. It is against MS own policies. (and they tend to do what I say, although I am the self-confessed village idiot on this forum... O:-) )
« Last Edit: May 22, 2018, 06:55:08 am by Thaddy »
Specialize a type, not a var.

katronix

  • Jr. Member
  • **
  • Posts: 54
Re: RTF ability
« Reply #14 on: May 22, 2018, 03:39:43 pm »
I apologize in advance, I realize this question is likely off topic from the previous question I asked, and possibly off topic for this board.

However in the KMemoEditor demo, it largely just uses the TKMemoFrame which is a pre-defined part of the component. If I wanted to expand upon it, say add my own functionality I should be able to right?

For example, the main menu is installed with:

Menu := FFrame.MainMenu;

How would I add say another Menu to it? I did try creating a Menu on the form, and use:

Menu := FFrame.MainMenu + MenuItem1;

However, this got me:

Main.pas(48,27) Error: Operator is not overloaded: "TMainMenu" + "TMenuItem"

How would I combine the two? (Adding TMainMenu + TMainMenu didn't work either).

Thanks for the help in advance,

Chris

 

TinyPortal © 2005-2018