Recent

Author Topic: [SOLVED] ListBox ItemIndex does not deselect previous selection  (Read 4061 times)

VTwin

  • Hero Member
  • *****
  • Posts: 841
  • Former Turbo Pascal 3 user
[SOLVED] ListBox ItemIndex does not deselect previous selection
« on: December 03, 2018, 11:10:43 pm »
Setting ListBox ItemIndex does not deselect the previous selection, when MultiSelect = false. Project attached.

I'd appreciate a confirmation before posting a bug report.

Thanks,
VTwin
« Last Edit: December 11, 2018, 09:38:08 pm by VTwin »
“Talk is cheap. Show me the code.” -Linus Torvalds

macOS 10.13.6: Lazarus 2.0.7 fixes svn r62562 (64 bit Cocoa)
Ubuntu 18.04.3: Lazarus 2.0.6 (64 bit on VBox)
Windows 7 Pro SP1: Lazarus 2.0.6 (64 bit on VBox)
fpc 3.0.4

Hansaplast

  • Hero Member
  • *****
  • Posts: 570
  • Tweaking4All.com
    • Tweaking4All
Re: ListBox ItemIndex does not deselect previous selection
« Reply #1 on: December 03, 2018, 11:21:16 pm »
Just compiled and tested your example project.
It works correctly on my Mac, setting ItemIndex does correctly deselects previous selected row.


I'm running Lazarus from trunk (Lazarus 2.1.0 r59719 FPC 3.0.4 x86_64-darwin-cocoa (alpha), macOS 10.14.1).

sash

  • Sr. Member
  • ****
  • Posts: 325
Re: ListBox ItemIndex does not deselect previous selection
« Reply #2 on: December 03, 2018, 11:33:23 pm »
Linux gtk2, xfce. Works as intended.
Lazarus 2.0.6 FPC 3.0.4 x86_64-linux-gtk2 @ Ubuntu 19.10 XFCE

VTwin

  • Hero Member
  • *****
  • Posts: 841
  • Former Turbo Pascal 3 user
Re: ListBox ItemIndex does not deselect previous selection
« Reply #3 on: December 04, 2018, 07:09:17 pm »
Many thanks! Apparently the fix has been made. I was using the latest 2.0 svn. I just checked the 2.1 trunk and, yes it does work. No need to report it. 

I need to build cocoa applications and want the latest stable version, with cocoa fixes. Can anyone explain at what point cocoa fixes are merged? Once the stable 2.0 is released will cocoa fixes be available by svn?



« Last Edit: December 04, 2018, 07:11:39 pm by VTwin »
“Talk is cheap. Show me the code.” -Linus Torvalds

macOS 10.13.6: Lazarus 2.0.7 fixes svn r62562 (64 bit Cocoa)
Ubuntu 18.04.3: Lazarus 2.0.6 (64 bit on VBox)
Windows 7 Pro SP1: Lazarus 2.0.6 (64 bit on VBox)
fpc 3.0.4

VTwin

  • Hero Member
  • *****
  • Posts: 841
  • Former Turbo Pascal 3 user
Re: ListBox ItemIndex does not deselect previous selection
« Reply #4 on: December 04, 2018, 07:35:46 pm »
@Hansaplast

I just tried updating 2.1 to 59727 and it fails. Have you tried?

Code: Pascal  [Select]
  1. /Developer/laz_trunk/packager/fppkghelper.pas(131,19) Error: (5000) Identifier not found "FFPpkg"
  2. /Developer/laz_trunk/packager/fppkghelper.pas(131,51) Error: (5000) Identifier not found "pkgpkInstalled"
  3. /Developer/laz_trunk/packager/fppkghelper.pas(132,26) Error: (5038) identifier idents no member "PackagesStructure"
  4. fppkghelper.pas(138) Fatal: (10026) There were 3 errors compiling module, stopping
  5. Fatal: (1018) Compilation aborted
  6. make[2]: *** [lazbuild] Error 1
  7. make[1]: *** [lazbuilder] Error 2
  8. make: *** [lazbuild] Error 2
« Last Edit: December 04, 2018, 07:40:01 pm by VTwin »
“Talk is cheap. Show me the code.” -Linus Torvalds

macOS 10.13.6: Lazarus 2.0.7 fixes svn r62562 (64 bit Cocoa)
Ubuntu 18.04.3: Lazarus 2.0.6 (64 bit on VBox)
Windows 7 Pro SP1: Lazarus 2.0.6 (64 bit on VBox)
fpc 3.0.4

Hansaplast

  • Hero Member
  • *****
  • Posts: 570
  • Tweaking4All.com
    • Tweaking4All
Re: ListBox ItemIndex does not deselect previous selection
« Reply #5 on: December 04, 2018, 07:51:26 pm »
@VTwin;


Yep, I just did and SVN update and recompiled ending up with the same error messages.
I did do a clean all as well. Sometimes I get lucky by removing it all and doing a fresh full trunc download. I'll give that a try now ... I'll report back if that worked.



Code: Pascal  [Select]
  1. /Users/hans/freepascal/lazarus/packager/fppkghelper.pas(131,19) Error: (5000) Identifier not found "FFPpkg"
  2. /Users/hans/freepascal/lazarus/packager/fppkghelper.pas(131,51) Error: (5000) Identifier not found "pkgpkInstalled"
  3. /Users/hans/freepascal/lazarus/packager/fppkghelper.pas(132,26) Error: (5038) identifier idents no member "PackagesStructure"
  4. fppkghelper.pas(138) Fatal: (10026) There were 3 errors compiling module, stopping
  5. Fatal: (1018) Compilation aborted
  6. make[2]: *** [lazbuild] Error 1
  7. make[1]: *** [lazbuilder] Error 2
  8. make: *** [lazbuild] Error 2
  9.  


VTwin

  • Hero Member
  • *****
  • Posts: 841
  • Former Turbo Pascal 3 user
Re: ListBox ItemIndex does not deselect previous selection
« Reply #6 on: December 04, 2018, 07:57:25 pm »
Thanks.

I just updated to 2.0.0RC2 v59727. The bug is still there. So I assume it will not be fixed in the next stable release 2.0.0. So, do I report it?
“Talk is cheap. Show me the code.” -Linus Torvalds

macOS 10.13.6: Lazarus 2.0.7 fixes svn r62562 (64 bit Cocoa)
Ubuntu 18.04.3: Lazarus 2.0.6 (64 bit on VBox)
Windows 7 Pro SP1: Lazarus 2.0.6 (64 bit on VBox)
fpc 3.0.4

Hansaplast

  • Hero Member
  • *****
  • Posts: 570
  • Tweaking4All.com
    • Tweaking4All
Re: ListBox ItemIndex does not deselect previous selection
« Reply #7 on: December 04, 2018, 07:58:07 pm »
@VTwin; completely removing, downloading it all and compiling just produced the same error.

Hansaplast

  • Hero Member
  • *****
  • Posts: 570
  • Tweaking4All.com
    • Tweaking4All
Re: ListBox ItemIndex does not deselect previous selection
« Reply #8 on: December 04, 2018, 07:59:14 pm »
Honestly; I'm always asking that same question. But ... since you found confirmation in the forum, you may want to report it as a bug yes.

Hansaplast

  • Hero Member
  • *****
  • Posts: 570
  • Tweaking4All.com
    • Tweaking4All
Re: ListBox ItemIndex does not deselect previous selection
« Reply #9 on: December 04, 2018, 08:05:18 pm »
I just went back to the previous version I used with


Code: Pascal  [Select]
  1. svn update -r r59719

VTwin

  • Hero Member
  • *****
  • Posts: 841
  • Former Turbo Pascal 3 user
Re: ListBox ItemIndex does not deselect previous selection
« Reply #10 on: December 04, 2018, 08:24:21 pm »
Excellent. Thanks for the confirmation and your solution.

I posted the question in the 2.0.0RC2 thread, maybe one of the developers will answer. I'm unclear on the process, but it would be a shame if cocoa fixes don't make it into 2.0.0.
“Talk is cheap. Show me the code.” -Linus Torvalds

macOS 10.13.6: Lazarus 2.0.7 fixes svn r62562 (64 bit Cocoa)
Ubuntu 18.04.3: Lazarus 2.0.6 (64 bit on VBox)
Windows 7 Pro SP1: Lazarus 2.0.6 (64 bit on VBox)
fpc 3.0.4

Hansaplast

  • Hero Member
  • *****
  • Posts: 570
  • Tweaking4All.com
    • Tweaking4All
Re: ListBox ItemIndex does not deselect previous selection
« Reply #11 on: December 04, 2018, 09:07:31 pm »
I tested all trunk versions from r59727 down to r59719 - it looks like the bug was introduced in r59720.
I'm sure the devs would like to know that.

VTwin

  • Hero Member
  • *****
  • Posts: 841
  • Former Turbo Pascal 3 user
Re: ListBox ItemIndex does not deselect previous selection
« Reply #12 on: December 05, 2018, 02:46:59 am »
Good sleuthing. Are you going to submit this?
“Talk is cheap. Show me the code.” -Linus Torvalds

macOS 10.13.6: Lazarus 2.0.7 fixes svn r62562 (64 bit Cocoa)
Ubuntu 18.04.3: Lazarus 2.0.6 (64 bit on VBox)
Windows 7 Pro SP1: Lazarus 2.0.6 (64 bit on VBox)
fpc 3.0.4

Hansaplast

  • Hero Member
  • *****
  • Posts: 570
  • Tweaking4All.com
    • Tweaking4All
Re: ListBox ItemIndex does not deselect previous selection
« Reply #13 on: December 05, 2018, 04:46:55 pm »
Haha, I thought you had already reported it.
No worries ... just reported it in Bugtracker that the IDE cannot be compiled: 0034652


I just tested r59729 under Windows, MacOS and Linux.
As expected; they all failed.  :o

VTwin

  • Hero Member
  • *****
  • Posts: 841
  • Former Turbo Pascal 3 user
Re: ListBox ItemIndex does not deselect previous selection
« Reply #14 on: December 06, 2018, 02:46:57 pm »
Haha, I thought you had already reported it.
No worries ... just reported it in Bugtracker that the IDE cannot be compiled: 0034652


I just tested r59729 under Windows, MacOS and Linux.
As expected; they all failed.  :o

Thanks, no I was too focused on the 2.0.0RC2 release, but would have if you had not. Can't build on all platforms!? Wow, hard to see how that could slip through.

No answers posted in the RC2 thread. I'm happy to test for bugs on 2.1 svn, but I'm reluctant to use it for a release until it is stable. I put out one cocoa release using 2.1 and discovered that it was acting strangely, forms not appearing.

Maybe cocoa bugs like this will not be fixed in a stable release until 2.2.0? Anyway, it is good to see such rapid progress in cocoa.

Not sure what to do though. Releasing a carbon 32 bit version as well does not look very professional. :(

Cheers,
VTwin
« Last Edit: December 06, 2018, 03:15:19 pm by VTwin »
“Talk is cheap. Show me the code.” -Linus Torvalds

macOS 10.13.6: Lazarus 2.0.7 fixes svn r62562 (64 bit Cocoa)
Ubuntu 18.04.3: Lazarus 2.0.6 (64 bit on VBox)
Windows 7 Pro SP1: Lazarus 2.0.6 (64 bit on VBox)
fpc 3.0.4