1205 |
1205 |
1206 |l oldWidth| |
1206 |l oldWidth| |
1207 |
1207 |
1208 l := someText. |
1208 l := someText. |
1209 l size > 1 ifTrue:[ |
1209 l size > 1 ifTrue:[ |
1210 l := OrderedCollection with:(l at:1) |
1210 l := OrderedCollection with:(l at:1) |
1211 ]. |
1211 ]. |
1212 oldWidth := self widthOfContents. |
1212 oldWidth := self widthOfContents. |
1213 super list:l. |
1213 super list:l. |
1214 self widthOfContents ~~ oldWidth ifTrue:[ |
1214 self widthOfContents ~~ oldWidth ifTrue:[ |
1215 self changed:#preferredExtent |
1215 self changedPreferredBounds:nil |
1216 ] |
1216 ] |
|
1217 |
|
1218 "Modified: 6.3.1997 / 16:13:36 / cg" |
1217 ! |
1219 ! |
1218 |
1220 |
1219 stringValue |
1221 stringValue |
1220 "alias for #contents - for compatibility with ST-80's InputField" |
1222 "alias for #contents - for compatibility with ST-80's InputField" |
1221 |
1223 |
1571 " |
1573 " |
1572 should (& can) we resize ? |
1574 should (& can) we resize ? |
1573 " |
1575 " |
1574 xCol := (self xOfCol:cursorCol inVisibleLine:cursorLine) - leftOffset. |
1576 xCol := (self xOfCol:cursorCol inVisibleLine:cursorLine) - leftOffset. |
1575 (xCol > (width * (5/6))) ifTrue:[ |
1577 (xCol > (width * (5/6))) ifTrue:[ |
1576 self changed:#preferredExtent |
1578 self changedPreferredBounds:nil |
1577 ] ifFalse:[ |
1579 ] ifFalse:[ |
1578 newWidth < (width * (1/6)) ifTrue:[ |
1580 newWidth < (width * (1/6)) ifTrue:[ |
1579 self changed:#preferredExtent |
1581 self changedPreferredBounds:nil |
1580 ] |
1582 ] |
1581 ]. |
1583 ]. |
1582 |
1584 |
1583 autoScrollHorizontally ifTrue:[ |
1585 autoScrollHorizontally ifTrue:[ |
1584 " |
1586 " |
1585 did someone react (i.e. has my extent changed) ? |
1587 did someone react (i.e. has my extent changed) ? |
1586 (if not, we scroll horizontally) |
1588 (if not, we scroll horizontally) |
1587 " |
1589 " |
1588 xCol := (self xOfCol:cursorCol inVisibleLine:cursorLine) - leftOffset. |
1590 xCol := (self xOfCol:cursorCol inVisibleLine:cursorLine) - leftOffset. |
1589 (xCol > (width * (5/6))) ifTrue:[ |
1591 (xCol > (width * (5/6))) ifTrue:[ |
1590 newOffset := leftOffset + (width // 2). |
1592 newOffset := leftOffset + (width // 2). |
1591 ] ifFalse:[ |
1593 ] ifFalse:[ |
1592 (xCol < (width * (1/6))) ifTrue:[ |
1594 (xCol < (width * (1/6))) ifTrue:[ |
1593 newOffset := 0 max: leftOffset - (width // 2). |
1595 newOffset := 0 max: leftOffset - (width // 2). |
1594 ] ifFalse:[ |
1596 ] ifFalse:[ |
1595 newOffset := leftOffset |
1597 newOffset := leftOffset |
1596 ] |
1598 ] |
1597 ]. |
1599 ]. |
1598 newOffset ~~ leftOffset ifTrue:[ |
1600 newOffset ~~ leftOffset ifTrue:[ |
1599 self scrollHorizontalTo:newOffset. |
1601 self scrollHorizontalTo:newOffset. |
1600 ] |
1602 ] |
1601 ]. |
1603 ]. |
|
1604 |
|
1605 "Modified: 6.3.1997 / 16:13:59 / cg" |
1602 ! |
1606 ! |
1603 |
1607 |
1604 showFocus:explicit |
1608 showFocus:explicit |
1605 "/ giving me the focus is loke clicking on me |
1609 "/ giving me the focus is loke clicking on me |
1606 "/ (tell my enterFieldGroup .... |
1610 "/ (tell my enterFieldGroup .... |