Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Docking Pane
  New Posts New Posts RSS Feed - CommandBar Menu and Docking Panes on MDIForm
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

CommandBar Menu and Docking Panes on MDIForm

 Post Reply Post Reply
Author
Message
Hemesh View Drop Down
Senior Member
Senior Member


Joined: 10 August 2010
Status: Offline
Points: 135
Post Options Post Options   Thanks (0) Thanks(0)   Quote Hemesh Quote  Post ReplyReply Direct Link To This Post Topic: CommandBar Menu and Docking Panes on MDIForm
    Posted: 15 September 2010 at 8:21am
Hi All,

I'm having this issue whereby I have a CommandBars Control, DockingPanes Control on the same MDIForm. When I set up the ActiveMenuBar and create a docking pane to the left of it, all seems ok... until i click on the docking pane control. When I do this the docking pane seems to move under the ActiveMenuBar for some reason... it's very odd I also have a picturebox aligned to the bottom of the MDI form, and the docking pane seems to have encompased the picture box into the bottom of the pane for some reason....

I've tried putting my docking pane child control in a PictureBox first, then setting the Handle to the PictureBox Handle, but it errors and forces the VB IDE to crash...

Has anyone successfully got an MDIForm with a command bar menu, docking pane on the left and status bar on the bottom working ok? i can't put the commandbar into a picture box as the GetActiveFormID event for the commandbar doesn't fire for some reason in a picturebox.. same thing with the CommandBarsFrame (as explained in a different post).

Thanks in advance
Product: Xtreme SuitePro (ActiveX) version 18.5.0

Platform: Windows 7 Enterprise (64-bit)

Language: Visual Basic 6.0
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: 15 September 2010 at 9:26am
have u used the

setcommandbars method?

also when using docking pane with commandbars... always send to back the docking pane control.
right click the docking pane control and click send to back
Back to Top
Hemesh View Drop Down
Senior Member
Senior Member


Joined: 10 August 2010
Status: Offline
Points: 135
Post Options Post Options   Thanks (0) Thanks(0)   Quote Hemesh Quote  Post ReplyReply Direct Link To This Post Posted: 15 September 2010 at 10:07am
Yes, that's it!, thanks younicke.

I now have a secondary problem though... Using the commandbars, I appear to get the issue of my status bar being overlapped by the MDI client area which can be shown in the CJ sample for docking panes on MDI...

Before:


After:


As you can see, the status bar is covered by the MDI's scrollbars for the form within. Got another trick up your sleeve to fix this one please?

Thanks!
Product: Xtreme SuitePro (ActiveX) version 18.5.0

Platform: Windows 7 Enterprise (64-bit)

Language: Visual Basic 6.0
Back to Top
SuperMario View Drop Down
Admin Group
Admin Group
Avatar

Joined: 14 February 2004
Status: Offline
Points: 18052
Post Options Post Options   Thanks (0) Thanks(0)   Quote SuperMario Quote  Post ReplyReply Direct Link To This Post Posted: 15 September 2010 at 2:29pm
Private Sub DockingPaneManager_GetClientBordersWidth(Left As Long, Top As Long, Right As Long, Bottom As Long)
    
    If sbStatusBar.Visible Then
        Bottom = sbStatusBar.Height
    End If
    If tbToolBar.Visible Then
        Top = tbToolBar.Height
    End If
   
End Sub
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: 15 September 2010 at 2:34pm
Hi,
 
The sample is using VB menu, right? I had same issues in SDI application with VB Menu, MS Statusbar, Dockingpanes, Commandbars and SkinFramework.
 
Seems 'position' of control in form have to be right. Don't know exact 'position' anymore (try to search forum for posts I did) but it matters that's for sure. ('position' = Send to Back or Bring to Front)
 
If you have still problems upload test project inhere, OK?
 
 
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
SuperMario View Drop Down
Admin Group
Admin Group
Avatar

Joined: 14 February 2004
Status: Offline
Points: 18052
Post Options Post Options   Thanks (0) Thanks(0)   Quote SuperMario Quote  Post ReplyReply Direct Link To This Post Posted: 15 September 2010 at 2:45pm
To keep the Docking Panes from drawing over top of the CommandBars you need to right-click on the docking pane control on your form and set "Send To Back". The ComandBars object must be "in-front" of the DockingPane control.
Back to Top
Hemesh View Drop Down
Senior Member
Senior Member


Joined: 10 August 2010
Status: Offline
Points: 135
Post Options Post Options   Thanks (0) Thanks(0)   Quote Hemesh Quote  Post ReplyReply Direct Link To This Post Posted: 16 September 2010 at 3:13am
Hi Guys,

Thanks for the responses!

SuperMario, The code in the GetClientWidth already exists in this project, and the DockingPaneManager is already at the Back of the ZOrder. This application is actually the CJ MDI Sample for Docking Panes, with two differences.

1) I've put on a CommandBars Object.
2) I've had to put the Standard VB Status Bar into a PictureBox to ensure it stays on top.

To fix one problem, i've followed what younicke said and set the DockingPaneManager.SetCommandBars = CommandBars1, but the resulting problem I saw was the screenshots above.

Aaron, I've attached said project to this reply to help uploads/20100916_031216_MDISample.rar (EDIT: Just realised I forgot to put the StatusBar in a PictureBox.. d'oh! you'll need to do this when you try the sample otherwise the statusbar doesn't move... that was another problem with the sample app )

On a side note, i've actually had to ignore VB's controls... so last night, I removed the VB StatusBar and replaced this with a modular object (declared with withevents) of a CJ StatusBar type, and assigned to this the CommandBars1.StatusBar and customised that. This seemed to work how I wanted it now, with the exception that the ShortcutBar I had (not a CJ Control) is now docked into a CJ window at runtime. That part is still causing me issues with re-sizing, so I might have to end up trying the CJ ShortcutBar to hopefully sort this all out!

It would still be nice to know why I can't get the standard VB Controls to play ball with the CJ ones though
Product: Xtreme SuitePro (ActiveX) version 18.5.0

Platform: Windows 7 Enterprise (64-bit)

Language: Visual Basic 6.0
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: 16 September 2010 at 6:05am
Hi,
 
SuperMario, if you think that this can be solved, please use attached sample to solve the problem. If you are going to say that we have to use CJ commandbar for creating menu, the least you can do is give us an explanation why it doesn't work (maybe you can't solve this yourself...) so everyone knows that it can't be used with VB menu / MS statusbar (with aligned controls???). I never got a good explanation why it couldn't be done so now is the time to step up to the plate. It's not a shame when some controls don't work side by side, at least we know what to do. And future members don't nag anymore why it doesn't work if you put this in the help or somewhere in this forum (articles )
 
Thanks a lot
 
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
SuperMario View Drop Down
Admin Group
Admin Group
Avatar

Joined: 14 February 2004
Status: Offline
Points: 18052
Post Options Post Options   Thanks (0) Thanks(0)   Quote SuperMario Quote  Post ReplyReply Direct Link To This Post Posted: 16 September 2010 at 9:58am
Aaron, what are you saying don't work?

If using MDI and other aligned controls just use RepositionAlignedControls of Commandbars (if you use commandbars), not need if only DP.

Private Sub CommandBars_RepositionAlignedControls (Left As Long, Top As Long, Right As Long, Bottom As Long)
  CommandBars.MoveAlignedControl Picture1, Left, Top, Right, Bottom
End Sub

But this is not needed for standard vb statusbar if that is what you really want to use.  My code above will account for the standard vb statusbar.  I am not sure why you want it in a picturebox....
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: 16 September 2010 at 11:45am
Hi SuperMario,
 
Maybe I don't understand... I ripped all unnecessary code from same sample. Please add code to position and size VBMenu, Statusbar, Toolbar and panes.
 
I expect Statusbar positioned at the bottom and sized to total with of form. Same for toolbar at the top. Furthermore the panes have to be fully visible.
 
Thanks a lot in advance
 
Uploaded project should be here ??? but seems I can't upload it (where is button?)
 
OK found button Wink uploads/3701/MDISample.zip
 
  
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
SuperMario View Drop Down
Admin Group
Admin Group
Avatar

Joined: 14 February 2004
Status: Offline
Points: 18052
Post Options Post Options   Thanks (0) Thanks(0)   Quote SuperMario Quote  Post ReplyReply Direct Link To This Post Posted: 16 September 2010 at 1:30pm
Guess I don't understand your problem.....the MDIDocking sample is EXACTLY what you just described Aaron.  Only Codejock control is DP in that sample.



As for aligned picture boxes WITHOUT commandbars...here is some code:

Private Sub DockingPaneManager_GetClientBordersWidth(Left As Long, Top As Long, Right As Long, Bottom As Long)
   
    Bottom = Picture1.Height
    Top = Picture2.Height
   
    If sbStatusBar.Visible Then
        Bottom = Bottom + sbStatusBar.Height
    End If
    If tbToolBar.Visible Then
        Top = Top + tbToolBar.Height
    End If
   
End Sub



If he does want CommandBars he just needs my RepositionAlignedControls code I already posted.
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: 16 September 2010 at 5:52pm
Hi SuperMario,
 
I uploaded my sample in my previous reply, please look at that one and add the necessary code
 
Thanks a lot
 
 
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
SuperMario View Drop Down
Admin Group
Admin Group
Avatar

Joined: 14 February 2004
Status: Offline
Points: 18052
Post Options Post Options   Thanks (0) Thanks(0)   Quote SuperMario Quote  Post ReplyReply Direct Link To This Post Posted: 16 September 2010 at 9:28pm
I don't understand....so you want to use our CommandBars or not?  Why would you want both ours and standard ugly vb menu\toolbar?
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: 17 September 2010 at 3:05am
Hi SuperMario,
 
I will try to explain a little further why I would like to see this working...
 
A lot of developers have the standard VB menu before using your suite. After a little testing and playing with the samples most of them will find out, if they drop a Commandbars control onto the form, the standard menu will be converted into a more 'sofisticated' menu. Wow that is cool, without changing any code the menu changed, CJ is the best and I want to buy these controls for sure Wink
 
But then the trouble starts, see my uploaded sample again. So my question is: can it be done or not? If you would get this working you would gain a lot of customers because VB menu is first thing they would like to change. I think that's why @Hemesh started this thread in the first place...
 
Thanks a lot
 
 
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
Hemesh View Drop Down
Senior Member
Senior Member


Joined: 10 August 2010
Status: Offline
Points: 135
Post Options Post Options   Thanks (0) Thanks(0)   Quote Hemesh Quote  Post ReplyReply Direct Link To This Post Posted: 17 September 2010 at 3:30am
I miss a lot on UK time.... d'oh!

I'm moving my app from VB Menus to CJ Menus and have existing third-party controls on my MDI Form (so the StatusBar and ShortcutBar is not VB Standard ones, although i've tried to use those anyway to get this working without due course). The main reason this was required was so that we are implementing the russian language and VB6 controls don't support unicode.

I did drop on the commandbars object and it translated the existing menus great, but it lost the ShortcutBar for some reason. I chose a CommandBarFrame which failed miserably with the event for GetActiveDocumentID not firing... after a lot of messing I opted to use the dockingpane to solve this which thanks to earlier in the thread, got solved easily :)

This still in turn failed for the status bar though so I had to replace that now with CJ ones after looking through all the samples to find the right one but got that positioned ok now. I still have a sort of issue with the third-party control that's docked in the pane not displaying right when maximising/restoring the window which is a real pain. I tried putting the control in a picturebox, then putting the picturebox handle into the docking pane which crashed the VB IDE... so i think I might end up trying the CJ ShortcutBar.... if that works ok (as i've found CJ controls in commandbars don't display correctly anyway unless they are in a picturebox first anyway.. vb6 ones though work fine...)

I'll try the code suggestion that SuperMario has mentioned for the sample i uploaded to see if that fixes things, but I think some more sample apps are needed explaining these things more as the tutorials don't always help either. I might knock some up after this project and upload to help others on the simple first bits :)

I do agree with Aaron, that fixing these niggles would help loads to existing and potential new customers. We aren't having a rant (even though my post sound like it) as I personally like the structure of the controls, it's just the niggles of things that don't work properly really spoil the experience, but i'm sure you guys are sorting this out asap Thumbs Up

EDIT: Tried SuperMarios code on the CJ DockingPanes MDI sample, it's still not worky Unhappy
Product: Xtreme SuitePro (ActiveX) version 18.5.0

Platform: Windows 7 Enterprise (64-bit)

Language: Visual Basic 6.0
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: 19 September 2010 at 11:57am
Hi,
 
SuperMario? Could "our" problem be fix or not?
 
Thanks
 
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
SuperMario View Drop Down
Admin Group
Admin Group
Avatar

Joined: 14 February 2004
Status: Offline
Points: 18052
Post Options Post Options   Thanks (0) Thanks(0)   Quote SuperMario Quote  Post ReplyReply Direct Link To This Post Posted: 20 September 2010 at 2:05pm
OK Aaron I see your question now (sorry, been busy preparing 13.4.1), but you guys must realize CB does not translate standard vb toolbars, only menus.  Which was one part of the sample that confused me.  I am not sure why you would want to keep the VB Toolbars.

Some important notes.

1. Aligned controls can only be positioned above\below Docking Panes, if you want DP then you should consider moving the aligned controls inside a DP or using a DialogBar.
2. Dialog Bars can't use a PictureBox with an Aligned property...to get around this you simply place a picturebox inside an aligned picturebox.  Then set the visibility of the aligned box to false and attache the non-aligned box to the DialogBar.

In short, if you use DP and CB and need aligned controls you need to decide to place them in a Pane or DialogBar.  My sample shows how to use the DialogBar to keep the ugly VB Toolbar and also shows the PictureBox "in" Picturebox method so it can be used with a DialogBar.

***Warning*** attaching an aligned picturebox to a dialogbar will crash VB...thus the above method.

uploads/369/frmMain.rar

*note you need to modify the vbp file to use 13.4.0 as I was using 13.4.1
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: 20 September 2010 at 5:27pm
Hi Supermario,
 
Clap 
 
This is wonderfull, just copy/pasted the necessary code to SDI sample and it works also. At least I know it is possible. I really thought it wasn't possible, also because I didn't got an answer in the posts I ever did in this forum about this issue. 
 
Thanks a lot
 
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
Hemesh View Drop Down
Senior Member
Senior Member


Joined: 10 August 2010
Status: Offline
Points: 135
Post Options Post Options   Thanks (0) Thanks(0)   Quote Hemesh Quote  Post ReplyReply Direct Link To This Post Posted: 22 September 2010 at 10:55am
Cheers guys, that clears up everything. Thumbs Up

With these in mind, would it be worth fixing up the samples so that these hints are in there for other customers (current/future) as it'd help in the long run :)

Thanks again SuperMario... hell of a workaround though lol!
Product: Xtreme SuitePro (ActiveX) version 18.5.0

Platform: Windows 7 Enterprise (64-bit)

Language: Visual Basic 6.0
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.047 seconds.