mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-30 16:10:19 +02:00
gtk2: unselect listbox items in multiselect mode when ItemIndex is changed by code
git-svn-id: trunk@20257 -
This commit is contained in:
parent
8f6e69d146
commit
8f1edc879c
@ -420,7 +420,7 @@ var
|
||||
begin
|
||||
if not WSCheckHandleAllocated(ACustomListBox, 'SelectItem') then
|
||||
Exit;
|
||||
Widget:=GetWidgetInfo(Pointer(ACustomListBox.Handle), True)^.CoreWidget;
|
||||
Widget := GetWidgetInfo(Pointer(ACustomListBox.Handle), True)^.CoreWidget;
|
||||
ListStoreModel := gtk_tree_view_get_model(PGtkTreeView(Widget));
|
||||
Selection := gtk_tree_view_get_selection(PGtkTreeView(Widget));
|
||||
|
||||
@ -476,10 +476,7 @@ begin
|
||||
|
||||
Inc(WidgetInfo^.ChangeLock);
|
||||
if (AIndex < 0) then
|
||||
if (gtk_tree_selection_get_mode(Selection) <> GTK_SELECTION_SINGLE) then
|
||||
Path := gtk_tree_path_new_first
|
||||
else
|
||||
Path := nil
|
||||
Path := nil
|
||||
else
|
||||
Path := gtk_tree_path_new_from_indices(AIndex, -1);
|
||||
|
||||
@ -490,7 +487,6 @@ begin
|
||||
gtk_tree_view_set_cursor(PGtkTreeView(Widget), Path, nil, False);
|
||||
end
|
||||
else
|
||||
if gtk_tree_selection_get_mode(Selection) = GTK_SELECTION_SINGLE then
|
||||
begin
|
||||
ClearCursor;
|
||||
gtk_tree_selection_unselect_all(Selection);
|
||||
|
Loading…
Reference in New Issue
Block a user