Mattias Gaertner wrote:
On Tue, 06 Feb 2007 13:55:28 -0200
Luiz Americo Pereira Camara <[EMAIL PROTECTED]> wrote:

Marc Weustink wrote:
Luiz Americo Pereira Camara wrote:
Marc Weustink wrote:
Luiz Americo Pereira Camara wrote:
Marc Weustink wrote:
Luiz Americo Pereira Camara wrote:
I fixed the double fire of MouseUp event when using right
mouse button
under win32. See http://www.freepascal.org/mantis/view.php?id=8276. But
one issue remained. If the Shift-F10 key is used both events
will be called: MouseUp and DoContextMenu. I can fix it in two
ways:

1) Implementing LM_CONTEXTMENU
2) Using the Dummy field of TLMMouse as a flag (Maybe renaming
it?)

What do you think is the better?
Anyone can think of another way?
3) similar to 1, add a IntfContextMenu, which gets called form
the widgetset. IIRC I was discussing this issue with Boguslaw a
while ago The widgetset itself knows best when a contextmenu is
shown, so the LCL
doesn't have to figure out which key/mouse combo is responsible for it.
Implementing 1 the key handling will be handled by the widgetset and not by LCL

Anyway i did not understand how it should work.
What are the advantages over 1?
Only that it skips sending a message. If possible we prefer
direct calls unless needed for compatibility.
I can not see another way to the WidgetSet notify the LCL.
Wincontrol.IntfContextMenu(some_params...)

So it is not a message, but a call

This message is sent from WidgetSet to LCL and not the contrary.
The LCL will not call the widgetset asking for a response.
I didn't suggest that.

It's up to the widgetset determine when to call the contextmenu. Win32 has hardcorded the Shift-F10 key. I don't know the if gtk/qt has one, but it can be easily added.

Anyway, i already implemented LM_CONTEXTMENU. It was quite simple, non intrusive patch and also compatible with delphi. See my
previous email.
Thats not the point, but to repeat:

Only that it skips sending a message. If possible we prefer
direct calls unless needed for compatibility.
It was exactly what i said. Implementing the Message you gain Delphi compatibility at a low cost. Some components use it.

Then it is OK. It was not clear to me that delphi uses a WM_CONTEXTMENU.

If for compatibility a big LCL change would be necessary i was against also
but in this case the changes are minimal (in fact there's no new
code, it was just a refactoring). Its a matter of see if the Delphi
compatiblity outweigth the additional message. I think yes.

PS: If the majority of the Lazarus developers decide i will implement the other way.

In general: we want to avoid as much the winapi messages, as they
create a lot of trouble and maintaince. But the WM_CONTEXTMENU message
is simple, so that I don't see a problem. Marc?

If it was a message we created to handle something ourselves, then I see, but in this case an existing, then there is no problem

Marc

_________________________________________________________________
    To unsubscribe: mail [EMAIL PROTECTED] with
               "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to