mousemessages over group
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
-
- VIP Livecode Opensource Backer
- Posts: 142
- Joined: Thu Feb 21, 2013 8:47 am
mousemessages over group
Hi,
I am drawing a line between 2 random groups on a stack.
mousedown will get me the first group, but releasing the mouse button will not give me the name of the second group.
mouseRelease will give me the first again.
mouseEnter will give me graphic that I am drawing with.
(for the moment I am only using the card script)
Any idea's?
Thanks,
best regards,
Marc
I am drawing a line between 2 random groups on a stack.
mousedown will get me the first group, but releasing the mouse button will not give me the name of the second group.
mouseRelease will give me the first again.
mouseEnter will give me graphic that I am drawing with.
(for the moment I am only using the card script)
Any idea's?
Thanks,
best regards,
Marc
-
- VIP Livecode Opensource Backer
- Posts: 4003
- Joined: Sun Jan 07, 2007 9:12 pm
- Location: Bochum, Germany
Re: mousemessages over group
Marc,
you could use mouseControl.
The trick is to send from "mouseRelease" a message in time. Then you go up the owner of control until you hit the card, which is the last owner before stack. Once you hit the card as owner you know that the owner before card is either the control itself (if it is not grouped) or the group the control belongs to. Mind you a group can be grouped.
My little stack should get you started. It shows just the basics of what I describe.
Kind regards
Bernd
you could use mouseControl.
The trick is to send from "mouseRelease" a message in time. Then you go up the owner of control until you hit the card, which is the last owner before stack. Once you hit the card as owner you know that the owner before card is either the control itself (if it is not grouped) or the group the control belongs to. Mind you a group can be grouped.
My little stack should get you started. It shows just the basics of what I describe.
Kind regards
Bernd
- Attachments
-
- GetMouseControl.livecode.zip
- (1.43 KiB) Downloaded 205 times
-
- VIP Livecode Opensource Backer
- Posts: 2718
- Joined: Sat Dec 22, 2007 5:35 pm
- Location: Genève
- Contact:
Re: mousemessages over group
Hi Marc,
Bernd was faster than me (Salut Bernd)
Here is a little stack as example but i think Bernd's getmousecontrol in time way is better.
Kind regards
Jean-Marc
Bernd was faster than me (Salut Bernd)
Here is a little stack as example but i think Bernd's getmousecontrol in time way is better.
Kind regards
Jean-Marc
- Attachments
-
- TraceLineBetweenTwoGroups.livecode.zip
- (1.57 KiB) Downloaded 206 times
https://alternatic.ch
-
- VIP Livecode Opensource Backer
- Posts: 142
- Joined: Thu Feb 21, 2013 8:47 am
Re: mousemessages over group
@ Jean-Marc,
you are essentially using mouseloc and the rect of the groups that you keep in a list. That could work, I will have to keep a list of all groups in the stack as they are being created or deleted.
@Bernd,
Thanks haven't done something like that before. Are there any potential drawbacks to that method?
Thanks again for the prompt replies.
Best regards,
Marc
you are essentially using mouseloc and the rect of the groups that you keep in a list. That could work, I will have to keep a list of all groups in the stack as they are being created or deleted.
@Bernd,
Thanks haven't done something like that before. Are there any potential drawbacks to that method?
sounds to me that it will not work all the time.The trick is to send from "mouseRelease" a message in time
Thanks again for the prompt replies.
Best regards,
Marc
-
- VIP Livecode Opensource Backer
- Posts: 4003
- Joined: Sun Jan 07, 2007 9:12 pm
- Location: Bochum, Germany
Re: mousemessages over group
Marc,
I don't see any reason why it should not work all the time.
Of course you could use other ways to accomplish this, (Salut Jean-Marc). Use what you feel comfortable with.
Kind regards
Bernd
Trick refers to the fact, that if you don't send in time "mouseRelease" will give you the control where you started. By sending it in time it gets the current control the mouse is over.The trick is to send from "mouseRelease" a message in time
sounds to me that it will not work all the time.
I don't see any reason why it should not work all the time.
Of course you could use other ways to accomplish this, (Salut Jean-Marc). Use what you feel comfortable with.
Kind regards
Bernd
-
- VIP Livecode Opensource Backer
- Posts: 2718
- Joined: Sat Dec 22, 2007 5:35 pm
- Location: Genève
- Contact:
Re: mousemessages over group
Bernd,
the name of this grc and we have to hide the grc before getMouseControl()
Kind regards
Jean-Marc
I think that happens because Marc use it to trace one line and getMouseControl() returnI don't see any reason why it should not work all the time
the name of this grc and we have to hide the grc before getMouseControl()
Kind regards
Jean-Marc
https://alternatic.ch
-
- VIP Livecode Opensource Backer
- Posts: 4003
- Joined: Sun Jan 07, 2007 9:12 pm
- Location: Bochum, Germany
Re: mousemessages over group
Hi Jean-Marc,
I think I did not read carefully enough. If Marc is drawing into a graphic the mouseControl will probably be the graphic on mouseRelease. And the graphic will not be part of the group he is looking for.
I guess checking the rect of the groups is the way to go as you do it.
Kind regards
Bernd
I think I did not read carefully enough. If Marc is drawing into a graphic the mouseControl will probably be the graphic on mouseRelease. And the graphic will not be part of the group he is looking for.
I guess checking the rect of the groups is the way to go as you do it.
Kind regards
Bernd
-
- VIP Livecode Opensource Backer
- Posts: 2262
- Joined: Thu Feb 28, 2013 11:52 pm
- Location: Göttingen, DE
Re: mousemessages over group
..........
Last edited by [-hh] on Wed Aug 13, 2014 3:09 pm, edited 1 time in total.
shiftLock happens
-
- VIP Livecode Opensource Backer
- Posts: 4003
- Joined: Sun Jan 07, 2007 9:12 pm
- Location: Bochum, Germany
Re: mousemessages over group
@Hermann,
thanks for reminding me of "controlAtLoc", I have not yet used it.
But actually in this case one has the same problem Jean-Marc pointed out: since apparently Marc wants to draw a line graphic mouseRelease will be on the graphic.
@Marc & Jean-Marc,
I took Jean-Marc's advice and hide the graphic within a screenLoc and then get the mouseControl. This works but does not mean this should be the way to solve the problem. I was just trying to adapt my solution. It was a nice exercise.
Kind regards
Bernd
thanks for reminding me of "controlAtLoc", I have not yet used it.
But actually in this case one has the same problem Jean-Marc pointed out: since apparently Marc wants to draw a line graphic mouseRelease will be on the graphic.
@Marc & Jean-Marc,
I took Jean-Marc's advice and hide the graphic within a screenLoc and then get the mouseControl. This works but does not mean this should be the way to solve the problem. I was just trying to adapt my solution. It was a nice exercise.
Kind regards
Bernd
- Attachments
-
- GetMouseControlAndDrawLine.livecode.zip
- (1.77 KiB) Downloaded 198 times
-
- VIP Livecode Opensource Backer
- Posts: 2262
- Joined: Thu Feb 28, 2013 11:52 pm
- Location: Göttingen, DE
Re: mousemessages over group
..........
Last edited by [-hh] on Wed Aug 13, 2014 3:08 pm, edited 1 time in total.
shiftLock happens
-
- VIP Livecode Opensource Backer
- Posts: 142
- Joined: Thu Feb 21, 2013 8:47 am
Re: mousemessages over group
Thank you all,
this has been very educational.
The goal is to make a small data flow diagram utility. So I will be adding groups on the fly and drawing lines between them.
I am inclined to go with Jean-Marc solution because I will have to save all elements (locations) of the diagram anyway.
Any further tips/ hints/ solutions are always welcome.
Best regards,
Marc
[EDIT: actually I am still undecided which way to go...]
this has been very educational.
The goal is to make a small data flow diagram utility. So I will be adding groups on the fly and drawing lines between them.
I am inclined to go with Jean-Marc solution because I will have to save all elements (locations) of the diagram anyway.
Any further tips/ hints/ solutions are always welcome.
Best regards,
Marc
[EDIT: actually I am still undecided which way to go...]
-
- VIP Livecode Opensource Backer
- Posts: 2718
- Joined: Sat Dec 22, 2007 5:35 pm
- Location: Genève
- Contact:
Re: mousemessages over group
Hi Marc,
I remember "Connecting objects with movable lines" of Bernd
To get it:
open revonline
search "Bernd", go to page 2 and you can download it
Kind regards
Jean-Marc
I remember "Connecting objects with movable lines" of Bernd
To get it:
open revonline
search "Bernd", go to page 2 and you can download it
Kind regards
Jean-Marc
https://alternatic.ch
-
- VIP Livecode Opensource Backer
- Posts: 2262
- Joined: Thu Feb 28, 2013 11:52 pm
- Location: Göttingen, DE
Re: mousemessages over group
..........
Last edited by [-hh] on Wed Aug 13, 2014 3:08 pm, edited 1 time in total.
shiftLock happens
-
- VIP Livecode Opensource Backer
- Posts: 142
- Joined: Thu Feb 21, 2013 8:47 am
Re: mousemessages over group
Ok,
Will do.
Best regards,
Marc
Will do.
Best regards,
Marc
-
- VIP Livecode Opensource Backer
- Posts: 2718
- Joined: Sat Dec 22, 2007 5:35 pm
- Location: Genève
- Contact:
Re: mousemessages over group
Hi Hermann,
I regularly try to convince Bern'd to give up his enthusiasm for the beaches of the Ruhr unsuccessfully.
However, I agree that users should use more RevOnLine
As soon as I finished the windows version EcrireEnPictos I will use my considerable influence on Bernd and I will update a few stacks for revonline
I take this message to thank you for your help. I think I will need your light for RaspberryPi projects.
Kind regards
Jean-Marc
I tried several times to "push" Bernd to make a collection of his stacks with short descriptions/tags. RevOnline is a good place for this, sadly currently not (yet) working a it should. Perhaps you can ask him too? And what about your collection?
I regularly try to convince Bern'd to give up his enthusiasm for the beaches of the Ruhr unsuccessfully.
However, I agree that users should use more RevOnLine
As soon as I finished the windows version EcrireEnPictos I will use my considerable influence on Bernd and I will update a few stacks for revonline
I take this message to thank you for your help. I think I will need your light for RaspberryPi projects.
Kind regards
Jean-Marc
https://alternatic.ch