Recent

Author Topic: [SOLVED] Installing RichMemo damages Lazarus. IDE shows "Invalid type cast"  (Read 929 times)

Hartmut

  • Sr. Member
  • ****
  • Posts: 420
1) Since I installed the RichMemo-package, every time when I start Lazarus, an error dialog is shown "Invalid type cast" (see attached screenshot1) and I can press "Abort" (which exits Lazarus) or "OK" (which starts Lazarus). No more information is shown to explain what is wrong. The "current project" is demo "testsimple" of the RichMemo-package. If I switch the current project to another RichMemo-demo (e.g. "customrtfload") I always get the same error-dialog. If I switch the current project to one of my own projects, this dialog does not come.

2) In many cases (but not always), when I start Lazarus, first another error dialog is shown "An error occured at last startup while loading <path_to_lpi_file>. Load this project again?" (see attached screenshot2). When I click on "Open project again" => the dialog "Invalid type cast" appears.

To get more infos, I started "startlazarus" directly from a terminal:
Code: Text  [Select][+][-]
  1. hg6@i3300:/opt/lazarus_206/lazarus$ ./startlazarus
  2. using config file /opt/lazarus_206/lazarus/lazarus.cfg
  3. Adding "--primary-config-path=/opt/lazarus_206/config_lazarus" as a parameter
  4.  is a file
  5. SetPrimaryConfigPath NewValue="/opt/lazarus_206/config_lazarus" -> "/opt/lazarus_206/config_lazarus"
  6. TLazarusManager.Run starting /opt/lazarus_206/lazarus/lazarus ...
  7. using config file /opt/lazarus_206/lazarus/lazarus.cfg
  8. SetPrimaryConfigPath NewValue="/opt/lazarus_206/config_lazarus" -> "/opt/lazarus_206/config_lazarus"
  9. Hint: (lazarus) [TMainIDE.ParseCmdLineOptions] PrimaryConfigPath="/opt/lazarus_206/config_lazarus"
  10. Hint: (lazarus) [TMainIDE.ParseCmdLineOptions] SecondaryConfigPath="/etc/lazarus"
  11. Hint: (lazarus) [TBuildManager.SetBuildTarget] Old=x86_64-linux-gtk2 New=x86_64-linux-gtk2 Changed: OS/CPU=True LCL=False
  12. Hint: (lazarus) AskIfLoadLastFailingProject START
  13. Hint: (lazarus) AskIfLoadLastFailingProject END True
  14. TApplication.HandleException: EInvalidCast
  15. Invalid type cast
  16.   Stack trace:
  17.   $000000000129714D line 786 of gtk2/gtk2richmemo.pas
  18.   $000000000059CBE3 line 7537 of include/wincontrol.inc
  19.   $0000000001291F70 line 650 of richmemo.pas
  20.   $000000000059C330 line 7447 of include/wincontrol.inc
  21.   $000000000059DAE8 line 7900 of include/wincontrol.inc
  22.   $000000000059CEB6 line 7582 of include/wincontrol.inc
  23.   $0000000000477A14 line 23 of include/scrollingwincontrol.inc
  24.   $0000000000480FAD line 2703 of include/customform.inc
  25.   $00000000004825D8 line 3171 of include/customform.inc
  26.   $000000000059C330 line 7447 of include/wincontrol.inc
  27.   $000000000059DAE8 line 7900 of include/wincontrol.inc
  28.   $0000000000593E37 line 3478 of include/wincontrol.inc
  29.   $0000000000593A47 line 3529 of include/wincontrol.inc
  30.   $00000000005AF2E0 line 5756 of include/control.inc
  31.   $0000000000C5CFBA line 6037 of sourcefilemanager.pas
  32.   $0000000000C5C250 line 5820 of sourcefilemanager.pas
  33.   $0000000000C52386 line 3790 of sourcefilemanager.pas

This is very annoying. I know that RichMemo-bugs can be added to the "Lazarus CCR" bug tracker, but there I saw, that there are many open RichMemo-bugs, many of them up to 1 year old, all assigned to Dmitry Boyarintsev, but no activities to see.

So my hope is, that maybe here I can find someone, who is enough familiar with that stuff and can help me earlier. I'm a bloody beginner to packages and a beginner to GUI-programming and the LCL.

RichMemo "r7273"
Linux Ubuntu 18.04 (64 bit)
Lazarus 2.0.6
FPC 3.0.4

Because this was my very first package I ever installed (maybe I did something wrong), here is what I did:
 - downloaded "lazarus-ccr-svn-r7273-components-richmemo.zip" from https://sourceforge.net/p/lazarus-ccr/svn/HEAD/tree/components/richmemo/
 - unpacked it into an arbitrary folder
 - started Lazarus / menu Package / Open Package File (.lpk) / select richmemopackage.lpk from the above folder / Open / Button "Use" / Install / "Yes" in the confirmation dialog
 - after that Lazarus was rebuild and restarted and "TRichMemo" was added to the "Common Controls" components

If you need more infos or tests, please let me know. Thanks a lot in advance.
« Last Edit: January 15, 2020, 09:56:41 am by Hartmut »

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2497
    • havefunsoft.com
please try r7279

please note that the there's a change in the package structure.
so you'll need to install richmemo_design package now.
Patron Cocoa Widgetset development https://www.patreon.com/skalogryz

Hartmut

  • Sr. Member
  • ****
  • Posts: 420
It works! (I used r7280). Thanks a lot, skalogryz for that quick solution!

BTW: I had hoped that the RichMemo-package would contain a demo of a simple RTF-Editor (something in the kind of a small "Wordpad" on Windows), but this was not the case. Do you have written such a program which you would share? Or maybe is this question too unapologetic?

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2497
    • havefunsoft.com
Do you have written such a program which you would share? Or maybe is this question too unapologetic?
There are samples that demonstrate parts of the functionality.

Here's RTF property editor dialog. (see the attached file).
or just click on "Rtf" property of TRichMemo

Are you interested in a particular functionality of Wordpad?
Patron Cocoa Widgetset development https://www.patreon.com/skalogryz

Hartmut

  • Sr. Member
  • ****
  • Posts: 420
Thank you for that interesting information. This little "Rich Text Edit Dialog" comes very close to all what I want. There would be only 2 features which I would be interested do add:
 - lists with bullets (numbered lists not necessary)
 - an undo function (^Z)

But I found 2 issues when loading a RTF-file, which was created by Wordpad on Windows:
 - the bullets from lists are not displayed and lists with long lines are not indented correctly
 - in Germany we have 7 special characters, called "Umlaute", which are Ä Ö Ü ä ö ü ß. They are missing (are not displayed).
   
I attached a demo RTF-file, which was created by Wordpad on Windows, and a screenshot, how it should look like and a screenshot, what the "Rich Text Edit Dialog" of RichMemo shows instead.

For me it would be essential, that I can use the same RTF-files both on Windows 7 and Linux (Ubuntu 18.04).
Do you think you can fix this issues (with reasonable effort)?
« Last Edit: January 13, 2020, 06:53:54 pm by Hartmut »

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2497
    • havefunsoft.com
please create bug create a standalone bug reports for each feature.
Patron Cocoa Widgetset development https://www.patreon.com/skalogryz

Hartmut

  • Sr. Member
  • ****
  • Posts: 420
As requested I created 2 bug reports:
 - https://bugs.freepascal.org/view.php?id=36575 (bug displaying bullets lists)
 - https://bugs.freepascal.org/view.php?id=36577 (bugs handling German special characters)
and 2 feature requests:
 - https://bugs.freepascal.org/view.php?id=36579 (bullets lists in "Rich Text Edit Dialog")
 - https://bugs.freepascal.org/view.php?id=36580 (Undo function (^Z) in "Rich Text Edit Dialog")
 
Thanks a lot, skalogryz for your continuous work on the RichMemo-package.

 

TinyPortal © 2005-2018