Update of /cvsroot/anyedit/AnyEditv2
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6889
Modified Files:
AnyEditView.cpp AnyEditView.h
Log Message:
Added MessageBox warning, when find next is back at the starting point of the search.
When find next goes past eof, the status bar is updated.
Index: AnyEditView.h
===================================================================
RCS file: /cvsroot/anyedit/AnyEditv2/AnyEditView.h,v
retrieving revision 1.52
retrieving revision 1.53
diff -C2 -d -r1.52 -r1.53
*** AnyEditView.h 16 Oct 2005 12:01:30 -0000 1.52
--- AnyEditView.h 17 Oct 2005 17:40:24 -0000 1.53
***************
*** 77,80 ****
--- 77,83 ----
int m_ptIncrementalStartPos;
+ // Remember the start position of the find operation.
+ int m_iFindStartPos;
+
void UpdateStatusMessage(void);
bool HandleCommand(UINT nID);
Index: AnyEditView.cpp
===================================================================
RCS file: /cvsroot/anyedit/AnyEditv2/AnyEditView.cpp,v
retrieving revision 1.92
retrieving revision 1.93
diff -C2 -d -r1.92 -r1.93
*** AnyEditView.cpp 16 Oct 2005 12:01:30 -0000 1.92
--- AnyEditView.cpp 17 Oct 2005 17:40:24 -0000 1.93
***************
*** 797,801 ****
void CAnyEditView::OnSearchClearAllBookmarks()
{
! m_Scintilla.ClearBookmarks();
}
--- 797,801 ----
void CAnyEditView::OnSearchClearAllBookmarks()
{
! m_Scintilla.MarkerDeleteAll(SC_BOOKMARK);
}
***************
*** 929,932 ****
--- 929,933 ----
void CAnyEditView::OnSearchFind()
{
+ m_iFindStartPos = m_Scintilla.GetCurrentPos();
CString strFind = m_Scintilla.GetFindString();
CFindDialog fnd(NULL, &m_Scintilla, &strFind);
***************
*** 1451,1457 ****
else
{
- if (nPosFind < nCurrentPos)
- theApp.GetMainFrameWnd()->SetMessageText("Search has reached end of file");
m_Scintilla.SelectionFromTarget();
}
}
--- 1452,1474 ----
else
{
m_Scintilla.SelectionFromTarget();
+ if(nCurrentPos > nPosFind)
+ {
+ theApp.GetMainFrameWnd()->SetMessageText("Search passed the end of file.");
+ if((m_iFindStartPos < nCurrentPos && m_iFindStartPos < nPosFind) ||
+ (m_iFindStartPos > nCurrentPos && m_iFindStartPos > nPosFind))
+ {
+ // Find reached the start of the search.
+ AfxMessageBox("Find reached the start of the search.", MB_ICONINFORMATION|MB_OK);
+ // theApp.GetMainFrameWnd()->SetMessageText("Search has reached end of file");
+ }
+ }
+ else
+ {
+ if(m_iFindStartPos < nPosFind && nCurrentPos < m_iFindStartPos)
+ {
+ AfxMessageBox("Find reached the start of the search.", MB_ICONINFORMATION|MB_OK);
+ }
+ }
}
}
|