[Pkg] The Trunk: ST80-dtl.87.mcz
commits at source.squeak.org
commits at source.squeak.org
Sun Jan 24 20:11:56 UTC 2010
David T. Lewis uploaded a new version of ST80 to project The Trunk:
http://source.squeak.org/trunk/ST80-dtl.87.mcz
==================== Summary ====================
Name: ST80-dtl.87
Author: dtl
Time: 24 January 2010, 2:59:37.473 pm
UUID: 698194a9-352b-4352-b039-3a2ec8a4b078
Ancestors: ST80-ar.86
Remove all MVC BitEditor references from non-MVC packages.
Form>>bitEdit to Project class>>bitEdit:
Form>>bitEditAt:scale: to Project class>>bitEdit:at:scale:
BitEditor class>>locateMagnifiedView:scale: to Rectangle class>>locateMagnifiedView:scale:
=============== Diff against ST80-ar.86 ===============
Item was changed:
----- Method: BitEditor class>>openOnForm: (in category 'instance creation') -----
openOnForm: aForm
"Create and schedule a BitEditor on the form aForm at its top left corner.
Show the small and magnified view of aForm."
| scaleFactor |
scaleFactor := 8 @ 8.
^self openOnForm: aForm
+ at: (Rectangle locateMagnifiedView: aForm scale: scaleFactor) topLeft
- at: (self locateMagnifiedView: aForm scale: scaleFactor) topLeft
scale: scaleFactor!
Item was changed:
----- Method: FormEditor>>magnify (in category 'editing tools') -----
magnify
"Allow for bit editing of an area of the Form. The user designates a
rectangular area that is scaled by 5 to allow individual screens dots to be
modified. Red button is used to set a bit to black, and yellow button is
used to set a bit to white. Editing continues until the user depresses any
key on the keyboard."
| smallRect smallForm scaleFactor tempRect |
scaleFactor := 8 at 8.
smallRect := (Rectangle fromUser: grid) intersect: view insetDisplayBox.
smallRect isNil ifTrue: [^self].
smallForm := Form fromDisplay: smallRect.
"Do this computation here in order to be able to save the existing display screen."
+ tempRect := Rectangle locateMagnifiedView: smallForm scale: scaleFactor.
- tempRect := BitEditor locateMagnifiedView: smallForm scale: scaleFactor.
BitEditor
openScreenViewOnForm: smallForm
at: smallRect topLeft
magnifiedAt: tempRect topLeft
scale: scaleFactor.
tool := previousTool!
Item was added:
+ ----- Method: MVCProject>>bitEdit:at:scale: (in category 'editors') -----
+ bitEdit: aForm at: magnifiedFormLocation scale: scaleFactor
+ "Create and schedule a view whose top left corner is magnifiedLocation
+ and that contains a view of aForm magnified by scaleFactor that can be
+ modified using the Bit Editor. It also contains a view of the original form."
+
+ BitEditor openOnForm: aForm at: magnifiedFormLocation scale: scaleFactor !
Item was changed:
----- Method: BitEditor class>>magnifyOnScreen (in category 'examples') -----
magnifyOnScreen
"Bit editing of an area of the display screen. User designates a
rectangular area that is magnified by 8 to allow individual screens dots to
be modified. red button is used to set a bit to black and yellow button is
used to set a bit to white. Editor is not scheduled in a view. Original
screen location is updated immediately. This is the same as FormEditor
magnify."
| smallRect smallForm scaleFactor tempRect |
scaleFactor := 8 @ 8.
smallRect := Rectangle fromUser.
smallRect isNil ifTrue: [^self].
smallForm := Form fromDisplay: smallRect.
+ tempRect := Rectangle locateMagnifiedView: smallForm scale: scaleFactor.
- tempRect := self locateMagnifiedView: smallForm scale: scaleFactor.
"show magnified form size until mouse is depressed"
self
openScreenViewOnForm: smallForm
at: smallRect topLeft
magnifiedAt: tempRect topLeft
scale: scaleFactor
"BitEditor magnifyOnScreen."!
Item was added:
+ ----- Method: MVCProject>>bitEdit: (in category 'editors') -----
+ bitEdit: aForm
+ "Create and schedule a view located in an area designated by the user
+ that contains a view of aForm magnified by 8 at 8 that can be modified using
+ a bit editor. It also contains a view of the original form."
+
+ BitEditor openOnForm: aForm
+
+ "Note that using direct messages to BitEditor, fixed locations and scales can be created.
+ That is, also try:
+ BitEditor openOnForm: self at: <some point>
+ BitEditor openOnForm: self at: <some point> scale: <some point>"!
Item was added:
+ ----- Method: MVCProject>>editCharacter:ofFont: (in category 'editors') -----
+ editCharacter: character ofFont: strikeFont
+ "Open a bit editor on a character in the given strike font. Note that you must
+ do an accept (in the option menu of the bit editor) if you want this work.
+ Accepted edits will not take effect in the font until you leave or close the bit editor.
+ Also note that unaccepted edits will be lost when you leave or close."
+ "Note that BitEditor only works in MVC currently."
+
+ "(TextStyle default fontAt: 1) edit: $="
+
+ | charForm editRect scaleFactor bitEditor savedForm r |
+ charForm := strikeFont characterFormAt: character.
+ editRect := Rectangle locateMagnifiedView: charForm scale: (scaleFactor := 8 @ 8).
+ bitEditor := BitEditor
+ bitEdit: charForm
+ at: editRect topLeft
+ scale: scaleFactor
+ remoteView: nil.
+ savedForm := Form fromDisplay: (r := bitEditor displayBox
+ expandBy: (0 @ 23 corner: 0 @ 0)).
+ bitEditor controller startUp.
+ bitEditor release.
+ savedForm displayOn: Display at: r topLeft.
+ strikeFont characterFormAt: character put: charForm!
Item was removed:
- ----- Method: BitEditor class>>locateMagnifiedView:scale: (in category 'private') -----
- locateMagnifiedView: aForm scale: scaleFactor
- "Answer a rectangle at the location where the scaled view of the form,
- aForm, should be displayed."
-
- ^ Rectangle originFromUser: (aForm extent * scaleFactor + (0 at 50)).
- !
More information about the Packages
mailing list