Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Property Grid
  New Posts New Posts RSS Feed - How to set a particular item ?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

How to set a particular item ?

 Post Reply Post Reply
Author
Message
Atul View Drop Down
Newbie
Newbie


Joined: 02 May 2008
Location: India
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote Atul Quote  Post ReplyReply Direct Link To This Post Topic: How to set a particular item ?
    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
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: 22 January 2009 at 8:08am

???

so store and restore it.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
Atul View Drop Down
Newbie
Newbie


Joined: 02 May 2008
Location: India
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote Atul Quote  Post ReplyReply Direct Link To This Post 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 
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: 23 January 2009 at 1:41am
So what problem ? call pItem->SetValue to change current item.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1201
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post 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
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.250 seconds.