Print Page | Close Window

CXTPPropertyGridInplaceList - derivation.

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=3009
Printed Date: 22 November 2024 at 4:12am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: CXTPPropertyGridInplaceList - derivation.
Posted By: Kevin6
Subject: CXTPPropertyGridInplaceList - derivation.
Date Posted: 05 October 2005 at 7:35am

Oleg,

I would like to be able to customise some of the functionality of the ListBox control in the PropertyGrid.

I do not understand how I am supposed to do this as the class construction makes this difficult to understand.

There are no examples that I can find in the Samples to help me with this.

I would appreciate some advice.

regards

Richard



-------------
Kevin.



Replies:
Posted By: Oleg
Date Posted: 05 October 2005 at 8:05am

in 9.80 was added CXTPPropertyGrid::SetInplaceList to set custom inplace list

m_wndGrid.SetInplaceList (new CMyInplaceList);

 



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


Posted By: Kevin6
Date Posted: 05 October 2005 at 8:30am

Dear Oleg,

 As ever many thanks for your reply - I am able to continue with my development.

I have search for -: SetInplaceList

in the help/documentation but it is not documented. Please can you add it to the documentation list.

regards

Richard

ps. I am using ver 9.70



-------------
Kevin.


Posted By: Cedric
Date Posted: 25 January 2006 at 5:36am

Hye. I tried to inherit CTXPropertyGridInplaceList, to draw something different than text. drawing of GridItem is fine. But when I to show my InplaceList when AddString message is occur i got an execption error.

Where I'm wrong ?

I join a sample with my problem

https://forum.codejock.com/uploads/Cedric/2006-01-25_053544_GridSample.zip - 2006-01-25_053544_GridSample.zip

PS: My Item is "Style" in global setting and I worked with 9.80



Posted By: Oleg
Date Posted: 25 January 2006 at 9:31am

Standard List created with LBS_STRING style.

I suggest you to change logic something like:

CStyleItem::CStyleItem( CString _Caption )
 : CXTPPropertyGridItem( _Caption )
{
 m_nFlags = xtpGridItemHasComboButton;
 m_StyleList.m_pItem = this;

 //SOLID epaisseur 1 a cause du system NT
 AddStyleItem(PS_SOLID,1);
 
 //Traits exotiques

 AddStyleItem( PS_DOT, 2 );
 AddStyleItem( PS_DASH, 2 );
 AddStyleItem( PS_DASHDOT, 2 );
 AddStyleItem( PS_DASHDOTDOT, 2 );

 //Ajouter les épaisseurs "SOLID" >1
 AddStyleItem( PS_SOLID, 2 );
 AddStyleItem( PS_SOLID, 3 );
 AddStyleItem( PS_SOLID, 4 );
 AddStyleItem( PS_SOLID, 5 );
 AddStyleItem( PS_SOLID, 7 );
 AddStyleItem( PS_SOLID, 9 );
 AddStyleItem( PS_SOLID, 11 );
}

void CStyleItem::AddStyleItem(int style,int epaisseur)
{
 // add a listbox item
 DWORD stockval = MAKELONG((style & PS_STYLE_MASK)|PS_GEOMETRIC, epaisseur);
 GetConstraints()->AddConstraint(_T("Item"), stockval);
}

to move items to constraints of Items.

and drawing:

void CStyleItemList::DrawItem ( LPDRAWITEMSTRUCT lpDrawItemStruct )
{
 CDC* pDC = CDC::FromHandle(lpDrawItemStruct->hDC);
 CXTPPropertyGridItemConstraint* p = (CXTPPropertyGridItemConstraint*)lpDrawItemStruct->itemDa ta;
 DWORD a = p->m_dwData;

 



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


Posted By: Cedric
Date Posted: 26 January 2006 at 3:32am
Thanks it's worked.



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