Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2008-10

Mac OS X : Unable to assign events from within Carbon IDE...

7 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Unknown author

Using SVN version 17134 I am unable to assign events like OnClick etc using the Carbon IDE with a double click. It simply jumps to the top of the .pas unit and the focus on the project inspector malfunctions while on the event tab. You basically can't select anything on the events tab then, until you click on the class tree. This used to happen about 2 weeks ago, then someone fixed it, and now it is broken again.

Dominique.

Reply by email

Christian Budde
to Unknown author

Hello,

I just worked a bit with lazarus after some month. It's still quite impressive how good it works. On the other hand it's sad that so many things do not work yet. Especially in Win32 IMHO it's still easier to work in Delphi and only switch to Lazarus when necessary.

The reasons for this are so many small which simply doesn't work right or are anoying. One thing I'd like to mention here is the fact that in Delphi you can scroll in the editor by more than a line if you hold [CTRL] pressed while scrolling with the mouse. It's been in the since ages!

I just had a look in the 'synedit.pp' and it seems to be in there as well. However, it is if defined out. It seems as if the mouse wheel scrolling is handled elsewhere. Unfortunately I'm not that familar with the IDE (I did a grep for MouseWheel, but could only find that an TWouseWheelEvent is fired, but not where to find this).

Could someone give me a hint where to find and fix this. Or explain me, why the available code in the synedit.pp file can't be used?

If I could help out to solve this issue I'd be glad to 'fix' some more (like the annoying Shift+Click, that triggers slightly wrong and makes me continuously enter the wrong unit).

Kind regards,

Christian

Reply by email

Martin Friebe
to Christian Budde
Christian Budde wrote 18 lines
Hello, I just worked a bit with lazarus after some month. It's still quite impressive how good it works. On the other hand it's sad that so many things do not work yet. Especially in Win32 IMHO it's still easier to work in Delphi and only switch to Lazarus when necessary. The reasons for this are so many small which simply doesn't work right or are anoying. One thing I'd like to mention here is the fact that in Delphi you can scroll in the editor by more than a line if you hold [CTRL] pressed while scrolling with the mouse. It's been in the since ages! I just had a look in the 'synedit.pp' and it seems to be in there as well. However, it is if defined out. It seems as if the mouse wheel scrolling is handled elsewhere. Unfortunately I'm not that familar with the IDE (I did a grep for MouseWheel, but could only find that an TWouseWheelEvent is fired, but not where to find this).

Hi, I am not 100% sure, but I had a tiny bit of exposure to this before.

There is a lot more happening to mousewheel handling, and it's hidden in the LCL. First is that the Mousewheel event is sometimes redirected (at least under Windows). Windows does sent it to the active Window. LCL does redirect it to the Window over which the mouse currently hovers.

Have a look at http://bugs.freepascal.org/view.php?id=11768 it gives some hints where the Message goes.

I don't remember all of it, and it's Windows only (so you must find the other OS yourself)
lcl\interfaces\win32\win32winapi.inc line 180
The Msg send to Synedit is WM_HScroll or something like this. It is also worth checking i f the Msg goes th Synedit or the Scrollbar

Good look with this. Hope someone else can shine some more light on it.

Show quoted text 7 lines
Could someone give me a hint where to find and fix this. Or explain me, why the available code in the synedit.pp file can't be used? If I could help out to solve this issue I'd be glad to 'fix' some more (like the annoying Shift+Click, that triggers slightly wrong and makes me continuously enter the wrong unit).

Can you give an example what exactly goes wrong with the shift click, please? (And which OS?)

Show quoted text 8 lines
Kind regards, Christian _______________________________________________ Lazarus mailing list http://www.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

Christian Budde
to Martin Friebe

Hi Martin

Show quoted text 8 lines
I don't remember all of it, and it's Windows only (so you must find the other OS yourself) lcl\interfaces\win32\win32winapi.inc line 180 The Msg send to Synedit is WM_HScroll or something like this. It is also worth checking i f the Msg goes th Synedit or the Scrollbar Good look with this. Hope someone else can shine some more light on it.

Thanks for the hint! I'll sure have a look later today.

Show quoted text 9 lines
> Could someone give me a hint where to find and fix this. Or explain me, > why the available code in the synedit.pp file can't be used? > > If I could help out to solve this issue I'd be glad to 'fix' some more > (like the annoying Shift+Click, that triggers slightly wrong and makes > me continuously enter the wrong unit). > Can you give an example what exactly goes wrong with the shift click, please? (And which OS?)

If you click on a unit for example, hold the mouse button down (pressed) and then use the modifier [CTRL] it jumps to the units source OnMouseButtonUp. In Delphi it only got triggered OnMouseButtonDown. So, sorry it's not Shift+Click, but Ctrl+Click. However this is very annoying for me, since I'm continuously entering the wrong units.

All this is Win32. Haven't checked the other OS yet.

Kind regards,

Christian

Reply by email

Martin Friebe
to Christian Budde
Christian Budde wrote 15 lines
>> If I could help out to solve this issue I'd be glad to 'fix' some more >> (like the annoying Shift+Click, that triggers slightly wrong and makes >> me continuously enter the wrong unit). >> > Can you give an example what exactly goes wrong with the shift click, > please? (And which OS?) > If you click on a unit for example, hold the mouse button down (pressed) and then use the modifier [CTRL] it jumps to the units source OnMouseButtonUp. In Delphi it only got triggered OnMouseButtonDown. So, sorry it's not Shift+Click, but Ctrl+Click. However this is very annoying for me, since I'm continuously entering the wrong units. All this is Win32. Haven't checked the other OS yet.

This is probably cross all OS. I am not sure what the intended behaviour is.

I guess that it is correct to take the action on Mouse-up, but it may be sensible to limit it on cases where ctrl was hold down during the mouse-down event. IMHO in that case, you could either say:
- if ctrl was down during mouse-down, then mouse-up should trigger the jump, independent of ctrl still being pressed or not
- if ctrl was down during mouse-down, then mouse-up will jump, if ctrl is still pressed, and was not released in between. But maybe it can/should be done on MouseDown, but I don't know what opuld happen, if you end up in the new unit, with the mouse button still down?

Maybe others have ideas too, also you may wish to discuss this with the Lazarus team them self, if such a change would be accepted. Mattias would be probably be a good contact for this. Maybe he will pick up on this mail?

Implementing any change to this, should be straight forward, as all Mouse/Key-Up/Down handlers are in synedit.pp
Search for "CtrlMouse" and
(responsible for the underlining of the link), that should point you to all other places of interest.

Martin

Reply by email

Christian Budde
to Martin Friebe

Hi Martin

Show quoted text 24 lines
This is probably cross all OS. I am not sure what the intended behaviour is. I guess that it is correct to take the action on Mouse-up, but it may be sensible to limit it on cases where ctrl was hold down during the mouse-down event. IMHO in that case, you could either say: - if ctrl was down during mouse-down, then mouse-up should trigger the jump, independent of ctrl still being pressed or not - if ctrl was down during mouse-down, then mouse-up will jump, if ctrl is still pressed, and was not released in between. But maybe it can/should be done on MouseDown, but I don't know what opuld happen, if you end up in the new unit, with the mouse button still down? Maybe others have ideas too, also you may wish to discuss this with the Lazarus team them self, if such a change would be accepted. Mattias would be probably be a good contact for this. Maybe he will pick up on this mail? Implementing any change to this, should be straight forward, as all Mouse/Key-Up/Down handlers are in synedit.pp Search for "CtrlMouse" and (responsible for the underlining of the link), that should point you to all other places of interest.

I just had a look for the 'CtrlMouse' thing and found that the source code is already correct (basically). The only thing that seems to be wrong is that the GetKeyShiftState doesn't contain any info about the mouse buttons.
So 'ssLeft in GetKeyShiftState' is always false. Thus the query for GetKeyShiftState to distinguish, whether the mouse is pressed or not fail and so the whole thing got triggered wrong.

Is this a known issue (or even feature?) of the LCL?

Any hints appretiated,

Christian

Reply by email

Martin Friebe
to Christian Budde
Christian Budde wrote 37 lines
Hi Martin > This is probably cross all OS. I am not sure what the intended > behaviour is. > > I guess that it is correct to take the action on Mouse-up, but it may be > sensible to limit it on cases where ctrl was hold down during the > mouse-down event. IMHO in that case, you could either say: > - if ctrl was down during mouse-down, then mouse-up should trigger the > jump, independent of ctrl still being pressed or not > - if ctrl was down during mouse-down, then mouse-up will jump, if ctrl > is still pressed, and was not released in between. > But maybe it can/should be done on MouseDown, but I don't know what > opuld happen, if you end up in the new unit, with the mouse button still > down? > > Maybe others have ideas too, also you may wish to discuss this with the > Lazarus team them self, if such a change would be accepted. Mattias > would be probably be a good contact for this. Maybe he will pick up on > this mail? > > Implementing any change to this, should be straight forward, as all > Mouse/Key-Up/Down handlers are in synedit.pp > Search for "CtrlMouse" and > (responsible for the underlining of the link), that should point you to > all other places of interest. > I just had a look for the 'CtrlMouse' thing and found that the source code is already correct (basically). The only thing that seems to be wrong is that the GetKeyShiftState doesn't contain any info about the mouse buttons. So 'ssLeft in GetKeyShiftState' is always false. Thus the query for GetKeyShiftState to distinguish, whether the mouse is pressed or not fail and so the whole thing got triggered wrong. Is this a known issue (or even feature?) of the LCL?

I don't know what the intended behaviour is, but I assume not to much thought was spend on it.
I don't know if anyone else noticed, or had an issue with it.

In order to archive your target, you could probably make the assignment of fLastControlIsPressed dependent on left-mouse not pressed. Or maybe make just the inclusion of SYNEDIT_LINK_MODIFIER depended, while exclusion of the flag works always (or you get a sticky ctrl key, once the mouse is down)
=> so ctrl-up will be recognized, even while the left-mouse is down. But ctrl-down will only be remembered, while the mouse is still unpressed.

Afaik your options on it are:
- discuss it here, get Mattias or a Lazarus' Team members opinion.
- Report it as a bug, (with or without Patch, you can get the patch in later if you like). That way you will definitely get an answer if your intended behaviour is acceptable or not

Imho, I think your change request does sounds acceptable.

Martin

Reply by email