The Trunk: Morphic-cmm.478.mcz

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

The Trunk: Morphic-cmm.478.mcz

commits-2
Chris Muller uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-cmm.478.mcz

==================== Summary ====================

Name: Morphic-cmm.478
Author: cmm
Time: 1 December 2010, 10:54:20.028 am
UUID: a875be1e-74ad-49a4-b2aa-8a70956c0b65
Ancestors: Morphic-laza.477

- Removed unused PasteUpMorph>>'autoLineLayout' and 'resizeToFit' since these functions are already inherited from Morph anyway.
- Fixed ability to adjust the font of all contents of a TextMorph via its "change font" halo, but there is still a bug with adjusting the font of just the selection which I don't know how to fix.

=============== Diff against Morphic-laza.477 ===============

Item was changed:
  BorderedMorph subclass: #PasteUpMorph
+ instanceVariableNames: 'presenter model cursor padding backgroundMorph turtleTrailsForm turtlePen lastTurtlePositions isPartsBin indicateCursor wantsMouseOverHalos worldState griddingOn'
- instanceVariableNames: 'presenter model cursor padding backgroundMorph turtleTrailsForm turtlePen lastTurtlePositions isPartsBin autoLineLayout indicateCursor resizeToFit wantsMouseOverHalos worldState griddingOn'
  classVariableNames: 'DisableDeferredUpdates MinCycleLapse StillAlive WindowEventHandler'
  poolDictionaries: ''
  category: 'Morphic-Worlds'!
 
  !PasteUpMorph commentStamp: '<historical>' prior: 0!
  A morph whose submorphs comprise a paste-up of rectangular subparts which "show through".  Anything called a 'Playfield' is a PasteUpMorph.
 
  Facilities commonly needed on pages of graphical presentations and on simulation playfields, such as the painting of new objects, turtle trails, gradient fills, background paintings, parts-bin behavior, collision-detection, etc., are (or will be) provided.
 
  A World, the entire Smalltalk screen, is a PasteUpMorph.  A World responds true to isWorld.  Morph subclasses that have specialized menus (BookMorph) build them in the message addBookMenuItemsTo:hand:.  A PasteUpMorph that is a world, builds its menu in HandMorph buildWorldMenu.
 
  presenter A Presenter in charge of stopButton stepButton and goButton,
  mouseOverHalosEnabled soundsEnabled fenceEnabled coloredTilesEnabled.
  model <not used>
  cursor ??
  padding ??
  backgroundMorph A Form that covers the background.
  turtleTrailsForm Moving submorphs may leave trails on this form.
  turtlePen Draws the trails.
  lastTurtlePositions A Dictionary of (aPlayer -> aPoint) so turtle trails can be drawn
  only once each step cycle.  The point is the start of the current stroke.
  isPartsBin If true, every object dragged out is copied.
  autoLineLayout ??
  indicateCursor ??
  resizeToFit ??
  wantsMouseOverHalos If true, simply moving the cursor over a submorph brings up its halo.
  worldState If I am also a World, keeps the hands, damageRecorder, stepList etc.
  griddingOn If true, submorphs are on a grid
 
  !

Item was changed:
  ----- Method: PasteUpMorph>>convertAlignment (in category 'layout') -----
  convertAlignment
+ self
+ clipSubmorphs: true ;
+ layoutPolicy: nil ;
+ layoutInset: 0 ;
+ cellInset: 0 ;
+ vResizing: #rigid!
- self clipSubmorphs: true.
- (autoLineLayout == true) ifTrue:[
- self layoutPolicy: TableLayout new.
- self layoutInset: 8; cellInset: 4.
- self listDirection: #leftToRight; wrapDirection: #topToBottom.
- self minHeight: self height.
- ] ifFalse:[
- self layoutPolicy: nil.
- self layoutInset: 0; cellInset: 0.
- ].
- (resizeToFit == true) ifTrue:[
- self vResizing: #shrinkWrap.
- ] ifFalse:[
- self vResizing: #rigid.
- ].!

Item was changed:
  ----- Method: TextEditor>>changeSelectionFontTo: (in category 'attributes') -----
+ changeSelectionFontTo: aFont
- changeSelectionFontTo: aFont
  | attr |
+ aFont ifNil: [ ^ self ].
- aFont ifNil:[^self].
  attr := TextFontReference toFont: aFont.
+ paragraph text
+ addAttribute: attr
+ from: self startIndex
+ to:
+ (self hasSelection
+ ifTrue: [ self stopIndex - 1 min: paragraph text size ]
+ ifFalse: [ paragraph text size ]).
- paragraph text addAttribute: attr from: self startIndex to: (self stopIndex-1 min: paragraph text size).
  paragraph composeAll.
  self recomputeInterval.
+ morph changed!
- morph changed.!

Item was changed:
  ----- Method: TextEditor>>changeTextFont (in category 'attributes') -----
  changeTextFont
  "Present a dialog which allows the user to select a font, and if one is chosen, apply it to the current selection. If there is no selection, or the selection is empty, apply it to the whole morph."
+ | curFont startIndex |
- | curFont startIndex chooser newFont |
  startIndex := self startIndex.
  curFont := (paragraph text fontAt: startIndex withStyle: paragraph textStyle).
  morph openModal: (
  Cursor wait showWhile: [
+ (FontChooserTool default
- (chooser := FontChooserTool default
  withTitle: 'Change the selected text''s font to...' translated
  for: self
  setSelector: #changeSelectionFontTo:
  getSelector: curFont)
  "Do not allow changing the emphasis; we don't know how to deal with
  a 'pre-emphasized' font here, so bail."
  offerStyleList: false;
+ open])!
- open]).
- newFont := chooser result.
- newFont ifNotNil:[self changeSelectionFontTo: newFont].!