bug in designer (w/ fix) |
Post Reply |
Author | |
Ark42
Senior Member Joined: 20 October 2003 Status: Offline Points: 291 |
Post Options
Thanks(0)
Posted: 29 May 2004 at 2:14am |
Creating a new menu item wih ID 57616 should result in a special MRU control, but it won't because in CXTPControls::Add in XTPControls.cpp the code does not match the code found in CXTPControls::AddMenuItem AddMenuItem has: if (nID == XTP_ID_WINDOWLIST) pControl = (CXTPControl*)CXTPControlWindowList::CreateObject(); else if (nID == XTP_ID_WORKSPACE_ACTIONS) pControl = (CXTPControl*)CXTPControlWorkspaceActions::CreateObject() ; else if (nID == ID_VIEW_TOOLBAR) pControl = (CXTPControl*)CXTPControlToolbars::CreateObject(); else if (nID == ID_OLE_VERB_FIRST && strCaption == _T("<<OLE VERBS GO HERE>>")) pControl = (CXTPControl*)CXTPControlOleItems::CreateObject(); else if (nID == ID_FILE_MRU_FILE1) pControl = (CXTPControl*)CXTPControlRecentFileList::CreateObject(); else pControl = (CXTPControl*)CXTPControlButton::CreateObject(); but Add only has: if (nId == XTP_ID_WINDOWLIST) pControl = (CXTPControl*)CXTPControlWindowList::CreateObject(); else if (nId == XTP_ID_WORKSPACE_ACTIONS) pControl = (CXTPControl*)CXTPControlWorkspaceActions::CreateObject() ; else if (nId == ID_VIEW_TOOLBAR) pControl = (CXTPControl*)CXTPControlToolbars::CreateObject(); else pControl = (CXTPControl*)CXTPControlButton::CreateObject(); so copying the basic code regarding ID_FILE_MRU_FILE1 should fix this problem. well, its sort of a fix, since it causes the app to lock up when you click on the File menu after that... Edited by Ark42 |
|
Ark42
Senior Member Joined: 20 October 2003 Status: Offline Points: 291 |
Post Options
Thanks(0)
|
I think it causes an infinite recursion since CXTPControlRecentFileList::OnCalcDynamicSize calls CXTPControls::Add to add with ID_FILE_MRU_FILE1 - 16 I would propse then XTP_ID_FILE_MRU (35003) and adding: else if (nId == XTP_ID_FILE_MRU) pControl = (CXTPControl*)CXTPControlRecentFileList::CreateObject(); would probably let you actually create the MRU menu item via the designer editor. |
|
Ark42
Senior Member Joined: 20 October 2003 Status: Offline Points: 291 |
Post Options
Thanks(0)
|
Can a fix like this go into the next version? I added XTP_ID_FILE_MRU to my copy and recompiled and it works fine now, I can create a MRU menu via the designer editor and it works, but only with this modification. |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Added
|
|
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 |