Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS General Discussion » Have an "intersection" option when combining CExtPropertyStore's, so only properties in all stores a Collapse All
Subject Author Date
Malcolm D Jul 11, 2007 - 7:10 PM

Looking at the CExtPropertyStore which I am going to start using, it would be good if we have the option of combining other property stores in an "intersection" type operation instead of a "union" type operation. (I uses terms from "Set Theory" - if you are familir then I think it should give you the idea straight away. Another way to express it is using "AND" instead of "OR", where OR gives a Union, )

What I mean is this. When you combine two (or more) stores, all the properties get added and put in a "mix" property, even if the property only exists in one of the stores. This is what I call the "union" behaviour - the properties shown in the window are those from any on the stores.( items only in this store OR that store)
Another behaviour I would like is to have an intersection, so only if the property exists in all the combined store does i get displayed in the combination store. (items only in this store AND that store)

Thanks

Suhai Gyorgy Jul 12, 2007 - 12:40 PM

Here’s Support’s answer to this question from Dec of 2006:

We have just added a CExtPropertyItem::AdjustIntersection() method which implements this feature. Here is how it works. For example, you have n objects and some properties are present in all n objects and some other properties are not. If you select these objects and want to display the combined properties in the property grid, then the new method allows you to exclude the properties that are not common to all objects and display only the common properties, i.e. the properties common to all objects. So if you have n objects with k properties and only 1 property is common, only this one property will be displayed in the grid. Please note that AdjustIntersection() takes a parameter (nIntersectionItemCount) that in most cases should be set to the number of objects (combined property stores) and in this case the method will leave only the properties common to all objects (property stores). You can set some m less than <n in this parameter if you want to display properties that are common only to m objects but although it may be useful in some cases, it would implement the idea of non-strict intersection.

So it is really easy to use it. For example, you have three objects selected in the design area. First, create a combined property store which is merged from the three source property stores corresponding to the objects. Secondly, invoke pCombinedPropertyStore->AdjustIntersection( 3 ) for the combined property store to remove all the mixed property values which are absent in all the three source property stores.

Malcolm D Jul 12, 2007 - 6:08 PM

Thanks

Looking at the code, it looks like it does what I want.