![]() |
MRU List |
Post Reply
|
| Author | |
nitquest
Newbie
Joined: 11 September 2006 Location: United States Status: Offline Points: 1 |
Post Options
Thanks(0)
Quote Reply
Topic: MRU ListPosted: 11 September 2006 at 1:54pm |
|
Hi,
I have a task of disabling the MRU list in File Menu when in one view and enabling it in other. I created the menu in Mainframe OnCreate using :
however, when I try to diasble the MRU using this function, it wont work. Can someone please help? if (((CMainFrame *)AfxGetMainWnd())->GetDockingPaneManager()->IsPaneSelected(ID_VIEW_SCRIPT)) return; // Disable the MRU list if in Jobs Pane CXTPMenuBar *pMenuBar = ((CMainFrame *)AfxGetMainWnd())->GetCommandBars()->GetMenuBar(); if(pMenuBar != NULL){ CMenu* pMenu = pMenuBar->GetMenu(); int nItems = m_pRecentFileList->GetSize(); for (int n = 0; n < nItems; n++) pMenu->EnableMenuItem(ID_FILE_MRU_FILE1 + n, MF_BYCOMMAND | MF_GRAYED); } pMenu is always NULL. why? How do I access Menu? |
|
![]() |
|
sunilwarke
Newbie
Joined: 28 September 2006 Status: Offline Points: 6 |
Post Options
Thanks(0)
Quote Reply
Posted: 29 November 2006 at 4:00am |
|
Hi, I do have the same problem and still trying to find the solution. Did you get any solution for your problem? TR, Sunil |
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 29 November 2006 at 6:07am |
|
Hello,
Add this code to you CYourApp
...
void CCustomThemesApp::OnUpdateMRUFiles(CCmdUI* pCmdUI)
{ CXTPControl* pControl = CXTPControl::FromUI(pCmdUI); if (!pControl) return; int nIndex = pControl->GetIndex() + 1;
CXTPControls* pControls = pControl->GetControls(); while (nIndex < pControls->GetCount()) { CXTPControl* pRecentFile = pControls->GetAt(nIndex); if (pRecentFile->GetID() < ID_FILE_MRU_FILE1 || pRecentFile->GetID() > ID_FILE_MRU_FILE1 + 16 ) break; pRecentFile->SetEnabled(FALSE);
nIndex++; } }
|
|
|
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 |