Morph Drop Shadows

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

Morph Drop Shadows

bravo12
Can I change the pick up a morph so that it doesn't have a shadow?  I tried in the morph menu to drop shadow: show shadow, but this doesn't work.  It doesn't affect the morph  whether the show shadow is checked or not.

dhs



_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Morph Drop Shadows

K. K. Subramaniam
On Sunday 20 May 2007 10:07 pm, David H. Shanabrook wrote:
> Can I change the pick up a morph so that it doesn't have a shadow?  I
> tried in the morph menu to drop shadow: show shadow, but this doesn't
> work.  It doesn't affect the morph  whether the show shadow is
> checked or not.
Which version is your image? For drop shadow to be visible, make sure the drop
shadow color is different from the background and the offset is non-zero.

The drop shadow (in halo menu) is different from the temporary shadow that
appears when you 'pick' the morph.

Regards .. Subbu
_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Morph Drop Shadows

bravo12
Subbu

It is the temporary shadow that appears when I pick the morph that I  
want to eliminate.  I am using 3.9 although I can switch to an older  
version if it would help.

dhs

On 20 May 2007, at 13:23, subbukk wrote:

> On Sunday 20 May 2007 10:07 pm, David H. Shanabrook wrote:
>> Can I change the pick up a morph so that it doesn't have a shadow?  I
>> tried in the morph menu to drop shadow: show shadow, but this doesn't
>> work.  It doesn't affect the morph  whether the show shadow is
>> checked or not.
> Which version is your image? For drop shadow to be visible, make  
> sure the drop
> shadow color is different from the background and the offset is non-
> zero.
>
> The drop shadow (in halo menu) is different from the temporary  
> shadow that
> appears when you 'pick' the morph.
>
> Regards .. Subbu
> _______________________________________________
> Beginners mailing list
> [hidden email]
> http://lists.squeakfoundation.org/mailman/listinfo/beginners

_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Morph Drop Shadows

K. K. Subramaniam
On Sunday 20 May 2007 11:08 pm, David H. Shanabrook wrote:
> Subbu
>
> It is the temporary shadow that appears when I pick the morph that I
> want to eliminate.  I am using 3.9 although I can switch to an older
> version if it would help.
You can't control this from the halo menu. It is a built-in behavior for all
Morphs.  I am not aware of any preference setting to eliminate this pick up
shadow. You will have to patch the Morph classes to eliminate it.

Sorry .. Subbu
_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Morph Drop Shadows

Bert Freudenberg
In reply to this post by bravo12
The Hand draws a shadow of all morphs it is holding. You could  
implement the dragging of your morphs yourself and not leave that to  
HandMorph. Or hack HandMorph>>fullDrawOn: method to not draw the  
shadow (possibly in a subclass).

May I ask what you need this for?

- Bert -

On May 20, 2007, at 19:38 , David H. Shanabrook wrote:

> Subbu
>
> It is the temporary shadow that appears when I pick the morph that  
> I want to eliminate.  I am using 3.9 although I can switch to an  
> older version if it would help.
>
> dhs
>
> On 20 May 2007, at 13:23, subbukk wrote:
>
>> On Sunday 20 May 2007 10:07 pm, David H. Shanabrook wrote:
>>> Can I change the pick up a morph so that it doesn't have a  
>>> shadow?  I
>>> tried in the morph menu to drop shadow: show shadow, but this  
>>> doesn't
>>> work.  It doesn't affect the morph  whether the show shadow is
>>> checked or not.
>> Which version is your image? For drop shadow to be visible, make  
>> sure the drop
>> shadow color is different from the background and the offset is  
>> non-zero.
>>
>> The drop shadow (in halo menu) is different from the temporary  
>> shadow that
>> appears when you 'pick' the morph.
>>
>> Regards .. Subbu




_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Morph Drop Shadows

bravo12
I am experimenting with geometry tutors, such as pentominos.  when  
trying to fit shapes precisely together the shadow is very  
disturbing, it is hard to know what is the shadow and what is the  
shape, especially for kids.

dhs


On 20 May 2007, at 14:51, Bert Freudenberg wrote:

> The Hand draws a shadow of all morphs it is holding. You could  
> implement the dragging of your morphs yourself and not leave that  
> to HandMorph. Or hack HandMorph>>fullDrawOn: method to not draw the  
> shadow (possibly in a subclass).
>
> May I ask what you need this for?
>
> - Bert -
>
> On May 20, 2007, at 19:38 , David H. Shanabrook wrote:
>
>> Subbu
>>
>> It is the temporary shadow that appears when I pick the morph that  
>> I want to eliminate.  I am using 3.9 although I can switch to an  
>> older version if it would help.
>>
>> dhs
>>
>> On 20 May 2007, at 13:23, subbukk wrote:
>>
>>> On Sunday 20 May 2007 10:07 pm, David H. Shanabrook wrote:
>>>> Can I change the pick up a morph so that it doesn't have a  
>>>> shadow?  I
>>>> tried in the morph menu to drop shadow: show shadow, but this  
>>>> doesn't
>>>> work.  It doesn't affect the morph  whether the show shadow is
>>>> checked or not.
>>> Which version is your image? For drop shadow to be visible, make  
>>> sure the drop
>>> shadow color is different from the background and the offset is  
>>> non-zero.
>>>
>>> The drop shadow (in halo menu) is different from the temporary  
>>> shadow that
>>> appears when you 'pick' the morph.
>>>
>>> Regards .. Subbu
>
>
>
>
> _______________________________________________
> Beginners mailing list
> [hidden email]
> http://lists.squeakfoundation.org/mailman/listinfo/beginners

_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Morph Drop Shadows

Bert Freudenberg
In that case it's surely simplest to add the mouse handling to your  
pentomino tiles.

- Bert -

On May 20, 2007, at 21:01 , David H. Shanabrook wrote:

> I am experimenting with geometry tutors, such as pentominos.  when  
> trying to fit shapes precisely together the shadow is very  
> disturbing, it is hard to know what is the shadow and what is the  
> shape, especially for kids.
>
> dhs
>
>
> On 20 May 2007, at 14:51, Bert Freudenberg wrote:
>
>> The Hand draws a shadow of all morphs it is holding. You could  
>> implement the dragging of your morphs yourself and not leave that  
>> to HandMorph. Or hack HandMorph>>fullDrawOn: method to not draw  
>> the shadow (possibly in a subclass).
>>
>> May I ask what you need this for?
>>
>> - Bert -
>>
>> On May 20, 2007, at 19:38 , David H. Shanabrook wrote:
>>
>>> Subbu
>>>
>>> It is the temporary shadow that appears when I pick the morph  
>>> that I want to eliminate.  I am using 3.9 although I can switch  
>>> to an older version if it would help.
>>>
>>> dhs
>>>
>>> On 20 May 2007, at 13:23, subbukk wrote:
>>>
>>>> On Sunday 20 May 2007 10:07 pm, David H. Shanabrook wrote:
>>>>> Can I change the pick up a morph so that it doesn't have a  
>>>>> shadow?  I
>>>>> tried in the morph menu to drop shadow: show shadow, but this  
>>>>> doesn't
>>>>> work.  It doesn't affect the morph  whether the show shadow is
>>>>> checked or not.
>>>> Which version is your image? For drop shadow to be visible, make  
>>>> sure the drop
>>>> shadow color is different from the background and the offset is  
>>>> non-zero.
>>>>
>>>> The drop shadow (in halo menu) is different from the temporary  
>>>> shadow that
>>>> appears when you 'pick' the morph.
>>>>
>>>> Regards .. Subbu
>>




_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Morph Drop Shadows

Benjamin Schroeder-2
In reply to this post by bravo12

On May 20, 2007, at 3:01 PM, David H. Shanabrook wrote:

> I am experimenting with geometry tutors, such as pentominos.  when  
> trying to fit shapes precisely together the shadow is very  
> disturbing, it is hard to know what is the shadow and what is the  
> shape, especially for kids.

When I want to remove the drag-shadow from Morphs, I often use  
something like the following methods (implemented on my Morph subclass):

        fullDrawOn: aCanvas

                aCanvas isShadowDrawing ifTrue: [^ self].
       
                super fullDrawOn: aCanvas.
       
#fullDrawOn: is sent to a Morph to ask it to draw itself, its border,  
and its submorphs. The Hand uses it to draw a shadow copy of the  
Morph. This method says, if that's what's going on, don't draw  
anything (therefore preventing any shadow from being shown).

        wantsToBeCachedByHand

                ^ false

This message is also sent during shadow drawing. It seems to be  
necessary to prevent shadows from being drawn, but I'm afraid I have  
forgotten why! and I'm not sure I have a chance to track it down  
right now. (I almost held off from posting this because of that, but  
I thought it would be better to offer the advice and leave an  
exercise for the reader. :)

Note that the shadow does serve at least one important purpose. In  
the default mouse handling, clicking on a Morph picks it up, and one  
must click the mouse again to drop the Morph. It can be confusing to  
have a Morph "stuck" to the hand without any visual indication.

I often make a simple mouse override to fix this too, if I am not  
doing any more specialized mouse handling on my own. Here is what I do:

        handlesMouseDown: evt

                ^ true

This tells Morphic that a particular Morph wants to receive mouse  
events.

        mouseDown: evt

                evt hand
                        waitForClicksOrDrag: self
                        event: evt
                        selectors: #( #click: #doubleClick: #doubleClickTimeout: #startDrag:)
                        threshold: 0

This message is sent on mouse down. The method here tells the Hand to  
parse upcoming mouse events, and decide whether a click, double  
click, or drag might be happening. The threshold of "0" says to  
interpret any mouse movement at all as a drag. (There is a simpler  
variant of #waitForClicksOrDrag... that defaults that to 10, which I  
find to be too unresponsive.)

        startDrag: evt

                evt hand grabMorph: self.

This is called when the Hand detects a drag, after the "wait" message  
from above. The method just tells the hand to pick up this Morph.

Of course I'm sure there must be some flag that does the same  
thing! ;) If I am writing a system with many Morphs like this, I of  
course put all of this code in a superclass to avoid clutter.

Hope this helps,
Benjamin Schroeder

_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Morph Drop Shadows

bravo12
In reply to this post by bravo12

On May 20, 2007, at 3:01 PM, David H. Shanabrook wrote:


I am experimenting with geometry tutors, such as pentominos.  when  

trying to fit shapes precisely together the shadow is very  

disturbing, it is hard to know what is the shadow and what is the  

shape, especially for kids.


When I want to remove the drag-shadow from Morphs, I often use  

something like the following methods (implemented on my Morph subclass):

...

Of course I'm sure there must be some flag that does the same  

thing! ;) If I am writing a system with many Morphs like this, I of  

course put all of this code in a superclass to avoid clutter.


Hope this helps,

Benjamin Schroeder







You could take the same tack in Squeak. For instance, open a Workspace and 

drill down using halos till you get to the smallest part. Drag it to a 

different place. Repeat for all the parts. Then 'inspect/explore/browse' each 

part to see how it was put together. You could also try tracing code 

execution using "debug it" to pick up programming idioms. Use 'explain' to 

find out more about new words/terms. Debug through ClickExerciser object to 

see how it handles mouse clicks.


Enjoy .. Subbu



I found if I just change the value of HandMorph dropShadows shadowOffset from 6@8 to 0@0 this eliminates the drop shadows.  For morphs with opacity less than 1.0 the morph turns opaque when clicked on; which helps with noticing the object is picked.

Would this be a variable which could be set in Preferences?  I think others must also find drop shadows make positioning morphs difficult in some circumstances.

Thanks 

dhs


_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Morph Drop Shadows

Jerome Peace
In reply to this post by bravo12
[Newbies] Morph Drop Shadows

HI David H. Shanabrook,

As Bert says the trick is to move the morph w/o
lifting it.
One general way to do that with any morph is the brown
halo handle.

The other is to create a morph that behaves the way
you want.
I had started some work which I had hope to apply to
moving block puzzles.

I wrote a little about it Here:
http://lists.squeakfoundation.org/pipermail/squeak-dev/2007-May/116371.html

And posted my work in progress code to bob's super
swiki

http://209.143.91.36/super/728
MovingPiece-wiz


The codes in the form of a 3dot9 project.
Load the project and look at the change set for it.


Also earlier related work on puzzleboards modified a
pasteup morph to prevent overlapping pieces:

http://209.143.91.36/super/634
Puzzleboards

The code is in both project form (for an old 3.7
squeak) and as change sets. The change set should work
in 3.9 and probably a recent 3.8 (if they fixed the
bug mentioned)


You will need to adapt it to apply to pentomino's

Hth.

Yours in curiosity and service, --Jerome Peace




***
>[Newbies] Morph Drop Shadows
>
>
>Bert Freudenberg bert at freudenbergs.de
>Sun May 20 19:05:01 UTC 2007
>
>
>In that case it's surely simplest to add the mouse
handling to your  
>pentomino tiles.
>
>- Bert -
>
>On May 20, 2007, at 21:01 , David H. Shanabrook
wrote:
>
>> I am experimenting with geometry tutors, such as
pentominos.  when  
>> trying to fit shapes precisely together the shadow
is very  
>> disturbing, it is hard to know what is the shadow
and what is the  
>> shape, especially for kids.
>>
>> dhs
>>
>>
>> On 20 May 2007, at 14:51, Bert Freudenberg wrote:
>>
>>> The Hand draws a shadow of all morphs it is
holding. You could  
>>> implement the dragging of your morphs yourself and
not leave that  
>>> to HandMorph. Or hack HandMorph>>fullDrawOn:
method to not draw  
>>> the shadow (possibly in a subclass).
>>>
>>> May I ask what you need this for?
>>>
>>> - Bert -
>>>
>>> On May 20, 2007, at 19:38 , David H. Shanabrook
wrote:
>>>
>>>> Subbu
>>>>
>>>> It is the temporary shadow that appears when I
pick the morph  
>>>> that I want to eliminate.  I am using 3.9
although I can switch  
>>>> to an older version if it would help.
>>>>
>>>> dhs
>>>>
>>>> On 20 May 2007, at 13:23, subbukk wrote:
>>>>
>>>>> On Sunday 20 May 2007 10:07 pm, David H.
Shanabrook wrote:
>>>>>> Can I change the pick up a morph so that it
doesn't have a  
>>>>>> shadow?  I
>>>>>> tried in the morph menu to drop shadow: show
shadow, but this  
>>>>>> doesn't
>>>>>> work.  It doesn't affect the morph  whether the
show shadow is
>>>>>> checked or not.
>>>>> Which version is your image? For drop shadow to
be visible, make  
>>>>> sure the drop
>>>>> shadow color is different from the background
and the offset is  
>>>>> non-zero.
>>>>>
>>>>> The drop shadow (in halo menu) is different from
the temporary  
>>>>> shadow that
>>>>> appears when you 'pick' the morph.
>>>>>
>>>>> Regards .. Subbu
>>>
***



 
____________________________________________________________________________________
Never miss an email again!
Yahoo! Toolbar alerts you the instant new Mail arrives.
http://tools.search.yahoo.com/toolbar/features/mail/
_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners