2008-07-04 01:19 UTC
Hello,
I tried to create a search & find function in a form.
I have two textboxes: one single line edit to input the pattern and another textbox as multiline edit for the text which includes the pattern. Because there is not Find-method for textboxes I use Lisp-functions to do that. If the pattern is found the text is selected using SetSel successfully. But unfortunately, the multiline edit won't be scrolled to the line with the selected part when using SetSel. I tried a workaround using GetLineLength, sum up the linelengths until the start character shall be found. But I have the feeling that the sum of linelengths up to the line with the first position of the pattern doesn't match with the returning result of vl-string-search.
What would be the best way to scroll to the correct line of current selection?
Fred
I tried to create a search & find function in a form.
I have two textboxes: one single line edit to input the pattern and another textbox as multiline edit for the text which includes the pattern. Because there is not Find-method for textboxes I use Lisp-functions to do that. If the pattern is found the text is selected using SetSel successfully. But unfortunately, the multiline edit won't be scrolled to the line with the selected part when using SetSel. I tried a workaround using GetLineLength, sum up the linelengths until the start character shall be found. But I have the feeling that the sum of linelengths up to the line with the first position of the pattern doesn't match with the returning result of vl-string-search.
What would be the best way to scroll to the correct line of current selection?
Fred