Another WPTools4 to WPTools5 question

  • Hello again,

    I'm now very nearly done upgrading to WPTools5 and WPForm 2.50. Man what a huge task this has been! Please never never again make such huge changes to the design!!

    I have yet another (small) problem that hopefully has an easy work-around?

    In WPTools4 I had code like this:

    self.WPRichText1.TopOffset := self.WPRichText1.ActiveLine^.y_start;

    This was used to display the active line as the first visible line in the control. I used the code in conjunction with bookmarks to jump around in the text.

    How can I do the same thing in WPTools5?

    Regards,
    Erik

    • Offizieller Beitrag

    Hi,

    >>I'm now very nearly done upgrading to WPTools5 and WPForm 2.50. Man what a huge task this has been! Please never never again make such huge changes to the design!! <<
    I could have sticked with the old design, but then you won't have the seperation of data/view, the true paragraph styles, the paragraph objects, the WYSIWYG editable header/footer, different page sizes in one document, fast zooming etc. That would have been a lot cheaper for me - but I will of course update software architecture which does not meet the demands in future, too. Well, WPTools 5 was a rewrite -

    >>I have yet another (small) problem that hopefully has an easy work-around?

    In WPTools4 I had code like this:

    self.WPRichText1.TopOffset := self.WPRichText1.ActiveLine^.y_start;

    This was used to display the active line as the first visible line in the control. I used the code in conjunction with bookmarks to jump around in the text.

    How can I do the same thing in WPTools5? <<

    Position the cursor on the bookmark (BookmarkMoveTo) and then call ShowCursor.

    The above code does not work at all in V5 since the lines are just an array with start/end markers, not position records as in V4. V5 can place a line on several pages (the same line!) - this is done with header/footer rows for example.

    Regards,

    Julian

  • Thanks, but your solution is not quite good enough for me because I want the bookmark line to be the topmost visible line.

    If I first position the cursor at the bottom on the document and then issue a BookmarkMoveTo before calling ShowCursor then the result is very near to what I want and a perfectly fine solution for me.

    Regards,
    Erik