Display of found object disappears
Copy link to clipboard
Copied
Dear experts,
My FindSomething function is quite successful. The found objects are always selected and hence I have a visible clue what was found. Three objects, however loose their selection as soon as the button function is left:
- Automatic Hyphen: the cursor is just behind it (UI selects the hyphen)
- Object style override: I do not see what is the object (UI selects the object: frame, graphic)
- Object Style tag (UI selects the object: frame, graphic)
KLD_F.ButtonFind = function () { // =========================
var oTR, iFindType, iFS, iFV, iMode, sSearch, bWord, bCase, bBack;
// ...
$.bp(true);
oTR = KLD_F.FindSomething (iFS, iFV, sSearch, iMode, bWord, bCase, bBack);
if (oTR == undefined) {
alert ("Object not found");
return;
}
} //--- end of ButtonFind -----------------------------------
When stepping through the function the selection disappears as soon as I reach the last line.
What happens here?
Additional observations for AutoHyphen (2020-12-10 12:43)
- The cursor at the location after the found for AutoHyphen does not blink. It blinks only after a screen refresh (CTRL+l).
- The reported oTR.beg.offset is the same as oTR.end.offset. When reducing the beg.offset to be one and then setting the TextSelection to this modifies oTR also the character before the AutoHyphen is selected.
Copy link to clipboard
Copied
For the 'non-indication of the automatic hyphen I have found a solution:
At the end of the find process - before leaving function ButtonFind - I issue a KB command "SelectPreviousCharacter". This makes the hyphen visible.
I have however not the tiniest idea how to handle the situation for a found Object tag or a found Object style override. Although I get a valid TextRange, its components are invalid:
- The Find process scrolls to the object (page), but I do not see the cursor nor anything selected.
- How does the standard UI handle this?
- Object Tag and Object style override are not handled in the FDK documentation (FM15, FM-16). So I can not get any information on this …
Any input is highly welcome!

