Print Page | Close Window

How to set a particular item ?

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


Topic: How to set a particular item ?
Posted By: Atul
Subject: How to set a particular item ?
Date Posted: 22 January 2009 at 8:03am
Hi,
    I have a CXTPPropertyGridItemConstraints* pList. To this list, I am adding three constraints.
pList->AddConstraint(_T("No Shadow"));
pList->AddConstraint(_T("Hard Shadow"));
pList->AddConstraint(_T("Soft Shadow"));
Now, I want to have a functionality such that, when the user selects on Hard Shadow and closes the application, and again reopens it, the grid should show "Hard Shadow". I am storing the state of the variables into registry.
Is there any way, by which this can be done ?
Thanks in advance,
Atul



Replies:
Posted By: Oleg
Date Posted: 22 January 2009 at 8:08am

???

so store and restore it.


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


Posted By: Atul
Date Posted: 22 January 2009 at 8:17am
No, i just want it to highlight the appropriate current item.I have a way of storing and restoring 


Posted By: Oleg
Date Posted: 23 January 2009 at 1:41am
So what problem ? call pItem->SetValue to change current item.

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


Posted By: mgampi
Date Posted: 23 January 2009 at 4:58am
Hi;

I use this solution when creating the property grid item:

        pItem=pCategory->AddChildItem(new CXTPPropertyGridItem(IDS_STATE_PROPITEM_CHARTCONTENT));
        CXTPPropertyGridItemConstraints* pConstraints=pItem->GetConstraints();

        CString strConstraint;
        VERIFY(strConstraint.LoadString(IDS_STATECHART_CAPTION0));
        pConstraints->AddConstraint(strConstraint);
        VERIFY(strConstraint.LoadString(IDS_STATECHART_CAPTION1));
        pConstraints->AddConstraint(strConstraint);
        VERIFY(strConstraint.LoadString(IDS_STATECHART_CAPTION2));
        pConstraints->AddConstraint(strConstraint);
        VERIFY(strConstraint.LoadString(IDS_STATECHART_CAPTION3));
        pConstraints->AddConstraint(strConstraint);
        VERIFY(strConstraint.LoadString(IDS_STATECHART_CAPTION4));
        pConstraints->AddConstraint(strConstraint);
        VERIFY(strConstraint.LoadString(IDS_STATECHART_CAPTION5));
        pConstraints->AddConstraint(strConstraint);
        pItem->SetFlags(xtpGridItemHasComboButton);

        _XRStateChartTypes chartType=_pDoc->GetChartType();

        pConstraints->SetCurrent(chartType);
        pItem->SetValue(pConstraints->GetAt(chartType));



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

Product: Xtreme Toolkit v 22.1.0, new Projects v 24.0.0
Platform: Windows 10 v 22H2 (64bit)
Language: VC++ 2022



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