![]() |
Menu item separator without using BeginGroup |
Post Reply
|
| Author | |
nighthawk
Senior Member
Joined: 11 June 2004 Status: Offline Points: 167 |
Post Options
Thanks(0)
Quote Reply
Topic: Menu item separator without using BeginGroupPosted: 13 June 2008 at 8:41am |
|
I have a proposal for a new feature:
It is very frustrating for me to have the menu/toolbar separator attached to a specific menu item (by setting Control.BeginGroup = True). There are a number of places in my programs where I change the visibility of individual menu items during runtime and if I hide the first menu item in a group, I have to go through and change the BeginGroup property on the next visible menu item. This is frustrating and can get complicated when there are lots of menu items that change visibility. I would love it if you can make it possible to add a separator that floats in a specific spot. For example, the built-in VB6 menu editor does not attach the separator to any other menu item so I can hide the menu items above and below the separator without effecting the separator itself. One way this could be done is to set aside a special menu id value that will add a separator in that position: CommandBar.Controls.Add(xtpControlButton, 1, "Item1", -1, False) CommandBar.Controls.Add(xtpControlButton, SEPARATOR_ID, "-", -1, False) CommandBar.Controls.Add(xtpControlButton, 2, "Item2", -1, False) CommandBar.Controls.Add(xtpControlButton, 3, "Item3", -1, False) In the above example, I can hide Item2 at runtime and still have the separator dividing Item1 and Item3. Just a thought. |
|
![]() |
|
shipwreck
Senior Member
Joined: 18 April 2008 Location: United States Status: Offline Points: 308 |
Post Options
Thanks(0)
Quote Reply
Posted: 20 June 2008 at 8:23pm |
|
Any specific reason why you would want to do this, If you like the "Aqua" look, you can just add another control in the menu, maybe a label perhaps? Make it's caption blank, and disable it. It will be there, in the order you have loaded your controls.
|
|
|
Product: Xtreme Suite Pro (Active-X), Version 15.3.1
Platform: Windows 7 Ultimate SP1 (64Bit) & Windows XP Mode SP3 (32Bit) Language: Visual Basic 6.0 SP6 |
|
![]() |
|
nighthawk
Senior Member
Joined: 11 June 2004 Status: Offline Points: 167 |
Post Options
Thanks(0)
Quote Reply
Posted: 27 June 2008 at 4:38pm |
|
Unfortunately, a blank label still leaves a space where the caption would normally be displayed. I don't want any spacing between the stand-alone group separator line and the menu buttons above and below.
|
|
![]() |
|
stefanadelbert
Groupie
Joined: 29 October 2008 Location: Australia Status: Offline Points: 31 |
Post Options
Thanks(0)
Quote Reply
Posted: 30 April 2009 at 7:50pm |
|
I'm having exactly the same issue, and definitely don't want to have to do the extra housekeeping of applying the separator to the next applicable menu item.
Is there any other way of achieving this? |
|
![]() |
|
nighthawk
Senior Member
Joined: 11 June 2004 Status: Offline Points: 167 |
Post Options
Thanks(0)
Quote Reply
Posted: 30 April 2009 at 9:06pm |
|
I found the following workaround. Adding a menu item using the following code creates a separator independent of any menu item:
Dim Control As XtremeCommandBars.CommandBarControl Set Control = CommandBar.Controls.Add(xtpControlGallery, Id, "") Control.Height = 0 Control.Width = 0 Control.BeginGroup = True (This also works for toolbar separators) The only problem I have encountered is that if there is a situation where a lot of normal menu items are hidden, I can sometimes end up with separators in unwanted spots. For example, sometimes I can end up with a separator in the very first or last position of a menu. Also, I can sometimes end up with two separators next to each other. This doesn't look good so I wrote a function that loops through all the menus and toolbars and hide seperators when they are show up in these unwanted places. |
|
|
Product: Xtreme SuitePro (ActiveX) version 13.0.0
Platform: Windows XP (32bit) - SP 3 Language: Visual Basic 6.0 |
|
![]() |
|
chrisABC
Senior Member
Joined: 05 June 2008 Status: Offline Points: 258 |
Post Options
Thanks(0)
Quote Reply
Posted: 05 May 2009 at 3:27pm |
Your cpu has too much spare time :-) |
|
|
Chris (Manchester, UK) -- www.abc6.co.uk ---- Using CodeJock ActiveX Suite 13.1.0 with Windows8, VB6 SP6
|
|
![]() |
|
nighthawk
Senior Member
Joined: 11 June 2004 Status: Offline Points: 167 |
Post Options
Thanks(0)
Quote Reply
Posted: 06 May 2009 at 5:55am |
I only need to check the controls when the program does something to change one of the visibility settings. Looping through a few dozen controls on such rare occasions is not a problem. |
|
|
Product: Xtreme SuitePro (ActiveX) version 13.0.0
Platform: Windows XP (32bit) - SP 3 Language: Visual Basic 6.0 |
|
![]() |
|
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 |