[Cuis-dev] Quick print & quick implementors

Gerald Klix cuis.01 at klix.ch
Wed Dec 1 04:04:03 PST 2021


Hi Hernan,

please find attached one solution for the shift-click conflict.
I suppose shift-double-click is probably a better one.


HTH,

Gerald


On 12/1/21 11:01 AM, Gerald Klix via Cuis-dev wrote:
> +1
> 
> Cool! If you move that feature up to CodeWindow, it's available
> even in change sorters.
> 
> Please see attached change set.
> 
> 
> However shift-click already extends the current selection.
> I tried different modifiers, alas they are all taken.
> Morph>>doubleClick:localPosition: does not work either,
> probably, because the morph in question
> handles double-clicks by itself (it also implements
> triple-clicks).
> 
> Perhaps we can check this and only invoke that functionality
> if the selection would not be changed by the shift click,
> or if the selection is empty ... Will try figure some
> smart way.
> 
> 
> HTH,
> 
> Gerald
> 
> 
> 
> On 11/30/21 11:23 PM, Hernan Wilkinson via Cuis-dev wrote:
>> Hi,
>>   I created two new features that I'm attaching to this email.
>> 1) If you do shift+click in the debugger over the code, you will get the
>> same result as doing inspect on it but it will be shown as a hover help.
>> Here is a link that shows how it works:
>> https://twitter.com/HernanWilkinson/status/1465079401641652225?s=20
>> 2) If you do shift+click in the browser, if the mouse is over a message
>> send, it will show the implementors of that message, if it is over a 
>> class,
>> it will open the browser over the class. Here also a link:
>> https://twitter.com/HernanWilkinson/status/1465079839916974085?s=20
>>
>> Doing this I realized that there is really no need to differentiate 
>> sender
>> (cmd+n) from references to it (cmd+N), if the browser is smart enough to
>> realize the cursor is on a selector it can show senders, if the cursor is
>> over a class, it can show the references to it.
>> The same between implementors (cmd+m) and browse (cmd+b).
>> So I expanded the functionality of doing senders and implementors when
>> nothing is selected (something I did 2 year ago aprox) to check if the
>> cursor is over a selector or a class and act accordingly.
>>
>> Also in this .cs is a fix to PseudoClass that did now answer superclass
>> (I'm sorry Juan to put everything in the same .cs :-) )
>>
>> I hope you like it!
>> Hernan.
>>
>>
>>
> 
-------------- next part --------------
'From Haver 5.0 [latest update: #4993] on 1 December 2021 at 12:59:02 pm'!

!InnerTextMorph methodsFor: 'events' stamp: 'KLG 12/1/2021 12:36:35'!
mouseButton1Up: aMouseButtonEvent localPosition: localEventPosition

	self pauseBlinking.

	self 
		valueOfProperty: #mouseButton1Up:localPosition:
		ifPresentDo: [ :handler | handler value: aMouseButtonEvent value: localEventPosition ].

	aMouseButtonEvent wasHandled ifFalse: [
		self handleInteraction: [ editor mouseButton1Up: aMouseButtonEvent  localPosition: localEventPosition ]].

	(owner is: #ScrollPane) ifTrue: [
		owner scrollSelectionIntoView ]! !


!CodeWindow methodsFor: 'GUI building' stamp: 'KLG 12/1/2021 12:49:08'!
buildMorphicCodePane
	"Construct the pane that shows the code.
	Respect the Preference for standardCodeFont."
	
	| codePane |
	(codePane _ TextModelMorph
		textProvider: model
		textGetter: #acceptedContents
		textSetter: #contents:notifying:
		selectionGetter: #contentsSelection)
			emptyTextDisplayMessage: 'Smalltalk code (nothing selected?)'.	
	codePane scroller setProperty: #mouseButton1Up:localPosition: toValue: [ :event :mousePosition |
		event wasHandled: (event shiftPressed and: [				codePane editor hasSelection not ] ::
			and: [ codePane editor implementorsOfNodeUnder: mousePosition. true ] ) ].
	^ codePane! !


!DebuggerWindow methodsFor: 'GUI building' stamp: 'KLG 12/1/2021 12:55:01'!
buildMorphicCodePane
	"Construct the pane that shows the code."
	
	codePane _ super buildMorphicCodePane.
	
	codePane scroller setProperty: #mouseButton1Up:localPosition: toValue: [ :event :mousePosition |
		event wasHandled:
			(event shiftPressed and: [ codePane editor hasSelection not ] ::
				and: [ codePane editor quickPrintOfNodeUnder: mousePosition. true ] ) ].
	
	^ codePane! !



More information about the Cuis-dev mailing list