Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Docking Pane
  New Posts New Posts RSS Feed - Changing the title of a pane
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Changing the title of a pane

 Post Reply Post Reply
Author
Message
Maui View Drop Down
Groupie
Groupie


Joined: 10 June 2004
Status: Offline
Points: 95
Post Options Post Options   Thanks (0) Thanks(0)   Quote Maui Quote  Post ReplyReply Direct Link To This Post Topic: Changing the title of a pane
    Posted: 18 January 2005 at 4:08pm

I have created a pane. The pane shows the contents of a folder.

I want to set the title of the pane to be whatever the current directory on show is.

I used this code.

        Set P = .DockingPane.FindPane(ID_PANE_GALLERY)
        If Not P Is Nothing Then
             P.Title = sPath
             Debug.Print "new title=" & sPath
        End If

The Title doesnt change even though I can see with the debug that the correct info is being passed.

There is no .refresh method so Im not sure what to do next?

Please dont tell me that the only answer is to destroy and then recreate the pane.

Thanks 

 

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

Joined: 11 June 2004
Status: Offline
Points: 167
Post Options Post Options   Thanks (0) Thanks(0)   Quote nighthawk Quote  Post ReplyReply Direct Link To This Post Posted: 18 January 2005 at 4:25pm
Try adding the line:

P.RedrawPanes

after setting the title.
Back to Top
Maui View Drop Down
Groupie
Groupie


Joined: 10 June 2004
Status: Offline
Points: 95
Post Options Post Options   Thanks (0) Thanks(0)   Quote Maui Quote  Post ReplyReply Direct Link To This Post Posted: 19 January 2005 at 6:05am

Cheers

.DockingPane.RedrawPanes works as long as the panes are docked.

If the panes arent docked then they arent effected until they are redocked.

CJ support - Pls log this as a bug.

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: 19 January 2005 at 7:37am

I found this a long time ago and created a workaround for it.  I figured this would have been fixed by now, but I guess not.  This work-around was designed before the ThemedFloatingPanes option was introduced, so I don't know how that will affect it, but you can play with it to make it work.  The general idea behind this was that a floating pane was actually a window with a title bar.  The workaround was to use the 'SetWindowText' API function to directly change the title of the window.  I wrapped it up into a function that took three parameters... the DockingPane object, the ID of the pane to update, and the new title.

Declare Function SetWindowText Lib "user32.dll" Alias "SetWindowTextA" (ByVal hWnd As Long, ByVal lpString As String) As Long
Declare Function GetParent Lib "user32.dll" (ByVal hWnd As Long) As Long
Public Sub UpdatePaneTitle(ByRef dockingPanes As DockingPane, ByVal iPaneID As Integer, ByVal sTitle As String)
    Dim hWnd As Long, p As Pane
    Set p = dockingPanes.FindPane(iPaneId)
    If p Is Nothing Then Exit Sub
    p.Title = sTitle
    If p.Floating = True Then
        'The container for the floating form is two levels up from
        'the docked item itself.  We need to update both captions.
        SetWindowText p.handle, sTitle
        hWnd = GetParent(GetParent(p.handle))
        If hWnd <> 0 Then
             SetWindowText hWnd, sTitle
        End If
    Else
        dockingPanes.RecalcLayout
    End If
End Sub

At the time, I don't think the 'RedrawPanes' method existed, so I used 'RecalcLayout' instead.  I'm sure you can tweak this to accomplish what you need.  Hope this helps!  Of course, it'd still be nice if Codejock can wrap up a resolution to this.

Back to Top
Maui View Drop Down
Groupie
Groupie


Joined: 10 June 2004
Status: Offline
Points: 95
Post Options Post Options   Thanks (0) Thanks(0)   Quote Maui Quote  Post ReplyReply Direct Link To This Post Posted: 20 January 2005 at 10:06am

Looks great.

Thank you for your help. I will let you know how I get on.

Back to Top
Maui View Drop Down
Groupie
Groupie


Joined: 10 June 2004
Status: Offline
Points: 95
Post Options Post Options   Thanks (0) Thanks(0)   Quote Maui Quote  Post ReplyReply Direct Link To This Post Posted: 22 January 2005 at 4:32pm

Had 5 mins this morning on the PC and tried your suggestion but it didnt work.

Wont have time to get on the PC for a few days so it will be a while before I can test this further.

Here's hoping that the next release will address this problem.

 

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: 22 January 2005 at 5:04pm
Sorry... I think I used this back in the v8.x days, so I guess it doesn't work anymore.
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.176 seconds.