Print Page | Close Window

HOWTO: v19.3 - CXTPPropertyGridEnum - how to empty

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=24059
Printed Date: 21 February 2024 at 11:31pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: HOWTO: v19.3 - CXTPPropertyGridEnum - how to empty
Posted By: mgampi
Subject: HOWTO: v19.3 - CXTPPropertyGridEnum - how to empty
Date Posted: 21 September 2020 at 3:36am
Hi;

After migration to v19.3, we no longer can 'empty' an enum property.
In older toolkit versions we set -1 in ctor and/or to the SetEnum() funtion. This does the trick.
In v19.3 we get an assert and the display value is not empty anymore.

BTW: The signature and implementation of the SetEnum function is not consistent:

void CXTPPropertyGridItemEnum::SetEnum(int nValue)
{
    m_nValue = nValue;

    if (m_pBindEnum)
    {
        *m_pBindEnum = nValue;
    }

    int nIndex = m_pConstraints->FindConstraint(XTPToULongPtrChecked(nValue));
    CXTPPropertyGridItem::SetValue(m_pConstraints->GetAt(nIndex));
}

Can you see the int --> unsigned long --> int conversion?
Why?



-------------
Martin

Product: Xtreme Toolkit v 19.0.0, new Projects v 19.1.0
Platform: Windows 10 v 1909 (64bit)
Language: VC++ 2017



Replies:
Posted By: mgampi
Date Posted: 01 June 2021 at 10:25am
Hello!
What about this issue? We still see the problem in 19.2 and 19.3.
Anyone else?

How to fix it?

-------------
Martin

Product: Xtreme Toolkit v 19.0.0, new Projects v 19.1.0
Platform: Windows 10 v 1909 (64bit)
Language: VC++ 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