+ wxStaticText* itemWindow = (wxStaticText*) m_propertyWindow;
+ if (name == "label")
+ {
+ // Because setting a wxStaticText control's label may change the
+ // size, we must get the size and instantiate the resource immediately.
+ itemWindow->SetLabel(property->GetValue().StringValue());
+ int w, h;
+
+ wxItemResource *resource = wxResourceManager::GetCurrentResourceManager()->FindResourceForWindow(itemWindow);
+
+ m_propertyWindow->GetSize(&w, &h);
+ // m_propertyWindow->GetPosition(&x, &y);
+
+ // We need to convert to dialog units if
+ // the parent resource specifies dialog units.
+ if (m_propertyWindow->GetParent())
+ {
+ wxItemResource* parentResource = wxResourceManager::GetCurrentResourceManager()->FindResourceForWindow(m_propertyWindow->GetParent());
+ if (parentResource->GetResourceStyle() & wxRESOURCE_DIALOG_UNITS)
+ {
+ // wxPoint pt = m_propertyWindow->GetParent()->ConvertPixelsToDialog(wxPoint(x, y));
+ // x = pt.x; y = pt.y;
+ wxSize sz = m_propertyWindow->GetParent()->ConvertPixelsToDialog(wxSize(w, h));
+ w = sz.x; h = sz.y;
+ }
+ }
+ resource->SetSize(resource->GetX(), resource->GetY(), w, h);
+ return TRUE;
+ }
+ else
+ return wxItemPropertyInfo::SetProperty(name, property);