Changeset 271
- Timestamp:
- 10/03/08 07:00:21 (2 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
packages/defconAppKit/trunk/Lib/defconAppKit/views/glyphCollectionView.py
r270 r271 39 39 listShowColumnTitles 40 40 Same as showColumnTitles in vanilla.List 41 42 showModePlacard 43 Flag to indicate if the mode switch placard should be shown. This can be 44 useful if you only want to show the list or the cell view. 41 45 42 46 cellRepresentationName … … 75 79 76 80 def __init__(self, posSize, initialMode="cell", listColumnDescriptions=None, listShowColumnTitles=False, 81 showModePlacard=True, 77 82 cellRepresentationName="defconAppKitGlyphCell", glyphDetailWindowClass=GlyphInformationPopUpWindow, 78 83 selectionCallback=None, doubleClickCallback=None, deleteCallback=None, editCallback=None, … … 144 149 dropTypes.append(d["type"]) 145 150 self._glyphCellView.registerForDraggedTypes_(dropTypes) 151 self._placard = None 146 152 ## set up the placard 147 placardW = 34 148 placardH = 16 149 self._placard = vanilla.Group((0, 0, placardW, placardH)) 150 self._placard.button = PlacardSegmentedButton((0, 0, placardW, placardH), 151 [dict(imageObject=placardCellImage, width=16), dict(imageObject=placardListImage, width=18)], 152 callback=self._placardSelection, sizeStyle="mini") 153 self._nsObject.setPlacard_(self._placard.getNSView()) 153 if showModePlacard: 154 placardW = 34 155 placardH = 16 156 self._placard = vanilla.Group((0, 0, placardW, placardH)) 157 self._placard.button = PlacardSegmentedButton((0, 0, placardW, placardH), 158 [dict(imageObject=placardCellImage, width=16), dict(imageObject=placardListImage, width=18)], 159 callback=self._placardSelection, sizeStyle="mini") 160 self._nsObject.setPlacard_(self._placard.getNSView()) 154 161 ## tweak the scroll view 155 162 self._nsObject.setBackgroundColor_(gridColor) … … 186 193 if mode == "list": 187 194 documentView = self._tableView 188 placard.button.set(1) 195 if placard is not None: 196 placard.button.set(1) 189 197 elif mode == "cell": 190 198 documentView = self._glyphCellView 191 placard.button.set(0) 199 if placard is not None: 200 placard.button.set(0) 192 201 self._nsObject.setDocumentView_(documentView) 193 202 self._mode = mode
