How to make scrolling on normal list box behave like you are using a browse class

How to make scrolling normal list box behave like a browse class where in browse class, when scrolled down or up, selects the record down or up but in normal list box fill up with queue, selected record stays even when using scroll up or down.

Sorry, I don’t understand what you are asking?

You can handcode to test for multiple navigation events and calculate new position based on
selected = ?list{Prop:Vscrollpos}/255*records(yourQueue). You can find example in abbrowse.clw, TakeEvent method.

But easier is to use the QListClass (not sure when it was added).
Check the Immediate attribute for your list, this is necessary to capture the events.

Declare an object in local data of type QListClass

MyListHandler QListClass

After Window Opening, add code to connect queue and list to the handler.

MyListHandler.Init(?Listcontrol, MyQueue)

and add a call in ThisWindow.TakeEvent to capture the events
MyListHandler.TakeEvent()

ReturnValue = PARENT.TakeEvent() !generated code

The QListClass has much more functionality if you like to explore it, like EIP, Update Procedures. I do not know if it has any template support, or if it yet another undocumented feature in Clarion.

7 Likes

Wow, this works really well, I never thought such class exists. Thank you so much for this.

1 Like

this class is not present in CW 11 13.810, perhaps there is another with the same functionality.
You can found it in cw 10 v.13.244. I didn`t check other versions.

Hi @Marcelo_Sanseau

QListClass is defined in ABBrowse.INC and ABBrowse.CLW, it is in 10.0.12799 and 11.1.13855, so I would be surprised if it wasn’t in other versions also.

Mark

You are right. It is the consequence of working until the early hours of the morning.