// quick check, if no key value is specified then there's not much to do...
//
UpdateData(DIALOG_TO_DATA);
if(m_strFindKey.IsEmpty())
{
ErrorBox("Empty FIND <key>!\n\n(This is only permitted for FIND, not replace, for safety reasons)");
}
else
{
if(!m_strFindValue.IsEmpty()||GetYesNo(va("Empty FIND <value> means replace any existing ( & non-blank ) <value> for <key> \"%s\"\n\nProceed?",(LPCSTR)m_strFindKey)))
{
// another check, if they're trying to do a replace with a missing replace key, it'll just delete found keys...
//
if((!m_strReplaceKey.IsEmpty()&&!m_strReplaceValue.IsEmpty())||GetYesNo(va("Empty REPLACE <key> or <value> fields will just delete all occurence of <key> \"%s\"\n\nProceed?",m_strFindKey)))
{
if(GetYesNo("Sure?"))
{
CopyFields();
EndDialog(ID_RET_REPLACE);
}
}
}
}
}
voidCEntKeyFindReplace::OnFind()
{
// quick check, if no key value is specified then there's not much to do...
// if (m_strFindKey.IsEmpty() && m_bSelectAllMatchingEnts)
// {
// if (GetYesNo("Warning! Having a blank FIND <key> and ticking \"Select all matching ents\" can take a LONG time to do (and is probably a wrong choice anyway?)\n\nProceed?"))