Can't edit controls in docked pane
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=10485
Printed Date: 31 January 2025 at 5:56am Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com
Topic: Can't edit controls in docked pane
Posted By: RedFin
Subject: Can't edit controls in docked pane
Date Posted: 04 May 2008 at 1:27am
Hi,
I am hoping someone can tell me what I'm doing wrong here ...
I am using v12 of the docking pane control. I am loading a form thus ...
With DockingPane1
Set pneSchema = .CreatePane(0, Me.ScaleWidth * 0.2, Me.ScaleHeight, DockLeftOf, Nothing)
pneSchema.Options = PaneNoCaption
Set frmSchema = New frmDatabaseSchema
pneSchema.SetHandle frmSchema.hwnd
Connect Me 'this makes a connection to a database
If frmConnect.Cancelled Then
Unload Me
End If
ReDim frmQuery(3)
Set frmQuery(1) = New frmDatabaseQuery
Set frmQuery(2) = New frmDatabaseQuery
Set frmQuery(3) = New frmDatabaseQuery
.PaintManager.ShowCaption = False
Set qry1 = .CreatePane(1, Me.ScaleWidth * 0.8, Me.ScaleHeight, DockRightOf, pneSchema)
qry1.SetHandle frmQuery(1).hwnd
qry1.Title = "Untitled Query 1"
Set frmQuery(1).Connection = mcnSql
qry1.Enabled = PaneEnabled
frmQuery(1).sql = "SELECT * FROM tblentities"
Set qry2 = .CreatePane(2, Me.ScaleWidth * 0.8, Me.ScaleHeight, DockRightOf, qry1)
qry2.SetHandle frmQuery(2).hwnd
qry2.Title = "Untitled Query 2"
Set frmQuery(2).Connection = mcnSql
Set qry3 = .CreatePane(3, Me.ScaleWidth * 0.8, Me.ScaleHeight, DockRightOf, qry1)
Set frmQuery(2) = New frmDatabaseQuery
qry3.SetHandle frmQuery(3).hwnd
qry3.Title = "Untitled Query 3"
.AttachPane qry2, qry1
.AttachPane qry3, qry1
.Options.LunaColors = True
.Options.HideClient = True
With .TabPaintManager
.Appearance = xtpTabAppearanceVisualStudio2005
.Color = xtpTabColorOffice2003
.Position = xtpTabPositionTop
.Layout = xtpTabLayoutAutoSize
End With
qry1.Select
mId = 1
End With
... which creates the following ....
The problem is that some of the controls can't be used. eg. I can't edit the text in the text box (except through code using ... frmQuery(1).sql = "SELECT * FROM tblentities" as in the above code)
In the lower half of the picture I can't do anything with the 2 tables at the top, but can use the "Collate" and "Options" buttons right next them.
It is worth noting that events like mouse click etc work as normal.
However, if I undock the pane, it all works fine.
I've spent hours on this one single problem and tried all sorts of different options, and have tried to emulate the various codejock samples provided, all to no avail.
Can someone please save me from tearing my hair out !!
Thankyou,
Rohan
|
Replies:
Posted By: RedFin
Date Posted: 04 May 2008 at 2:12am
A bit more info ...
the controls are only receiving mouse events. On the grid at the bottom I can click rows and column headers (to change the sort order) etc, but if I click a row and then try the arrow keys, nothing happens.
.... and even weirder, I've just discovered that if I click on the grid at the bottom, the text box at the top receives the focus and I can edit it
|
Posted By: Aaron
Date Posted: 04 May 2008 at 4:09am
Hi,
Is it possible to upload the project and just have the code in which you load the panes? Just make a copy and delete all unwanted code.
------------- 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: RedFin
Date Posted: 04 May 2008 at 5:08am
Hi Aaron,
I'll see what I can do. There are quite a few custom controls referenced so it will need a bit of work to cut it down suitable for uploading.
In the meantime however, I've worked out that it is somehow related to the fact that I'm using an MDI form. To test, I modified the project to be SDI and it worked fine....I guess I can just live with it that way, but it would certainly be preferable for it to work with an MDI form.
Cheers,
Rohan
|
Posted By: younicke
Date Posted: 04 May 2008 at 5:44am
hi redfin,
since you wanted to use an mdi form, why dont you just use an mdi child form on your query forms? and then enable the tabworkspace of the commandbars object? as i have seen in your code you are also using dockingpanes for your query forms.
sample code:
With DockingPane1
Set pneSchema = .CreatePane(0, Me.ScaleWidth * 0.2, Me.ScaleHeight, DockLeftOf, Nothing)
pneSchema.Options = PaneNoCaption
Set frmSchema = New frmDatabaseSchema
pneSchema.SetHandle frmSchema.hwnd
Connect Me 'this makes a connection to a database
If frmConnect.Cancelled Then
Unload Me
End If
End With
dim i as long
for i = 0 to 2 dim fQuery as frmDatabaseQuery
set fQuery = new frmDatabaseQuery fQuery.Caption = "Untitled Query " & i+1 fQuery.Show next
just make sure that frmDatabaseQuery is an MDI-child form.
hope this helps.
|
Posted By: RedFin
Date Posted: 04 May 2008 at 6:49am
Hi younicke,
Thanks for the reply.
The idea is to have one app that can connect to multiple databases (each frmDatabaseQuery). Then within each frmDatabaseQuery, there can be multiple queries to that database.
Therefore, frmDatabaseQuery is set to be an mdiChild and the panes in frmDatabaseQuery hold multiple instances of the frmQuery form.
However, I did enable the tabworkspace for the frmDatabaseQuery forms, but the behaviour of the panes is still the same.
BUT...After a lot more playing around and just trying different things, I set frmQuery to be an mdiChild as well and voila ... it all works properly.
Curiously, even though I've set frmQuery to be an mdi child, the instances of it don't appear in the window list of the MDI form. Admittedly this is a good thing in this case, just not what I would have expected.
Thanks for your help,
Rohan
|
Posted By: younicke
Date Posted: 04 May 2008 at 6:52am
redfin,
glad you were to solve your problems.
|
|