By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,613 Members | 1,890 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,613 IT Pros & Developers. It's quick & easy.

Display hidden items with animation (easing/scrolling).

P: 13
Does anyone knows how to display hidden items using easing/scrolling animation (can also be a component)?

Similar to the one use in the Weather docklet in ObjectDock (the video shows the 5-days being displayed the way I'd like to do)?


Thanks in advanced.
Feb 24 '09 #1
Share this Question
Share on Google+
6 Replies


tlhintoq
Expert 2.5K+
P: 3,525
As for the dock... Looks like a total copy of the Macintosh dock.
Feb 25 '09 #2

P: 13
That dock was meant to be a copy, just like we have Vista alike apps in XP.

But what about the weather docklet? Any tip about how to achieve anything like that in C# (hover the mouse over an icon and then make it reveal another 5 items using motion)?
Feb 25 '09 #3

tlhintoq
Expert 2.5K+
P: 3,525

P: 13
I know that... I thing I'm not being clear enough here.

Let me change my question them... How to make some animated effects in C#?
If you watch the movie in the first post, at 0:45, you'll notice the weather docklet working. When the mouse hover it for a while, it shows 5 items (upcoming days).
Those items have some sorta of easing/motion effect (it goes straight up and them unfold other 4 items) and that is what I'd like to learn how to do.
Feb 25 '09 #5

tlhintoq
Expert 2.5K+
P: 3,525
Now I'm with you. You want to be able to do this...



Someone more knowledgable than I would have to describe how to do it via DirectX. I know that creating sprites would be one way.

But if it were me... I would design some sort of "WeatherPanelObject" class that is the white date, black panel, weather icon, weather text and temperatures. This can be something as simple as a form with a transparent back and no frame.

It will need methods for MoveLeft, MoveRight, MoveUp, MoveDown... SetDay, SetWeather, SetTemp and so on. (Change the .Location property) Looks like it will also need a SetOpacity method.

The animation is then just a matter of...

Expand|Select|Wrap|Line Numbers
  1. SetDay("Friday");
  2. SetWeather("Cloudy");
  3. SetTemp(35,Temp.Centigrade);
  4. SetOpacity(10);
  5. MoveUp();
  6. MoveUp();
  7. SetOpacity(15);
  8. MoveUp();
  9. MoveLeft();
  10. SetOpacity(25);
And so on to create the desired direction of movement.

Of course there are dozens of variations on exactly how certain parts could be done. That's where your programming style comes in. Maybe you don't want to explicity set the opacity as you move it. (Too much work for the sending method) So your WeatherPanelObject has its own timer that starts when it is first displayed and automatically increases the opacity every 500 milliseconds.

Maybe instead of having to send lots of MoveLeft(), MoveRight() commands you just want to send it an Argument of where it is supposed to be located like Position(1,5) meaning take up position 1 out of 5, which would be a different calculated position than if it were Position(1,3);

My personal plan would probably have all the methods for the parent class to move or change it, but send it an Argument class at creation that has all of its data (Temp, day, weather, position x out of y, etc.) then have it take control of itself from there. The creating parent class just has to make it. The child is does the rest on its own. The parent then can occassionally send updates if it is still on screen.
Feb 26 '09 #6

P: 13
Got it now.
In fact, I'm already working with a borderless form with no background, however I didn't think about creating others forms for the extra items... That way It definitely can be set its transparency (fading in/out)...

Thanks for clear up my mind. Have a nice day.
Feb 26 '09 #7

Post your reply

Sign in to post your reply or Sign up for a free account.