Changeset 254

Show
Ignore:
Timestamp:
08/29/08 15:42:07 (4 months ago)
Author:
tal
Message:
- New GlyphMultilineView. It is highly experimental and incomplete.
- Drawing tweaks to the cell and collection views.
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • packages/defconAppKit/trunk/Lib/defconAppKit/views/glyphCellView.py

    r231 r254  
    1111gridColor = backgroundColor = NSColor.colorWithCalibratedWhite_alpha_(.6, 1.0) 
    1212selectionColor = NSColor.colorWithCalibratedRed_green_blue_alpha_(.82, .82, .9, 1.0) 
     13selectionColor = NSColor.colorWithCalibratedRed_green_blue_alpha_(.62, .62, .7, .5) 
    1314 
    1415 
     
    253254        NSColor.whiteColor().set() 
    254255        for index, glyph in enumerate(self._glyphs): 
    255             t = top-cellHeight 
     256            t = top - cellHeight 
    256257            rect = ((left, t), (cellWidth, cellHeight)) 
     258 
     259            NSRectFill(rect) 
    257260 
    258261            self._clickRectsToIndex[rect] = index 
    259262            self._indexToClickRects[index] = rect 
    260  
    261             if index in self._selection: 
    262                 selectionColor.set() 
    263                 NSRectFill(rect) 
    264                 NSColor.whiteColor().set() 
    265             else: 
    266                 NSRectFill(rect) 
    267263 
    268264            image = glyph.getRepresentation(representationName, width=cellWidth, height=cellHeight, **representationArguments) 
     
    270266                (left, t), ((0, 0), (cellWidth, cellHeight)), NSCompositeSourceOver, 1.0 
    271267                ) 
     268 
     269            if index in self._selection: 
     270                selectionColor.set() 
     271                r = ((left+1, t+1), (cellWidth-3, cellHeight-3)) 
     272                NSRectFillUsingOperation(r, NSCompositePlusDarker) 
     273                NSColor.whiteColor().set() 
     274 
    272275            left += cellWidth 
    273  
    274276            if left + cellWidth > width: 
    275277                left = 0 
  • packages/defconAppKit/trunk/Lib/defconAppKit/views/glyphCollectionView.py

    r230 r254  
    115115            listColumnDescriptions = [dict(title="Name", attribute="name")] 
    116116        super(GlyphCollectionView, self).__init__(posSize, [], columnDescriptions=listColumnDescriptions, 
    117             editCallback=editCallback, 
     117            editCallback=editCallback, selectionCallback=selectionCallback, 
    118118            showColumnTitles=listShowColumnTitles, enableTypingSensitivity=True, enableDelete=enableDelete, 
    119119            autohidesScrollers=False,