Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Docking Pane
  New Posts New Posts RSS Feed - How do I determine which Pane is active?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

How do I determine which Pane is active?

 Post Reply Post Reply
Author
Message
SteveL View Drop Down
Newbie
Newbie
Avatar

Joined: 13 September 2004
Location: United Kingdom
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote SteveL Quote  Post ReplyReply Direct Link To This Post Topic: How do I determine which Pane is active?
    Posted: 13 September 2004 at 11:56am

Hi,

I have a number of panes containing different forms, but sharing one toolbar.

What I want is to capture when a particular pane/form is selected and rebuild the toolbar appropriately depending on what form is currently active. Also when selecting a menu option or tool event I need to know which pane is active  to fire the relevant action on the active pane. Unfortunately I can't figure out how to determine this. I have even tried workarounds such as manually setting a global active pane variable on the forms got focus event, which unfortuantely never seems to fire.

I read elsewhere that a selected event would be available in 8.62.

I am currently using 8.70 with VB6.0.

Any help would be greatly appreciated.

Back to Top
SuperMario View Drop Down
Admin Group
Admin Group
Avatar

Joined: 14 February 2004
Status: Offline
Points: 18057
Post Options Post Options   Thanks (0) Thanks(0)   Quote SuperMario Quote  Post ReplyReply Direct Link To This Post Posted: 13 September 2004 at 12:06pm
Try Something like this to determine the active pane:

      Dim activePane As Pane
      For Each activePane In DockingPaneManager
        If Not activePane Is Nothing Then
         &nbs p;If activePane.Selected = True And activePane.Hidden = False Then
         &nbs p;  MsgBox activePane.Title & " is currently selected.", vbOKOnly, "Currently Selected Pane"
         &nbs p;End If
        End If
      Next

You can use the pane actions to determine when a pane is opening, pinning, and closing in the Action event.  But this will not fire if you have panes grouped and are selecting different tabs in the group.  So you may need to use the code above and call it like every 100ms to determine which tab is active and if the appropriate commandbar is showing.  If you are using commandbars, you can place this in the update event.
Back to Top
JSram View Drop Down
Groupie
Groupie


Joined: 22 October 2004
Status: Offline
Points: 42
Post Options Post Options   Thanks (0) Thanks(0)   Quote JSram Quote  Post ReplyReply Direct Link To This Post Posted: 28 October 2004 at 5:07pm
Well this may work in some situation, but is a very akward workaround for something as simple as a 'Click' or "Selected' event. This is a very basic event that can't be that hard to implement?

Your controls are really great in many ways, with almost a confusing load of classes, properties and methods BUT really poor on events that could make life a lot easier many times. After all Windows are an eventdriven environment... So please, an event to determine when a panes tab is selected. It could even go in the Action event, but well I guess you knows best were to put it, but we need it.
Back to Top
JSram View Drop Down
Groupie
Groupie


Joined: 22 October 2004
Status: Offline
Points: 42
Post Options Post Options   Thanks (0) Thanks(0)   Quote JSram Quote  Post ReplyReply Direct Link To This Post Posted: 30 October 2004 at 6:58am
I actually found a workaround for this, although not sure if it's fool proof. If the pane is attached to a form handle, it seam that the form Activate event gets triggered each time a Pane tab is clicked. But I'm not sure this is consistent.
Back to Top
JamesH View Drop Down
Senior Member
Senior Member


Joined: 01 December 2004
Status: Offline
Points: 149
Post Options Post Options   Thanks (0) Thanks(0)   Quote JamesH Quote  Post ReplyReply Direct Link To This Post Posted: 09 December 2004 at 6:06pm

I am trying to get the selected pane but it seems the selected property is true for more than one pane.  Using the code sement below:

 int numSelected = 0;
 // Find the selected pane
 for ( int x = 1; x <= m_spPhotoPanes->PanesCount; x++ )
 {
  if ( m_spPhotoPanes->Panes[ x ]->Selected == VARIANT_TRUE &&
    m_spPhotoPanes->Panes[ x ]->Hidden == VARIANT_FALSE )
  {
   spSelectedPane = m_spPhotoPanes->Panes[ x ];
   numSelected++;
  }
 }

The numSelected variable is greater than one.  How can more than one pane be the active one?

Is there a better or different way to get the active pane?

Back to Top
SuperMario View Drop Down
Admin Group
Admin Group
Avatar

Joined: 14 February 2004
Status: Offline
Points: 18057
Post Options Post Options   Thanks (0) Thanks(0)   Quote SuperMario Quote  Post ReplyReply Direct Link To This Post Posted: 09 December 2004 at 10:38pm
There isn't a good way to do this right now.  JScram's solution sounds like it might work.  As for the multiple active panes.  I found that it count's hidden panes as active if they were shown then auto hidden, even if another pane is selected.
Back to Top
Boyd View Drop Down
Senior Member
Senior Member


Joined: 08 December 2003
Location: United States
Status: Offline
Points: 285
Post Options Post Options   Thanks (0) Thanks(0)   Quote Boyd Quote  Post ReplyReply Direct Link To This Post Posted: 10 December 2004 at 6:54am

So does Codejock plan to implement a solution for this?  I've seen this topic come up several times over the past year, many new updates to DockingPanes have been released, and there still hasn't been a solution to truly determine which pane is active.

Ideally, an event should be triggered when a pane is selected, and there should be a property that also returns the active pane.

I figure you're probably gearing up for another release very soon.  Is this something Codejock can implement for that release?

Back to Top
JamesH View Drop Down
Senior Member
Senior Member


Joined: 01 December 2004
Status: Offline
Points: 149
Post Options Post Options   Thanks (0) Thanks(0)   Quote JamesH Quote  Post ReplyReply Direct Link To This Post Posted: 10 December 2004 at 10:49am

Thanks for the reply, it's great to get such fast feedback.

Although getting the active pane would seem a useful addition, perhaps there is an alternate way to do what I am interested in.  I would like to be able to open a new pane as a tab in the currently active pane.  Can anyone think of a work-around that would accomplish that?

I will investigate JScram's solution.  We're using ATL but I assume the VB activate event is just generated by the standard windows message.

*edit*

It looks like the contained window gets a  WM_IME_SETCONTEXT message as well as the WM_SETFOCUS and WM_KILLFOCUS messages.  As a work-around I think I can use these to manually keep track of which pane is active.

*edit*

Thanks again,

- James



Edited by JamesH
Back to Top
JamesH View Drop Down
Senior Member
Senior Member


Joined: 01 December 2004
Status: Offline
Points: 149
Post Options Post Options   Thanks (0) Thanks(0)   Quote JamesH Quote  Post ReplyReply Direct Link To This Post Posted: 16 February 2005 at 2:18pm

First let me say thank you to Codejock for continuing to support the Active-X version of your controls it is really appreciated.  The release notes document is also very well put together.

 I have been putting off wrestling with a way to get the active pane hoping a new event would be added in 9.6.  The new HighlighActiveCaption property is great and now I can see which the active pane regardless of the theme.  However, I still can't find a way to programmatically determine what the active pane is.  I need to enable/disable various menu options depending on what the active pane is.  Am I missing something?

Thanks,

- James

Back to Top
SuperMario View Drop Down
Admin Group
Admin Group
Avatar

Joined: 14 February 2004
Status: Offline
Points: 18057
Post Options Post Options   Thanks (0) Thanks(0)   Quote SuperMario Quote  Post ReplyReply Direct Link To This Post Posted: 14 March 2005 at 9:52am
In the next release 2 new actions will be included; PaneActionActivated and PaneActionDeActivated.  There will also be a new property; DockingPane.ActivePane that will reference the currently active pane.
Back to Top
tknijff View Drop Down
Newbie
Newbie
Avatar

Joined: 11 February 2005
Location: Netherlands
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote tknijff Quote  Post ReplyReply Direct Link To This Post Posted: 15 March 2005 at 3:02am

It is very nice that two new actions PaneActionActivated and PaneActionDeActivated will be included! Keep on going with the good work...

Could you tell me when the next release is released?

Thanks,

Thierry

Back to Top
knight4c View Drop Down
Newbie
Newbie


Joined: 15 April 2005
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote knight4c Quote  Post ReplyReply Direct Link To This Post Posted: 04 May 2005 at 11:03am
I really need that event to.
I only whant to refresh a grid in a panel when the panel is selected to limit database access...
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.281 seconds.