Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Syntax Edit
  New Posts New Posts RSS Feed - Scrolling
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Scrolling

 Post Reply Post Reply
Author
Message
thodgson View Drop Down
Groupie
Groupie


Joined: 11 August 2003
Status: Offline
Points: 78
Post Options Post Options   Thanks (0) Thanks(0)   Quote thodgson Quote  Post ReplyReply Direct Link To This Post Topic: Scrolling
    Posted: 19 January 2007 at 1:49pm
I have a View which is derived from the SyntaxEditorView class.  My class does not have a CDocument associated with it.
 
In the Syntax Editor control, I am loading a different file in the same control when the user changes what they are looking at. 
 
After a file is loaded and text inserted into the control.  I need to scroll to the bottom of the Syntax Editor window after a file is loaded for a "tail"-like behavior for log files.
 
To accomplish this, I have to do the following:
 
 GetEditCtrl().Scroll(0,0);
 GetEditCtrl().SetScrollRange(SB_VERT, 1, 1);
 GetEditCtrl().Scroll(0, pXTPSyntaxEditBufferManager->GetRowCount());
 int nPos = GetEditCtrl().GetScrollPos(SB_VERT);
 GetEditCtrl().GoToRow(nPos);
 GetEditCtrl().Scroll(0, nPos);
 
The problem is that if the previously loaded file is larger than the current file, the control is still retaining some old values that prevent the scrolling from working properly.
 
Perhaps this is a bug...or maybe my code will help someone else out.
 
Tim H(http://www.ExclamationSoft.com)
Product: Xtreme Toolkit v13.1
Platform: Vista(x64)-SP1
Language: Visual C++ 6.0
Currently: Satisfied w/ Toolkit
Back to Top
sserge View Drop Down
Moderator Group
Moderator Group


Joined: 01 December 2004
Status: Offline
Points: 1297
Post Options Post Options   Thanks (0) Thanks(0)   Quote sserge Quote  Post ReplyReply Direct Link To This Post Posted: 19 January 2007 at 4:31pm
try adding:

GetEditCtrl().RecalcScrollBars();


--
WBR,
Serge
Back to Top
thodgson View Drop Down
Groupie
Groupie


Joined: 11 August 2003
Status: Offline
Points: 78
Post Options Post Options   Thanks (0) Thanks(0)   Quote thodgson Quote  Post ReplyReply Direct Link To This Post Posted: 20 January 2007 at 9:43am
Adding that seems to have no affect.
 
Not sure how that would allow me to scroll the the last line (bottom) of the file/document.
Tim H(http://www.ExclamationSoft.com)
Product: Xtreme Toolkit v13.1
Platform: Vista(x64)-SP1
Language: Visual C++ 6.0
Currently: Satisfied w/ Toolkit
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.219 seconds.