StrataFrame Forum

Problem with ThemedLinkMenu items Save/Undo in StrataFlix

http://forum.strataframe.net/Topic18291.aspx

By Edhy Rijo - 8/3/2008

I am implementing the ThemedLinkMenu (TLM) as used in StrataFlix, except that my forms are all with a WindowState of Maximized, then I noticed that when adding a new record, the Save/Undo items are not shown in the TLM, to duplicate in StrataFlix do the following:
  1. Set the form's MaximizeBox=True in MovieMaintenance and PeopleMaintenance forms.
  2. Run StrataFlix
  3. Run the Movie form and maximized it.
  4. Run the People form
    • Click the Add Person item
    • Notice there is not Save/Undo buttons in the TLM
    • Click the Maximize button to restore it to its normal size.
  5. Click the Movie form to activate it.
  6. Click the People form to activate it, and notice the Save/Undo items now shown in the TLM.

If you can't duplicate it, let me know and I'll post a video.

By Trent L. Taylor - 8/4/2008

If you'll notice, this was explicitly disabled within the sample for this very reason.  I did reproduce this and will look as to why this is happening later, but this can come froma number of different things.  If you don't allow the MovieMaintenance to be maximized as well, then it will already be maximized if the people is...which is standard .NET. But when this happens, certain events do not fire correctly.  So I will add this to a list to look at, but it probably won't be until towards the end of the week before I look at the sample again. 
By Edhy Rijo - 8/4/2008

HI Trent,

Thanks for checking on this so quick.

Unfortunately, my form's design are intended to be used Maximized and will not allow the end user to either minimized it or restore its regular size, that is why I found this little problem.

At any rate, there is no rush since I am still working on the design phase on this project and I have many other things to work out so I can wait for any work around this issue.

P.S.

I have to say this, the StrataFlix sample is pretty cool, and without it, I would never guess to program in VS the way it is done in this sample.  I have been able to rework my 3 SF projects to properly organize them and I am very happy with the outcome, and being new to .NET & SF, now many things make more sense.  Thanks Smile

By Trent L. Taylor - 8/4/2008

Thanks for your comments, Edhy.  I am glad that it has helped!  I will let you know once I have a chance to look at this.
By Keith Gordijn - 8/5/2008

Hi Edhy & Trent,



I am looking at doing the same thing as you have Edhy, creating the Menu and Action items as in the StrataFlix example. Actually I am using StrataFlix as a best practice example for using StrataFrame and creating projects and am slowly climbing my way up the rather large learning curve of C#, .NET and StrataFrame.



My question is for after the maximize issue is sorted as I too am looking at using my forms maximized. When you maximize a form within a parent form you get a "toolstrip" that contains an icon the minimize, maximize buttons etc. Using the StrataFlix example, modified to be able to maximize forms, there is no menustrip to contain these so when you maximize a form this strip is placed at the top of the form and pushes everything else down, catching to the eye but unfortunately in an unsightly way. I would like to present a taskbar like strip, either at the top or bottom of the main form that contains a tab or button for each open form so the user can easily select a form. This is a variation on Edhy's creating a panel in the sidebar to list open forms. So, at last to the question, can this be done using a menustrip or toolstrip or statusstrip and if so which would be the best way to go? Any ideas/pointers on where I can start are most welcome.



Cheers,

Keith Gordijn
By Dustin Taylor - 8/6/2008

I actually just answered a similar question, so I'll just pastethat replyhere BigGrin



The universal way to handle this in an MDI environment is to iterate through the MdiChildren collection to build your list of open windows. Once you have your list it is simply a matter of adding items to a themed link menu, toolstrip, or whatever other control you decide to use to track the open windows.



'-- Cycle through all of the forms

For Each frm As Form In _MDIClient.MdiChildren

'-- Build a menu, etc.

Next





For this approach, however, you are going to have to do some additional coding to account for whenever a form is opened or closed. However you are adding forms or whenever a form is closed you will need to call a public function that recreates this list.



In the StratFlix sample all of this is already plumbed for you. Whenever a form is opened it calls the LaunchDialog method of the FlixMain form. Whenever it is closed that close is handled by the HandleFormClosed function also on the FlixMain form. As such, if your MDI environment is set up just like StrataFlix, then you can use the LaunchDialog and HandleFormClosed methods to add and remove items form your open windows list, without ever needing to bother with the MdiChildren collection.



I don't have a code sample to do the whole thing at the moment, but that should give you a point in the right direction.



Hope it helps Smile
By Keith Gordijn - 8/6/2008

Thanks Dustin,



My MDI environment is modeled of StrataFlix so using the LaunchDialog and HandleFormClosed works for me. Smile



Cheers, Keith
By Edhy Rijo - 8/11/2008

Trent L. Taylor (08/04/2008)
I will let you know once I have a chance to look at this.

Hi Trent,

No mean to rush you, but I am at a point where a fix for this would be very helpful Smile.  I have designed all my main forms and I am getting to the point that not having this working for Maximized form is holding me back a bit while testing other functionality and entering test data.

So please when you have a chance this week see if you can help me out with this.

Thank!

By Edhy Rijo - 10/13/2008

Edhy Rijo (08/04/2008)
Unfortunately, my form's design are intended to be used Maximized and will not allow the end user to either minimized it or restore its regular size, that is why I found this little problem.

At any rate, there is no rush since I am still working on the design phase on this project and I have many other things to work out so I can wait for any work around this issue.

Hi Trent,

Sorry to bring this one up again, but I will start working on this project soon and would like to know if the problem with the Maximized window state can be resolved, if not I would have to change my form's design, but I do really want to use them as maximized.

By Trent L. Taylor - 10/14/2008

It ended up being an easy fix.  The bottom line is that the events fire differently when maximized.  Ironically, the OnActivated fires before the OnLoad if the form is maximized.  Thus the problem.  Move the OnLoad logic to the OnActivate and it will resolve the error.  I have updated the StrataFlix sample and you can get the fixed version in the My Account area of the website.
By Edhy Rijo - 10/14/2008

Hi Trent,

Thanks a lot, I tested the changes and it is working fine now.

Is there something else new, in the StrataFlix sample?

By Trent L. Taylor - 10/14/2008

No, not that we have released Wink