Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Property Grid
  New Posts New Posts RSS Feed - [FIXED] PropertyGridItemEnum is not case sensitve
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

[FIXED] PropertyGridItemEnum is not case sensitve

 Post Reply Post Reply
Author
Message
farr02 View Drop Down
Groupie
Groupie


Joined: 10 May 2005
Status: Offline
Points: 51
Post Options Post Options   Thanks (0) Thanks(0)   Quote farr02 Quote  Post ReplyReply Direct Link To This Post Topic: [FIXED] PropertyGridItemEnum is not case sensitve
    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)
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
farr02 View Drop Down
Groupie
Groupie


Joined: 10 May 2005
Status: Offline
Points: 51
Post Options Post Options   Thanks (0) Thanks(0)   Quote farr02 Quote  Post ReplyReply Direct Link To This Post 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)
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.172 seconds.