UIPainterView.st
changeset 212 1836a16763cc
parent 211 45f193f4e870
child 219 7b38043ae232
equal deleted inserted replaced
211:45f193f4e870 212:1836a16763cc
   470         ].
   470         ].
   471         self setSelection:nil withRedraw:true.
   471         self setSelection:nil withRedraw:true.
   472 
   472 
   473         newSel  := OrderedCollection new.
   473         newSel  := OrderedCollection new.
   474         builder := UIBuilder new.
   474         builder := UIBuilder new.
       
   475         className notNil ifTrue:[
       
   476             builder applicationClass:(Smalltalk classNamed:className).
       
   477         ].
   475 
   478 
   476         keepLayout ifFalse:[
   479         keepLayout ifFalse:[
   477             pasteOffset := 0@0.
   480             pasteOffset := 0@0.
   478             pasteOrigin := self sensor mousePoint.
   481             pasteOrigin := self sensor mousePoint.
   479             pasteOrigin := device translatePoint:pasteOrigin from:device rootView id to:frame id.
   482             pasteOrigin := device translatePoint:pasteOrigin from:device rootView id to:frame id.
   509         self realizeAllSubViews.
   512         self realizeAllSubViews.
   510         inputView raise.
   513         inputView raise.
   511         self select:newSel.
   514         self select:newSel.
   512         self elementChangedSize:frame.
   515         self elementChangedSize:frame.
   513     ]
   516     ]
       
   517 
       
   518     "Modified: 4.7.1997 / 23:49:14 / cg"
   514 !
   519 !
   515 
   520 
   516 pasteWithLayout
   521 pasteWithLayout
   517     "add the objects in the paste-buffer to the object view; don't change the
   522     "add the objects in the paste-buffer to the object view; don't change the
   518      layout
   523      layout
   943 
   948 
   944 addSpec:aSpecification builder:aBuilder in:aFrame
   949 addSpec:aSpecification builder:aBuilder in:aFrame
   945     "build view and subviews from aSpecification into a frame. The top view
   950     "build view and subviews from aSpecification into a frame. The top view
   946      is returned. The contained components of a spec are set to nil
   951      is returned. The contained components of a spec are set to nil
   947     "
   952     "
   948     aBuilder applicationClass:(Smalltalk classNamed:className).
   953 
       
   954     className notNil ifTrue:[
       
   955         aBuilder applicationClass:(Smalltalk classNamed:className).
       
   956     ].
   949 
   957 
   950     aBuilder componentCreationHook:[:aView :aSpec :aBdr||sv p s n|
   958     aBuilder componentCreationHook:[:aView :aSpec :aBdr||sv p s n|
   951         p := ViewProperty new.
   959         p := ViewProperty new.
   952         s := aSpec copy.
   960         s := aSpec copy.
   953         p spec:s.
   961         p spec:s.
   965         listHolder add:p
   973         listHolder add:p
   966     ].
   974     ].
   967 
   975 
   968     ^ aSpecification buildViewWithLayoutFor:aBuilder in:aFrame.
   976     ^ aSpecification buildViewWithLayoutFor:aBuilder in:aFrame.
   969 
   977 
       
   978     "Modified: 4.7.1997 / 23:48:55 / cg"
   970 !
   979 !
   971 
   980 
   972 fullSpecFor:anObject
   981 fullSpecFor:anObject
   973     "generate a full spec for an object
   982     "generate a full spec for an object
   974     "
   983     "
  1031 
  1040 
  1032     self singleSelection notNil ifTrue:[
  1041     self singleSelection notNil ifTrue:[
  1033         self withSelectionHiddenDo:[
  1042         self withSelectionHiddenDo:[
  1034             self transaction:#specification selectionDo:[:aView|
  1043             self transaction:#specification selectionDo:[:aView|
  1035                 builder := UIBuilder new.
  1044                 builder := UIBuilder new.
       
  1045                 className notNil ifTrue:[
       
  1046                     builder applicationClass:(Smalltalk classNamed:className).
       
  1047                 ].
  1036                 props   := self propertyOfView:aView.
  1048                 props   := self propertyOfView:aView.
  1037                 name    := (aSpec name) withoutSeparators.
  1049                 name    := (aSpec name) withoutSeparators.
  1038 
  1050 
  1039                 name = props name ifFalse:[
  1051                 name = props name ifFalse:[
  1040                     (self propertyOfName:name) notNil ifTrue:[
  1052                     (self propertyOfName:name) notNil ifTrue:[
  1058                 props spec:(aSpec copy).
  1070                 props spec:(aSpec copy).
  1059                 listHolder propertyChanged:props.
  1071                 listHolder propertyChanged:props.
  1060             ]
  1072             ]
  1061         ]
  1073         ]
  1062     ]
  1074     ]
       
  1075 
       
  1076     "Modified: 4.7.1997 / 23:49:44 / cg"
  1063 ! !
  1077 ! !
  1064 
  1078 
  1065 !UIPainterView methodsFor:'transaction'!
  1079 !UIPainterView methodsFor:'transaction'!
  1066 
  1080 
  1067 transaction:aType objects:something do:aOneArgBlock
  1081 transaction:aType objects:something do:aOneArgBlock
  1200 
  1214 
  1201     props notNil ifTrue:[
  1215     props notNil ifTrue:[
  1202         view    := props view.
  1216         view    := props view.
  1203         spec    := args at:1.
  1217         spec    := args at:1.
  1204         builder := UIBuilder new.
  1218         builder := UIBuilder new.
       
  1219         className notNil ifTrue:[
       
  1220             builder applicationClass:(Smalltalk classNamed:className).
       
  1221         ].
  1205         props spec:spec.
  1222         props spec:spec.
  1206 
  1223 
  1207         spec needsRebuildForAttributes ifTrue:[
  1224         spec needsRebuildForAttributes ifTrue:[
  1208             v := spec buildViewWithLayoutFor:builder in:view superView.
  1225             v := spec buildViewWithLayoutFor:builder in:view superView.
  1209             v realize.    
  1226             v realize.    
  1214             self elementChangedSize:view.
  1231             self elementChangedSize:view.
  1215         ].
  1232         ].
  1216         listHolder propertyChanged:props.
  1233         listHolder propertyChanged:props.
  1217     ]
  1234     ]
  1218 
  1235 
       
  1236     "Modified: 4.7.1997 / 23:49:39 / cg"
  1219 ! !
  1237 ! !
  1220 
  1238 
  1221 !UIPainterView methodsFor:'user actions - arrange'!
  1239 !UIPainterView methodsFor:'user actions - arrange'!
  1222 
  1240 
  1223 lowerSelection
  1241 lowerSelection