Use wxVariant::IsType() function to check the type of variant values in propgrid sample.
Use this dedicated function to check the type of variant value instead of calling wxVariant::GetType() function and performing explicit comparisons of returned string.
This commit is contained in:
@@ -2989,7 +2989,7 @@ void FormMain::OnMisc ( wxCommandEvent& event )
|
|||||||
}
|
}
|
||||||
else if ( id == ID_SETVALUES )
|
else if ( id == ID_SETVALUES )
|
||||||
{
|
{
|
||||||
if ( m_storedValues.GetType() == wxT("list") )
|
if ( m_storedValues.IsType(wxT("list")) )
|
||||||
{
|
{
|
||||||
m_pPropGridManager->GetGrid()->SetPropertyValues(m_storedValues);
|
m_pPropGridManager->GetGrid()->SetPropertyValues(m_storedValues);
|
||||||
}
|
}
|
||||||
|
@@ -77,9 +77,9 @@ wxFontDataProperty::~wxFontDataProperty () { }
|
|||||||
|
|
||||||
void wxFontDataProperty::OnSetValue()
|
void wxFontDataProperty::OnSetValue()
|
||||||
{
|
{
|
||||||
if ( m_value.GetType() != wxT("wxFontData") )
|
if ( !m_value.IsType(wxT("wxFontData")) )
|
||||||
{
|
{
|
||||||
if ( m_value.GetType() == wxT("wxFont") )
|
if ( m_value.IsType(wxT("wxFont")) )
|
||||||
{
|
{
|
||||||
wxFont font;
|
wxFont font;
|
||||||
font << m_value;
|
font << m_value;
|
||||||
|
Reference in New Issue
Block a user