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

#1 2011-09-18 14:52:42

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Challenge for someone.

So... after finding out that Jens made collapsable scripts work in 1.2, I want them now, in 1.4.
Whoever does it gets a loveit!  tongue  I'm serious.

Offline

 

#2 2011-09-18 14:53:26

kimmy123
Scratcher
Registered: 2008-05-20
Posts: 1000+

Re: Challenge for someone.

Just a love it?


http://i.imgur.com/Mg3TPIE.pnghttp://i.imgur.com/rgyzXV5.pnghttp://i.imgur.com/685FKVd.pnghttp://24.media.tumblr.com/8678e33865664f328e1654109679cb92/tumblr_mm1qu3jGD71s8caito3_r1_250.gif

Offline

 

#3 2011-09-18 14:55:17

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: Challenge for someone.

kimmy123 wrote:

Just a love it?

And advertisement in my sig. Maybe http://scratch.mit.edu/img/ic_loveyes.pnghttp://scratch.mit.edu/img/ic_loveyes.png. ;P

Offline

 

#4 2011-09-18 15:08:30

johnnydean1
Scratcher
Registered: 2010-02-12
Posts: 1000+

Re: Challenge for someone.

Its in Claw, 'nuff said (lol)


You can now reach me on Twitter @johnnydean1_

Offline

 

#5 2011-09-18 15:33:19

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: Challenge for someone.

Bingo has them, and that's based off 1.4... I really don't see the difficulty in making them.

Offline

 

#6 2011-09-19 03:25:54

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: Challenge for someone.

I'll get them off one of the mods then, and turn it into a patch.  smile

Offline

 

#7 2011-09-19 04:06:06

WindowsExplorer
Scratcher
Registered: 2011-02-25
Posts: 1000+

Re: Challenge for someone.

Here's the code:

Code:

'From MIT Squeak 0.9.4 (June 1, 2003) [No updates present.] on 12 August 2008 at 5:24:59 pm'!
BlockMorph subclass: #HatBlockMorph
    instanceVariableNames: 'scriptNameMorph indicatorMorph scriptOwner parameters isClickable isShowing showHideMorph '
    classVariableNames: ''
    poolDictionaries: ''
    category: 'Scratch-Blocks'!

!BlockMorph methodsFor: 'event handling' stamp: 'jens 8/11/2008 12:32'!
handlesMouseDown: evt

    ^self isHidden not
! !

!BlockMorph methodsFor: 'private' stamp: 'jens 8/11/2008 12:56'!
blockAttachPoints: aSet
    "Answer a collection of possible attachment points for me. Each entry is an Association mapping a point to the morph to which a dropping command block could be attached."

    | nextB result |
    self isHidden ifTrue: [^self].
    result _ #().
    (self isKindOf: HatBlockMorph) ifFalse: [
        ScratchTranslator isRTL
            ifTrue: [result _ result copyWith: (self topRight -> self)]
            ifFalse: [result _ result copyWith: (self topLeft -> self)]].
    nextB _ self nextBlock.
    nextB ifNil:[
        self isStopOrForever ifFalse: [
            ScratchTranslator isRTL
                ifTrue: [result _ result copyWith: (self bottomRight -> self)]
                ifFalse: [result _ result copyWith: (self bottomLeft -> self)]]].

    nextB
        ifNotNil: [nextB blockAttachPoints: aSet].

    aSet addAll: result.
! !


!HatBlockMorph methodsFor: 'initialization' stamp: 'jens 8/12/2008 12:45'!
initialize

    super initialize.
    self color: (Color h: 41 s: 0.85 v: 0.9).
    self extent: 92@38.
    scriptOwner _ nil.
    isShowing _ true.

    scriptNameMorph _ StringMorph new
        contents: 'script';
        font: (ScratchFrameMorph getFont: #Label);
        forceUnicodeRendering: true;
        color: Color white.
    self addMorph: scriptNameMorph.
! !

!HatBlockMorph methodsFor: 'drawing' stamp: 'jens 8/12/2008 12:57'!
drawBottomEdgeOn: aCanvas
    isShowing 
        ifTrue: [ super drawBottomEdgeOn: aCanvas]
        ifFalse: [ self drawSmoothBottomEdgeOn: aCanvas]

! !

!HatBlockMorph methodsFor: 'drawing' stamp: 'jens 8/8/2008 23:48'!
drawSmoothBottomEdgeOn: aCanvas

    | right y |
    right _ self width - 1.
    y _ self height - 7.

    self drawHLineFrom: 1 to: right - 1 y: y color: color on: aCanvas.
    self drawHLineFrom: 2 to: right - 2 y: y + 1 color: color on: aCanvas.
    self drawHLineFrom: 3 to: right - 2 y: y + 2 color: shadowColor on: aCanvas.

    self drawPoint: (right - 1)@y color: shadowColor on: aCanvas.
    self drawPoint: (right - 2)@(y + 1) color: shadowColor on: aCanvas.
! !

!HatBlockMorph methodsFor: 'event handling' stamp: 'jens 8/12/2008 12:59'!
mouseDown: evt
    "Handle a mouse click. Left button either drags or performs click action. Right button brings up a menu."

    | p |
    p _ evt cursorPoint.

    showHideMorph ifNotNil: [ ((showHideMorph bounds expandBy: 4) containsPoint: p) ifTrue: [^ self toggleShowing]].
    super mouseDown: evt! !

!HatBlockMorph methodsFor: 'collapsing/expanding' stamp: 'jens 8/12/2008 12:47'!
addShowHideMorph
    showHideMorph _ ImageMorph new form: (ScratchFrameMorph skinAt: #arrowOpenComment).
    self addMorphFront: showHideMorph.
! !

!HatBlockMorph methodsFor: 'collapsing/expanding' stamp: 'jens 8/12/2008 13:30'!
attachBlock: aBlock
    super attachBlock: aBlock.
    showHideMorph isNil ifTrue: [
            self addShowHideMorph ]! !

!HatBlockMorph methodsFor: 'collapsing/expanding' stamp: 'jens 8/12/2008 13:42'!
changed
    self nextBlock ifNil: [showHideMorph ifNotNil: [
            self removeShowHideMorph;
                 fixBlockLayout ]].
    super changed! !

!HatBlockMorph methodsFor: 'collapsing/expanding' stamp: 'jens 8/12/2008 17:24'!
position: aPoint
    "temporary workaround to display the toggle when reading a new project from disk"
    super position: aPoint.
    self nextBlock ifNotNil: [
        showHideMorph isNil ifTrue: [
            self addShowHideMorph ]]! !

!HatBlockMorph methodsFor: 'collapsing/expanding' stamp: 'jens 8/12/2008 12:48'!
removeShowHideMorph
    showHideMorph delete.
    showHideMorph _ nil! !

!HatBlockMorph methodsFor: 'collapsing/expanding' stamp: 'jens 8/12/2008 12:55'!
toggleShowing

    isShowing _ isShowing not.
    isShowing
        ifTrue: [
            self nextBlock isHidden: false.
            showHideMorph form: (ScratchFrameMorph skinAt: #arrowOpenComment)]
        ifFalse: [
            self nextBlock isHidden: true.
            showHideMorph form: (ScratchFrameMorph skinAt: #arrowClosedComment)].

    "kludge to force a complete repaint:"
    World activeHand grabMorph: self
! !


!BlockMorph reorganize!
('initialization' initialize)
('accessing' acceptsDroppedReporters acceptsTypeOf: canBecomeWatcher closestAttachTargetIn: codeString color: helpScreenName isBooleanReporter isForever isReporter isSpecialForm isSpecialForm: isStop isStopOrForever litUp: newScriptOwner: presentHelpScreen receiver receiver: scratchProc showErrorFeedback)
('block enumerating' blockSequence bottomBlock firstBlockList nextBlock nextBlock: topBlock tupleSequence)
('drawing' computeHighlightColors drawBodyOn: drawBottomEdgeOn: drawFinalOn:fromCanvas: drawHLineFrom:to:y:color:on: drawOn: drawPoint:color:on: drawReporterBodyOn: drawSmoothBottomEdgeOn: drawSmoothTopEdgeOn: drawStopBodyOn: drawTopEdgeOn:)
('drawing-optimization' changed fullBounds fullDrawOn: invalidRect: updateCachedFeedbackForm updateCachedForm)
('dropping/grabbing' aboutToBeGrabbedBy: handleReporterDrop justDroppedInto:event: rejectDropEvent: rootForGrabOf: slideBackToFormerSituation:)
('event handling' click: delete doubleClick: duplicate handleTool:hand: handlesMouseDown: mouseDown: rightButtonMenu showTuples startDrag: wantsKeyboardFocusFor:)
('stepping' step stepTime)
('processes' isRunning start stop toggleProcess)
('object i/o' fieldsVersion initFieldsFrom:version: storeFieldsOn:)
('private' attachBlock: blockAttachPoints: clearProcess copyRecordingIn: fixBlockLayout layoutChanged nonControlFlowSubmorphs printCodeOn:indent: printCodeSubmorph:on:)
!

http://i.imgur.com/H6LLdnK.pnghttp://i.imgur.com/VYuD7BY.png

Offline

 

#8 2011-09-19 04:20:31

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: Challenge for someone.

Is that the exact same code as was in Jens's?
LS97, you're amazing, and so is Bingo! Was the dev pass told on the CCBIS thread?

Offline

 

#9 2011-09-20 14:54:48

ProgrammingFreak
Scratcher
Registered: 2010-09-04
Posts: 1000+

Re: Challenge for someone.

scimonster wrote:

Is that the exact same code as was in Jens's?
LS97, you're amazing, and so is Bingo! Was the dev pass told on the CCBIS thread?

one of them is something I'll never tell you. blubber
Don't know what version its for though.  wink

Offline

 

#10 2011-09-20 15:14:24

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: Challenge for someone.

scimonster wrote:

Is that the exact same code as was in Jens's?
LS97, you're amazing, and so is Bingo!

I knew that  tongue

and almost exactly. i had to make it fit into my mod.
as for #2, CCBIS?

Offline

 

#11 2011-09-21 00:24:05

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: Challenge for someone.

LS97 wrote:

scimonster wrote:

Is that the exact same code as was in Jens's?
LS97, you're amazing, and so is Bingo!

I knew that  tongue

and almost exactly. i had to make it fit into my mod.
as for #2, CCBIS?

CCBIS?

Offline

 

#12 2011-09-21 10:58:06

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: Challenge for someone.

scimonster wrote:

LS97 wrote:

scimonster wrote:

Is that the exact same code as was in Jens's?
LS97, you're amazing, and so is Bingo!

I knew that  tongue

and almost exactly. i had to make it fit into my mod.
as for #2, CCBIS?

CCBIS?

You said it...

Offline

 

#13 2011-09-21 11:38:49

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: Challenge for someone.

LS97 wrote:

scimonster wrote:

LS97 wrote:


I knew that  tongue

and almost exactly. i had to make it fit into my mod.
as for #2, CCBIS?

CCBIS?

You said it...

What does CCBIS stand for?

Offline

 

#14 2011-09-21 12:00:46

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: Challenge for someone.

You were talking about a certain CCBIS thread.

Offline

 

#15 2011-09-21 12:24:02

roijac
Scratcher
Registered: 2010-01-19
Posts: 1000+

Re: Challenge for someone.

this a little offtopic, but ls97, could you also pls post the 1.3 image for linux? it's only 1.2 and 1.1 on there  sad

Offline

 

#16 2011-09-21 12:51:25

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: Challenge for someone.

roijac wrote:

this a little offtopic, but ls97, could you also pls post the 1.3 image for linux? it's only 1.2 and 1.1 on there  sad

You can get it from the Windows download  big_smile   big_smile

Offline

 

#17 2011-09-21 13:02:05

roijac
Scratcher
Registered: 2010-01-19
Posts: 1000+

Re: Challenge for someone.

still...
and read my form entry  big_smile

Offline

 

Board footer