The flexmdi framework provides extensibility to customize the effects on your windows. To implement your own custom effects you will use the following two classes:
flexmdi.effects.IMDIEffectsDescriptor which is the interface used to describe the contract between MDIManager and the effects it applies on windows in relation to events that take place such as minimize(), maximize(), tile() and cascase().
flexmdi.effects.MDIEffectsDescriptorBase is a base class that is defined that you can extend so that you only have to implement the effects for the MDI events you want to without having to implement the entire interface.
As the name implies effects are implemented as descriptor classes, which allows you to describe the effects you wish to take place when a certain event takes place. For example the FlexMDI framework broadcasts a minimize event which takes place when a window is minimized. To implement an effect on minimize you would use the getWindowMinimizeEffect() which can be implemented like:
public function getWindowMinimizeEffect(window:MDIWindow, manager:MDIManager, moveTo:Point = null):Effect
{
var parallel:Parallel = new Parallel(window);
// add effects to parallel here
return parallel;
}
Look to the interface to provide information on what kind of data is getting passed from the manager. Not all scenarios are the same and in fact the effects are broken down into two groups. Window Effects which get passed a window instance and relevant information such as where you need to move the window and Group Effects which get passed an array of GroupEffectItems that hold a window instance and resize and move to data. The difference is that a window effect gets applied to one window like minimize() or close() as where a group effect gets applied to all windows as is the case when you tile() or cascade().
Our goal was to have the manager do the math and the effects to make things look pretty. We've tried to make it as extensible as possible and we have covered a lot of scenarios. Ben Clinkinbeard wrote a good article about how to override default behavior that can be found here which will allow you to do things as stop effects before being played so you can implement custom business logic.
We're just getting started posting examples so if you're unsure about how to implement something be sure to let us know so we can make things more clear and easy for developers to use.
An example of the flex mdi explorer can be found here .
The flexmdi framework can be found at http://flexmdi.googlecode.com/
Hi, I wonder if it would be possible to drag-drop the mdi windows without superimpose, just like the igoogle gadget. Does MDI manage this kind of layout? and if not, will it be difficult to implement?
Thanks a lot.
Maoan
Posted by: Maoan Zhou | December 03, 2008 at 08:46 AM