trichview.support
Re: automatic scrolling puts the richview into view |
Author |
Message |
Michel Lefebvre |
Posted: 11/22/2004 18:56:04 I have had a problem quite similar to yours : the RVEdit being part of a larger frame (in which it is always fully "visible"), the parent frame having with its own scrollbars. I agree that the default behaviour is then particularly annoying. I have solved this as follows : In the parent scrolling frame, I have overloaded the AutoScrollInView method, so that when argument AControl is the RVEdit it applies a particular processing instead of the ihnerited one. This particular processing consists in getting the caret coordinates within the RVEdit, and scrolling the Parent window only as necessary to keep the caret visible. Note: to get optimal comfort, I also introduced top and bottom scrolling thresholds, corresponding approximately to the height of 3 text lines. This is ok when the caret move is initiated by an arrow key. But it should be disabled (set to 0) in case caret move is initiated by a mouse click (test "csLButtonDown in ActiveControl.ControlState"), otherwise it can cause an undesirable Extend-Selection effect. Of course, all this implies that the internal layout of this "parent frame" always ensures that the RVEdit is fully visible at this level. In my case, the layout is done by adusting the height or the RVE to DocumentHeight (plus some extra, to avoid transcient scrolling effects), after each change of the RVE content. Hope this will help. Best regards, ML "Daniel Zimmerman" <[email protected]> a �crit dans le message news: > I have a TRichViewEdit on a form with scroll bars, and the richviewedit is > only partially visible on the form (ie, it's in the part of the form that > can be reached by scrolling down. > > When i click inside the richviewedit, the form automatically scrolls to > display the entire richviewedit. > > How can i turn this off, so that it doesn't scroll? It actually causes > considerable annoyance in my application, because the effect for the user > is that the UI jumps around unexpectedly. > > Thanks in advance, > Daniel |
Powered by ABC Amber Outlook Express Converter