Recent

Author Topic: lzRichEdit: Windows/Linux rich text implementation  (Read 42003 times)

typo

  • Hero Member
  • *****
  • Posts: 3051
Re: lzRichEdit Windows/Linux rich text implementation
« Reply #15 on: November 12, 2014, 03:40:40 pm »
OK, BigChimp, thanks anyway.

typo

  • Hero Member
  • *****
  • Posts: 3051
Re: lzRichEdit: Windows/Linux rich text implementation
« Reply #16 on: November 19, 2014, 01:18:22 pm »
Added 4 new methods for Windows:

Code: [Select]
procedure LoadFromFile(AFileName: string);                       
procedure Print(const DocumentTitle: string; Margins :TMargins);   
procedure Redo;                                                 
procedure SaveToFile(AFileName: string);                         

Also added full justification paragraph attibute (see wiki page).

See in demo project how to export to HTML format.
« Last Edit: November 19, 2014, 02:50:37 pm by typo »

typo

  • Hero Member
  • *****
  • Posts: 3051
Re: lzRichEdit: Windows/Linux rich text implementation
« Reply #17 on: November 22, 2014, 09:14:37 pm »
Added 2 more properties:

CaretCoordinates
Column :Integer
Line :Integer

CaretPoint
X :Integer
Y :Integer

There is an issue in Linux with an Access Violation when one reopens a project with lzRichEdit component on a form.

Thanks.
« Last Edit: November 22, 2014, 10:17:36 pm by typo »

Never

  • Sr. Member
  • ****
  • Posts: 409
  • OS:Win7 64bit / Lazarus 1.4
Re: lzRichEdit: Windows/Linux rich text implementation
« Reply #18 on: November 23, 2014, 04:47:21 am »
feedback ***: win7 64 bit  from the demo provided
saves as expected *.rtf and *.html
load as expected *.rtf
print as expected
font change (name,size)as expected
formating as expected
printing as expected
issues:
when searching non english chars the selection mask is doubled
ex: if the string is [astring] and the search term is 'as' the text is found and 2 chars 'a' and 's' are selected
      if the string in editor is 'ασδερτασδ' and the search term is 'ασδ' then the selected text is 'ασδερτ'
when searching non english and english chars the selection mask is doubled/2
ex:
      if the string in editor is 'aαααα' and the search term is 'aα' then the selected text is 'aαα'
@typo congrats great job
Νέπε Λάζαρε λάγγεψων οξωκά ο φίλοσ'ς αραεύσε

typo

  • Hero Member
  • *****
  • Posts: 3051
Re: lzRichEdit: Windows/Linux rich text implementation
« Reply #19 on: November 23, 2014, 06:27:28 am »
Thanks for the feedback.

Feedback for Linux is also welcome.

Solution for the issue on Windows: find this line of code in the Example Project:

Code: [Select]
SelLength := Length(FindDlg.FindText);

and replace it by that:

Code: [Select]
SelLength := UTF8Length(FindDlg.FindText);

Thanks.
« Last Edit: November 23, 2014, 06:38:13 am by typo »

typo

  • Hero Member
  • *****
  • Posts: 3051
Re: lzRichEdit: Windows/Linux rich text implementation
« Reply #20 on: November 23, 2014, 05:57:03 pm »
Added 2 more methods:

GetWordAtPoint
Gets the word at the (x,y) position.

GetWordAtPos
Gets the word at the text position.

Thanks.

Never

  • Sr. Member
  • ****
  • Posts: 409
  • OS:Win7 64bit / Lazarus 1.4
Re: lzRichEdit: Windows/Linux rich text implementation
« Reply #21 on: November 23, 2014, 07:37:06 pm »
feedback ***: win7 64 bit  from the demo provided
Steps
open a txt file ex: test1.txt
edit the file ex: set one line align to center
save the file as rtf with name test1.rtf
open the new file test1.rtf
nothing is loaded
the file is saved thought as txt with the extension of rtf
you can confirm this if you open the file with another editor.
from time to time debuger crashes when clossing the app and in session several documntes where loaded but did not figure this out yet to spot exactly when it happens
Νέπε Λάζαρε λάγγεψων οξωκά ο φίλοσ'ς αραεύσε

typo

  • Hero Member
  • *****
  • Posts: 3051
Re: lzRichEdit: Windows/Linux rich text implementation
« Reply #22 on: November 23, 2014, 09:51:36 pm »
I use win7-32bit and can not reproduce this. The file is saved with an extension RTF, but is plan text, I can open it on Notepad and there is no formatting info there.

(Unless you mean "no format" by "nothing".)
« Last Edit: November 23, 2014, 09:59:30 pm by typo »

Never

  • Sr. Member
  • ****
  • Posts: 409
  • OS:Win7 64bit / Lazarus 1.4
Re: lzRichEdit: Windows/Linux rich text implementation
« Reply #23 on: November 23, 2014, 10:41:10 pm »
open a text file---> file/open
and save it as rtf--->file/save as (select rtf)
and open the saved rtf --->click on the  folder icon and select the saved rtf
nothing is loaded
and if you close the app from the
  • button top right you got a debugger crash
Νέπε Λάζαρε λάγγεψων οξωκά ο φίλοσ'ς αραεύσε

typo

  • Hero Member
  • *****
  • Posts: 3051
Re: lzRichEdit: Windows/Linux rich text implementation
« Reply #24 on: November 23, 2014, 10:49:23 pm »
Oh, yes, now I see. But I can not reproduce the crash.

Never

  • Sr. Member
  • ****
  • Posts: 409
  • OS:Win7 64bit / Lazarus 1.4
Re: lzRichEdit: Windows/Linux rich text implementation
« Reply #25 on: November 23, 2014, 10:55:59 pm »
:) don't worry it will happen have faith lol  :P
Νέπε Λάζαρε λάγγεψων οξωκά ο φίλοσ'ς αραεύσε

typo

  • Hero Member
  • *****
  • Posts: 3051
Re: lzRichEdit: Windows/Linux rich text implementation
« Reply #26 on: November 23, 2014, 11:43:03 pm »
It seems that the control does not open an RTF extension with plain text inside it. You can try to change the extension of a text file from TXT to RTF. You could not open it, the control remains empty, even if you can open it in other apps.

The openfile/savefile routines are not working fine. It is not with the control itself.

With PlainText set to False, the plain text is not shown, no matter it has an extension TXT or RTF.
« Last Edit: November 24, 2014, 12:17:55 am by typo »

typo

  • Hero Member
  • *****
  • Posts: 3051
Re: lzRichEdit: Windows/Linux rich text implementation
« Reply #27 on: November 24, 2014, 02:39:44 am »
Well, I think the issue is solved. You can download it from:

http://wiki.lazarus.freepascal.org/lzRichEdit#Download
« Last Edit: November 27, 2014, 03:06:43 pm by typo »

Never

  • Sr. Member
  • ****
  • Posts: 409
  • OS:Win7 64bit / Lazarus 1.4
Re: lzRichEdit: Windows/Linux rich text implementation
« Reply #28 on: November 24, 2014, 09:24:22 am »
i understand @typo
just reporting averything i see and it might discourage someone to test further
Νέπε Λάζαρε λάγγεψων οξωκά ο φίλοσ'ς αραεύσε

typo

  • Hero Member
  • *****
  • Posts: 3051
Re: lzRichEdit: Windows/Linux rich text implementation
« Reply #29 on: November 24, 2014, 03:41:13 pm »
Thanks for your feedback.

I am not bothered by your reports.
« Last Edit: November 24, 2014, 03:43:53 pm by typo »

 

TinyPortal © 2005-2018