Squeak Class Documentation category index | class index  
 
StringMorph
  category: Morphic-Basic
  superclass: Morph
  subclasses: StringButtonMorph ClockMorph FrameRateMorph PopUpChoiceMorph IndentingListItemMorph InfoStringMorph MenuItemMorph ZASMStepsMorph UpdatingStringMorph

No comment. Sorry.

instance methods
  accessing
  contents
contents:
contentsClipped:
fitContents
font
font:
font:emphasis:
fontName:size:
fontToUse
handsWithMeForKeyboardFocus
hasFocus
interimContents:
minimumWidth
setWidth:
userString
valueFromContents

  drawing
  drawOn:
lookTranslucent

  editing
  acceptContents
acceptValue:
cancelEdits
doneWithEdits
handlesMouseDown:
launchMiniEditor:
lostFocusWithoutAccepting
mouseDown:
wantsKeyboardFocusOnShiftClick
wouldAcceptKeyboardFocus

  font
  emphasis:

  initialization
  addOptionalHandlesTo:box:
initWithContents:font:emphasis:
initialize

  layout
  fullBounds
minHeight

  object fileIn
 

  parts bin
  initializeToStandAlone

  printing
  balloonTextForClassAndMethodString
balloonTextForLexiconString
balloonTextForMethodString
boundsForBalloon
fullPrintOn:
printOn:

class methods
  instance creation
  authoringPrototype
contents:
contents:font:
contents:font:emphasis:

  parts bin
  descriptionForPartsBin

  testing
  test
test2

instance methods
  accessing top  
 

contents


 

contents:


 

contentsClipped:

Change my text, but do not change my size as a result


 

fitContents


 

font

who came up with #fontToUse rather than font?!


 

font:


 

font:emphasis:


 

fontName:size:


 

fontToUse


 

handsWithMeForKeyboardFocus

Answer the hands that have me as their keyboard focus


 

hasFocus


 

interimContents:

The receiver is under edit and aString represents the string the user sees as she edits, which typically will not have been accepted and indeed may be abandoned


 

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.


 

setWidth:


 

userString

Do I have a text string to be searched on?


 

valueFromContents

Return a new value from the current contents string.


  drawing top  
 

drawOn:


 

lookTranslucent

keep the text the same color (black)


  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.


 

acceptValue:


 

cancelEdits


 

doneWithEdits


 

handlesMouseDown:

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


 

launchMiniEditor:


 

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:

If the shift key is pressed, make this string the keyboard input focus.


 

wantsKeyboardFocusOnShiftClick


 

wouldAcceptKeyboardFocus

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


  font top  
 

emphasis:

Set the receiver's emphasis as indicated


  initialization top  
 

addOptionalHandlesTo:box:


 

initWithContents:font:emphasis:


 

initialize


  layout top  
 

fullBounds

Return the bounding box of the receiver and all its children. Recompute the layout if necessary.


 

minHeight


  object fileIn top  

  parts bin top  
 

initializeToStandAlone

Set up the receiver, created by a #basicNew and now ready to be initialized, as a fully-formed morph suitable for providing a graphic for a parts bin surrogate, and, when such a parts-bin surrogate is clicked on, for attaching to the hand as a viable stand-alone morph. Because of historical precedent, #initialize has been expected to handle this burden, though a great number of morphs actually cannot stand alone. In any case, by default we call the historical #initialize, though unhappily, so that all existing morphs will work no worse than before when using this protocol.


  printing top  
 

balloonTextForClassAndMethodString

Answer suitable balloon text for the receiver thought of as an encoding of the form
<className> [ class ] <selector>


 

balloonTextForLexiconString

Answer suitable balloon text for the receiver thought of as an encoding (used in Lexicons) of the form
<selector> <spaces> (<className>>)


 

balloonTextForMethodString

Answer suitable balloon text for the receiver thought of as a method belonging to the currently-selected class of a browser tool.


 

boundsForBalloon

Some morphs have bounds that are way too big. This is a contorted way of making things work okay in PluggableListMorphs, whose list elements historically have huge widths


 

fullPrintOn:


 

printOn:

Append to the argument, aStream, a sequence of characters that
identifies the receiver.


class methods
  instance creation top  
 

authoringPrototype

Answer an instance of the receiver suitable for placing in a parts bin for authors


 

contents:

'StringMorph contents: str' is faster than 'StringMorph new contents: str'


 

contents:font:


 

contents:font:emphasis:


  parts bin top  
 

descriptionForPartsBin

If the receiver is a member of a class that would like to be represented in a parts bin, answer the name by which it should be known, and a documentation string to be provided, for example, as balloon help. When the 'nativitySelector' is sent to the 'globalReceiver', it is expected that some kind of Morph will result. The parameters used in the implementation below are for documentation purposes only!


  testing top  
 

test

Return a morph with lots of strings for testing display speed.


 

test2

Return a morph with lots of strings for testing display speed.