ObjectView.st
changeset 584 e3b11115fc18
parent 531 a2ceb2c8e853
child 588 2d6fc80017df
equal deleted inserted replaced
583:2ec13b7ceba5 584:e3b11115fc18
    42 "
    42 "
    43     a View which can hold DisplayObjects, can make selections, move them around etc.
    43     a View which can hold DisplayObjects, can make selections, move them around etc.
    44     this is an abstract class providing common mechanisms - actual instances are
    44     this is an abstract class providing common mechanisms - actual instances are
    45     DrawView, DirectoryView, LogicView or DocumentView.
    45     DrawView, DirectoryView, LogicView or DocumentView.
    46 
    46 
    47     Instance variables:
    47     [Instance variables:]
    48 
    48 
    49 	contents        <Collection>            the objects. The order in which
    49         contents        <Collection>            the objects. The order in which
    50 						these are in that collection defines
    50                                                 these are in that collection defines
    51 						their appearance in the z-plane:
    51                                                 their appearance in the z-plane:
    52 						an object located after another one
    52                                                 an object located after another one
    53 						here will be drawn ABOVE the other.
    53                                                 here will be drawn ABOVE the other.
    54 
    54 
    55 	sorted          <Boolean>               if set, redraw and picking methods
    55         sorted          <Boolean>               if set, redraw and picking methods
    56 						assume that the objects are sorted by 
    56                                                 assume that the objects are sorted by 
    57 						>= y-coordinates. These operations are
    57                                                 >= y-coordinates. These operations are
    58 						a bit faster then, since a binary search
    58                                                 a bit faster then, since a binary search
    59 						can be done. (use with care).
    59                                                 can be done. (use with care).
    60 
    60 
    61 	lastButt        <Point>                 last pointer press position
    61         lastButt        <Point>                 last pointer press position
    62 						(internal)
    62                                                 (internal)
    63 
    63 
    64 	pressAction     <Block>                 action to perform when mouse pointer
    64         pressAction     <Block>                 action to perform when mouse pointer
    65 						is pressed. Can be set to something like
    65                                                 is pressed. Can be set to something like
    66 						[self startCreate], [self startSelectOrMove]
    66                                                 [self startCreate], [self startSelectOrMove]
    67 						etc.
    67                                                 etc.
    68 
    68 
    69 	releaseAction   <Block>                 action to perform when mouse pointer is
    69         releaseAction   <Block>                 action to perform when mouse pointer is
    70 						released. Typically set in one of the
    70                                                 released. Typically set in one of the
    71 						startXXX methods.
    71                                                 startXXX methods.
    72 
    72 
    73 	shiftPressAction        <Block>         like pressAction, if shift key is
    73         shiftPressAction        <Block>         like pressAction, if shift key is
    74 						pressed.
    74                                                 pressed.
    75 
    75 
    76 	doublePressAction       <Block>         same for double-clicks
    76         doublePressAction       <Block>         same for double-clicks
    77 
    77 
    78 	motionAction            <Block>         action to perform on mouse-pointer
    78         motionAction            <Block>         action to perform on mouse-pointer
    79 						motion.
    79                                                 motion.
    80 
    80 
    81 	keyPressAction          <Block>         action for keyboard events
    81         keyPressAction          <Block>         action for keyboard events
    82 
    82 
    83 	selection               <any>           the current selection; either a single
    83         selection               <any>           the current selection; either a single
    84 						object or a collection of objects.
    84                                                 object or a collection of objects.
    85 
    85 
    86 	gridShown               <Boolean>       internal
    86         gridShown               <Boolean>       internal
    87 
    87 
    88 	gridPixmap              <Form>          internal
    88         gridPixmap              <Form>          internal
    89 
    89 
    90 	scaleMetric             <Symbol>        either #mm or #inch; used to
    90         scaleMetric             <Symbol>        either #mm or #inch; used to
    91 						decide how the grid is defined
    91                                                 decide how the grid is defined
    92 
    92 
    93 	dragObject                              internal
    93         dragObject                              internal
    94 
    94 
    95 	leftHandCursor                          cursor shown while dragging a rectangle
    95         leftHandCursor                          cursor shown while dragging a rectangle
    96 
    96 
    97 	oldCursor                               saved original cursor while dragging a rectangle
    97         oldCursor                               saved original cursor while dragging a rectangle
    98 
    98 
    99 	movedObject                             internal
    99         movedObject                             internal
   100 	moveStartPoint                          internal
   100         moveStartPoint                          internal
   101 	moveDelta                               internal
   101         moveDelta                               internal
   102 
   102 
   103 	documentFormat          <Symbol>        defines the size and layout of the
   103         documentFormat          <Symbol>        defines the size and layout of the
   104 						document. Can be any of
   104                                                 document. Can be any of
   105 						#letter, #a4, #a3 etc.
   105                                                 #letter, #a4, #a3 etc.
   106 
   106 
   107 	canDragOutOfView        <Boolean>       if true, objects can be dragged out of the
   107         canDragOutOfView        <Boolean>       if true, objects can be dragged out of the
   108 						view. If false, dragging is restricted to within
   108                                                 view. If false, dragging is restricted to within
   109 						this view.
   109                                                 this view.
   110 
   110 
   111 	rootMotion                              internal
   111         rootMotion                              internal
   112 	rootView                                internal
   112         rootView                                internal
   113 
   113 
   114 	aligning                <Boolean>       if true, pointer positions are
   114         aligning                <Boolean>       if true, pointer positions are
   115 						aligned (snapped) to the point
   115                                                 aligned (snapped) to the point
   116 						specified in gridAlign
   116                                                 specified in gridAlign
   117 
   117 
   118 	gridAlign               <Point>         if aligning is true, this point
   118         gridAlign               <Point>         if aligning is true, this point
   119 						defines the snapping. For example,
   119                                                 defines the snapping. For example,
   120 						12@12 defines snap to the nearest
   120                                                 12@12 defines snap to the nearest
   121 						12-point grid.
   121                                                 12-point grid.
   122 
   122 
   123     written spring/summer 89 by claus
   123     written spring/summer 89 by claus
       
   124 
       
   125     [author:]
       
   126         Claus Gittinger
       
   127 
       
   128     [see also:]
       
   129         DrawTool LogicTool
       
   130         DrawObject
       
   131         DisplayObject
   124 "
   132 "
   125 !
   133 !
   126 
   134 
   127 examples
   135 examples
   128 "
   136 "
  2761 ! !
  2769 ! !
  2762 
  2770 
  2763 !ObjectView class methodsFor:'documentation'!
  2771 !ObjectView class methodsFor:'documentation'!
  2764 
  2772 
  2765 version
  2773 version
  2766     ^ '$Header: /cvs/stx/stx/libwidg/ObjectView.st,v 1.32 1996-04-10 20:25:49 cg Exp $'
  2774     ^ '$Header: /cvs/stx/stx/libwidg/ObjectView.st,v 1.33 1996-04-25 17:16:52 cg Exp $'
  2767 ! !
  2775 ! !