Listbox problem build 7401

Discussions related to Visual Prolog
David Snook
Active Member
Posts: 36
Joined: 6 Feb 2003 0:01

Listbox problem build 7401

Unread post by David Snook » 26 Sep 2013 7:41

Hi,

I just came across a bug using a listbox in a dialog with build 7401. I couldn't find any related discussion in the forum or any mention in the fixes with 7402.

If there are more items than can be displayed in a listbox and all items are selected (multiSelect is set to true) then all items are displayed over the control and dialog. In some circumstances the listbox and items will initially display correct with the expected scrollbar but when the dialog is moved slightly then all items suddenly appear over the dialog and listbox control.

For my purposes I think I'm going to use the ListViewControl instead but wanted to pass this on.

Best regards,

David Snook

User avatar
Thomas Linder Puls
VIP Member
Posts: 1172
Joined: 28 Feb 2000 0:01

Unread post by Thomas Linder Puls » 26 Sep 2013 8:18

I am not quite sure what you mean, is it possible for you to attach an image showing the problem?
Regards Thomas Linder Puls
PDC

David Snook
Active Member
Posts: 36
Joined: 6 Feb 2003 0:01

Unread post by David Snook » 26 Sep 2013 22:24

Hi Thomas,

I included a tiny test project here to show what happens. While creating this I noticed that it didn't happen if the selectAll option is set on the onShow event and seems to be a problem when selecting all items happens as a user option.

Regards,

David Snook
Attachments
listboxtest.zip
(29.41 KiB) Downloaded 232 times

User avatar
Thomas Linder Puls
VIP Member
Posts: 1172
Joined: 28 Feb 2000 0:01

Unread post by Thomas Linder Puls » 27 Sep 2013 20:33

I have not been able to reproduce the problem (I have used build 7401). What exactly should I do to see the problem?
Regards Thomas Linder Puls
PDC

David Snook
Active Member
Posts: 36
Joined: 6 Feb 2003 0:01

Unread post by David Snook » 27 Sep 2013 23:27

When you run the app and select <Listbox test> then select the "Select All" radiobutton you should see what's shown below.

When all items in the listbox are selected they overlap the control and dialog. It will overlap above or below depending on the order the items are selected.

Maybe it's something to do with my machine/configuration?

Regards,

David Snook
Attachments
listbox.jpg
listbox.jpg (108.79 KiB) Viewed 4060 times

User avatar
Thomas Linder Puls
VIP Member
Posts: 1172
Joined: 28 Feb 2000 0:01

Unread post by Thomas Linder Puls » 28 Sep 2013 14:28

I cannot reproduce that behavior.
Regards Thomas Linder Puls
PDC

Paul Cerkez
VIP Member
Posts: 94
Joined: 6 Mar 2000 0:01

Unread post by Paul Cerkez » 28 Sep 2013 14:35

David,
Check to make sure your video drivers are current. The last time I had a similar problem (using c# and ASP ) it went away once I updated my video driver.

Just a suggestion. May not help in your case but is worth a shot.

Good Luck

P.
AI Rules!
P.

David Snook
Active Member
Posts: 36
Joined: 6 Feb 2003 0:01

Unread post by David Snook » 28 Sep 2013 23:34

I ran the program on a different machine with no problem (although Windows XP).

Thanks for the suggestion Paul - Good thought. The drivers are current and to be sure I removed and re-installed them. I ran a full hardware diagnostic and again separately for the video. I updated to VP 7402 and ran Windows Update to be sure everything was current. I even re-wrote the small project on VP7.3 and get the same problem but there is no indication of any problem at all with the computer or the video. Weird!

I found someone else who had the same problem back in June and posted it on a Microsoft forum;

http://social.msdn.microsoft.com/Forums ... ay-problem

The answer provided there works - make the control invisible, perform the selection then make it visible again. Looking at it now I've tended to avoid using "suspend" and "resume" when updating listbuttons and listboxes and this may be a good lesson learned (those functions are there for a reason). This also solves the problem. :roll:

Thanks for the help and suggestions.


Regards,

David Snook

User avatar
Thomas Linder Puls
VIP Member
Posts: 1172
Joined: 28 Feb 2000 0:01

Unread post by Thomas Linder Puls » 30 Sep 2013 8:25

Those functions are there to avoid flickering and repeated rapid layout changes.

You problem looks like a typical clipping problem: drawing takes place outside the visible area, but the clipping to the visible area should make sure that only the relevant part of the drawing becomes visible.

However, the listbox is a standard Windows control that have been around "forever" and runs on an "infinite" number of computers without the mentioned problem. So I doubt that it doesn't clip correctly.

A bad driver with a flaw in the clipping algorithms may cause such a problem (as Paul pointed out). I have no other suggestions about the cause.
Regards Thomas Linder Puls
PDC

David Snook
Active Member
Posts: 36
Joined: 6 Feb 2003 0:01

Unread post by David Snook » 2 Oct 2013 5:28

Thank you Thomas.

Paul was absolutely right. It took some time but I finally got it.

The following doesn't relate to Visual Prolog but may be of some general interest:

I checked the video driver a few times, removing, checking for updates and re-installing through <Device manager> - no change. I then checked the Dell support site for updated drivers and it actually provided an older driver. Still no change but in testing the "Select All" routine with a sleep function the listbox worked ok down to 2 milliseconds but not with 1. I then updated the driver through <Device Manager> and it worked down to 1 millisecond but not without it. That gave me the thought to check the video driver directly with the manufacturer, in my case Intel (I should have checked this first). There was in fact a more current driver and that did the trick - all works fine now.

Code: Select all

predicates     onSelectAllStateChanged : radioButton::stateChangedListener. clauses     onSelectAllStateChanged(_Source, _OldState, _NewState):-         Len = listbox_ctl:getCount(),         foreach Row = std::fromto(0,Len-1) do             listbox_ctl:selectAt(Row,true) ,programControl::sleep(1)         end foreach.
I can't comment on why Dell might recommend an older driver but now question how Device Manager and Windows determines a driver is current and updated?

In any case, All is fine now. Thank you Paul. Thank you Thomas.

Best Regards,

David Snook

Post Reply