Print Page | Close Window

bug in designer (w/ fix)

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=795
Printed Date: 27 November 2024 at 1:13am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: bug in designer (w/ fix)
Posted By: Ark42
Subject: bug in designer (w/ fix)
Date 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...



Replies:
Posted By: Ark42
Date Posted: 29 May 2004 at 10:44am

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.


Posted By: Ark42
Date Posted: 02 June 2004 at 10:16am

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.



Posted By: Oleg
Date Posted: 03 June 2004 at 12:58am
Added

-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net