Re: The Trunk: Tools-ul.277.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Tools-ul.277.mcz

Chris Muller-3
Usually the Control key is used to indicate copy..

On Sun, Nov 7, 2010 at 8:41 PM,  <[hidden email]> wrote:

> Levente Uzonyi uploaded a new version of Tools to project The Trunk:
> http://source.squeak.org/trunk/Tools-ul.277.mcz
>
> ==================== Summary ====================
>
> Name: Tools-ul.277
> Author: ul
> Time: 8 November 2010, 3:41:44.565 am
> UUID: 21959a81-fb7f-7942-af9d-26b4f38b869d
> Ancestors: Tools-ul.276
>
> - copy methods instead of moving when they're dragged to another Browser's method categories and shift is pressed. Don't ask questions in this case.
>
> =============== Diff against Tools-ul.276 ===============
>
> Item was changed:
>  ----- Method: Browser>>dropOnMessageCategories:at: (in category 'drag and drop') -----
>  dropOnMessageCategories: method at: index
> +
> +       | dstClass category copy |
> +       copy := Sensor shiftPressed.
> -       | dstClass category |
>        (method isKindOf: CompiledMethod)
>                ifFalse:[^self inform: 'Can only drop methods'].
>        dstClass := self selectedClassOrMetaClass.
>        (dstClass == method methodClass) ifTrue:[
>                category := self messageCategoryList at: index.
>                dstClass organization classify: method selector  under: category.
>                ^true].
> +       copy ifFalse: [
> +               (self confirm: (
> +                       'Classes {1} and {2} are unrelated.{3}Are you sure you want to move this method?'
> +                               format: { method methodClass. dstClass. Character cr }))
> +                                       ifFalse: [ ^false ] ].
> -       (self confirm: (
> -               'Classes {1} and {2} are unrelated.{3}Are you sure you want to move this method?'
> -                       format: { method methodClass. dstClass. Character cr })) ifFalse: [ ^false ].
>        dstClass
>                compile: method getSource
>                classified: (self messageCategoryList at: index)
>                withStamp: method timeStamp
>                notifying: nil.
> +       copy ifFalse: [
> +               method methodClass removeSelector: method selector ].
> -       method methodClass removeSelector: method selector.
>        ^true!
>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Tools-ul.277.mcz

Bert Freudenberg
I don't think there's a precedent for "control" meaning "copy" in Squeak. Shift as a modifier for mouse events is used occasionally.
 
In any case, direct references to Sensor are evil. This should be in the tool builder code, not the browser.

- Bert -

On 16.11.2010, at 16:39, Chris Muller wrote:

> Usually the Control key is used to indicate copy..
>
> On Sun, Nov 7, 2010 at 8:41 PM,  <[hidden email]> wrote:
>> Levente Uzonyi uploaded a new version of Tools to project The Trunk:
>> http://source.squeak.org/trunk/Tools-ul.277.mcz
>>
>> ==================== Summary ====================
>>
>> Name: Tools-ul.277
>> Author: ul
>> Time: 8 November 2010, 3:41:44.565 am
>> UUID: 21959a81-fb7f-7942-af9d-26b4f38b869d
>> Ancestors: Tools-ul.276
>>
>> - copy methods instead of moving when they're dragged to another Browser's method categories and shift is pressed. Don't ask questions in this case.
>>
>> =============== Diff against Tools-ul.276 ===============
>>
>> Item was changed:
>>  ----- Method: Browser>>dropOnMessageCategories:at: (in category 'drag and drop') -----
>>  dropOnMessageCategories: method at: index
>> +
>> +       | dstClass category copy |
>> +       copy := Sensor shiftPressed.
>> -       | dstClass category |
>>        (method isKindOf: CompiledMethod)
>>                ifFalse:[^self inform: 'Can only drop methods'].
>>        dstClass := self selectedClassOrMetaClass.
>>        (dstClass == method methodClass) ifTrue:[
>>                category := self messageCategoryList at: index.
>>                dstClass organization classify: method selector  under: category.
>>                ^true].
>> +       copy ifFalse: [
>> +               (self confirm: (
>> +                       'Classes {1} and {2} are unrelated.{3}Are you sure you want to move this method?'
>> +                               format: { method methodClass. dstClass. Character cr }))
>> +                                       ifFalse: [ ^false ] ].
>> -       (self confirm: (
>> -               'Classes {1} and {2} are unrelated.{3}Are you sure you want to move this method?'
>> -                       format: { method methodClass. dstClass. Character cr })) ifFalse: [ ^false ].
>>        dstClass
>>                compile: method getSource
>>                classified: (self messageCategoryList at: index)
>>                withStamp: method timeStamp
>>                notifying: nil.
>> +       copy ifFalse: [
>> +               method methodClass removeSelector: method selector ].
>> -       method methodClass removeSelector: method selector.
>>        ^true!
>>
>>
>>
>


Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Tools-ul.277.mcz

Nicolas Cellier
2010/11/16 Bert Freudenberg <[hidden email]>:
> I don't think there's a precedent for "control" meaning "copy" in Squeak. Shift as a modifier for mouse events is used occasionally.
>
> In any case, direct references to Sensor are evil. This should be in the tool builder code, not the browser.
>
> - Bert -
>

I guess Chris reference was OS feel or non Squeak apps feel (like
select/control + drag => creates a copy in power point, or control +
drag creates a file copy in Windows explorer)

Nicolas

Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Tools-ul.277.mcz

Chris Muller-3
> I guess Chris reference was OS feel or non Squeak apps feel (like
> select/control + drag => creates a copy in power point, or control +
> drag creates a file copy in Windows explorer)

Yes, and in Gnome and KDE as well.  There have been complaints in the
past about the "non-standard" feel of Squeak, in particular with the
modifier key for commands (alt vs. control), so that's why I
suggested, if we are introducing a new modifier function, to try to be
more consistent..

Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Tools-ul.277.mcz

Levente Uzonyi-2
In reply to this post by Chris Muller-3
On Tue, 16 Nov 2010, Chris Muller wrote:

> Usually the Control key is used to indicate copy..

If you drag a methd and press shift, you'll see a red + mark which
suggests copying instead of moving. IIRC this worked in some browsers
during 3.9 or 3.10 (maybe in OmniBrowser).


Levente