Print Page | Close Window

[FIXED] PropertyGridItemEnum is not case sensitve

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Property Grid
Forum Description: Topics Related to Codejock Property Grid
URL: http://forum.codejock.com/forum_posts.asp?TID=18718
Printed Date: 04 December 2024 at 1:08pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: [FIXED] PropertyGridItemEnum is not case sensitve
Posted By: farr02
Subject: [FIXED] PropertyGridItemEnum is not case sensitve
Date Posted: 25 July 2011 at 3:15am
Hello,

CXTPPropertyGridItemEnum is not case sensitive (tested with version 13.4.2 and 15.1.1). The following code is taken from the GridSample. I have just added some more constraints and the TRACE statements:


        CXTPPropertyGridItem* pItem = pStandard->AddChildItem(new CXTPPropertyGridItemEnum(_T("Enum item"), 2));
        pItem->GetConstraints()->AddConstraint(_T("Windows 98"), 1);
        pItem->GetConstraints()->AddConstraint(_T("Windows 2000"), 2);
        pItem->GetConstraints()->AddConstraint(_T("Windows XP"), 3);
        pItem->GetConstraints()->AddConstraint(_T("Windows xp"), 4);
        pItem->GetConstraints()->AddConstraint(_T("windows xp"), 5);
        pItem->GetConstraints()->AddConstraint(_T("windows XP"), 6);

        TRACE1("Constraint: %d\n", pItem->GetConstraints()->FindConstraint(_T("Windows XP")));
        TRACE1("Constraint: %d\n", pItem->GetConstraints()->FindConstraint(_T("Windows xp")));
        TRACE1("Constraint: %d\n", pItem->GetConstraints()->FindConstraint(_T("windows xp")));
        TRACE1("Constraint: %d\n", pItem->GetConstraints()->FindConstraint(_T("windows XP")));


All FindConstraint statements return 2 (the index of "Windows XP").
The fix for the bug seems to be simple. Just replace the "CompareNoCase" in the CXTPPropertyGridItemConstraints::FindConstraint method with "Compare". It would be nice if CodeJock can fix this in the next version.

Best regards
   Holger Farr.




-------------
Product: Xtreme Toolkit Pro version 16.3.1, 18.4.0

Platform: Windows 10 (64 Bit)

Language: Visual C++ 15.0 (Visual Studio 2017)



Replies:
Posted By: Oleg
Date Posted: 26 July 2011 at 1:55pm
Sorry we don't consider it as bug. was a lot of requests for compareNoCase in past. just can't be changed now. Please update code as you need.

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


Posted By: farr02
Date Posted: 01 August 2011 at 2:27am
Hello Oleg,

thanks for the answer. I updated the code and it works well for me.
For the future it would be nice to have a possibility to set a user defined compare method in FindConstraints. This avoids changing the library source code after every new release. Smile



-------------
Product: Xtreme Toolkit Pro version 16.3.1, 18.4.0

Platform: Windows 10 (64 Bit)

Language: Visual C++ 15.0 (Visual Studio 2017)



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