--- a/EditTextView.st Thu Dec 12 15:19:03 2019 +0100
+++ b/EditTextView.st Thu Dec 12 15:24:20 2019 +0100
@@ -7372,7 +7372,7 @@
Return the corresponding copyBuffer text or nil.
Used with 'Paste Previous' menu function"
- |sel listOfPasteTextLines box history|
+ |sel listOfPasteTextLines box history textView scrTextView|
history := device getCopyBufferHistory copy.
@@ -7384,19 +7384,33 @@
text := entry asString string asCollectionOfLines.
shown := text detect:[:line| line notEmptyOrNil] ifNone:[' '].
text size > 1 ifTrue:[
- shown := shown,(resources string:' ... [%1 lines]' with:text size).
+ shown := shown,((resources string:' ... [%1 lines]' with:text size) withColor:Color gray).
].
shown
].
+ textView := TextView with:c'\n\n'.
+
box := ListSelectionBox
title:(resources string:'Clipboard History')
okText:(resources string:'Paste')
abortText:(resources string:'Cancel')
list:listOfPasteTextLines
- action:[:idx | idx notNil ifTrue:[sel := history at:idx]].
+ action:[:idx |
+ idx notNil ifTrue:[
+ sel := history at:idx
+ ].
+ ].
box label:(resources string:'Select Previous Copybuffer String').
+ scrTextView := HVScrollableView forView:textView.
+ scrTextView height:100.
+ box verticalPanel verticalLayout:#bottomFit; add:scrTextView.
+ box listView
+ onChangeEvaluate:[:what :parameter :changedObject |
+ what == #selection ifTrue:[ textView contents:(history at:parameter ifAbsent:'') ]
+ ].
box useIndex:true.
+ box width:600.
box show.
^ sel.