ImageEditor.st
changeset 1045 c387bcacdf37
parent 1033 21b3bc025e0c
child 1047 f2d55d342903
equal deleted inserted replaced
1044:e63478a6e668 1045:c387bcacdf37
   214 'Shows a list of used colors of the image.'
   214 'Shows a list of used colors of the image.'
   215 
   215 
   216 #compressColormap
   216 #compressColormap
   217 'Remove unneeded entries from the colorMap.'
   217 'Remove unneeded entries from the colorMap.'
   218 
   218 
   219 #crobAll
   219 #cropAll
   220 'Find and remove all borders.'
   220 'Find and remove all borders.'
   221 
   221 
   222 #crobBottom
   222 #cropBottom
   223 'Find and remove bottom border.'
   223 'Find and remove bottom border.'
   224 
   224 
   225 #crobLeft
   225 #cropLeft
   226 'Find and remove left border.'
   226 'Find and remove left border.'
   227 
   227 
   228 #crobManual
   228 #cropManual
   229 'Specify border(s) to remove.'
   229 'Specify border(s) to remove.'
   230 
   230 
   231 #crobRight
   231 #cropRight
   232 'Find and remove right border.'
   232 'Find and remove right border.'
   233 
   233 
   234 #crobTop
   234 #cropTop
   235 'Find and remove top border.'
   235 'Find and remove top border.'
   236 
   236 
   237 #drawModeBox
   237 #drawModeBox
   238 'Switches to box-drawing mode.'
   238 'Switches to box-drawing mode.'
   239 
   239 
   451               )
   451               )
   452           )
   452           )
   453       )
   453       )
   454 !
   454 !
   455 
   455 
   456 grobDialogSpec
   456 gropDialogSpec
   457     "This resource specification was automatically generated
   457     "This resource specification was automatically generated
   458      by the UIPainter of ST/X."
   458      by the UIPainter of ST/X."
   459 
   459 
   460     "Do not manually edit this!! If it is corrupted,
   460     "Do not manually edit this!! If it is corrupted,
   461      the UIPainter may not be able to read the specification."
   461      the UIPainter may not be able to read the specification."
   470     ^
   470     ^
   471      
   471      
   472        #(#FullSpec
   472        #(#FullSpec
   473           #window: 
   473           #window: 
   474            #(#WindowSpec
   474            #(#WindowSpec
   475               #name: 'Crob Borders'
   475               #name: 'Crop Borders'
   476               #layout: #(#LayoutFrame 22 0 233 0 266 0 415 0)
   476               #layout: #(#LayoutFrame 22 0 233 0 266 0 415 0)
   477               #label: 'Crob Borders'
   477               #label: 'Crop Borders'
   478               #min: #(#Point 10 10)
   478               #min: #(#Point 10 10)
   479               #max: #(#Point 800 478)
   479               #max: #(#Point 800 478)
   480               #bounds: #(#Rectangle 22 233 267 416)
   480               #bounds: #(#Rectangle 22 233 267 416)
   481               #usePreferredExtent: false
   481               #usePreferredExtent: false
   482           )
   482           )
   983                                #(
   983                                #(
   984                                  #(#MenuItem
   984                                  #(#MenuItem
   985                                     #label: 'All'
   985                                     #label: 'All'
   986                                     #translateLabel: true
   986                                     #translateLabel: true
   987                                     #value: #doCrobAll
   987                                     #value: #doCrobAll
   988                                     #activeHelpKey: #crobAll
   988                                     #activeHelpKey: #cropAll
   989                                 )
   989                                 )
   990                                  #(#MenuItem
   990                                  #(#MenuItem
   991                                     #label: '-'
   991                                     #label: '-'
   992                                 )
   992                                 )
   993                                  #(#MenuItem
   993                                  #(#MenuItem
   994                                     #label: 'Left'
   994                                     #label: 'Left'
   995                                     #translateLabel: true
   995                                     #translateLabel: true
   996                                     #value: #doCrobLeft
   996                                     #value: #doCrobLeft
   997                                     #activeHelpKey: #crobLeft
   997                                     #activeHelpKey: #cropLeft
   998                                 )
   998                                 )
   999                                  #(#MenuItem
   999                                  #(#MenuItem
  1000                                     #label: 'Right'
  1000                                     #label: 'Right'
  1001                                     #translateLabel: true
  1001                                     #translateLabel: true
  1002                                     #value: #doCrobRight
  1002                                     #value: #doCrobRight
  1003                                     #activeHelpKey: #crobRight
  1003                                     #activeHelpKey: #cropRight
  1004                                 )
  1004                                 )
  1005                                  #(#MenuItem
  1005                                  #(#MenuItem
  1006                                     #label: 'Top'
  1006                                     #label: 'Top'
  1007                                     #translateLabel: true
  1007                                     #translateLabel: true
  1008                                     #value: #doCrobTop
  1008                                     #value: #doCrobTop
  1009                                     #activeHelpKey: #crobTop
  1009                                     #activeHelpKey: #cropTop
  1010                                 )
  1010                                 )
  1011                                  #(#MenuItem
  1011                                  #(#MenuItem
  1012                                     #label: 'Bottom'
  1012                                     #label: 'Bottom'
  1013                                     #translateLabel: true
  1013                                     #translateLabel: true
  1014                                     #value: #doCrobBottom
  1014                                     #value: #doCrobBottom
  1015                                     #activeHelpKey: #crobBottom
  1015                                     #activeHelpKey: #cropBottom
  1016                                 )
  1016                                 )
  1017                                  #(#MenuItem
  1017                                  #(#MenuItem
  1018                                     #label: '-'
  1018                                     #label: '-'
  1019                                 )
  1019                                 )
  1020                                  #(#MenuItem
  1020                                  #(#MenuItem
  1021                                     #label: 'Manual...'
  1021                                     #label: 'Manual...'
  1022                                     #translateLabel: true
  1022                                     #translateLabel: true
  1023                                     #value: #doCrobManual
  1023                                     #value: #doCrobManual
  1024                                     #activeHelpKey: #crobManual
  1024                                     #activeHelpKey: #cropManual
  1025                                 )
  1025                                 )
  1026                               ) nil
  1026                               ) nil
  1027                               nil
  1027                               nil
  1028                           )
  1028                           )
  1029                       )
  1029                       )
  2283     "change grid magnification"
  2283     "change grid magnification"
  2284 
  2284 
  2285     imageEditView changeGridMagnification
  2285     imageEditView changeGridMagnification
  2286 !
  2286 !
  2287 
  2287 
  2288 doCrobAll
  2288 doCropAll
  2289     "find all borders and cut them off"
  2289     "find all borders and cut them off"
  2290 
  2290 
  2291     imageEditView crobLeft:true right:true top:true bottom:true.   
  2291     imageEditView cropLeft:true right:true top:true bottom:true.   
  2292     self updateInfoLabel
  2292     self updateInfoLabel
  2293 
  2293 
  2294     "Modified: / 7.9.1998 / 14:26:23 / cg"
  2294     "Modified: / 7.9.1998 / 14:26:23 / cg"
  2295     "Created: / 7.9.1998 / 16:33:43 / cg"
  2295     "Created: / 7.9.1998 / 16:33:43 / cg"
  2296 !
  2296 !
  2297 
  2297 
  2298 doCrobBottom
  2298 doCropBottom
  2299     "find a bottom border and cut it off"
  2299     "find a bottom border and cut it off"
  2300 
  2300 
  2301     imageEditView crobLeft:false right:false top:false bottom:true.   
  2301     imageEditView cropLeft:false right:false top:false bottom:true.   
  2302     self updateInfoLabel
  2302     self updateInfoLabel
  2303 
  2303 
  2304     "Created: / 7.9.1998 / 13:00:20 / cg"
  2304     "Created: / 7.9.1998 / 13:00:20 / cg"
  2305     "Modified: / 7.9.1998 / 14:26:23 / cg"
  2305     "Modified: / 7.9.1998 / 14:26:23 / cg"
  2306 !
  2306 !
  2307 
  2307 
  2308 doCrobLeft
  2308 doCropLeft
  2309     "find a left border and cut it off"
  2309     "find a left border and cut it off"
  2310 
  2310 
  2311     imageEditView crobLeft:true right:false top:false bottom:false.   
  2311     imageEditView cropLeft:true right:false top:false bottom:false.   
  2312     self updateInfoLabel
  2312     self updateInfoLabel
  2313 
  2313 
  2314     "Created: / 7.9.1998 / 13:00:14 / cg"
  2314     "Created: / 7.9.1998 / 13:00:14 / cg"
  2315     "Modified: / 7.9.1998 / 14:26:34 / cg"
  2315     "Modified: / 7.9.1998 / 14:26:34 / cg"
  2316 !
  2316 !
  2317 
  2317 
  2318 doCrobManual
  2318 doCropManual
  2319     "let user specify borders and cut them off"
  2319     "let user specify borders and cut them off"
  2320 
  2320 
  2321     |bindings left top right bottom|
  2321     |bindings left top right bottom|
  2322 
  2322 
  2323     bindings := IdentityDictionary new.
  2323     bindings := IdentityDictionary new.
  2324     bindings at:#left put:(left := 0 asValue).
  2324     bindings at:#left put:(left := 0 asValue).
  2325     bindings at:#right put:(right := 0 asValue).
  2325     bindings at:#right put:(right := 0 asValue).
  2326     bindings at:#top put:(top := 0 asValue).
  2326     bindings at:#top put:(top := 0 asValue).
  2327     bindings at:#bottom put:(bottom := 0 asValue).
  2327     bindings at:#bottom put:(bottom := 0 asValue).
  2328     (self openDialogInterface:#grobDialogSpec withBindings:bindings)
  2328     (self openDialogInterface:#gropDialogSpec withBindings:bindings)
  2329     ifTrue:[
  2329     ifTrue:[
  2330         left := left value.
  2330         left := left value.
  2331         right := right value.
  2331         right := right value.
  2332         top := top value.
  2332         top := top value.
  2333         bottom := bottom value.
  2333         bottom := bottom value.
  2340 
  2340 
  2341     "Created: / 7.9.1998 / 18:16:07 / cg"
  2341     "Created: / 7.9.1998 / 18:16:07 / cg"
  2342     "Modified: / 7.9.1998 / 18:20:42 / cg"
  2342     "Modified: / 7.9.1998 / 18:20:42 / cg"
  2343 !
  2343 !
  2344 
  2344 
  2345 doCrobRight
  2345 doCropRight
  2346     "find a right border and cut it off"
  2346     "find a right border and cut it off"
  2347 
  2347 
  2348     imageEditView crobLeft:false right:true top:false bottom:false.   
  2348     imageEditView cropLeft:false right:true top:false bottom:false.   
  2349     self updateInfoLabel
  2349     self updateInfoLabel
  2350 
  2350 
  2351     "Created: / 7.9.1998 / 13:00:14 / cg"
  2351     "Created: / 7.9.1998 / 13:00:14 / cg"
  2352     "Modified: / 7.9.1998 / 14:26:44 / cg"
  2352     "Modified: / 7.9.1998 / 14:26:44 / cg"
  2353 !
  2353 !
  2354 
  2354 
  2355 doCrobTop
  2355 doCropTop
  2356     "find a top border and cut it off"
  2356     "find a top border and cut it off"
  2357 
  2357 
  2358     imageEditView crobLeft:false right:false top:true bottom:false.   
  2358     imageEditView cropLeft:false right:false top:true bottom:false.   
  2359     self updateInfoLabel
  2359     self updateInfoLabel
  2360 
  2360 
  2361     "Created: / 7.9.1998 / 13:00:19 / cg"
  2361     "Created: / 7.9.1998 / 13:00:19 / cg"
  2362     "Modified: / 7.9.1998 / 14:26:52 / cg"
  2362     "Modified: / 7.9.1998 / 14:26:52 / cg"
  2363 !
  2363 !