Changeset 277
- Timestamp:
- 10/28/08 17:30:09 (2 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
packages/defconAppKit/trunk/Lib/defconAppKit/views/glyphCellView.py
r268 r277 114 114 self._glyphDetailOnMouseMoved = False 115 115 116 self._windowIsClosed = False 117 116 118 return self 117 119 … … 122 124 def setAllowsDrag_(self, value): 123 125 self._allowDrag = value 126 127 def preloadGlyphCellImages(self): 128 representationName = self._cellRepresentationName 129 representationArguments = self._cellRepresentationArguments 130 cellWidth = self._cellWidth 131 cellHeight = self._cellHeight 132 for glyph in self._glyphs: 133 glyph.getRepresentation(representationName, width=cellWidth, height=cellHeight, **representationArguments) 124 134 125 135 def setGlyphs_(self, glyphs): … … 221 231 222 232 def windowCloseNotification_(self, notification): 233 self._windowIsClosed = True 223 234 if self._glyphDetailWindow is not None: 224 235 if self._glyphDetailWindow.getNSWindow() is not None: … … 272 283 self._indexToClickRects = {} 273 284 285 visibleRect = self.visibleRect() 286 274 287 NSColor.whiteColor().set() 275 288 for index, glyph in enumerate(self._glyphs): … … 282 295 self._indexToClickRects[index] = rect 283 296 284 image = glyph.getRepresentation(representationName, width=cellWidth, height=cellHeight, **representationArguments) 285 image.drawAtPoint_fromRect_operation_fraction_( 286 (left, t), ((0, 0), (cellWidth, cellHeight)), NSCompositeSourceOver, 1.0 287 ) 288 289 if index in self._selection: 290 selectionColor.set() 291 r = ((left+1, t+1), (cellWidth-3, cellHeight-3)) 292 NSRectFillUsingOperation(r, NSCompositePlusDarker) 293 NSColor.whiteColor().set() 297 if NSIntersectsRect(visibleRect, rect): 298 image = glyph.getRepresentation(representationName, width=cellWidth, height=cellHeight, **representationArguments) 299 image.drawAtPoint_fromRect_operation_fraction_( 300 (left, t), ((0, 0), (cellWidth, cellHeight)), NSCompositeSourceOver, 1.0 301 ) 302 303 if index in self._selection: 304 selectionColor.set() 305 r = ((left+1, t+1), (cellWidth-3, cellHeight-3)) 306 NSRectFillUsingOperation(r, NSCompositePlusDarker) 307 NSColor.whiteColor().set() 294 308 295 309 left += cellWidth … … 299 313 300 314 path = NSBezierPath.bezierPath() 301 for i in xrange(1, self._rowCount ):315 for i in xrange(1, self._rowCount+1): 302 316 top = (i * cellHeight) - .5 303 317 path.moveToPoint_((0, top)) 304 318 path.lineToPoint_((width, top)) 305 for i in xrange(1, self._columnCount ):319 for i in xrange(1, self._columnCount+1): 306 320 left = (i * cellWidth) - .5 307 321 path.moveToPoint_((left, 0)) … … 383 397 def _handleDetailWindow(self, event, found, mouseDown=False, mouseMoved=False, mouseDragged=False, mouseUp=False, inDragAndDrop=False): 384 398 # no window 399 if self._windowIsClosed: 400 return 385 401 if self._glyphDetailWindow is None: 386 402 return
