Used specialized template functions to assign wxColour and wxFont to wxVariant

This commit is contained in:
Artur Wieczorek 2019-07-07 23:14:36 +02:00
parent 0b27a66700
commit 21f9329836
2 changed files with 6 additions and 10 deletions

View File

@ -155,7 +155,7 @@ void wxFontDataProperty::RefreshChildren()
if ( GetChildCount() < 6 ) // Number is count of wxFontProperty's children + 1.
return;
wxFontData fontData; fontData << m_value_wxFontData;
wxVariant variant; variant << fontData.GetColour();
wxVariant variant = WXVARIANT(fontData.GetColour());
Item(6)->SetValue( variant );
}

View File

@ -645,7 +645,7 @@ void wxFontProperty::OnSetValue()
if ( !font.IsOk() )
{
m_value << *wxNORMAL_FONT;
m_value = WXVARIANT(*wxNORMAL_FONT);
}
}
@ -744,8 +744,7 @@ wxVariant wxFontProperty::ChildChanged( wxVariant& thisValue,
font.SetFamily( static_cast<wxFontFamily>(fam) );
}
wxVariant newVariant;
newVariant << font;
wxVariant newVariant = WXVARIANT(font);
return newVariant;
}
@ -1022,7 +1021,7 @@ void wxSystemColourProperty::OnSetValue()
if ( m_value.IsType(wxS("wxColour*")) )
{
wxColour* pCol = wxStaticCast(m_value.GetWxObjectPtr(), wxColour);
m_value << *pCol;
m_value = WXVARIANT(*pCol);
}
wxColourPropertyValue val = GetVal(&m_value);
@ -1638,9 +1637,7 @@ void wxColourProperty::Init( wxColour colour )
{
if ( !colour.IsOk() )
colour = *wxWHITE;
wxVariant variant;
variant << colour;
m_value = variant;
m_value = WXVARIANT(colour);
int ind = ColToInd(colour);
if ( ind < 0 )
ind = m_choices.GetCount() - 1;
@ -1666,8 +1663,7 @@ wxColour wxColourProperty::GetColour( int index ) const
wxVariant wxColourProperty::DoTranslateVal( wxColourPropertyValue& v ) const
{
wxVariant variant;
variant << v.m_colour;
wxVariant variant = WXVARIANT(v.m_colour);
return variant;
}