Fixed docview crash bug when On... functions return FALSE.
Fixed valgen.cpp to cope with strings in wxChoice/wxComboBox. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_2_BRANCH@7639 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -214,21 +214,46 @@ bool wxGenericValidator::TransferToWindow(void)
|
||||
if (m_validatorWindow->IsKindOf(CLASSINFO(wxChoice)) )
|
||||
{
|
||||
wxChoice* pControl = (wxChoice*) m_validatorWindow;
|
||||
if (m_pInt)
|
||||
{
|
||||
pControl->SetSelection(*m_pInt) ;
|
||||
return TRUE;
|
||||
}
|
||||
if (m_pInt)
|
||||
{
|
||||
pControl->SetSelection(*m_pInt) ;
|
||||
return TRUE;
|
||||
}
|
||||
else if (m_pString)
|
||||
{
|
||||
if (pControl->FindString(* m_pString) > -1)
|
||||
{
|
||||
pControl->SetStringSelection(* m_pString);
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
} else
|
||||
#endif
|
||||
if (m_validatorWindow->IsKindOf(CLASSINFO(wxComboBox)) )
|
||||
{
|
||||
wxComboBox* pControl = (wxComboBox*) m_validatorWindow;
|
||||
if (m_pInt)
|
||||
{
|
||||
pControl->SetSelection(*m_pInt) ;
|
||||
return TRUE;
|
||||
}
|
||||
else if (m_pString)
|
||||
{
|
||||
if (pControl->FindString(* m_pString) > -1)
|
||||
{
|
||||
pControl->SetStringSelection(* m_pString);
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
} else
|
||||
if (m_validatorWindow->IsKindOf(CLASSINFO(wxStaticText)) )
|
||||
{
|
||||
wxStaticText* pControl = (wxStaticText*) m_validatorWindow;
|
||||
if (m_pString)
|
||||
{
|
||||
pControl->SetLabel(*m_pString) ;
|
||||
return TRUE;
|
||||
}
|
||||
if (m_pString)
|
||||
{
|
||||
pControl->SetLabel(*m_pString) ;
|
||||
return TRUE;
|
||||
}
|
||||
} else
|
||||
if (m_validatorWindow->IsKindOf(CLASSINFO(wxTextCtrl)) )
|
||||
{
|
||||
@@ -395,6 +420,11 @@ bool wxGenericValidator::TransferFromWindow(void)
|
||||
*m_pString = pControl->GetValue() ;
|
||||
return TRUE;
|
||||
}
|
||||
else if (m_pString)
|
||||
{
|
||||
*m_pString = pControl->GetStringSelection();
|
||||
return TRUE;
|
||||
}
|
||||
} else
|
||||
#endif
|
||||
#if wxUSE_CHOICE
|
||||
@@ -406,8 +436,27 @@ bool wxGenericValidator::TransferFromWindow(void)
|
||||
*m_pInt = pControl->GetSelection() ;
|
||||
return TRUE;
|
||||
}
|
||||
else if (m_pString)
|
||||
{
|
||||
*m_pString = pControl->GetStringSelection();
|
||||
return TRUE;
|
||||
}
|
||||
} else
|
||||
#endif
|
||||
if (m_validatorWindow->IsKindOf(CLASSINFO(wxComboBox)) )
|
||||
{
|
||||
wxComboBox* pControl = (wxComboBox*) m_validatorWindow;
|
||||
if (m_pInt)
|
||||
{
|
||||
*m_pInt = pControl->GetSelection() ;
|
||||
return TRUE;
|
||||
}
|
||||
else if (m_pString)
|
||||
{
|
||||
*m_pString = pControl->SetStringSelection(* m_pString);
|
||||
return TRUE;
|
||||
}
|
||||
} else
|
||||
if (m_validatorWindow->IsKindOf(CLASSINFO(wxStaticText)) )
|
||||
{
|
||||
wxStaticText* pControl = (wxStaticText*) m_validatorWindow;
|
||||
|
Reference in New Issue
Block a user