Manish Jethani (mannu) wrote,
Manish Jethani
mannu

Expose-like window navigation in Flex

What's the point in buying a Mac if you're not going to copy some of its cool features?

In my spare time, I've been working on an implementation of Expose-like window navigation in Flex 2. It's nowhere near complete, but I got so desperate to write about it that I've uploaded a quick demo here (SWF).

fTube with Flexpose

Demo: fTube with Flexpose (SWF)

My implementation is called Flexpose. To see it in action:

  • Open a few videos by double-clicking on items in the data grid.
  • Make sure some of the windows are overlapping. If not, you can just arrange them anyhow by dragging them by their title bars.
  • Press F8 to enter expose mode.
  • To make a window active, click on it.

As I said earlier, it's nowhere near complete. Here's a list of known bugs and missing features:

  • F8 doesn't work when none of the controls have focus.
  • When a window is highlighted (by hovering the mouse over it), its title should be displayed in front, in a larger font.
  • Keyboard navigation is not yet implemented. To switch between windows, you have to use the mouse.
  • The windows animate to different positions depending on which one is currently active. This is due to a small implementation glitch: the windows are sorted by their order on the display list, whereas they should be sorted based on their screen positions.
  • When the number of windows exceeds a certain limit, the whole thing becomes sluggish.

Am I missing anything? Let me know.

In any case, this is pretty good for what you can do in a web browser. And to think it takes only one line of MXML to include this in any Flex 2 application.

<Flexpose />

Yup, that's it. One line.

So, now you must be wondering where you can get the source code. Hang on a little more. In addition to the above list of bugs and missing features, I also need to refactor the code, optimise it, comment it, etc. I'm going on a long vacation now, so I'll probably complete this when I come back in 2007. Meanwhile, feel free to show this demo to your friends (heh).

Happy Hacking.

PS: The demo won't work in Internet Explorer. Sorry about that.

Tags: flex, hacks
Subscribe

Comments for this post were disabled by the author