`Inspector2Tab`: add new API method to simplify creation of list views jv
authorJan Vrany <jan.vrany@labware.com>
Fri, 01 Sep 2023 22:32:10 +0100
branchjv
changeset 19646 235fea37201a
parent 19645 346f10c81090
child 19647 0b91a1b7bfae
`Inspector2Tab`: add new API method to simplify creation of list views
Tools__Inspector2Tab.st
--- a/Tools__Inspector2Tab.st	Tue Apr 04 17:00:56 2023 +0200
+++ b/Tools__Inspector2Tab.st	Fri Sep 01 22:32:10 2023 +0100
@@ -2,6 +2,7 @@
  COPYRIGHT (c) 2006 by eXept Software AG
  COPYRIGHT (c) 2015 Jan Vrany
  COPYRIGHT (c) 2017 Jan Vrany
+ COPYRIGHT (c) 2023 LabWare
 	      All Rights Reserved
 
  This software is furnished under a license and may be used
@@ -29,6 +30,7 @@
  COPYRIGHT (c) 2006 by eXept Software AG
  COPYRIGHT (c) 2015 Jan Vrany
  COPYRIGHT (c) 2017 Jan Vrany
+ COPYRIGHT (c) 2023 LabWare
 	      All Rights Reserved
 
  This software is furnished under a license and may be used
@@ -121,6 +123,12 @@
     "Modified: / 09-02-2017 / 09:23:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
+font: aFont
+    view scrolledView font: aFont.
+
+    "Created: / 02-09-2023 / 15:33:57 / Jan Vrany <jan.vrany@labware.com>"
+!
+
 inspector: anInspector2
     inspector := anInspector2
 
@@ -140,6 +148,21 @@
     "Modified: / 17-02-2008 / 08:58:41 / janfrog"
 !
 
+list:aCollectionOrValueModelOrBlock
+    | list |
+
+    list := SelectionInListModelView new.
+    list list: aCollectionOrValueModelOrBlock value.
+    list useIndex: false.
+    list highlightMode:#line. 
+    list doubleClickAction: [ :item | inspector inspect: (list list at: item) ].
+    
+    self view:(HVScrollableView forView: list).
+
+    "Created: / 01-09-2023 / 22:20:14 / Jan Vrany <jan.vrany@labware.com>"
+    "Modified: / 02-09-2023 / 15:31:23 / Jan Vrany <jan.vrany@labware.com>"
+!
+
 priority
     ^ priority ? 25