a month ago
From the Dialog Managet help:
"A mouse click on the empty client area of a list box (where there is no list item) removes all the previous selections."
This is true for a MultiSelListBox. But SingleSelListBox does not remove a selection.
I did not found any event to do this by code.
( ListBoxClicked, ListBoxMouseDown, ListBoxSelectionChangeRequested, ItemMouseDown, ItemClicked dont filred )
Is there any trick ?
PS: Tried to force MultiSelListBox no more one selectection with no sucsess.
Solved! Go to Solution.
3 weeks ago
Oh yeah, you're right - it works on macOS but not Windows. Smells like a bug…
3 weeks ago
I've got a number of single selection lists and they seem to be acting correctly, i.e. clicking in a blank area deselects everything. Although I think we have tab controls mapped to list columns - possibly that makes it behave differently?
I also override DG::ListBoxObserver methods like ListBoxSelectionChanged (which fires when the blank are is clicked and checking the selected row returns 0). At this point the tab controls are refreshed and the list is redrawn. Possibly that's a factor?
3 weeks ago
Hello Ralph, thank you for reply.
Most of my tables have columns (tabfields) and often have ontab edit controls.
But click below rows into empty space dont clear a selection and ListBoxSelectionChanged did not fired.
Windows only. May be there is difference Mac-Win platforms ?
PS: And currently on this workplace I tried max AC26 API.
3 weeks ago
Oh yeah, you're right - it works on macOS but not Windows. Smells like a bug…
3 weeks ago
Thnaks, I guess it may be not a bug, but a native listbox control feature.
Usually it is not big issue. But in one of my table with ontab controls I would like to clear selection (and remove ontab editing) for convenience.
Funny, the is no ListBoxSelectionChanged event, if do a click on already selected row, as a trick to remove selection.
So I found only one trick not very obvious to the user, but worked.
bool TableStageDelivery::ListBoxSelectionChangeRequested(const DG::ListBoxMouseDownEvent& ev)
{
if (ev.GetSource() == &mi_list)
{
short item = ev.GetListItem();
if (item == mi_list.GetSelectedItem())
{
mi_list.DeselectItem(item);
OnSelectionChanged(true);
return true;
}
}
return false;
}