Squeak Class Documentation category index | class index  
 
CipherPanel
  category: Morphic-Games
  superclass: WordGamePanelMorph
  subclasses:

The CipherPanel, as its name suggests, is a tool for decoding simple substitution codes, such as are presented on the puzzle pages of many Sunday newspapers. Most of the capability is inherited from the two WordGame classes used. To try it out, choose newMorph/Games/CipherPanel in a morphic project, or execute, in any project:

CipherPanel new openInWorld

instance methods
  events
  keyCharacter:atIndex:nextFocus:

  initialization
  encodedQuote:
extent:

  menu
  addMenuItemsTo:hand:
buttonRow
cipherStats
clearTyping
enterANewCipher
showHelpWindow
showHintsWindow
squeakCipher

  parts bin
  initializeToStandAlone

class methods
  as yet unclassified
  encode:
includeInNewMorphMenu
new
newFromQuote:
randomComment
sampleString
tedsHack

  parts bin
  descriptionForPartsBin

instance methods
  events top  
 

keyCharacter:atIndex:nextFocus:

Override with actual response


  initialization top  
 

encodedQuote:

World addMorph: CipherPanel new


 

extent:

Lay out with word wrap, alternating bewteen decoded and encoded lines.


  menu top  
 

addMenuItemsTo:hand:

override with actual menu items


 

buttonRow


 

cipherStats


 

clearTyping

Clear out all letters entered as a solution.


 

enterANewCipher


 

showHelpWindow


 

showHintsWindow


 

squeakCipher


  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.


class methods
  as yet unclassified top  
 

encode:

CipherPanel encode: 'Now is the time for all good men to come to the aid of their country.'


 

includeInNewMorphMenu

Return true for all classes that can be instantiated from the menu


 

new

NOTE: Use newFromQuote: rather than new to create new CipherPanels


 

newFromQuote:

Use this to creat new panels instead of new.


 

randomComment

CipherPanel randomComment


 

sampleString


 

tedsHack

Generate cryptic puzzles from method comments in the system


  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!