@param value
Value of attribute.
+
+ @remarks Setting attribute's value to Null variant will simply remove it
+ from property's set of attributes.
*/
void SetAttribute( const wxString& name, wxVariant value );
Value of attribute.
@param argFlags
Optional. Use wxPG_RECURSE to set the attribute to child properties recursively.
+
+ @remarks Setting attribute's value to Null variant will simply remove it
+ from property's set of attributes.
*/
void SetPropertyAttribute( wxPGPropArg id, const wxString& attrName, wxVariant value, long argFlags = 0 )
{
#endif
}
+ {
+ RT_START_TEST(Attributes)
+
+ wxPGProperty* prop = pgman->GetProperty(wxT("StringProperty"));
+ prop->SetAttribute(wxT("Dummy Attribute"), (long)15);
+
+ if ( prop->GetAttribute(wxT("Dummy Attribute")).GetLong() != 15 )
+ RT_FAILURE();
+
+ prop->SetAttribute(wxT("Dummy Attribute"), wxVariant());
+
+ if ( !prop->GetAttribute(wxT("Dummy Attribute")).IsNull() )
+ RT_FAILURE();
+ }
+
{
wxPropertyGridPage* page1;
wxPropertyGridPage* page2;
// Free old, if any
wxPGHashMapS2P::iterator it = m_map.find(name);
if ( it != m_map.end() )
+ {
((wxVariantData*)it->second)->DecRef();
+ if ( !data )
+ {
+ // If Null variant, just remove from set
+ m_map.erase(it);
+ return;
+ }
+ }
+
if ( data )
+ {
data->IncRef();
- m_map[name] = data;
+ m_map[name] = data;
+ }
}
#endif // wxUSE_PROPGRID