[squeak-dev] The Trunk: MorphicExtras-kfr.150.mcz
commits at source.squeak.org
commits at source.squeak.org
Tue Jul 15 21:01:57 UTC 2014
Karl Ramberg uploaded a new version of MorphicExtras to project The Trunk:
http://source.squeak.org/trunk/MorphicExtras-kfr.150.mcz
==================== Summary ====================
Name: MorphicExtras-kfr.150
Author: kfr
Time: 15 July 2014, 10:47:55.947 pm
UUID: c620d424-01dd-e24f-b692-73ac079ee6ef
Ancestors: MorphicExtras-kfr.149
Set brush size and color to "usefull" values, eg. mid size and black.
=============== Diff against MorphicExtras-kfr.149 ===============
Item was changed:
----- Method: PaintBoxMorph>>addBrushesOffImage: (in category 'initialization') -----
addBrushesOffImage: offImage
| posSpec |
posSpec := #(
(13 37 64 13 37 64) "offset X"
(107 107 107 124 124 124) "offset Y"
(21 24 27 21 24 27) "width"
(18 18 18 25 25 25) "height").
#(brush1: brush2: brush3: brush4: brush5: brush6: ) keysAndValuesDo: [:index :name |
| button nib rect on off |
(self submorphNamed: name) ifNil:
[nib := Form dotOfSize: (#(1 2 3 6 11 26) at: index).
rect := ((posSpec at: 1) at: index) @ ((posSpec at: 2) at: index)
extent: ((posSpec at: 3) at: index) @ ((posSpec at: 4) at: index).
off := (offImage copy: rect) as8BitColorForm.
"highlight a frame"
on := off deepCopy.
(on getCanvas copyOrigin: 0 at 0 clipRect: (0 at 0 extent: rect extent))
frameAndFillRectangle: (0 at 0 extent: rect extent) fillColor: Color transparent
borderWidth: 2 borderColor: (Color r: 0.6 g: 0.8 b: 1.0).
(button := ThreePhaseButtonMorph new)
onImage: on;
offImage: off;
pressedImage: on;
bounds: (rect translateBy: self position);
setNamePropertyTo: name;
actionSelector: #brush:action:nib:evt:;
arguments: (Array with: button with: name with: nib);
actWhen: #buttonUp; target: self.
self addMorph: button.]].
brushes := #(brush1: brush2: brush3: brush4: brush5: brush6: ) collect: [:name | self submorphNamed: name].
+ currentBrush := brushes at: 3.
- currentBrush := brushes last.
currentBrush state: #on.
!
Item was changed:
----- Method: PaintBoxMorph>>buildAPrototype (in category 'initialization') -----
buildAPrototype
| onImage |
self initialize.
self image: self class paletteImage.
rotationTabForm := self class rotationTabImage.
scaleTabForm := self class scaleTabImage.
(colorMemoryThin := self class colorMemoryThinImage asMorph)
setNamePropertyTo: 'ColorPickerClosed';
position: self position + (11 at 150);
on: #mouseEnter send: #showColorPalette: to: self.
self addMorph: colorMemoryThin.
(colorMemory := PaintBoxColorPicker new image: self class colorMemoryImage)
setNamePropertyTo: 'ColorPickerOpened';
on: #mouseDown send: #takeColorEvt:from: to: self.
+ currentColor := Color black.
- currentColor := Color transparent.
onImage := self class paletteOnImage.
self
addToolsOffImage: image onImage: onImage;
addBrushesOffImage: image;
addActionsOffImage: image onImage: onImage;
addStampsAndShapes;
addShapeButtonsOffImage: self class shapesImage onImage: self class shapesOnImage;
addStampButtonsOffImage: self class stampsImage onImage: self class stampsOnImage.
stampHolder := ScrollingToolHolder newPrototypeFor: self.!
More information about the Squeak-dev
mailing list
|