Get main menu fail |
Post Reply |
Author | |
Ark42
Senior Member Joined: 20 October 2003 Status: Offline Points: 291 |
Post Options
Thanks(0)
Posted: 14 November 2004 at 12:59pm |
This is very useful, I just spent a while searching for this, and this is what I was looking for. In order to change menu items, instead of using ON_WM_INITMENUPOPUP, you use ON_XTP_INITCOMMANDSPOPUP() which will call a function like void CMainFrame::OnInitCommandsPopup(CXTPPopupBar* pCommandBar) And I think you can then call pCommandBar->GetControlPopup()->GetID() and alter the bar if you want from there. The Notifications is a good resource to look at here. Edited by Ark42 |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
pMenuBar->GetControl(0)->GetCommandBar()->GetContro l(9)->SetCaption("Print1"); or pCommandBars->FindControl(..)->SetCaption("Print1"); but better catch INITCOMMANDSPOPUP notifiaction and change caption before popup become visible. See Notifications sample. |
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
amhigh
Newbie Joined: 23 September 2004 Status: Offline Points: 2 |
Post Options
Thanks(0)
|
Thanks for point this out. I appreciate. After get the menubar, how can I obtain the information of the menu bar? For example, I used to get th "Caption" of the menubar and be able to chagne it (say, Change the caption of "Print ..." under the "File" menu to the caption of my own language) with the MFC, now after integrate with Codejock, after I get the menubar, how can I do the same thing as I did it before? Can you please provide me some hints or any examples? Thanks for your help.
|
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Xtreme CommandBars don't use CMenu. you must change all code for CommandBars api: pMainFrame->GetCommandBars()->GetMenuBar(); to add button: pMenuBar->GetControls()->Add(..) access: pMenuBar->GetControls()->GetAt(i) remove: pMenuBar->GetControls()->Remove(i)
Please, _learn_ all samples we provided.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
amhigh
Newbie Joined: 23 September 2004 Status: Offline Points: 2 |
Post Options
Thanks(0)
|
Dear Codejock experts: I use the Visual C++ 6.0 to develop my own application, Thanks for any help. Best Regards.
|
|
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 |