UIPainterView.st
changeset 2278 8ff3bd6f0820
parent 2276 485bda17023f
child 2295 79edbe5882c6
equal deleted inserted replaced
2277:342f25e2c276 2278:8ff3bd6f0820
   706 
   706 
   707     mime notNil ifTrue:[
   707     mime notNil ifTrue:[
   708         mime = 'application/x-waltop-digital-notepad' ifTrue:[
   708         mime = 'application/x-waltop-digital-notepad' ifTrue:[
   709             sketchPainterClass := TOPFileDrawer.
   709             sketchPainterClass := TOPFileDrawer.
   710         ].
   710         ].
       
   711         (mime startsWith:'image') ifTrue:[
       
   712             self viewBackground:(ImageReader fromFile:aFilename).
       
   713             ^ self.
       
   714         ].
   711     ].
   715     ].
   712     sketchPainterClass isNil ifTrue:[
   716     sketchPainterClass isNil ifTrue:[
   713         self error:'unsupported sketch file format'
   717         self error:'unsupported sketch file format'
   714     ].
   718     ].
   715 
   719 
   718     sketchPainter readFile:aFilename.
   722     sketchPainter readFile:aFilename.
   719     sketchPainter ajustSketch.
   723     sketchPainter ajustSketch.
   720     self invalidate.
   724     self invalidate.
   721 
   725 
   722     "Created: / 16-01-2008 / 17:46:26 / cg"
   726     "Created: / 16-01-2008 / 17:46:26 / cg"
   723 
       
   724 ! !
   727 ! !
   725 
   728 
   726 !UIPainterView methodsFor:'event handling'!
   729 !UIPainterView methodsFor:'event handling'!
   727 
   730 
   728 keyPress:key x:x y:y view:aView
   731 keyPress:key x:x y:y view:aView