BUG: DockManager.SelectedDocumentChanged not always fired

Bars for Windows Forms Forum

Posted 9 years ago by 7Alpha7
Version: 2.0.0110
Platform: .NET 3.5
Environment: Windows Vista (32-bit)
Avatar
Hi,

I have this ennoying behaviour with the DockManager that the document selection failed when the screen is splitted in several areas.

=> open two documents
=> split them vertically
=> select alternately the right and the left document tab

After some time (two selections) it's not possible to select the other tab anymore; the tab is entered since some control gets the focus but the tab is not in the selected state (not bold) and the SelectedDocumentChanged is not fired.

Thank you to fix it since I need this event to work properly.
(and if you could at the same time allow the option button to be hidden in the navigation bar it would be perfect ;) )

Jean Philippe

Comments (5)

Posted 9 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
We tried to repro this in our Docking demo but couldn't. Do you see it happening there, and if so, what are the exact steps?

Also are you running the latest build?

Please let us know ASAP as we are very close to releasing a new build any day now.


Actipro Software Support

Posted 9 years ago by 7Alpha7
Avatar
No I cannot reproduce the behavior in the Docking demo either. But I can say what is the difference between the demo and my App :

When I detect the SelectedDocumentChanged event I open two ToolWindows related to the selected document (in fact the same tool windows for each document but with the content refreshed depending on the active tab).

=> if the tool windows are not already open the tool windows are created
=> if the tool windows are already created the Activate(true) method is called on them

When I disable the code that activates the tool windows on the SelectedDocumentChanged event the selection between the two splitted tabs works properly. As soon as I call the code it does not work anymore, IF and only IF the documents are splitted.

It might be the Activate(true) that mess something up, I don't know...

[Modified at 11/29/2010 05:27 PM]
Posted 9 years ago by 7Alpha7
Avatar
Ok.

Take the Docking demo app.

Edit the DockForm.cs file, changing the dockManager_SelectedDocumentChanged part :

Code before :

private void dockManager_SelectedDocumentChanged(object sender, ActiproSoftware.UIStudio.Dock.TabbedMdiWindowEventArgs e) {            

eventsListBox.SelectedIndex = eventsListBox.Items.Add(String.Format("SelectedDocumentChanged: Key={0}", 
                (e.TabbedMdiWindow != null ? e.TabbedMdiWindow.Key : "<null>")));
        }
Code after :

private void dockManager_SelectedDocumentChanged(object sender, ActiproSoftware.UIStudio.Dock.TabbedMdiWindowEventArgs e) {
            eventsToolWindow.Activate(true);
            toolWindowPropertiesToolWindow.Activate(true);
            eventsListBox.SelectedIndex = eventsListBox.Items.Add(String.Format("SelectedDocumentChanged: Key={0}", 
                (e.TabbedMdiWindow != null ? e.TabbedMdiWindow.Key : "<null>")));
        }
=> run the Docking demo
=> split the two documents vertically
=> select alternaltely the left and the right
=> do not enjoy

[Modified at 11/29/2010 05:28 PM]
Posted 9 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Ok this seems to something we ran into in the past where something inside of core WinForms focus tracking breaks down. The good news is that if you change your code to Activate(false) it seems to work fine. Passing true to Activate will move focus into those tool windows which is not what you want to do here. You simply want to make sure their tabs are selected.


Actipro Software Support

Posted 9 years ago by 7Alpha7
Avatar
Yes it works fine with Activate(false). It's true that I don't need to focus the tool windows in my case but I might have wanted to...
The latest build of this product (v2020.1 build 0400) was released 2 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.