Print Page | Close Window

Scrolling

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Syntax Edit
Forum Description: Topics Related to Codejock Syntax Edit
URL: http://forum.codejock.com/forum_posts.asp?TID=6165
Printed Date: 23 November 2024 at 9:12pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Scrolling
Posted By: thodgson
Subject: Scrolling
Date 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 - http://www.ExclamationSoft.com )
Product: Xtreme Toolkit v13.1
Platform: Vista(x64)-SP1
Language: Visual C++ 6.0
Currently: Satisfied w/ Toolkit



Replies:
Posted By: sserge
Date Posted: 19 January 2007 at 4:31pm
try adding:

GetEditCtrl().RecalcScrollBars();


--
WBR,
Serge


Posted By: thodgson
Date 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 - http://www.ExclamationSoft.com )
Product: Xtreme Toolkit v13.1
Platform: Vista(x64)-SP1
Language: Visual C++ 6.0
Currently: Satisfied w/ Toolkit



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net