A new version of Morphic was added to project The Inbox:
http://source.squeak.org/inbox/Morphic-bp.509.mcz ==================== Summary ==================== Name: Morphic-bp.509 Author: bp Time: 8 January 2011, 2:14:26.633 pm UUID: 19ffadad-6aae-4d54-9cd1-5631b0ac3dd1 Ancestors: Morphic-bp.508, Morphic-bp.505 - merged, note that Graphics-bp.173 has to be loaded before because it is a prerequisite of Morphic-bp.505 =============== Diff against Morphic-bp.508 =============== Item was removed: - Object subclass: #LayoutFrame - instanceVariableNames: 'leftFraction leftOffset topFraction topOffset rightFraction rightOffset bottomFraction bottomOffset' - classVariableNames: '' - poolDictionaries: '' - category: 'Morphic-Layouts'! - - !LayoutFrame commentStamp: '<historical>' prior: 0! - I define a frame for positioning some morph in a proportional layout. - - Instance variables: - leftFraction - topFraction - rightFraction - bottomFraction <Float> The fractional distance (between 0 and 1) to place the morph in its owner's bounds - leftOffset - topOffset - rightOffset - bottomOffset <Integer> Fixed pixel offset to apply after fractional positioning (e.g., "10 pixel right of the center of the owner")! Item was removed: - ----- Method: LayoutFrame class>>classVersion (in category 'accessing') ----- - classVersion - ^1 "changed treatment of bottomOffset and rightOffset" - ! Item was removed: - ----- Method: LayoutFrame class>>fractions: (in category 'instance creation') ----- - fractions: fractionsOrNil - ^self fractions: fractionsOrNil offsets: nil! Item was removed: - ----- Method: LayoutFrame class>>fractions:offsets: (in category 'instance creation') ----- - fractions: fractionsOrNil offsets: offsetsOrNil - - | fractions offsets | - - fractions := fractionsOrNil ifNil: [0@0 extent: 0@0]. - offsets := offsetsOrNil ifNil: [0@0 extent: 0@0]. - ^self new - topFraction: fractions top offset: offsets top; - leftFraction: fractions left offset: offsets left; - bottomFraction: fractions bottom offset: offsets bottom; - rightFraction: fractions right offset: offsets right - ! Item was removed: - ----- Method: LayoutFrame class>>offsets: (in category 'instance creation') ----- - offsets: offsetsOrNil - ^self fractions: nil offsets: offsetsOrNil! Item was removed: - ----- Method: LayoutFrame>>bottomFraction (in category 'accessing') ----- - bottomFraction - ^bottomFraction! Item was removed: - ----- Method: LayoutFrame>>bottomFraction: (in category 'accessing') ----- - bottomFraction: aNumber - bottomFraction := aNumber! Item was removed: - ----- Method: LayoutFrame>>bottomFraction:offset: (in category 'accessing') ----- - bottomFraction: aNumber offset: anInteger - - bottomFraction := aNumber. - bottomOffset := anInteger! Item was removed: - ----- Method: LayoutFrame>>bottomOffset (in category 'accessing') ----- - bottomOffset - ^bottomOffset! Item was removed: - ----- Method: LayoutFrame>>bottomOffset: (in category 'accessing') ----- - bottomOffset: anInteger - bottomOffset := anInteger! Item was removed: - ----- Method: LayoutFrame>>convertToCurrentVersion:refStream: (in category 'objects from disk') ----- - convertToCurrentVersion: varDict refStream: smartRefStrm - | className oldClassVersion | - - "JW 2/1/2001" - "Since class version isn't passed in varDict, look it up through smartRefSrm." - className := varDict at: #ClassName. - oldClassVersion := (smartRefStrm structures at: className) first. - (oldClassVersion = 0) ifTrue: [ self negateBottomRightOffsets ]. - ^super convertToCurrentVersion: varDict refStream: smartRefStrm. - ! Item was removed: - ----- Method: LayoutFrame>>layout:in: (in category 'layout') ----- - layout: oldBounds in: newBounds - "Return the proportional rectangle insetting the given bounds" - | left right top bottom | - leftFraction ifNotNil:[ - left := newBounds left + (newBounds width * leftFraction). - leftOffset ifNotNil:[left := left + leftOffset]]. - rightFraction ifNotNil:[ - right := newBounds right - (newBounds width * (1.0 - rightFraction)). - rightOffset ifNotNil:[right := right + rightOffset]]. - topFraction ifNotNil:[ - top := newBounds top + (newBounds height * topFraction). - topOffset ifNotNil:[top := top + topOffset]]. - bottomFraction ifNotNil:[ - bottom := newBounds bottom - (newBounds height * (1.0 - bottomFraction)). - bottomOffset ifNotNil:[bottom := bottom + bottomOffset]]. - left ifNil:[ right - ifNil:[left := oldBounds left. right := oldBounds right] - ifNotNil:[left := right - oldBounds width]]. - right ifNil:[right := left + oldBounds width]. - top ifNil:[ bottom - ifNil:[top := oldBounds top. bottom := oldBounds bottom] - ifNotNil:[top := bottom - oldBounds height]]. - bottom ifNil:[bottom := top + oldBounds height]. - ^(left rounded @ top rounded) corner: (right rounded @ bottom rounded)! Item was removed: - ----- Method: LayoutFrame>>leftFraction (in category 'accessing') ----- - leftFraction - ^leftFraction! Item was removed: - ----- Method: LayoutFrame>>leftFraction: (in category 'accessing') ----- - leftFraction: aNumber - leftFraction := aNumber! Item was removed: - ----- Method: LayoutFrame>>leftFraction:offset: (in category 'accessing') ----- - leftFraction: aNumber offset: anInteger - - leftFraction := aNumber. - leftOffset := anInteger! Item was removed: - ----- Method: LayoutFrame>>leftOffset (in category 'accessing') ----- - leftOffset - ^leftOffset! Item was removed: - ----- Method: LayoutFrame>>leftOffset: (in category 'accessing') ----- - leftOffset: anInteger - leftOffset := anInteger! Item was removed: - ----- Method: LayoutFrame>>minExtentFrom: (in category 'layout') ----- - minExtentFrom: minExtent - "Return the minimal extent the given bounds can be represented in" - | width height left right top bottom | - left := leftFraction ifNil: [0.0]. - right := rightFraction ifNil: [1.0]. - width := left = right - ifTrue: [0] - ifFalse: [minExtent x / (right - left)]. - top := topFraction ifNil: [0.0]. - bottom := bottomFraction ifNil: [1.0]. - height := bottom = top - ifTrue: [0] - ifFalse: [minExtent y / (bottom - top)]. - leftOffset ifNotNil:[width := width + leftOffset]. - rightOffset ifNotNil:[width := width + rightOffset]. - topOffset ifNotNil:[height := height + topOffset]. - bottomOffset ifNotNil:[height := height + bottomOffset]. - ^width truncated @ height truncated! Item was removed: - ----- Method: LayoutFrame>>negateBottomRightOffsets (in category 'objects from disk') ----- - negateBottomRightOffsets - - bottomOffset ifNotNil: [ bottomOffset := bottomOffset negated ]. - rightOffset ifNotNil: [ rightOffset := rightOffset negated ]. - - ! Item was removed: - ----- Method: LayoutFrame>>rightFraction (in category 'accessing') ----- - rightFraction - ^rightFraction! Item was removed: - ----- Method: LayoutFrame>>rightFraction: (in category 'accessing') ----- - rightFraction: aNumber - rightFraction := aNumber! Item was removed: - ----- Method: LayoutFrame>>rightFraction:offset: (in category 'accessing') ----- - rightFraction: aNumber offset: anInteger - - rightFraction := aNumber. - rightOffset := anInteger! Item was removed: - ----- Method: LayoutFrame>>rightOffset (in category 'accessing') ----- - rightOffset - ^rightOffset! Item was removed: - ----- Method: LayoutFrame>>rightOffset: (in category 'accessing') ----- - rightOffset: anInteger - rightOffset := anInteger! Item was removed: - ----- Method: LayoutFrame>>topFraction (in category 'accessing') ----- - topFraction - ^topFraction! Item was removed: - ----- Method: LayoutFrame>>topFraction: (in category 'accessing') ----- - topFraction: aNumber - topFraction := aNumber! Item was removed: - ----- Method: LayoutFrame>>topFraction:offset: (in category 'accessing') ----- - topFraction: aNumber offset: anInteger - - topFraction := aNumber. - topOffset := anInteger! Item was removed: - ----- Method: LayoutFrame>>topOffset (in category 'accessing') ----- - topOffset - ^topOffset! Item was removed: - ----- Method: LayoutFrame>>topOffset: (in category 'accessing') ----- - topOffset: anInteger - topOffset := anInteger! |
Free forum by Nabble | Edit this page |