Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Docking Pane
  New Posts New Posts RSS Feed - Can't edit controls in docked pane
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Can't edit controls in docked pane

 Post Reply Post Reply
Author
Message
RedFin View Drop Down
Groupie
Groupie
Avatar

Joined: 26 March 2008
Location: Australia
Status: Offline
Points: 47
Post Options Post Options   Thanks (0) Thanks(0)   Quote RedFin Quote  Post ReplyReply Direct Link To This Post Topic: Can't edit controls in docked pane
    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
Back to Top
RedFin View Drop Down
Groupie
Groupie
Avatar

Joined: 26 March 2008
Location: Australia
Status: Offline
Points: 47
Post Options Post Options   Thanks (0) Thanks(0)   Quote RedFin Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post 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....
Back to Top
RedFin View Drop Down
Groupie
Groupie
Avatar

Joined: 26 March 2008
Location: Australia
Status: Offline
Points: 47
Post Options Post Options   Thanks (0) Thanks(0)   Quote RedFin Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
younicke View Drop Down
Senior Member
Senior Member
Avatar

Joined: 11 March 2005
Status: Offline
Points: 107
Post Options Post Options   Thanks (0) Thanks(0)   Quote younicke Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
RedFin View Drop Down
Groupie
Groupie
Avatar

Joined: 26 March 2008
Location: Australia
Status: Offline
Points: 47
Post Options Post Options   Thanks (0) Thanks(0)   Quote RedFin Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
younicke View Drop Down
Senior Member
Senior Member
Avatar

Joined: 11 March 2005
Status: Offline
Points: 107
Post Options Post Options   Thanks (0) Thanks(0)   Quote younicke Quote  Post ReplyReply Direct Link To This Post Posted: 04 May 2008 at 6:52am
redfin,

glad you were to solve your problems.


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