Recent

Author Topic: Handling of index in ListBox  (Read 2321 times)

winni

  • Hero Member
  • *****
  • Posts: 3197
Re: Handling of index in ListBox
« Reply #15 on: February 21, 2020, 12:16:57 am »
Hi!

Seems you are missing a good Operating System.

Just tested your code with Linux:

No errors, no problems, subitems shown,  back to mainmenue works.

Winni
« Last Edit: February 21, 2020, 12:37:00 am by winni »

howardpc

  • Hero Member
  • *****
  • Posts: 4144
Re: Handling of index in ListBox
« Reply #16 on: February 21, 2020, 01:08:15 am »
Like winni, I can't see any problems with your program, except the lack of a Form1 OnDestroy handler to free your dispSL stringlist.

MaxCuriosus

  • Full Member
  • ***
  • Posts: 136
Re: Handling of index in ListBox
« Reply #17 on: February 21, 2020, 02:11:36 am »
Hi!

Seems you are missing a good Operating System.

Just tested your code with Linux:

No errors, no problems, subitems shown,  back to mainmenue works.

Winni

1) What do you mean by a good Operating System? Debian 9 is not a good O.S?

2) The program has been compiled on a Debian 9 system with Lazarus 2.02 and FPC 3.0.4
 and run on the same computer, and another computer with Debian 9, and with Tails 4.3.
Same anomaly each time.

3) Yes I can go to the sub-menu and come back, but it always return to the first line, regardless of the prior selection in the main menu.

howardpc

  • Hero Member
  • *****
  • Posts: 4144
Re: Handling of index in ListBox
« Reply #18 on: February 21, 2020, 09:51:23 am »
I simplified your app and rewrote it according to what I think you want, as a single unit.
Does this in fact behave as you expect on your OS?

MaxCuriosus

  • Full Member
  • ***
  • Posts: 136
Re: Handling of index in ListBox
« Reply #19 on: February 21, 2020, 06:40:15 pm »
howardpc,

First thank you for simplifying and streamlining my code.

The flow logic for navigating the forms doesn't match the desired behavior,

however,

I've noticed the zeroing of the variable "Key" when parsing the virtual keys in the event handler, and that's the solution to the problem that has been nagging me all along. Now even my initial program works on any platform/configuration.

For good measure I've attached a revised version of your code.

Thank you very much for the time you spent on this issue.

P.S. I suspect that a similar issue could arise when using StringGrids.

 

TinyPortal © 2005-2018