Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - Using OnInitCommandsPopup
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Using OnInitCommandsPopup

 Post Reply Post Reply
Author
Message
jmathies View Drop Down
Newbie
Newbie
Avatar

Joined: 07 December 2004
Location: United States
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote jmathies Quote  Post ReplyReply Direct Link To This Post Topic: Using OnInitCommandsPopup
    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

 

Back to Top
jmathies View Drop Down
Newbie
Newbie
Avatar

Joined: 07 December 2004
Location: United States
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote jmathies Quote  Post ReplyReply Direct Link To This Post Posted: 07 December 2004 at 5:14pm
I am a dork. BOOL bVisible flag set to TRUE. DOH!
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.086 seconds.