Recent

Author Topic: fpc 3.3.1 or lazarus 2.3 not working well  (Read 1396 times)

edgarrod71

  • Jr. Member
  • **
  • Posts: 68
fpc 3.3.1 or lazarus 2.3 not working well
« on: March 30, 2023, 06:22:33 pm »
I wrote a few weeks ago that using latest lazarus couldn't let me write this caret ^ nor any foreign characters like áÁéÉíÍóÓúÚüÜ.  Tested it and it let me write russian characters.  Problem seem to be SynEdit.  That was tested using BigSur.  I moved to El Capitan partition on my hard disk where I have lazarus version 2.0.12 with fpc 3.0.2 and the problem is not shown.  I upgraded fpc to 3.2.0 and everything is ok.  So I decided last night to upgrade fpc to 3.3.1 and Lazarus to 2.3.0 and the problem shows again with some addings...

For instance, I created a new project, put a TSynEdit, a TMemo and a TButton on the form, put a line to copy from Memo1 to SynEdit1 but I found that IDE doesn't put the declaration of 3 classes inside the TForm!  (I put a screen capture). 

I thought it was because of lazarus 2.3.0, but when I went to my old lazarus 2.0.12 results that same happened!   My logic points that is a fpc problem.  Any ideas?

Returning to make the app work to see if the problem of chars not showing, results that the button copies from memo "áéíóúÁÉÍÓÚ^üÜ" but when I try to write inside TSynEdit, it doesn't write them correctly, they are without the tildes.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 8862
  • Debugger - SynEdit - and more
    • wiki
Re: fpc 3.3.1 or lazarus 2.3 not working well
« Reply #1 on: March 30, 2023, 06:49:28 pm »
It's (likely) not SynEdit.

There are 2 types of controls
- custom
- native

A TEdit or TMemo is native. It offers what the OS provides. It mostly can't be customized beyond that (e.g. you can't easily add colors to a memo). The key handling is passed through, the LCL (lcl/wigdetset) does not do much to the keys.

SynEdit is custom. It is all in Pascal, and can be changed. All key handling however is done in lcl/wigdetset.

So whatever causes the issue, is then (most likely) affecting all custom controls.

edgarrod71

  • Jr. Member
  • **
  • Posts: 68
Re: fpc 3.3.1 or lazarus 2.3 not working well
« Reply #2 on: March 30, 2023, 08:26:31 pm »
I can write tilde chars on any customcontrol, but not on SynEdit.  AFAIK FreePascal uses SynEdit for the Source Code window and other forms.

What I'm worried now is about why the IDE is putting the unit of SynEdit but not SynEdit1: TSynEdit; inside TForm

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 8862
  • Debugger - SynEdit - and more
    • wiki
Re: fpc 3.3.1 or lazarus 2.3 not working well
« Reply #3 on: March 30, 2023, 11:29:01 pm »
I don't use Mac, so I can't test.

The previous mention however, applies in the same way to all OS, hence it is information I could supply. And it has in the past in similar ways happened on Linux.


Anyway, if you are 100% certain that all other custom controls work (e.g. AtSynEdit / mind that many grids, albeit custom, do use a normal TEdit for input, and therefore their input is actually not custom).
So if you are certain, then it might be a conflict with the configured keys.

In the IDE they are in Tools > Options > Editor > Keymap.
In TSynEdit on your own app, the object inspector will list them as a property "KeyStroke" (IIRC) of the SynEdit.

If any key matches the physical key that triggers the accent, the that key will be used on its own, and never mades it as accent. The key may in the list appear with some generic description (according to VK codes, or some default keymap / I am not sure about how it will be labelled)
Simple clear *all* codes from KeyStrokes and test.




Quote
What I'm worried now is about why the IDE is putting the unit of SynEdit but not SynEdit1: TSynEdit; inside TForm

Does that also happen with a brand new project?

- Usually that points to a problem parsing the rest of the code in the unit. Though in that case an error dialog should pop up.
- As for Lazarus 2.3 there was a recent fix (this week) regarding a maybe related issue, where sometimes the projects package list wasn't updated.

Also mind, that fpc 3.3.1 can be unstable at times. At current I know of at least one bug in it, that actually generates wrong asm code for some projects. It shouldn't affect SynEdit, but I don't know about lcl/widgetset. https://gitlab.com/freepascal.org/fpc/source/-/issues/40165

edgarrod71

  • Jr. Member
  • **
  • Posts: 68
Re: fpc 3.3.1 or lazarus 2.3 not working well
« Reply #4 on: March 31, 2023, 05:04:37 pm »
One curious thing is when I delete de components on form, the component declaration lines inside TForm added by hand are deleted by IDE! (it is supposed to do) :D   

Checked the advise about Tools keymapping and it's not the problem.  Put a SynEdit component on a brand new project form and deleted all keystrokes, problem continues. 

Changed to Russian Keyboard and it prints the ^ caret.  But Spanish, even English Keyboard cannot.  I put a screen capture image to show with comments, and app running.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 8862
  • Debugger - SynEdit - and more
    • wiki
Re: fpc 3.3.1 or lazarus 2.3 not working well
« Reply #5 on: April 01, 2023, 12:18:09 am »
It might be someone needs to look at it, how has more Mac experience than I.

Though from your description it is not easy to even pinpoint possible reasons.

1) You subject says "fpc 3.3.1 or lazarus 2.3"

a) That suggests it does work with Lazarus 2.2.x and Fpc 3.2.2 ?

b) But does it then work with 
- Lazarus 2.3, but fpc 3.2.2 or 3.2.3 ?
- Lazarus 2.2.6 and (either or any of the fpc versions)?


2) You have at least 2 problems (that are likely unrelated to each other).
- typing certain keys in SynEdit
- The IDE designer not adding components to the source code.

Either of which could be working or non-working with any Laz/fpc version combination.

---
For any one trying to figure out what it is, knowing where it broke may be of use....

If it worked in Lazarus 2.2.n, but fails in 2.3 (however with fpc 3.2.2) then it probably needs to be reported as a bug against Lazarus..




dbannon

  • Hero Member
  • *****
  • Posts: 2443
    • tomboy-ng, a rewrite of the classic Tomboy
Re: fpc 3.3.1 or lazarus 2.3 not working well
« Reply #6 on: April 01, 2023, 02:24:06 am »
I an unfamiliar with the expression "tilde character" so forgive my guess if its wrong.  I suspect your problem might relate to this bug - https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/38454

Its an issue of how the character is entered rather than being stored in the component. And seems a GTK2 (ie not qt5) on Linux so seems doubtful you would see it with Cocoa. But does sound similar and maybe related. My guess is it will never be fixed on GTK2 and its nearing the end of its life.

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

AlexTP

  • Hero Member
  • *****
  • Posts: 2116
    • UVviewsoft
Re: fpc 3.3.1 or lazarus 2.3 not working well
« Reply #7 on: April 01, 2023, 09:38:21 am »
I didn't read all the topic, only 1st post. You need the Cocoa patch from bugtracker. Find it by words "IME" and "cocoa". I attach changed LCL files.

Thaddy

  • Hero Member
  • *****
  • Posts: 12971
Re: fpc 3.3.1 or lazarus 2.3 not working well
« Reply #8 on: April 01, 2023, 12:12:54 pm »
I an unfamiliar with the expression "tilde character"
The tilde "~" needs to be escaped, since in a code editor the tilde "~" has a special meaning: it governs e.g. menu characters for short-cuts. (Also e.g. buttons and more)
That is the same in Delphi, by the way, and it is a convention so not Pascal specific.
So the issue is about not knowing or reading the documentation. (as usual)
« Last Edit: April 01, 2023, 12:36:36 pm by Thaddy »
I actually get compliments for being rude... (well, Dutch, but that is the same)

PascalDragon

  • Hero Member
  • *****
  • Posts: 5042
  • Compiler Developer
Re: fpc 3.3.1 or lazarus 2.3 not working well
« Reply #9 on: April 01, 2023, 04:20:14 pm »
I an unfamiliar with the expression "tilde character"
The tilde "~" needs to be escaped, since in a code editor the tilde "~" has a special meaning: it governs e.g. menu characters for short-cuts. (Also e.g. buttons and more)
That is the same in Delphi, by the way, and it is a convention so not Pascal specific.
So the issue is about not knowing or reading the documentation. (as usual)

That's “&”, not “~” what you mean here.

korba812

  • Sr. Member
  • ****
  • Posts: 349
Re: fpc 3.3.1 or lazarus 2.3 not working well
« Reply #10 on: April 01, 2023, 06:13:59 pm »
I an unfamiliar with the expression "tilde character"
The tilde "~" needs to be escaped, since in a code editor the tilde "~" has a special meaning: it governs e.g. menu characters for short-cuts. (Also e.g. buttons and more)
That is the same in Delphi, by the way, and it is a convention so not Pascal specific.
So the issue is about not knowing or reading the documentation. (as usual)
That's “&”, not “~” what you mean here.
If I remember correctly the "~" character has a special meaning in TV/FV - just like the "&" character in VCL/LCL.

edgarrod71

  • Jr. Member
  • **
  • Posts: 68
Re: fpc 3.3.1 or lazarus 2.3 not working well
« Reply #11 on: April 01, 2023, 07:22:15 pm »
1) You subject says "fpc 3.3.1 or lazarus 2.3"

a) That suggests it does work with Lazarus 2.2.x and Fpc 3.2.2 ?

b) But does it then work with 
- Lazarus 2.3, but fpc 3.2.2 or 3.2.3 ?
- Lazarus 2.2.6 and (either or any of the fpc versions)?

a) I downloaded latest fpc and latest lazarus and they are on versions 3.3.1
"Free Pascal Compiler version 3.3.1 [2023/03/30] for x86_64"
Lazarus About says version 2.3.

b) I was working with fpc 3.0.4 and Laz 2.0.12 before jumping to latest versions, so I didn't test on Laz 2.2.6 neither fpc 3.2.2 nor 3.2.3.

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 10715
  • FPC developer.
Re: fpc 3.3.1 or lazarus 2.3 not working well
« Reply #12 on: April 01, 2023, 07:30:42 pm »
FPC 3.0.4 is 2017......  Most people don't remember it :-)

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 8862
  • Debugger - SynEdit - and more
    • wiki
Re: fpc 3.3.1 or lazarus 2.3 not working well
« Reply #13 on: April 01, 2023, 09:12:38 pm »
b) I was working with fpc 3.0.4 and Laz 2.0.12 before jumping to latest versions, so I didn't test on Laz 2.2.6 neither fpc 3.2.2 nor 3.2.3.

I would guess that when you used Laz 2.0.12 that was using Carbon.
While now you likely are using Cocoa.

And that could also be a reason for the difference.

edgarrod71

  • Jr. Member
  • **
  • Posts: 68
Re: fpc 3.3.1 or lazarus 2.3 not working well
« Reply #14 on: April 01, 2023, 09:53:33 pm »
FPC 3.0.4 is 2017......  Most people don't remember it :-)

I know that, I downloaded on my Big Sur partition fpc 3.2.2 and laz 2.6 with the problem of not writing these characters "^ ~ á é í ó ú Á É Í Ó Ú ü Ü", so I installed older versions on El Capitan, and the downloadable Mac binaries on the laz site were fpc 3.0.4 and laz 2.0.12.  Others were made for further versions.

 

TinyPortal © 2005-2018