ImageEditor.st
changeset 3411 fd6472405fd0
parent 3409 d821859c163e
child 3412 bd8ab9274cbd
equal deleted inserted replaced
3410:9b25f06de776 3411:fd6472405fd0
   108 !
   108 !
   109 
   109 
   110 openModalOnFile:aFileName
   110 openModalOnFile:aFileName
   111     "opens an Image Editor on aFileName"
   111     "opens an Image Editor on aFileName"
   112 
   112 
   113     self openLoadingImageWith:[:editor | 
   113     self 
   114         editor loadFromFile:aFileName.
   114         openLoadingImageWith:[:editor | 
   115     ] modal:true.
   115             editor loadFromFile:aFileName.
       
   116         ] 
       
   117         modal:true.
   116 
   118 
   117     "
   119     "
   118      self openModalOnFile: '../../goodies/bitmaps/gifImages/back.gif'
   120      self openModalOnFile: '../../goodies/bitmaps/gifImages/back.gif'
   119     "
   121     "
       
   122 
       
   123     "Modified (format): / 18-02-2017 / 00:17:52 / cg"
   120 !
   124 !
   121 
   125 
   122 openModalOnImage:anImage
   126 openModalOnImage:anImage
   123     "opens a modal Image Editor on an image.
   127     "opens a modal Image Editor on an image.
   124      Returns the modified image or nil if unsaved/unchanged"
   128      Returns the modified image or nil if unsaved/unchanged"
  2967          (MenuItem
  2971          (MenuItem
  2968             label: '-'
  2972             label: '-'
  2969           )
  2973           )
  2970          (MenuItem
  2974          (MenuItem
  2971             activeHelpKey: fileEditMask
  2975             activeHelpKey: fileEditMask
  2972             enabled: imageIsLoadedHolder
  2976             enabled: hasMaskHolder
  2973             label: 'Edit Mask'
  2977             label: 'Edit Mask'
  2974             itemValue: doEditMask
  2978             itemValue: doEditMask
  2975             translateLabel: true
  2979             translateLabel: true
  2976           )
  2980           )
  2977          (MenuItem
  2981          (MenuItem
  3019          )
  3023          )
  3020         nil
  3024         nil
  3021         nil
  3025         nil
  3022       )
  3026       )
  3023 
  3027 
  3024     "Modified: / 16-02-2017 / 11:01:52 / cg"
  3028     "Modified: / 18-02-2017 / 00:41:45 / cg"
  3025 !
  3029 !
  3026 
  3030 
  3027 menuFile
  3031 menuFile
  3028     "This resource specification was automatically generated
  3032     "This resource specification was automatically generated
  3029      by the MenuEditor of ST/X."
  3033      by the MenuEditor of ST/X."
  3136             label: 'Save to File...'
  3140             label: 'Save to File...'
  3137             itemValue: doSaveImageFileAs
  3141             itemValue: doSaveImageFileAs
  3138           )
  3142           )
  3139          (MenuItem
  3143          (MenuItem
  3140             activeHelpKey: fileSaveMaskAs
  3144             activeHelpKey: fileSaveMaskAs
  3141             enabled: imageIsLoadedHolder
  3145             enabled: hasMaskHolder
  3142             label: 'Save Mask to File...'
  3146             label: 'Save Mask to File...'
  3143             itemValue: doSaveImageMaskFileAs
  3147             itemValue: doSaveImageMaskFileAs
  3144           )
  3148           )
  3145          (MenuItem
  3149          (MenuItem
  3146             activeHelpKey: fileSaveButtonImageAs
  3150             activeHelpKey: fileSaveButtonImageAs
  3198           )
  3202           )
  3199          )
  3203          )
  3200         nil
  3204         nil
  3201         nil
  3205         nil
  3202       )
  3206       )
       
  3207 
       
  3208     "Modified: / 18-02-2017 / 00:41:36 / cg"
  3203 !
  3209 !
  3204 
  3210 
  3205 menuMouseButtonColors
  3211 menuMouseButtonColors
  3206     "This resource specification was automatically generated
  3212     "This resource specification was automatically generated
  3207      by the MenuEditor of ST/X."
  3213      by the MenuEditor of ST/X."
  5200 hasLastGrabScreenArea
  5206 hasLastGrabScreenArea
  5201     ^ [ lastGrabbedScreenArea notNil ]
  5207     ^ [ lastGrabbedScreenArea notNil ]
  5202 !
  5208 !
  5203 
  5209 
  5204 hasMask
  5210 hasMask
       
  5211     self image isNil ifTrue:[^ false].
       
  5212     self image mask isNil ifTrue:[^ false].
  5205     ^ colorMapMode value notNil and:[colorMapMode value startsWith:'mask']
  5213     ^ colorMapMode value notNil and:[colorMapMode value startsWith:'mask']
  5206 
  5214 
  5207     "Created: / 18.8.1998 / 17:17:38 / cg"
  5215     "Created: / 18-08-1998 / 17:17:38 / cg"
       
  5216     "Modified: / 18-02-2017 / 00:40:25 / cg"
       
  5217 !
       
  5218 
       
  5219 hasMaskHolder
       
  5220     ^ [ self hasMask ]
       
  5221 
       
  5222     "Created: / 18-02-2017 / 00:41:19 / cg"
  5208 !
  5223 !
  5209 
  5224 
  5210 modified
  5225 modified
  5211     ^ imageEditView modified
  5226     ^ imageEditView modified
  5212 !
  5227 !
  6946     self findColorMapMode.     
  6961     self findColorMapMode.     
  6947     "/ imageEditView removelastUndo
  6962     "/ imageEditView removelastUndo
  6948 !
  6963 !
  6949 
  6964 
  6950 doEditMask
  6965 doEditMask
  6951     self image mask edit
  6966     |mask|
       
  6967 
       
  6968     (mask := self image mask) notNil ifTrue:[
       
  6969         mask edit
       
  6970     ].
       
  6971 
       
  6972     "Modified: / 18-02-2017 / 00:38:51 / cg"
  6952 !
  6973 !
  6953 
  6974 
  6954 doFlipHorizontal
  6975 doFlipHorizontal
  6955     "flips horizontally current image"
  6976     "flips horizontally current image"
  6956 
  6977