+ wxItemResource *resource = wxResourceManager::GetCurrentResourceManager()->FindResourceForWindow(m_propertyWindow);
+ if (resource)
+ {
+ wxString value = property->GetValue().StringValue();
+
+ wxString strName = value.Before('=');
+ wxString strId = value.After('=');
+ int id = atoi(strId);
+
+ wxString oldSymbolName = wxResourceManager::GetCurrentResourceManager()->GetSymbolTable().GetSymbolForId(resource->GetId());
+ int oldSymbolId = resource->GetId();
+
+ if (strName != "")
+ {
+ // If we change the id for an existing symbol, we need to:
+ // 1) Check if there are any other resources currently using the original id.
+ // If so, will need to change their id to the new id.
+ // 2) Remove the old symbol, add the new symbol.
+ // In this check, we don't have to do this, but we need to do it in SetProperty.
+
+ if (strName == oldSymbolName && id != oldSymbolId)
+ {
+ wxASSERT( (!wxResourceManager::GetCurrentResourceManager()->GetSymbolTable().IsStandardSymbol(oldSymbolName)) );
+
+ // It's OK to change just the id. But we'll need to change all matching ids in all resources,
+ // because ids are unique and changing one resource's id must change all identical ones.
+ wxResourceManager::GetCurrentResourceManager()->ChangeIds(oldSymbolId, id);
+
+ wxResourceManager::GetCurrentResourceManager()->GetSymbolTable().RemoveSymbol(oldSymbolName);
+ wxResourceManager::GetCurrentResourceManager()->GetSymbolTable().AddSymbol(strName, id);
+ }
+
+ // If we change the name but not the id, we'll just need to remove and
+ // re-add the symbol/id pair.
+ if (strName != oldSymbolName && id == oldSymbolId)
+ {
+ wxASSERT( (!wxResourceManager::GetCurrentResourceManager()->GetSymbolTable().IsStandardSymbol(oldSymbolName)) );
+
+ wxResourceManager::GetCurrentResourceManager()->GetSymbolTable().RemoveSymbol(oldSymbolName);
+
+ if (!wxResourceManager::GetCurrentResourceManager()->GetSymbolTable().SymbolExists(strName))
+ {
+ wxResourceManager::GetCurrentResourceManager()->GetSymbolTable().AddSymbol(strName, id);
+ }
+ }
+
+ // What if we're changing both the name and the id?
+ // - if there's no symbol of that name, just remove the old, add the new (in SetProperty)
+ // - if there is a symbol of that name, if id matches, do nothing. If not, veto.
+
+ if (strName != oldSymbolName && id != oldSymbolId)
+ {
+ // Remove old symbol if it's not being used
+ if (!wxResourceManager::GetCurrentResourceManager()->IsSymbolUsed(resource, oldSymbolId) &&
+ !wxResourceManager::GetCurrentResourceManager()->GetSymbolTable().IsStandardSymbol(oldSymbolName))
+ {
+ wxResourceManager::GetCurrentResourceManager()->GetSymbolTable().RemoveSymbol(oldSymbolName);
+ }
+
+ if (!wxResourceManager::GetCurrentResourceManager()->GetSymbolTable().SymbolExists(strName))
+ {
+ wxResourceManager::GetCurrentResourceManager()->GetSymbolTable().AddSymbol(strName, id);
+ }
+ }
+ resource->SetId(id);
+ }
+
+ return TRUE;
+ }
+ else
+ return FALSE;
+ }
+ else if (name == "border")
+ {
+ long borderStyle = wxNO_BORDER;
+ wxString val = property->GetValue().StringValue();
+
+ if (val == "wxSIMPLE_BORDER")
+ borderStyle = wxSIMPLE_BORDER;
+ else if (val == "wxRAISED_BORDER")
+ borderStyle = wxRAISED_BORDER;
+ else if (val == "wxSUNKEN_BORDER")
+ borderStyle = wxSUNKEN_BORDER;
+ else if (val == "wxDOUBLE_BORDER")
+ borderStyle = wxDOUBLE_BORDER;
+ else if (val == "wxSTATIC_BORDER")
+ borderStyle = wxSTATIC_BORDER;
+ else
+ borderStyle = wxNO_BORDER;
+
+ SetWindowStyle(m_propertyWindow, wxSIMPLE_BORDER, FALSE);
+ SetWindowStyle(m_propertyWindow, wxRAISED_BORDER, FALSE);
+ SetWindowStyle(m_propertyWindow, wxSUNKEN_BORDER, FALSE);
+ SetWindowStyle(m_propertyWindow, wxDOUBLE_BORDER, FALSE);
+ SetWindowStyle(m_propertyWindow, wxSTATIC_BORDER, FALSE);
+ SetWindowStyle(m_propertyWindow, wxNO_BORDER, FALSE);
+
+ SetWindowStyle(m_propertyWindow, borderStyle, TRUE);
+
+ wxItemResource *resource = wxResourceManager::GetCurrentResourceManager()->FindResourceForWindow(m_propertyWindow);
+ resource->SetStyle(m_propertyWindow->GetWindowStyleFlag());