| Код | TSearchTypes st; TFindDialog *cd; int newpos;
if ((cd = dynamic_cast<TFindDialog *> (Sender)) == 0) MessageBox(NULL, "Dynamic Cast Failed!", "Find/Rep", MB_OK);
if (cd->Options.Contains(frMatchCase)) st << stMatchCase; if (cd->Options.Contains(frWholeWord)) st << stWholeWord;
if (RichEdit1->SelLength) RichEdit1->SelStart += 1;
newpos = RichEdit1->FindText(cd->FindText, RichEdit1->SelStart, RichEdit1->Text.Length(), st);
if (newpos != -1) { RichEdit1->SelStart = newpos; RichEdit1->SelLength = cd->FindText.Length(); } else { MessageBox(NULL, "End of document reached.", "Find/Rep", MB_OK); RichEdit1->SelStart = 0; }
|
Вот код для поиска.... но в нем есть один существенный недостаток - модификатор направления поиска не работает... (поиск только сверху-вниз)... Помогите доработать |