Print Page | Close Window

ShowPane without Activation

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Docking Pane
Forum Description: Topics Related to Codejock Docking Pane
URL: http://forum.codejock.com/forum_posts.asp?TID=11224
Printed Date: 01 July 2024 at 3:06am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: ShowPane without Activation
Posted By: jemery
Subject: ShowPane without Activation
Date Posted: 27 June 2008 at 1:42am
I have an application I'm working on where we have, say, a list of items you can scroll through and other windows display information about those items.

When the selectionChanged event is fired in the listView I want to bring the relevant data windows to that selection to the front of whatever set of windows it's in (basically make sure it's visible).

Unfortunately, the showPane function automatically takes focus away from the listView and setting back focus immediately doesn't seem to do anything (so far).

What I want to do is find an alternative (or a passable option parameter) for showPane that does -not- make the associated window active so that I can allow users to, say, scroll through the items.  I've tried other possibilities like setting them hidden and the like, but all roads so far lead back to having to use showPane, which I do not want to do.

Is there something I'm overlooking?



Replies:
Posted By: Aaron
Date Posted: 27 June 2008 at 2:24am
Hi,
 
Can you upload sample project?
 
 
 


-------------
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....


Posted By: jemery
Date Posted: 27 June 2008 at 2:51am
Hmm.  I would have to create a new one from scratch as I can't give anything out (NDA).

I'd think it was a very simple issue if I can get it across.  When you use showPane it makes the pane you are bringing to the front the active form for the application (I presume it calls Activate() on it).  That's what I want to avoid.  I don't want the pane to become the active form but I still want to bring it to the front in the docking system.

We have lists of things in another pane that users want to be able to scroll through via the scroll wheel or arrow keys, but showPane steals the focus away whenever they select an item in the list.  Admittedly it's a nicety to be able to bring relevant panes about that item to the front, but that feature vastly speeds up their workflow and we don't want to lose it (it's useful enough that being unable to scroll through things is worth suffering through).

Here's a quick example straight from our app:

selectedIndexChanged event:

            Pane thisPane = DockingPaneManager.FindPane(WindowID.DOCKING_WINDOW_GROUP_VIEW);
            if ((!thisPane.Hidden) && (!thisPane.Closed))
            {
// This code makes the pane active, stealing focus from our current window and making our users unhappy :)              DockingPaneManager.ShowPane(WindowID.DOCKING_WINDOW_GROUP_VIEW);
            }

            // Setting focus back immediately does nothing as focus appears to be lost right after this code finishes execution, perhaps in another thread.
            this.ListView.Activate();

I've tried puzzling through other things like making it hidden/unhidden but all other commands also seem to automatically call Activate() on the pane being shown.  I can't seem to find anything to avoid that.


Posted By: jemery
Date Posted: 27 June 2008 at 3:00am
I guess to be even more specific, imagine a list of items like:

Ball
Turtle
Yellow
Moon
Green

When you use the keys to go up and down through the list you might want to show a property pane tied to the height and age of an object if the item is an object.  If it's a color you might instead bring the color wheel to the front in order to see what the color looks like.

As it stands now I don't know how to do that as you would lose active control of the listBox whenever a pane is shown.  Meaning when you press up to reach 'Turtle' the property pane takes over control because it has showPane called on it.

This is really abstract but it seems like a simple example of why you wouldn't want to have showPane take away control.

Maybe 'showPaneSilently?'


Posted By: Aaron
Date Posted: 27 June 2008 at 3:27am
Hi,
 
I'm glad you didn't try to create a sample because I could't open your project anyway, I have only VB6.0 installed. Maybe an option for you is to change your signature like I did so all members can see what version, platform and language you use. 
 
Try to set the focus to the pane (with listview in it).
 
In the DockingPane_Action event you can select the pane
 
Select Case Action
    Case PaneActionActivated
        DockingPane.Panes(ID of the pane with listview in it).Select
End Select
 
 


-------------
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net