- if (font && (fontStyle == font->GetStyle()))
- return NULL; // No change
- }
- else if (font) fontStyle = font->GetStyle();
- if (name.Contains("Weight"))
- {
- wxString val = property->GetValue().StringValue();
- fontWeight = wxStringToFontWeight(val);
-
- if (font && (fontWeight == font->GetWeight()))
- return NULL; // No change
- }
- else if (font) fontWeight = font->GetWeight();
-
- if (name.Contains("Underlined"))
- {
- fontUnderlined = property->GetValue().BoolValue();
-
- if (font && (fontUnderlined == font->GetUnderlined()))
- return NULL; // No change
- }
- else if (font) fontUnderlined = font->GetUnderlined();
-
- wxFont *newFont = wxTheFontList->FindOrCreateFont(pointSize, fontFamily, fontStyle, fontWeight, fontUnderlined);
- if (newFont)
- {
- return newFont;
- }
- else
- return NULL;
-}
-
-wxProperty *wxWindowPropertyInfo::GetProperty(wxString& name)
-{
- wxItemResource* resource = wxResourceManager::GetCurrentResourceManager()->FindResourceForWindow(m_propertyWindow);
-
- wxFont *font = & m_propertyWindow->GetFont();
- if (name == "fontPoints" || name == "fontFamily" || name == "fontStyle" || name == "fontWeight" ||
- name == "fontUnderlined")
- return GetFontProperty(name, font);
- else if (name == "name")
- return new wxProperty("name", m_propertyWindow->GetName(), "string");
- else if (name == "title")
- return new wxProperty("title", m_propertyWindow->GetTitle(), "string");
- else if (name == "x")
- {
- return new wxProperty("x", (long)resource->GetX(), "integer");
- }
- else if (name == "y")
- {
- return new wxProperty("y", (long)resource->GetY(), "integer");
- }
- else if (name == "width")
- {
- return new wxProperty("width", (long)resource->GetWidth(), "integer");
- }
- else if (name == "height")
- {
- return new wxProperty("height", (long)resource->GetHeight(), "integer");
- }
- else if (name == "id")
- {
- wxItemResource *resource = wxResourceManager::GetCurrentResourceManager()->FindResourceForWindow(m_propertyWindow);
- if (resource)
+ if (name.Contains("Family"))
+ {
+ wxString val = property->GetValue().StringValue();
+ fontFamily = wxStringToFontFamily(val);
+
+ if (font && (fontFamily == font->GetFamily()))
+ return NULL; // No change
+ }
+ else if (font) fontFamily = font->GetFamily();
+
+ if (name.Contains("Style"))
+ {
+ wxString val = property->GetValue().StringValue();
+ fontStyle = wxStringToFontStyle(val);
+
+ if (font && (fontStyle == font->GetStyle()))
+ return NULL; // No change
+ }
+ else if (font) fontStyle = font->GetStyle();
+ if (name.Contains("Weight"))