Squeak Class Documentation category index | class index  
 
FormEditor
  category: ST80-Editors
  superclass: MouseMenuController
  subclasses:

I represent the basic editor for creating and modifying Forms. This is intended to be an easy to use general-purpose picture (bitMap) editor. I am a kind of MouseMenuController that creates a yellow button menu for accepting and canceling edits. My instances give up control if the cursor is outside the FormView or if a key on the keyboard is pressed.

instance methods
  basic control sequence
  controlInitialize
controlTerminate

  control defaults
  controlActivity
isControlActive

  cursor
  cursorPoint

  editing tools
  block
changeGridding
changeTool:
colorBlack
colorDarkGray
colorGray
colorLightGray
colorWhite
curve
eraseMode
fileInForm
fileOutForm
line
magnify
newSourceForm
overMode
repeatCopy
reverseMode
setColor:
singleCopy
togglexGridding
toggleyGridding
underMode

  initialize-release
  initialize
release

  menu messages
  accept
cancel
edit
fileOut
redButtonActivity

  pluggable menus
  getPluggableYellowButtonMenu:

  private
  dragForm
normalizeColor:
rubberBandFrom:until:
selectTool:
setVariables
trackFormUntil:

class methods
  class initialization
  flashCursor:
initialize

  examples
  formFromDisplay
fullScreen
newForm

  instance creation
  openFullScreenForm
openOnForm:

  private
  createFullScreenForm
createOnForm:
setKeyboardMap

instance methods
  basic control sequence top  
 

controlInitialize

Sent by Controller|startUp as part of the standard control sequence, it
provides a place in the standard control sequence for initializing the
receiver (taking into account the current state of its model and view). It
should be redefined in subclasses to perform some specific action.


 

controlTerminate

Resets the cursor to be the normal Smalltalk cursor.


  control defaults top  
 

controlActivity

Refer to the comment in Controller|controlActivity.


 

isControlActive

In contrast to class Controller, only blue button but not yellow button
events will end the receiver's control loop.


  cursor top  
 

cursorPoint

Answer the mouse coordinate data gridded according to the receiver's
grid.


  editing tools top  
 

block

Allow the user to fill a rectangle with the gray tone and mode currently
selected.


 

changeGridding

Allow the user to change the values of the horizontal and/or vertical
grid modules. Does not change the primary tool.


 

changeTool:

Change the value of the instance variable tool to be the tool
corresponding to aCharacter. Typically sent from a Switch in a
FormMenuView.


 

colorBlack

Set the mask (color) to black. Leaves the tool set in its previous state.


 

colorDarkGray

Set the mask (color) to dark gray. Leaves the tool set in its previous
state.


 

colorGray

Set the color to gray. Leaves the tool set in its previous state.


 

colorLightGray

Set the mask (color) to light gray. Leaves the tool set in its previous
state.


 

colorWhite

Set the color to white. Leaves the tool set in its previous state.


 

curve

Conic-section specified by three points designated by: first point--press
red button second point--release red button third point--click red button.
The resultant curve on the display is displayed according to the current
form and mode.


 

eraseMode

Set the mode for the tools that copy the form onto the display to erase.
Leaves the tool set in its previous state.


 

fileInForm

Ask the user for a file name and then recalls the Form in that file as the current source Form (form). Does not change the tool.


 

fileOutForm

Ask the user for a file name and save the current source form under that name. Does not change the tool.


 

line

Line is specified by two points from the mouse: first point--press red
button; second point--release red button. The resultant line is displayed
according to the current form and mode.


 

magnify

Allow for bit editing of an area of the Form. The user designates a
rectangular area that is scaled by 5 to allow individual screens dots to be
modified. Red button is used to set a bit to black, and yellow button is
used to set a bit to white. Editing continues until the user depresses any
key on the keyboard.


 

newSourceForm

Allow the user to define a new source form for the FormEditor. Copying
the source form onto the display is the primary graphical operation.
Resets the tool to be repeatCopy.


 

overMode

Set the mode for the tools that copy the form onto the display to over.
Leaves the tool set in its previous state.


 

repeatCopy

As long as the red button is pressed, copy the source form onto the
display screen.


 

reverseMode

Set the mode for the tools that copy the form onto the display to reverse.
Leaves the tool set in its previous state.


 

setColor:

Set the mask (color) to aColor.
Hacked to invoke color chooser if not B/W screen.
Leaves the tool set in its previous state.


 

singleCopy

If the red button is clicked, copy the source form onto the display
screen.


 

togglexGridding

Turn x (horizontal) gridding off, if it is on, and turns it on, if it is off.
Does not change the primary tool.


 

toggleyGridding

Turn y (vertical) gridding off, if it is on, and turns it on, if it is off.
Does not change the primary tool.


 

underMode

Set the mode for the tools that copy the form onto the display to under.
Leaves the tool set in its previous state.


  initialize-release top  
 

initialize

Initialize the state of the receiver. Subclasses should include 'super
initialize' when redefining this message to insure proper initialization.


 

release

Break the cycle between the Controller and its view. It is usually not
necessary to send release provided the Controller's view has been properly
released independently.


  menu messages top  
 

accept

The edited information should now be accepted by the view.


 

cancel

The edited information should be forgotten by the view.


 

edit


 

fileOut


 

redButtonActivity

Refer to the comment in MouseMenuController|redButtonActivity.


  pluggable menus top  
 

getPluggableYellowButtonMenu:


  private top  
 

dragForm


 

normalizeColor:


 

rubberBandFrom:until:


 

selectTool:

A new tool has been selected. It is denoted by aCharacter. Set the tool.
This code is written out in long hand (i.e., rather than dispatching on a
table of options) so that it is obvious what is happening.


 

setVariables


 

trackFormUntil:


class methods
  class initialization top  
 

flashCursor:


 

initialize

Controller initialize


  examples top  
 

formFromDisplay

Create an instance of me on a new form designated by the user at a
location designated by the user.


 

fullScreen

Create an instance of me on a new form that fills the full size of the
display screen.


 

newForm

Create an instance of me on a new form at a location designated by the user.


  instance creation top  
 

openFullScreenForm

Create and schedule an instance of me on the form whose extent is the
extent of the display screen.


 

openOnForm:

Create and schedule an instance of me on the form aForm.


  private top  
 

createFullScreenForm

Create a StandardSystemView for a FormEditor on the form whole screen.


 

createOnForm:

Create a StandardSystemView for a FormEditor on the form aForm.


 

setKeyboardMap

Keyboard Mapping.