Forum > Beginners

Getting stuff from a ListBox and doing stuff with it

(1/3) > >>

Mighty gods of Pascal, I entreat thee:

My program is entirely based around a large TPageControl that flicks between different screens.  There is a certain feature which, when activated, means I need to 'breadcrumb' the screens the user clicks on so that I can then cycle backwards between them, going backwards in the same order that the user clicked on them.  I've successfully created an invisible ListBox to store the names of the Tabsheets the user has clicked through when this feature is active.  I cannot for the life of me work out how I then read the contents of the ListBox and pass that onto the TPageControl, to actually make the pages move.  My best attempt is the following, which probably evokes feelings of pity and mild cuteness in mighty gods such as Thee:  :D

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---MainScreen.ActivePage:=CumuHistory.Items[CumuHistory.items.count];
Anyway, with that embarrassing attempt out of the way,  :-[ how do I actually do it?

I am burning incense in front of graven images of you all, in eternal gratitude.

Wouldn't it be easier to store ActivePageIndex in an array in the OnChange event handler? Then you can traverse the array from bottom to top, setting ActivePageIndex (or PageIndex) from it, to "walk-back" the user actions.

I knew someone was going to say that....  :D um.... then I'd.... uh.... have to learn how to use arrays.   :-[

And I'd probably still have the same questions at the end of it to be honest.  At least I can make the ListBox temporarily visible so I can see what it's doing, too....

My total programming experience before Pascal was in HyperCard and I guess I still think like a HyperCard programmer.   :-[

OK, gimme a little time and I'll write a small example ;)



[0] Message Index

[#] Next page

Go to full version