<< Return to Main Index

< Return to Class Index

CGXStyle::IsSubSet

virtual BOOL IsSubSet(const CGXStyle& styleSubSet) const;

styleSubSet

Reference to the style which is checked to determine if it is a subset of the current style.

Return Value

TRUE if the specified style is a subset of this style.

Remarks

Checks each attribute included in styleSubSet to determine if it is included in the current style and the settings are equal.

Take the following style as an example:

   CGXStyle style;
   style.SetValue("xxx").SetTextColor(RGB(255,0,0));

·The following expression always returns TRUE, because an empty style is always a subset of another style:

   BOOL b = style.IsSubSet( CGXStyle() );

·The next expression also returns TRUE, because both styles are equal:

   BOOL b = style.IsSubSet( style );

·The next expression is also TRUE:

   BOOL b = style.IsSubSet( CGXStyle().SetValue("xxx") );

·The next expression is FALSE, because style has no horizontal alignment included:

   BOOL b = style.IsSubSet( CGXStyle().SetHorizontalAlignment(DT_LEFT) );

·The next expression is FALSE, because value is different:

   BOOL b = style.IsSubSet( CGXStyle().SetValue("yyy") );

Control-Factory Specific ->

This method has been implemented using the abstraction mechanism as discussed in the chapter "Reducing the size of your application" in the user's guide. A call to the CGXStyle::ImplementCompareSubset method from within the control factory class' InitializeApplicationComponents method will make the concrete implementation of this method available to your application.

If no concrete implementation is available this method returns FALSE. A warning will be displayed in the debug window.

END Control-Factory Specific

See Also

CGXStyle::ChangeStyle CGXFont::IsSubSet

CGXStyle

Class Overview | Class Members