But the TransitionToPanel event should still be loaded everytime an panel is shown, regardless off where it was shown from. At least for consistency.
That's weird because if I comment the lines for that control it disappears from the panel.
I have attached the code from my Mainmenu.dll so you can have a look and tell me what I'm doing wrong.
Code:
private void Animation_AnimateStartup()
{
Animation_Count++;
if (Animation_Count == 100)
{
Animation_Count = 0;
Animation_Timer.Enabled = false;
}
else
{
LeftMenuBar.Left = Animation_Count;
Animation_Timer.Enabled = true;
}
}
#endregion
}
}
Edit:
Was finally able to redraw the control. I was declaring a private control (like in the code above) but it turned out that this control did not get the UpdateThisControl event populated. Instead it was a clone of the control (this clone was created when the panel was loaded) that got this UpdateThisControl populated. I had to loop trough the controls that an panel reported as it's contents to be able to find the control that I could redraw.
Why is this created as a clone?
It makes it a lot harder for a skin to control it's controls when it first has to create a new control, load this new control to a panel, load this new panel to a screen and then to later control it I have to search for this other cloned control (which is a copy of the loaded control) in the controlslist of a screen.
And I could not use the one in my local panel object either since this doesn't hold the cloned control (hence not the updated UpdateThisControl event).
The objects that's being passed on by a click event or some other events are the cloned one with the correct UpdateThisControl event so it works if I use that one, but in my case I don't have this source object.
This seems somewhat backwards to me that I can't use the properties of my locally created controls.
I sure hope this explanation made some sense, if not give a shout and I'll try to explain better.
btw: Here is the code I used to find the control in the screen:
Code:
for (int i = 0; i < Screen[0].controlCount; i++)
{
if (Screen[0].getControl(i).Name == "LeftMenuBar")
Screen[0].getControl(i).Left = Animation_Count;
}
Edit2:
Been thinking some more about this cloneing behavior and I think it's problably due to the fact that OM can utilize multiple screens, thereby creating the need for different animations at different times on the different screens. Am I right? Or is it intended to show the same on all screens at all times (like a cloned display)?
If so then I think that any event should have a screen parameter passed on so that any animation or control parameter change can be initiated on the correct screen.
The click event has the screen parameter but the system event is missing this one.
Cheers
Bookmarks