ImageEditor.st
changeset 2796 f589f0efbaaf
parent 2792 f056aa5d29a7
child 2807 b89a09017a97
equal deleted inserted replaced
2795:4ad46363cf3c 2796:f589f0efbaaf
    15 	instanceVariableNames:'imageEditView colorMapMode editMode mouseKeyColorMode
    15 	instanceVariableNames:'imageEditView colorMapMode editMode mouseKeyColorMode
    16 		selectedColorIndex postOpenAction imageSeqNr drawingColormap
    16 		selectedColorIndex postOpenAction imageSeqNr drawingColormap
    17 		lastShiftUsedWrap lastGrabbedScreenArea
    17 		lastShiftUsedWrap lastGrabbedScreenArea
    18 		allowedToChangeImageDimensionAndDepth'
    18 		allowedToChangeImageDimensionAndDepth'
    19 	classVariableNames:'LastDirectory LastSizeString MaskClipboard LastColormapMode
    19 	classVariableNames:'LastDirectory LastSizeString MaskClipboard LastColormapMode
    20 		DefaultRelativeSizes'
    20 		DefaultRelativeSizes LastURL'
    21 	poolDictionaries:''
    21 	poolDictionaries:''
    22 	category:'Interface-UIPainter'
    22 	category:'Interface-UIPainter'
    23 !
    23 !
    24 
    24 
    25 !ImageEditor class methodsFor:'documentation'!
    25 !ImageEditor class methodsFor:'documentation'!
   439 #fileLoadFromClass
   439 #fileLoadFromClass
   440 'Select and load an image from a resource method'
   440 'Select and load an image from a resource method'
   441 
   441 
   442 #fileLoadFromFile
   442 #fileLoadFromFile
   443 'Select and load an image from a file'
   443 'Select and load an image from a file'
       
   444 
       
   445 #fileLoadFromURL
       
   446 'Load an image from the net, given its URL'
   444 
   447 
   445 #fileNewImage
   448 #fileNewImage
   446 'Create a new image'
   449 'Create a new image'
   447 
   450 
   448 #filePrint
   451 #filePrint
  2371             label: 'Load from File...'
  2374             label: 'Load from File...'
  2372             itemValue: doLoadFromFile
  2375             itemValue: doLoadFromFile
  2373             translateLabel: true
  2376             translateLabel: true
  2374           )
  2377           )
  2375          (MenuItem
  2378          (MenuItem
       
  2379             activeHelpKey: fileLoadFromURL
       
  2380             label: 'Load from URL...'
       
  2381             itemValue: doLoadFromURL
       
  2382             translateLabel: true
       
  2383           )
       
  2384          (MenuItem
  2376             label: 'Grab'
  2385             label: 'Grab'
  2377             translateLabel: true
  2386             translateLabel: true
  2378             submenu: 
  2387             submenu: 
  2379            (Menu
  2388            (Menu
  2380               (
  2389               (
  2517           )
  2526           )
  2518          )
  2527          )
  2519         nil
  2528         nil
  2520         nil
  2529         nil
  2521       )
  2530       )
  2522 
       
  2523     "Modified: / 04-07-2010 / 10:17:15 / cg"
       
  2524 !
  2531 !
  2525 
  2532 
  2526 menuMouseButtonColors
  2533 menuMouseButtonColors
  2527     "This resource specification was automatically generated
  2534     "This resource specification was automatically generated
  2528      by the MenuEditor of ST/X."
  2535      by the MenuEditor of ST/X."
  5960         LastDirectory := file asFilename directoryName.
  5967         LastDirectory := file asFilename directoryName.
  5961         self loadFromFile:file
  5968         self loadFromFile:file
  5962     ]
  5969     ]
  5963 !
  5970 !
  5964 
  5971 
       
  5972 doLoadFromURL
       
  5973     "opens a dialog for loading an image from a URL"
       
  5974 
       
  5975     |tempFile url|
       
  5976 
       
  5977     self checkModified ifFalse:[ ^ self ].
       
  5978 
       
  5979     url := Dialog 
       
  5980                 request:'Load Image from URL'
       
  5981                 initialAnswer:LastURL.
       
  5982 
       
  5983     url notEmptyOrNil ifTrue:[
       
  5984         LastURL := url.
       
  5985         tempFile := Filename newTemporary.
       
  5986         HTTPInterface get:url destinationFile:tempFile.
       
  5987         self loadFromFile:tempFile.
       
  5988         tempFile delete
       
  5989     ]
       
  5990 
       
  5991     "Created: / 20-09-2010 / 11:30:59 / cg"
       
  5992 !
       
  5993 
  5965 doNewImage
  5994 doNewImage
  5966     "opens a dialog with choices of size and color map for creating a new image"
  5995     "opens a dialog with choices of size and color map for creating a new image"
  5967 
  5996 
  5968     |dialogAspects width height cMapString cMapMode cMap imageClass image szString defaultSize ext|
  5997     |dialogAspects width height cMapString cMapMode cMap imageClass image szString defaultSize ext|
  5969 
  5998