BOOL CScintillaBibWnd::MarkMatches(LPCSTR lpText) { if (lpText == NULL) return FALSE; ClearBookmarks(); DWORD matches = 0; m_nSearchflags = 0; if (m_WholeWords) m_nSearchflags |= SCFIND_WHOLEWORD; if (m_MatchCase) m_nSearchflags |= SCFIND_MATCHCASE; if (m_RegExpr) m_nSearchflags |= SCFIND_REGEXP; TextToFind tf; int lPos = -1; char* txt = new char[strlen(lpText)+1]; strcpy(txt, lpText); tf.lpstrText = txt; tf.chrg.cpMax = SendMessage(SCI_GETLENGTH, 0, 0); do { tf.chrg.cpMin = lPos+1; lPos = SendMessage(SCI_FINDTEXT, m_nSearchflags, (long)&tf); if (lPos > -1) { int l = SendMessage(SCI_LINEFROMPOSITION, lPos, 0) + 1; AddBookmark(l); matches++; } } while (lPos > -1); delete [] txt; return matches; }
void COXNotesEditView::DeleteNotes() { m_nSide=SIDE_NONE; m_nNotesWidth=0; ClearBookmarks(); RedrawWindow(); }