Bug? ResizeControl Triggers From Outside of CustomControl with Assigned Behavior

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Bug? ResizeControl Triggers From Outside of CustomControl with Assigned Behavior

Mark Waddingham via use-livecode
WE have a peculiar bug, at least I think it is a bug.

Where

1) navigation bar at bottom of screen, a custom control with a  bkgnd grc 50 px tall 1024 wide and 4 widgets on it.

2) has assigned behavior "behavior_bottomToolsNav"
      # with some complex dynamic layout stuff happening to handle change of orientation
      # the four widgets will automatically find their proper relative position in either orientation

3)  It has a resize control that does the dynamic layout change when the device is turn one way or the other.



BUG:

I'm working way up on this card "far away" from the rect of the bottom tool bar.

context:
1) paste a chevron widget… supposed serve as a go next button
2) switch to select tool, change the shape of the widget and the bottom bar's icons change position

So I put this in the behavrio just to confirm

on resizeControl
answer "gotcha!" with "OK"
LayoutControl
end resizeControl

and indeed, on resizing the widget outside the custom control resize is "heard" by that behavior
OK close card, do not save

try again, this time adjust some other object on the card, outside the custom control.. yep!  same thing.. nothing to do with my widget. I can change the rect of a fld up the card and the bottom bar "reacts"

shouldn't

resizeControl

only be triggered  by "me"

??

assuming this is a bug, I hacked around it with this:

on resizeControl
put the childControlNames of me into tNavControls
if the short name of the target is not among the lines of tNavControls then
answer "That's not in me!" with "OK"; exit to top
else
LayoutControl
end if
end resizeControl
for testing and then this for production

on resizeControl
put the childControlNames of me into tNavControls
if the short name of the target is among the lines of tNavControls then
LayoutControl
end if
end resizeControl

But do we agree? this is a bug?




_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Bug? ResizeControl Triggers From Outside of CustomControl with Assigned Behavior

Mark Waddingham via use-livecode
I saw this recently. It isn't a bug, the navigation group is a background
group so it will catch any message that isn't blocked earlier in the
message path. You can put an empty resizecontrol handler in objects that
shouldn't respond, or check in the group script that the target is one of
the group members, as you did.

--
Jacqueline Landman Gay         |     [hidden email]
HyperActive Software           |     http://www.hyperactivesw.com



On July 15, 2017 10:27:08 AM Sannyasin Brahmanathaswami via use-livecode
<[hidden email]> wrote:

> WE have a peculiar bug, at least I think it is a bug.
>
> Where
>
> 1) navigation bar at bottom of screen, a custom control with a  bkgnd grc
> 50 px tall 1024 wide and 4 widgets on it.
>
> 2) has assigned behavior "behavior_bottomToolsNav"
>       # with some complex dynamic layout stuff happening to handle change of
>       orientation
>       # the four widgets will automatically find their proper relative position
>       in either orientation
>
> 3)  It has a resize control that does the dynamic layout change when the
> device is turn one way or the other.
>
>
>
> BUG:
>
> I'm working way up on this card "far away" from the rect of the bottom tool
> bar.
>
> context:
> 1) paste a chevron widget… supposed serve as a go next button
> 2) switch to select tool, change the shape of the widget and the bottom
> bar's icons change position
>
> So I put this in the behavrio just to confirm
>
> on resizeControl
> answer "gotcha!" with "OK"
> LayoutControl
> end resizeControl
>
> and indeed, on resizing the widget outside the custom control resize is
> "heard" by that behavior
> OK close card, do not save
>
> try again, this time adjust some other object on the card, outside the
> custom control.. yep!  same thing.. nothing to do with my widget. I can
> change the rect of a fld up the card and the bottom bar "reacts"
>
> shouldn't
>
> resizeControl
>
> only be triggered  by "me"
>
> ??
>
> assuming this is a bug, I hacked around it with this:
>
> on resizeControl
> put the childControlNames of me into tNavControls
> if the short name of the target is not among the lines of tNavControls then
> answer "That's not in me!" with "OK"; exit to top
> else
> LayoutControl
> end if
> end resizeControl
> for testing and then this for production
>
> on resizeControl
> put the childControlNames of me into tNavControls
> if the short name of the target is among the lines of tNavControls then
> LayoutControl
> end if
> end resizeControl
>
> But do we agree? this is a bug?
>
>
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode



_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Bug? ResizeControl Triggers From Outside of CustomControl with Assigned Behavior

Mark Waddingham via use-livecode
I'm hitting this again… in order to stylize a widget I  grouped it (by itself) now we get to do the cool effects/inks to make it look good.

But it also is used as a button. and I place the group on all the cards in the stack,

Now we have 3 different backgrounds all of which expect mouse events.

I can't any use case where you would want any group to trap a mouse event outside its rect.

Seems only to introduce chaos. Especially where many custom controls may want to be shared on multiple cards… it "goes crazy"  and debugging the msg path and hacking around this issue, starts to get nightmarish

BR

 

On 7/15/17, 5:46 AM, "use-livecode on behalf of J. Landman Gay via use-livecode" <[hidden email] on behalf of [hidden email]> wrote:

    I saw this recently. It isn't a bug, the navigation group is a background
    group so it will catch any message that isn't blocked earlier in the
    message path. You can put an empty resizecontrol handler in objects that
    shouldn't respond, or check in the group script that the target is one of
    the group members, as you did.
   
   

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Bug? ResizeControl Triggers From Outside of CustomControl with Assigned Behavior

Mark Waddingham via use-livecode

> On 17 Jul 2017, at 9:42 am, Sannyasin Brahmanathaswami via use-livecode <[hidden email]> wrote:
>
> I can't any use case where you would want any group to trap a mouse event outside its rect.

It sounds like you want sharedBehavior on and backgroundBehavior off

If it’s a background it behaves like it’s a layer between card and stack so all card messages travel through it. That’s the way backgrounds work and changing that would break a _lot_ of code!

Cheers

Monte
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Loading...