summaryrefslogtreecommitdiff
path: root/plugins/NewStory/src/history_dlg.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/NewStory/src/history_dlg.cpp')
-rw-r--r--plugins/NewStory/src/history_dlg.cpp22
1 files changed, 20 insertions, 2 deletions
diff --git a/plugins/NewStory/src/history_dlg.cpp b/plugins/NewStory/src/history_dlg.cpp
index db0e55c4dc..b06f408865 100644
--- a/plugins/NewStory/src/history_dlg.cpp
+++ b/plugins/NewStory/src/history_dlg.cpp
@@ -541,7 +541,15 @@ public:
DoGlobalSearch();
}
- m_histWindow.SendMsg(NSM_FINDNEXT, ptrW(edtSearchText.GetText()), 0);
+ int iOldCaret = m_histCtrl->caret;
+ int res = m_histCtrl->FindNext(ptrW(edtSearchText.GetText()));
+ if (res == -1)
+ SetWindowTextW(m_hwndStatus, TranslateT("No more occuurences found"));
+ else if (res < iOldCaret)
+ SetWindowTextW(m_hwndStatus, TranslateT("Passed the end of history"));
+ else
+ SetWindowTextW(m_hwndStatus, L"");
+
return false;
}
@@ -849,7 +857,14 @@ public:
void onClick_FindPrev(CCtrlButton *)
{
- m_histWindow.SendMsg(NSM_FINDPREV, ptrW(edtSearchText.GetText()), 0);
+ int iOldCaret = m_histCtrl->caret;
+ int res = m_histCtrl->FindPrev(ptrW(edtSearchText.GetText()));
+ if (res == -1)
+ SetWindowTextW(m_hwndStatus, TranslateT("No more occuurences found"));
+ else if (res > iOldCaret)
+ SetWindowTextW(m_hwndStatus, TranslateT("Passed the beginning of history"));
+ else
+ SetWindowTextW(m_hwndStatus, L"");
}
void onClick_Message(CCtrlButton *)
@@ -930,6 +945,9 @@ public:
case HOTKEY_SEEK_BACK:
btnFindPrev.Click();
break;
+ case HOTKEY_SEARCH:
+ btnSearch.Click();
+ break;
}
switch (msg) {