page up/page down

hey. i'm kindof new at this. but what i'm trying to do is have a lightbared menu which will span across about 5-6 pages. the lightbars possible movements will be up and down.

so for example i'd have

1st selection 2nd selection 3rd selection 4th selection ect. ect.

5 pages down. now i can't seem to get everything working. well i can't get anything working :) i've used lightbars before but i can't get it working under here..

could someone help me out and send me some source code. even if its not lightbared and just a multipage type thing.. just so i can get started :)

cheers!

-- cope!

rdts

Delphi Developer

Wed, 18 Jun 1902 08:00:00 GMT

Re:page up/page down

You need to reprint the list when the user changes page. (you may need CRT unit in pascal)

The 'line-number offset' is stored. When first page is shown, the offset is 0. when the second page is shown, and (assume one page contains 20 lines) the offset is 20. And so on.

To print the third line of the second page: 3 + offset = 3 + 20 = 23 (the 23rd line is printed)

If the user selects the third line on the second page: 3 + offset = 3 + 20 = 23 (the user selects 23)

You need to convert between the 'list item number' and the 'line number on the screen' very often. the correct lines are printed to the screen, and the user's selection is converted into the right item number.

Try to do pencil work with a list of 10 items and a small page of 3 lines. Try to figure out how the numbers changes from one to another.

cope <8e0opk$72...@news.eisa.net.au>...

Quote

>hey. i'm kindof new at this. > but what i'm trying to do is have a lightbared menu which will span >across about 5-6 pages. >the lightbars possible movements will be up and down.

>5 pages down. >now i can't seem to get everything working. well i can't get anything >working :) i've used lightbars before but i can't get it working under >here..

>could someone help me out and send me some source code. even if its not >lightbared and just a multipage type thing.. just so i can get started :)

>cheers!

>-- cope!

Clif Pen

Delphi Developer

Wed, 18 Jun 1902 08:00:00 GMT

Re:page up/page down

Quote

On Mon, 24 Apr 2000 16:16:27 -0000, "cope" <cop...@eisa.net.au> wrote: >hey. i'm kindof new at this. > but what i'm trying to do is have a lightbared menu which will span >across about 5-6 pages. >the lightbars possible movements will be up and down.

>5 pages down. >now i can't seem to get everything working. well i can't get anything >working :) i've used lightbars before but i can't get it working under >here..

>could someone help me out and send me some source code. even if its not >lightbared and just a multipage type thing.. just so i can get started :)

>cheers!

>-- cope!

Program ManyMenus; {Each menu is stored as a record in a file of records which can then be accessed by record number 0.. and displayed. The action to be taken upon selection is identified by the record number and the menu item, whether selected by a highlight bar, numerically or by alphabetical char.

In order to read various numbers of selections on each menu, it is suggested that an array be used within each record all of which are initialized to '' so this can be used as a terminator for that specific menu. Only the simple computer made menus are shown here. The selection method and logic are left to you.}