Fixed Find bugs, found one more
All three bugs in the previous posting are now fixed. The Find functionality appears to be working pretty well, with the exception of one new bug which has emerged:
When a search hit is found in an annotation title, it often seems to stick on that ann title and not move on when Find is pressed again; it's as if if fails to get the next container correctly, and searches again within the same container. The reason for this is that the code which determines where the cursor is currently located (GetCursorLocation
), which is called to find out where to start searching from, cannot yet tell where the focus last was; it can't just ask which form has focus, because obviously what has the focus is the Search form itself, which has invoked the Find action. Therefore, currently, it just checks to see which windows are visible, and if the teiHeader window is visible, it assumes that one had the focus. Of course, if searching has been done, that's not necessarily the case; it may just have been left open. But if so, it always starts the search from that container, working forward, and therefore always finds the same hit if the hit is in an annotation title.
Currently working on a solution.