Squeak Class Documentation category index | class index  
 
UpdatingStringMorph
  category: Morphic-Widgets
  superclass: StringMorph
  subclasses: UpdatingStringMorphWithArgument UpdatingBooleanStringMorph NameStringInHalo UpdatingNumericStringMorph SyntaxUpdatingStringMorph

A StringMorph that constantly tries to show the current data from the target object. When sent #step, it shows what the target objects has (target perform: getSelector). When edited (with shift-click), it writes back to the target.

floatPrecision = 1. to round to integer.
floatPrecision = .1 to round to 1 decimal place, etc.

Even when ((target == nil) or: [getSelector == nil]), the user would still like to edit the string with shift-click.

instance methods
  accessing
  autoAcceptOnFocusLoss
autoAcceptOnFocusLoss:
contents:
fitContents
floatPrecision
floatPrecision:
getSelector
getSelector:
growable
growable:
maximumWidth
minimumWidth
minimumWidth:
putSelector
putSelector:
target
target:

  card & stack
  couldHoldSeparateDataForEachInstance
currentDataValue
putOnBackground
setNewContentsFrom:
variableDocks

  copying
  veryDeepFixupWith:
veryDeepInner:

  drawing
 

  editing
  acceptContents
addCustomMenuItems:hand:
doneWithEdits
handlerForMouseDown:
handlesMouseDown:
lostFocusWithoutAccepting
mouseDown:
setFontSize
setFontStyle
setPrecision
setToAllowTextEdit
toggleGrowability
userEditsAllowed
wouldAcceptKeyboardFocus

  formats
  useDefaultFormat
useStringFormat

  initialization
  initialize

  object fileIn
 

  stepping
  step
stepTime
stepTime:
updateContentsFrom:

  target access
  acceptValue:
acceptValueFromTarget:
checkTarget
informTarget
readFromTarget
valueFromContents

class methods
  instance creation
  on:selector:

instance methods
  accessing top  
 

autoAcceptOnFocusLoss


 

autoAcceptOnFocusLoss:


 

contents:

This is the original StringMorph implementation of #contents:, restored down in UpdatingStringMorph because a recent 'optimization' of the StringMorph version of this method broke UpdatingStringMorphs.


 

fitContents


 

floatPrecision

Answer the floatPrecision to use:
1.0 -> show whole number
0.1 -> show one digit of precision
.01 -> show two digits of precision
etc.
Initialize the floatPrecision to 1 if it is not already defined


 

floatPrecision:


 

getSelector


 

getSelector:


 

growable


 

growable:


 

maximumWidth

Answer the maximum width that the receiver can have. A nil value means no maximum, and for practical purposes results in a value of 99999 here temporarily, for help in future debugging


 

minimumWidth

Answer the minimum width that the receiver can have. A nonzero value here keeps the receiver from degenerating into something that cannot ever be seen or touched again! Obeyed by fitContents.


 

minimumWidth:

Set the minimum width that the receiver can have. A nonzero value here keeps the receiver from degenerating into something that cannot ever be seen or touched again! Obeyed by fitContents.


 

putSelector


 

putSelector:


 

target


 

target:


  card & stack top  
 

couldHoldSeparateDataForEachInstance

Answer whether this type of morph is inherently capable of holding separate data for each instance ('card data')


 

currentDataValue

Answer the current data value held by the receiver


 

putOnBackground

Place the receiver, formerly private to its card, onto the shared background. If the receiver needs data carried on its behalf by the card, such data will be represented on every card.


 

setNewContentsFrom:


 

variableDocks

Answer a list of VariableDock objects for docking up my data with an instance held in my containing playfield. For a numeric-readout tile.


  copying top  
 

veryDeepFixupWith:

If target field is weakly copied, fix it here. If they were in the tree being copied, fix them up, otherwise point to the originals!!


 

veryDeepInner:

Copy all of my instance variables. Some need to be not copied at all, but shared.


  drawing top  

  editing top  
 

acceptContents

The message is sent when the user hits enter or Cmd-S. Accept the current contents and end editing. This default implementation does nothing.


 

addCustomMenuItems:hand:

Add morph-specific items to the given menu which was invoked by the given hand. This method provides is invoked both from the halo-menu and from the control-menu regimes.


 

doneWithEdits

If in a SyntaxMorph, shrink min width after editing


 

handlerForMouseDown:

Answer an object to field the mouseDown event provided, or nil if none


 

handlesMouseDown:

Do I want to receive mouseDown events (mouseDown:, mouseMove:, mouseUp:)?


 

lostFocusWithoutAccepting

The message is sent when the user, having been in an editing episode on the receiver, changes the keyboard focus -- typically by clicking on some editable text somewhere else -- without having accepted the current edits.


 

mouseDown:

The mouse went down over the receiver. If appropriate, launch a mini-editor so that the user can commence text-editing here


 

setFontSize


 

setFontStyle


 

setPrecision


 

setToAllowTextEdit

Set up the receiver so that it will be receptive to text editing, even if there is no putSelector provided


 

toggleGrowability


 

userEditsAllowed

Answer whether user-edits are allowed to this field


 

wouldAcceptKeyboardFocus

Answer whether a plain mouse click on the receiver should result in a text selection there


  formats top  
 

useDefaultFormat

Use the object's own printString format.


 

useStringFormat


  initialization top  
 

initialize

Initialie the receiver to have default values in its instance variables


  object fileIn top  

  stepping top  
 

step

Do some periodic activity. Use startStepping/stopStepping to start and stop getting sent this message. The time between steps is specified by this morph's answer to the stepTime message. The generic version dispatches control to the player, if any. The nasty circumlocation about owner's transformation is necessitated by the flexing problem that the player remains in the properties dictionary both of the flex and the real morph. In the current architecture, only the top renderer's pointer to the player should actually be honored for the purpose of firing.


 

stepTime

Answer the desired time between steps in milliseconds. This default implementation requests that the 'step' method be called once every second.


 

stepTime:


 

updateContentsFrom:


  target access top  
 

acceptValue:

If target is a CardPlayer, and its costume is one of my owners, change target to its current CardPlayer


 

acceptValueFromTarget:


 

checkTarget


 

informTarget

Obtain a value from my contents, and tell my target about it


 

readFromTarget

Update my readout from my target


 

valueFromContents

Return a new value from the current contents string.


class methods
  instance creation top  
 

on:selector: