WinBatch® Technical Support Forum

Archived Boards => WinBatch Dynamic Dialogs => Topic started by: galaara98 on August 15, 2014, 11:18:46 AM

Title: ITEMBOX - Clear Selection
Post by: galaara98 on August 15, 2014, 11:18:46 AM
I have an ItemBox that is tall enough to show say 25 items.   I allow Multi-Select (no sure if it matters, but thought I would state it)

Let say the Item box has 10 "Items" in it
Items = "sdfsdf" : @TAB : "#$sdf" , etc.

So the item box is showing about 15 "Items Worth" of blank space at the bottom
Now I Select an item (and later test selecting a few items)

Now I want to STOP selecting ANY items.

My intuition tells me I can just "Normal Click" in the empty area at the bottom of the list. 
But when I click in the "Empty Area", the ItemBox does not "Unselect all" as I had expected it too.

( I can test this "is this normal" theory in Windows Explorer, by navigating to a folder that has only a few items, then expanding the Explorer Window to be tall enough to show more than the available "Items", now select a file or two, and then Click on nothing below the files)

Currently to "bandaide" the situation, I have added a contextual menu to the ItemBox, with a "Clear Selection" named menuitem and execute DialogControlSet(Handle, "ControlName", 6,"") when the user chooses it

Have I misconfigured something to produce these results, and if not.. how does Wilson WindowWare feel about changing the ITEMBOX to match my expectations?

Aaron
Title: Re: ITEMBOX - Clear Selection
Post by: td on August 15, 2014, 12:07:02 PM
The WinBatch Dialog 'ITEMBOX' control exhibits the default behavior for user32 listbox controls with regard to mouse click events in any empty area of this type of control.  There are several alternatives to using a context menu however.  The simplest may be to add a 'Clear Selection' button to your dialog or have one of an existing control's events clear the selection in your 'ITEMBOX'. 
Title: Re: ITEMBOX - Clear Selection
Post by: galaara98 on August 15, 2014, 12:31:49 PM
Bummed, but acceptable :)
The context menu is not bad, I was just hoping for even better (for my users)

Aaron
Title: Re: ITEMBOX - Clear Selection
Post by: td on August 15, 2014, 12:50:22 PM
I suppose you could add a bunch of blank items to your ITEMBOX. You would need to check for a blank selected item in your callback so you could cancel all selections.
Title: Re: ITEMBOX - Clear Selection
Post by: galaara98 on August 15, 2014, 01:22:48 PM
hahaha.. honestly... that is not a terrible solution.  Not hard to implement, and would satisfy the requirement...

Interesting.... interesting..

Aaron