Emile Schwarz
2005-06-13 10:25:13 UTC
Hi,
REALbasic 5.5.5
Mac OS X 10.4.1
I do not care to read the last added Row, but after some times using that prart
of the project waiting without 'user feedback', I decided - before lunch today -
to make the last Row visible.
Sorry, I forget one thing: there is a loop who takes a text file, scan its
contents, take the relevant (for me) information and display them (two Columns)
in a ListBox. Before today changes, the only user feedback was the vertical
ScrollBar - at the beginning - who grow (or shrink depending on what part of the
ScrollBar you're looking at) until no change happens. And you wait, wait, wait
(or do something else until the data scan is done).
Now, I can go ahead on 'How do I scroll the ListBox to display the last Row ?'.
In a (far distant) REALbasic version, I do that, but since my archives are not
available, I had to start from the beginning.
Try #1:
-------
My first idea was simple: I know the number of Rows (ListBox.ListCount), the Row
Height (ListBox.DefaultRowHeight), I only have to compute the value:
YPosition = ListBox.ListCount * ListBox.DefaultRowHeight
But this does not works, ListBox.DefaultRowHeight = -1 by default.
Try #2:
-------
No problemo: I only have to use ListBox.TextSize (there can be a small error,
but I can work-around that addind 1 pixel or two to the ListBox.TextSize).
But this does not works, ListBox.TextSize = 0 by default. (here, because I set
zero to be XPlatform compliant).
Try #3:
-------
No problemo: I only have to use 12 - for 12 pixels - (there can be a small
error, but I can work-around that using 13 or 14...).
This does works, but I have to be XPlatform compliant and to add #If Target ...
/ ... #Else and so on... too many bucks for the bang. :(
Try #4:
-------
What if I use a 'by default large' number (in a constant) and pass this value to
ListBox.ScrollPosition ?
As soon as I thank at that, I implemented it.
Result:
Hey, this works fine... but slow down the whole operation (I suspected that, so
this is not a surprise). The scrollbar inside blue object (don't remember the
official name, I call than the 'ascinter' think 'lift') is now located on the
bottom part of the ScrollBar and I see that the Rows are... scrolling to the top.
Try #5:
-------
What about using a ChasingArrows Control in a small window that I open at the
start of the Loop (before For ...) and close at the end of the Loop (after
Next...) ?
NOW THE QUESTION:
What solution did you try ?
[one of the above or one I didn't think at - for the moment - ?]
More information:
The test file size weight 380KB and fills 300 Rows. I do not know the typical
number of generated Rows (lines), but I think that less than 600KB was the
largest (html with embedded JavaScript) source file; that let me think at around
600 Rows (lines).
TIA,
Emile
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>
REALbasic 5.5.5
Mac OS X 10.4.1
I do not care to read the last added Row, but after some times using that prart
of the project waiting without 'user feedback', I decided - before lunch today -
to make the last Row visible.
Sorry, I forget one thing: there is a loop who takes a text file, scan its
contents, take the relevant (for me) information and display them (two Columns)
in a ListBox. Before today changes, the only user feedback was the vertical
ScrollBar - at the beginning - who grow (or shrink depending on what part of the
ScrollBar you're looking at) until no change happens. And you wait, wait, wait
(or do something else until the data scan is done).
Now, I can go ahead on 'How do I scroll the ListBox to display the last Row ?'.
In a (far distant) REALbasic version, I do that, but since my archives are not
available, I had to start from the beginning.
Try #1:
-------
My first idea was simple: I know the number of Rows (ListBox.ListCount), the Row
Height (ListBox.DefaultRowHeight), I only have to compute the value:
YPosition = ListBox.ListCount * ListBox.DefaultRowHeight
But this does not works, ListBox.DefaultRowHeight = -1 by default.
Try #2:
-------
No problemo: I only have to use ListBox.TextSize (there can be a small error,
but I can work-around that addind 1 pixel or two to the ListBox.TextSize).
But this does not works, ListBox.TextSize = 0 by default. (here, because I set
zero to be XPlatform compliant).
Try #3:
-------
No problemo: I only have to use 12 - for 12 pixels - (there can be a small
error, but I can work-around that using 13 or 14...).
This does works, but I have to be XPlatform compliant and to add #If Target ...
/ ... #Else and so on... too many bucks for the bang. :(
Try #4:
-------
What if I use a 'by default large' number (in a constant) and pass this value to
ListBox.ScrollPosition ?
As soon as I thank at that, I implemented it.
Result:
Hey, this works fine... but slow down the whole operation (I suspected that, so
this is not a surprise). The scrollbar inside blue object (don't remember the
official name, I call than the 'ascinter' think 'lift') is now located on the
bottom part of the ScrollBar and I see that the Rows are... scrolling to the top.
Try #5:
-------
What about using a ChasingArrows Control in a small window that I open at the
start of the Loop (before For ...) and close at the end of the Loop (after
Next...) ?
NOW THE QUESTION:
What solution did you try ?
[one of the above or one I didn't think at - for the moment - ?]
More information:
The test file size weight 380KB and fills 300 Rows. I do not know the typical
number of generated Rows (lines), but I think that less than 600KB was the
largest (html with embedded JavaScript) source file; that let me think at around
600 Rows (lines).
TIA,
Emile
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>