About CXTPMenuBar |
Post Reply |
Author | |
kmustty
Newbie Joined: 25 October 2010 Status: Offline Points: 2 |
Post Options
Thanks(0)
Posted: 25 October 2010 at 10:37am |
I use the following code to create a menubar
code:
if (CMDIFrameWnd::OnCreate(lpCreateStruct) == -1)
return -1; if (!m_wndStatusBar.Create(this) ||
!m_wndStatusBar.SetIndicators(indicators, sizeof(indicators)/sizeof(UINT))) { TRACE0("Failed to create status bar\n"); return -1; // fail to create } if (!InitCommandBars())
return -1; CXTPPaintManager::SetTheme(xtpThemeRibbon);
CXTPCommandBars* pCommandBars = GetCommandBars();
CXTPMenuBar* pMenuBar = pCommandBars->SetMenu(_T("Menu Bar"), IDR_MAINFRAME);
pMenuBar->SetFlags(xtpFlagIgnoreSetMenuMessage); pMenuBar->EnableDocking(xtpFlagAlignTop); pMenuBar->ModifyBarStyle(CBRS_GRIPPER, 0);
The resource menu IDR_MAINFRAME I have already modified some of the submenu name. Now,
I want to get the submenu name of menubar(menu IDR_MAINFRAME ), how can I code? Thx for help!
|
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi,
You want access specific control and get its caption ?
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
kmustty
Newbie Joined: 25 October 2010 Status: Offline Points: 2 |
Post Options
Thanks(0)
|
Yes. The project requires such an operation . I spent some time to study ,I found that the menu is not the normal menu which can't get its CMenu pointer. So can you put forward a solution to the problem? I got fred some days. thx |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi,
Yes, CXTPMenuBar is not CMenu and use own methods to change/access/delete controls you need first get pointer to file control: CXTPControl* pFile = pMenuBar->GetControl(0); and now can access control inside CommandBar of "File" control: CXTPControl* pSomeControl = pFile->GetCommandBar()->GetControl(nIndex); now you can change its caption pSomeControl->SetCaption("New Caption");
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
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 |