Can't edit controls in docked pane |
Post Reply |
Author | |
RedFin
Groupie Joined: 26 March 2008 Location: Australia Status: Offline Points: 47 |
Post Options
Thanks(0)
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 |
|
RedFin
Groupie Joined: 26 March 2008 Location: Australia Status: Offline Points: 47 |
Post Options
Thanks(0)
|
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 |
|
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
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.... |
|
RedFin
Groupie Joined: 26 March 2008 Location: Australia Status: Offline Points: 47 |
Post Options
Thanks(0)
|
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 |
|
younicke
Senior Member Joined: 11 March 2005 Status: Offline Points: 107 |
Post Options
Thanks(0)
|
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. |
|
RedFin
Groupie Joined: 26 March 2008 Location: Australia Status: Offline Points: 47 |
Post Options
Thanks(0)
|
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 |
|
younicke
Senior Member Joined: 11 March 2005 Status: Offline Points: 107 |
Post Options
Thanks(0)
|
redfin,
glad you were to solve your problems. |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |