Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Docking Pane
  New Posts New Posts RSS Feed - Problem with DockingPane Focus
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Problem with DockingPane Focus

 Post Reply Post Reply
Author
Message
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 Topic: Problem with DockingPane Focus
    Posted: 19 April 2004 at 2:40pm

Since the 8.6x version of Xtreme Suite for ActiveX, I have been having an issue with controls not properly receiving focus after clicking around on different panes.  This issue still exists in the latest 8.70 release.  After many attempts to isolate the issue, I have finally found a way to do so.  Here's a description of the problem.

I have a form with docking panes.  One pane contains a simple VB Textbox.  Another pane contains a 3rd-party grid control.  If I click on the grid control and then click back to my textbox, the focus is not properly given to the textbox.  If I type characters, the textbox shows those characters being typed.  But if I use the cursor keys or PageUp/Down keys, nothing happens.  It's as if some keyboard/mouse events are still being processed by the grid control and others are being processed by the textbox.  It's very difficult to get the controls to respond properly again (combination of closing the pane and selecting other panes eventually fixes it).  This problem does not exist when the grid control is not in a docking pane.

Needless to say, this type of issue can't exist in a commercial program.  I'm providing a demo application that will illustrate the issue I'm describing.  It's a modification of the "MDIDocking" example to include two new panes (a pane with the Textbox and a pane with the Grid).

This example uses a 3rd-party grid control called 'itGrid' by 'it-partners.com'.  The OCX control is located in the 'it-partners.com' directory of the project and must be registered to run the compiled 'MDIDocking.exe' sample.  If you plan to work with the application in the IDE, you'll need to download and install the eval version to have the proper license for the control.  The eval version can be downloaded from the following link:

http://www.it-partners.com/downloads.asp?RequireDetails=Y&am p;Product=itGrid

The project has been zipped and, due to 500k size limit, is attached here in two files (#1 has just the project, #2 contains the grid control):

2004-04-19_143445_MDIDockingMOD_1.zip; 2004-04-19_143513_MDIDockingMOD_2.zip

I hope that someone from Codejock can isolate the issue and provide a fix.  I've had the same problem with more than one grid control, so I know the grid control is not the problem.  If I had to guess, I'd say that the grid control is using message hooks or subclassing to provide in-cell editing.  The grid does not appear to be properly notified when the pane looses focus, so these hooks are still in place when focus is on another control.  Just a guess

Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 20 April 2004 at 1:35am
See email I send.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
castleJoe View Drop Down
Newbie
Newbie


Joined: 16 August 2004
Status: Offline
Points: 30
Post Options Post Options   Thanks (0) Thanks(0)   Quote castleJoe Quote  Post ReplyReply Direct Link To This Post Posted: 13 October 2004 at 7:40am
I have the same problem with my grid (use latest CJ version). Is there a fix/workaround?
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: 13 October 2004 at 12:30pm

The problem appears to lie in Visual Basic.  I looked at all the Codejock examples when I began designing my application.  They almost always used a Form to design a pane and then used the handle to that Form to attach to the pane.  Initially, this approach appears to work.

That's when I started seeing these focus problems.  It appears that Visual Basic isn't properly send/receiving some of the windows messages related to focus when you use a Form to hold the contents of a pane.

The solution is to stop using separate Forms to hold your pane controls.  Instead, create a PictureBox on the same form that contains the DockingPanes control.  Set the 'Border' of these PictureBoxes to 0 (for no border).  When you attach your panes, specify the handle to the PictureBox instead of the handle to the Form.

This approach makes it harder to organize your code because the code for all your separate panes now resides in one location.  But I stopped having the focus problems after I did this.

As a general rule when working with any of the Codejock controls, don't use a Form to contain your controls.  Use a PictureBox instead.  I wish they'd update their examples to stop using Forms since this starts you developing in the wrong direction.

I hope this helped provide some insight.

Back to Top
gshawn View Drop Down
Senior Member
Senior Member


Joined: 04 October 2004
Status: Offline
Points: 227
Post Options Post Options   Thanks (0) Thanks(0)   Quote gshawn Quote  Post ReplyReply Direct Link To This Post Posted: 13 October 2004 at 2:03pm

Thanks Boyd, that was a very informative post. It doesn't sound like these are issues that the CodeJock developers can fix, so I don't think we'll be seeing a resolution soon... The problem as you mentioned is that ALL the code now resides in the same form. This will make it a nightmare to use on large projects like mine. Do you or anyone else perhaps know of another alternative?

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: 13 October 2004 at 6:19pm

I've been using this approach on a fairly large project, and I've still managed to keep things clean.  The only code that really has to remain on the main form are the event handlers.  Anything else can generally be moved to a module.  I've declared a global reference to the main form of my application so that it can be accessed from the modules.  As necessary, I made certain items in the main form public so that they can also be accessed by the modules.

It's not as tidy a solution as just being able to place everything on a form, but it has worked.  Good luck!

Back to Top
tobi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 09 September 2004
Location: Germany
Status: Offline
Points: 451
Post Options Post Options   Thanks (0) Thanks(0)   Quote tobi Quote  Post ReplyReply Direct Link To This Post Posted: 29 October 2004 at 2:46pm

I have some problems doing the PictureBox way Boyd descibed in my MDI VB6 application:
When I put a picturebox on my main mdi form the picturebox is put to the top of the window and I can change its location. That makes it hard to handle more pictureboxes/panes !
Then when I try to assign the picturebox hwnd to the pane handle

Private Sub DockingPaneManager_AttachPane(ByVal Item As XtremeDockingPane.IPane)
    Select Case Item.Id
        Case ID_PANE_PICTUREPANE:
             Item.Handle = picMainPane.hWnd
End Select

I receive a error message that says that method "Handle" for object "IPane" went wrong !?

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: 29 October 2004 at 2:51pm
You probably need to refference like fMainFrame.picMainPane.hwnd, just a guess.  Or maybe try storing the picture box on a "dummy" form.
Back to Top
tobi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 09 September 2004
Location: Germany
Status: Offline
Points: 451
Post Options Post Options   Thanks (0) Thanks(0)   Quote tobi Quote  Post ReplyReply Direct Link To This Post Posted: 29 October 2004 at 3:22pm
Your first suggestion does not work - same error ! The second way works but do you think I will not run into the focus problem ?
Back to Top
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 Posted: 13 January 2005 at 5:27am

Hi.

I have an application with up to seven panes open at any one time. Each one of these contains a form with a variety of controls. We are implementing a windows explorer style interface with a treeview in one pane, which acts as the parent and the rest of the panes being children whose data is dependant upon what level in the treeview we are.

As we change the level of the treeview we therefore update the data shown in all child forms.

The problem is, if I use the cursor keys to navigate the treeview, it fires a nodeclick event (correctly) which updates the child forms(correctly).

Unfortunately, for some reason, the pane with the treeview then loses focus and one of the child panes becomes active. I have even tried explicitly setting the focus back to the form and treeview control but this still doesn't work.

However, if I have no other panes open it behaves correctly. When I do have other panes there, I am never setting focus to them, merely updating their displays via code. I could perhaps accept the fact that this is all down to the way that vb handles things and that maybe I should be using picture boxes instead, if it wasn't for the following:

If I have the pane with the treeview floating, it works correctly. It is just when it is docked that it all becomes a mess. I've noticed other posts elsewhere that have similar issues.

This suggests to me that the docking pane may be handling things differently for docked panes and floating ones, so there may be something that codejock developers can do.

Has anyone encountered similar and have a workaround (that doesn't involve rewriting the whole app with picture boxes two weeks before its supposed release date!!)?

Cheers,

 

Steve

 

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: 21 February 2005 at 8:09am

Hi,

I had the same problem with the focus, so I am using PictureBoxes now for the DockingPanes.

However, I discovered a major problem: when you make the docking pane floating, the form of the DockingPane cannot get the focus anymore... (it looks that the floating pane becomes Modal)

Has anyone encountered this problem and have a workaround?

Thanks,

Thierry

Back to Top
acmh View Drop Down
Newbie
Newbie
Avatar

Joined: 14 March 2005
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote acmh Quote  Post ReplyReply Direct Link To This Post Posted: 14 March 2005 at 4:21am

Hi,
I am having the same problem as knijff where after placing my forms in PictureBoxes and float them, I can't interact with parent form.
Anyone know anywork around?
Albert

 

Back to Top
acmh View Drop Down
Newbie
Newbie
Avatar

Joined: 14 March 2005
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote acmh Quote  Post ReplyReply Direct Link To This Post Posted: 14 March 2005 at 5:41am

Hi,
Apparently my problem has something to do with focusing of the PictureBox. After I set the TabStop as false, it worked but once I clicked on a Textbox in the PictureBox, it gets stuck again.

Albert

Back to Top
Zarch View Drop Down
Newbie
Newbie


Joined: 15 June 2005
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote Zarch Quote  Post ReplyReply Direct Link To This Post Posted: 14 July 2005 at 8:33am

Hi,

I have the exact same problems as listed above by Boyd and SteveL. Is there anything codejock can do to fix this? I refuse to accept the fact that there is no way for a pane with a grid control or treeview to work correctly? I used forms as well in my panes. I'm willing to use pictureboxes if that is in fact the workaround that will get the panes working corectly, but it looks like even that has problems! How should I proceed from here? It seems the docking panes have a fundemental problem that should be addressed and documented somewhere.

Regards...

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.125 seconds.