Hi gang,

I've been toying with the outstanding flexmdi component from flexlib and have found something challenging...

One of the pieces of the MDIWindow is the minimize() function. I'm creating the windows on the canvas dynamically based on the users last know settings...including whether they have minimized any of the windows on their dashboard. I have a variable in their record for each window called isCollapsed (bit/bool). What I'm trying to do is when the records are read and the windows are dynamically created, I check to see if the isCollapsed == true and if so, I'm trying to fire the MDIWindow.minimize() function. However, it's expecting a mouseEvent and I'm not sure how to force a non-existent event into the function???

Basically, I need to programmatically emulate a mouseclick on the minimize button of the window.

I've tried a number of alternative methods without success, including these:

                               newWindow.minimize();
                               newWindow.minimize(null);
newWindow.dispatchEvent(MDIWindowEvent.MINIMIZE); dispatchEvent(new MDIWindowEvent(MDIWindowEvent.MINIMIZE, newWindow));

   Here is the minimize function:

       public function minimize(event:MouseEvent = null):void
       {
           // if the panel is floating, save its state
           if(windowState == MDIWindowState.NORMAL)
           {
               savePanel();
           }
dispatchEvent(new MDIWindowEvent(MDIWindowEvent.MINIMIZE, this));
           windowState = MDIWindowState.MINIMIZED;
           showControls = false;
       }

   Has anyone tried to do this or have any ideas on what to try next?

Thanks,
Adrian

Reply via email to