Print Page | Close Window

Using OnInitCommandsPopup

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=1503
Printed Date: 07 June 2024 at 5:54am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Using OnInitCommandsPopup
Posted By: jmathies
Subject: Using OnInitCommandsPopup
Date Posted: 07 December 2004 at 5:00pm

Hello,

I'm currently working with a drop down menu on a button within a toolbar. Within my app, the items in the drop down are customizable via a configuration interface within the app. The drop down supports a maximum of 10 items, some of which may not be visible because they have not been configured. To accomplish this, i've:

1) defined a menu for the button with 10 items

2) received the OnInitCommandsPopup event, in which I set the caption text for each item configured, and set the visiblilty of each item not configured to false.

This work as expected, I end up with a drop down menu with the items that have been configured available, and the items not configured hidden. 

But, if the user configures an additional menu item, and then selects the drop down, this item does not show up. The reason is that

CXTPControl* pCtrl = pCommandList->FindControl( xtpControlButton, nMeniId, TRUE, FALSE );

Fails to find the menu id. For some reason, after I set a menu item visibility to false, it is removed from the control list. Also, after closing and reopening the app, the same problem occurs. I can 'reset' the problem by deleting the registry data assocociated with the controls. (CommandBars-Controls)

Maybe i've approached this from the wrong direction. What is causing the non visible menu item controls within the control list to be removed?

Regards,
Jim

 




Replies:
Posted By: jmathies
Date Posted: 07 December 2004 at 5:14pm
I am a dork. BOOL bVisible flag set to TRUE. DOH!



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net