Animator Confusion

Hey guys,

I’m trying to add an animator to my project to resize a sheet dialog and move a control into place if the user clicks a particular button. But it’s not working as well as expected…

Here’s the code:

  yui2ColorPicker1.Visible = True
  Animator1.Resize(self,844,self.Height,1.0)
  Animator1.AddKeyFrame(1)
  Animator1.Move(yui2ColorPicker1,519,14,0.75)
  Animator1.Play

So the control is a Yahoo User Interface color picker from Daniel Taylor. It initially is hidden off screen around -250 pixels. I simply want to use the animator to grow the WebDialog and then move the control into position. It doesn’t happen that way.

The Resize action starts growing my dialog from zero from the left hand side of the parent web page. And while it says it’s width is 844 in the debugger it definitely isn’t as it doesn’t grow enough to include the color picker control.

So Resize seems to not just resize the WebDialog, it moves it as well…

So I figured I’d not mess with an animator on the dialog resize. Instead, I’d just set it’s width using and do the code below:

 self.width = 844
  yui2ColorPicker1.Visible = True
  Animator1.Move(yui2ColorPicker1,519,14,0.75)
  Animator1.Play

Now the dialog stays in the correct spot and opens to the correct width, but the animator doesn’t move the color picker. As soon as the width of the dialog changes, the color picker is already in place. No nice, smooth animation over 3/4 second.

So I am a bit befuddled. Is it because I’m working with a sheet dialog that things aren’t quite right? Can the animator not be used to resize a dialog?

Did some testing in 2013r3.3 just now.
The only way I could get the animator to do things right with a WebDialog was if it was of type Palette.
Got very strange behaviour on all other dialog types.
https://youtu.be/xnUKXXqbxV0

I’m on 2013.33 though so things could be different in newer versions… :slight_smile:

There is a problem in sheet and modal WebDialogs width and height reporting. Bumped into that with RubberViewsWE. Took some rain dance around the bug to get things right.

<https://xojo.com/issue/39623>

It’s possible you’re hitting a long standing issue with the first use of a WebAnimator resetting the size and position of the control to be animated.

<https://xojo.com/issue/21736>

Do you get the same problem on second use of the WebAnimator?

[quote=220016:@Ian Jones]It’s possible you’re hitting a long standing issue with the first use of a WebAnimator resetting the size and position of the control to be animated.

<https://xojo.com/issue/21736>

Do you get the same problem on second use of the WebAnimator?[/quote]

I don’t know.

This is interesting because I see weird things happening with the animator. If I want a web toolbar to be at a top of 0, and I set it for that, it doesn’t seem to always show the full toolbar. I’ve seen it resize my toolbar as well like you stated. And so I have to have all sorts of statements to set the height of the control and also I set the top at something like 3 or 4 pixels and that guarantees me I have the whole thing. It just seems to function with a mind of its own.

This one with the Sheet Dialog is really strange. So thanks to Albin for confirming it and thanks to Michel for more info related to it…

It will be nice when the Web framework really gets some love and TLC to clean up all the quirks. It’s just buggy…