From 2ea4b2c24d39cc3b71e0bdac6baae89a89bb8488 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Minisini?= Date: Sun, 11 Dec 2022 21:00:30 +0100 Subject: [PATCH] TreeView: Unselectable items are now really really unselectable. [GB.GUI.BASE] * BUG: TreeView: Unselectable items are now really really unselectable. --- .../gb.gui.base/.src/TreeView/TreeViewSelection.class | 4 ++-- comp/src/gb.gui.base/.src/TreeView/_TreeView.class | 9 +++------ 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/comp/src/gb.gui.base/.src/TreeView/TreeViewSelection.class b/comp/src/gb.gui.base/.src/TreeView/TreeViewSelection.class index f1f4e3ad9..33187031d 100644 --- a/comp/src/gb.gui.base/.src/TreeView/TreeViewSelection.class +++ b/comp/src/gb.gui.base/.src/TreeView/TreeViewSelection.class @@ -54,8 +54,8 @@ Public Sub SelectItem(sKey As String, bSelected As Boolean) Dim hParent As _TreeView = GetParent() Dim hItem As _TreeView_Item - hItem = hParent[sKey] - If Not hItem Then Return + Try hItem = hParent[sKey] + If Error Then Return If Not hItem.Selectable Then Return If bSelected Then diff --git a/comp/src/gb.gui.base/.src/TreeView/_TreeView.class b/comp/src/gb.gui.base/.src/TreeView/_TreeView.class index 99934d1c5..d6aadb4ee 100644 --- a/comp/src/gb.gui.base/.src/TreeView/_TreeView.class +++ b/comp/src/gb.gui.base/.src/TreeView/_TreeView.class @@ -1127,12 +1127,9 @@ End Public Sub GridView_Change() Dim hItem As _TreeView_Item - - hItem = _RowToItem($hView.Row) - If Not hItem Or If Not hItem.Selectable Then - Stop Event - Return - Endif + + Try hItem = _RowToItem($hView.Row) + If Not hItem Or If Not hItem.Selectable Then Stop Event $hView.Rows[$hView.Row].EnsureVisible() End