Posted 20 years ago
by Adamczak
-
Developer,
AAA Software Enterprises

I've been using your TabStripPanel and DockableWindow for a long time. I was trying to convert to use UIStudio and I've run into a blocking issue.
I have created a simple form that has a dock manager on it. I created a single document window, which contains a userControl that has a tab strip on it. I added two tabs, each one contains a single user control for that tab. I put trace messages in the constructors for all of these, in the dispose methods and the onload methods. I create one of these views, and things run ok, here is debug output:
DocumentView constructor: enter
Tab1 constructor: enter
Tab1 constructor: exit
Tab2 constructor: enter
Tab2 constructor: exit
DocumentView.tabStrip1_SelectionChanging: enter
DocumentView.tabStrip1_SelectionChanging: exit
Tab1.OnLoad: enter
Tab1.OnLoad: exit
DocumentView.tabStrip1_SelectionChanged: enter
DocumentView.tabStrip1_SelectionChanged: exit
DocumentView constructor: exit
DocumentView.OnLoad: enter
DocumentView.OnLoad: exit
Notice, the selection changing events fire twice, why?
The blocking issue for me is when I close the document window, all sorts of unexpected things happen. Here's the debug output:
DocumentView.Dispose: enter
Tab1.OnLoad: enter
Tab1.OnLoad: exit
Tab2.Dispose: enter
Tab2.Dispose: exit
DocumentView.tabStrip1_SelectionChanging: enter
DocumentView.tabStrip1_SelectionChanging: exit
DocumentView.tabStrip1_SelectionChanged: enter
DocumentView.tabStrip1_SelectionChanged: exit
Tab1.Dispose: enter
Tab1.Dispose: exit
DocumentView.Dispose: exit
Notice the dispose for the document view enters, then I get a SECOND Tab1.OnLoad event (how is this possible? very bad) Then I get a Tab2.Dispose (that's good), then I get 2 selection changed events (that's bad too), and then I get a Tab1.Dispose event (that's good).
I was expecting to see the Tab2.Dispose and Tab1.Dispose events only. This is causing all sorts of issues for me. Most of my code does something in the OnLoad event for the tab controls that should happen only once. Also, most of my code does something when the tab is changed, but if that event fires when disposing of controls, bad things happen.
I have a sample project that I can zip up and send you to reproduce this behavior.
I have created a simple form that has a dock manager on it. I created a single document window, which contains a userControl that has a tab strip on it. I added two tabs, each one contains a single user control for that tab. I put trace messages in the constructors for all of these, in the dispose methods and the onload methods. I create one of these views, and things run ok, here is debug output:
DocumentView constructor: enter
Tab1 constructor: enter
Tab1 constructor: exit
Tab2 constructor: enter
Tab2 constructor: exit
DocumentView.tabStrip1_SelectionChanging: enter
DocumentView.tabStrip1_SelectionChanging: exit
Tab1.OnLoad: enter
Tab1.OnLoad: exit
DocumentView.tabStrip1_SelectionChanged: enter
DocumentView.tabStrip1_SelectionChanged: exit
DocumentView constructor: exit
DocumentView.OnLoad: enter
DocumentView.OnLoad: exit
Notice, the selection changing events fire twice, why?
The blocking issue for me is when I close the document window, all sorts of unexpected things happen. Here's the debug output:
DocumentView.Dispose: enter
Tab1.OnLoad: enter
Tab1.OnLoad: exit
Tab2.Dispose: enter
Tab2.Dispose: exit
DocumentView.tabStrip1_SelectionChanging: enter
DocumentView.tabStrip1_SelectionChanging: exit
DocumentView.tabStrip1_SelectionChanged: enter
DocumentView.tabStrip1_SelectionChanged: exit
Tab1.Dispose: enter
Tab1.Dispose: exit
DocumentView.Dispose: exit
Notice the dispose for the document view enters, then I get a SECOND Tab1.OnLoad event (how is this possible? very bad) Then I get a Tab2.Dispose (that's good), then I get 2 selection changed events (that's bad too), and then I get a Tab1.Dispose event (that's good).
I was expecting to see the Tab2.Dispose and Tab1.Dispose events only. This is causing all sorts of issues for me. Most of my code does something in the OnLoad event for the tab controls that should happen only once. Also, most of my code does something when the tab is changed, but if that event fires when disposing of controls, bad things happen.
I have a sample project that I can zip up and send you to reproduce this behavior.