This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2011-05-09 16:55:20

thebuilderdd
Scratcher
Registered: 2008-01-26
Posts: 1000+

Change the devolper menu of Scratch source code?

I am working on TACKLE, and in version 1.1, I would like people to shift click the logo, instead. How can I change that?

Offline

 

#2 2011-05-09 16:59:44

Pecola1
Scratcher
Registered: 2010-09-06
Posts: 1000+

Re: Change the devolper menu of Scratch source code?

First you will need:

Code:

developersMenu
    | t1 |
    self world activeHand toolType: nil.
    Cursor normal show.
    t1 _ CustomMenu new.
    fillScreenFlag
        ifTrue: [t1 add: 'turn fill screen off' action: #fillScreenOff]
        ifFalse: [t1 add: 'turn fill screen on' action: #fillScreenOn].
    UseErrorCatcher
        ifTrue: [t1 add: 'turn error catching off' action: #toggleErrorCatcher]
        ifFalse: [t1 add: 'turn error catching on' action: #toggleErrorCatcher].
    t1 addLine.
    t1 add: 'save image for end-user' action: #saveImageForEndUser.
    t1 invokeOn: self

In scratch frame morph menu/button actions.

Now in event handling::

Code:

mouseDown: t1 
    | t2 |
    t1 hand toolType: nil.
    t2 _ self position + (ScratchFrameMorph isXO
                    ifTrue: [72 @ 26]
                    ifFalse: [38 @ 10]).
    (((t2 extent: 10 @ 12)
        containsPoint: t1 cursorPoint)
        and: [t1 shiftPressed])
        ifTrue: [^ self developersMenu].
    t1 cursorPoint y - self top < topPane height
        ifTrue: [fillScreenFlag ifFalse: [t1 hand grabMorph: self]]

(the last one will replace the first mouse down method)


If you are reading this, please read to the end, because if you don't you won't know what's at the end. Don't just skip to the end though otherwise you won't be able to read the middle, which is most important. Now you must be wondering why you just read all that, the reason is you may have not noticed something, read it again and see if you notice it this time  smile

Offline

 

#3 2011-05-09 17:06:20

thebuilderdd
Scratcher
Registered: 2008-01-26
Posts: 1000+

Re: Change the devolper menu of Scratch source code?

Pecola1 wrote:

First you will need:

Code:

developersMenu
    | t1 |
    self world activeHand toolType: nil.
    Cursor normal show.
    t1 _ CustomMenu new.
    fillScreenFlag
        ifTrue: [t1 add: 'turn fill screen off' action: #fillScreenOff]
        ifFalse: [t1 add: 'turn fill screen on' action: #fillScreenOn].
    UseErrorCatcher
        ifTrue: [t1 add: 'turn error catching off' action: #toggleErrorCatcher]
        ifFalse: [t1 add: 'turn error catching on' action: #toggleErrorCatcher].
    t1 addLine.
    t1 add: 'save image for end-user' action: #saveImageForEndUser.
    t1 invokeOn: self

In scratch frame morph menu/button actions.

Now in event handling::

Code:

mouseDown: t1 
    | t2 |
    t1 hand toolType: nil.
    t2 _ self position + (ScratchFrameMorph isXO
                    ifTrue: [72 @ 26]
                    ifFalse: [38 @ 10]).
    (((t2 extent: 10 @ 12)
        containsPoint: t1 cursorPoint)
        and: [t1 shiftPressed])
        ifTrue: [^ self developersMenu].
    t1 cursorPoint y - self top < topPane height
        ifTrue: [fillScreenFlag ifFalse: [t1 hand grabMorph: self]]

(the last one will replace the first mouse down method)

So, will this change it to the logo?

Offline

 

#4 2011-05-10 19:05:41

Pecola1
Scratcher
Registered: 2010-09-06
Posts: 1000+

Re: Change the devolper menu of Scratch source code?

thebuilderdd wrote:

Pecola1 wrote:

First you will need:

Code:

developersMenu
    | t1 |
    self world activeHand toolType: nil.
    Cursor normal show.
    t1 _ CustomMenu new.
    fillScreenFlag
        ifTrue: [t1 add: 'turn fill screen off' action: #fillScreenOff]
        ifFalse: [t1 add: 'turn fill screen on' action: #fillScreenOn].
    UseErrorCatcher
        ifTrue: [t1 add: 'turn error catching off' action: #toggleErrorCatcher]
        ifFalse: [t1 add: 'turn error catching on' action: #toggleErrorCatcher].
    t1 addLine.
    t1 add: 'save image for end-user' action: #saveImageForEndUser.
    t1 invokeOn: self

In scratch frame morph menu/button actions.

Now in event handling::

Code:

mouseDown: t1 
    | t2 |
    t1 hand toolType: nil.
    t2 _ self position + (ScratchFrameMorph isXO
                    ifTrue: [72 @ 26]
                    ifFalse: [38 @ 10]).
    (((t2 extent: 10 @ 12)
        containsPoint: t1 cursorPoint)
        and: [t1 shiftPressed])
        ifTrue: [^ self developersMenu].
    t1 cursorPoint y - self top < topPane height
        ifTrue: [fillScreenFlag ifFalse: [t1 hand grabMorph: self]]

(the last one will replace the first mouse down method)

So, will this change it to the logo?

yes


If you are reading this, please read to the end, because if you don't you won't know what's at the end. Don't just skip to the end though otherwise you won't be able to read the middle, which is most important. Now you must be wondering why you just read all that, the reason is you may have not noticed something, read it again and see if you notice it this time  smile

Offline

 

Board footer