Changeset 285
- Timestamp:
- 11/13/08 14:23:23 (2 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
packages/defconAppKit/trunk/Lib/defconAppKit/views/glyphCellView.py
r280 r285 200 200 201 201 def glyphDetailWindow(self): 202 if self._glyphDetailWindow is None and self._glyphDetailWindowClass is not None: 203 self._setupGlyphDetailWindow() 202 204 return self._glyphDetailWindow 205 206 def _setupGlyphDetailWindow(self): 207 if self._glyphDetailWindow is None and self._glyphDetailWindowClass is not None: 208 screen = self.window().screen() 209 self._glyphDetailWindow = self._glyphDetailWindowClass(screen=screen) 203 210 204 211 # selection … … 257 264 # if window() returns an object, open the detail window 258 265 if self.window() is not None: 259 if self._glyphDetailWindow is None and self._glyphDetailWindowClass is not None:260 self._glyphDetailWindow = self._glyphDetailWindowClass()261 266 self.subscribeToWindow() 262 267 self.subscribeToScrollViewFrameChange() … … 402 407 if self._windowIsClosed: 403 408 return 404 if self._glyphDetailWindow is None: 409 glyphDetailWindow = self.glyphDetailWindow() 410 if glyphDetailWindow is None: 405 411 return 406 412 # determine show/hide … … 415 421 ## to be called after a drop from the view has occurred 416 422 ## outside of the view. 417 elif mouseDragged and not self._glyphDetailWindow.isVisible():423 elif mouseDragged and not glyphDetailWindow.isVisible(): 418 424 shouldBeVisible = False 419 425 ## event requirements … … 454 460 # set the position 455 461 if shouldBeVisible: 456 x, y = eventLocation 457 windowX, windowY = event.window().frame().origin 458 detailX = windowX + x 459 detailY = windowY + y 462 detailX, detailY = self.window().convertBaseToScreen_(eventLocation) 460 463 glyph = self._glyphs[found] 461 self._glyphDetailWindow.setPositionNearCursor((detailX, detailY))462 self._glyphDetailWindow.set(glyph)463 if not self._glyphDetailWindow.isVisible():464 self._glyphDetailWindow.show()465 else: 466 self._glyphDetailWindow.hide()464 glyphDetailWindow.setPositionNearCursor((detailX, detailY)) 465 glyphDetailWindow.set(glyph) 466 if not glyphDetailWindow.isVisible(): 467 glyphDetailWindow.show() 468 else: 469 glyphDetailWindow.hide() 467 470 468 471 def _mouseSelection(self, event, found, mouseDown=False, mouseDragged=False, mouseUp=False, mouseMoved=False): … … 816 819 class GlyphInformationPopUpWindow(InformationPopUpWindow): 817 820 818 def __init__(self ):821 def __init__(self, screen=None): 819 822 posSize = (200, 280) 820 super(GlyphInformationPopUpWindow, self).__init__(posSize )823 super(GlyphInformationPopUpWindow, self).__init__(posSize, screen=screen) 821 824 self.glyphView = GlyphInformationGlyphView((5, 5, -5, 145)) 822 825 packages/defconAppKit/trunk/Lib/defconAppKit/windows/popUpWindow.py
r281 r285 32 32 nsWindowLevel = NSTornOffMenuWindowLevel 33 33 34 def __init__(self, posSize ):34 def __init__(self, posSize, screen=None): 35 35 super(InformationPopUpWindow, self).__init__(posSize, "", minSize=None, 36 36 maxSize=None, textured=False, autosaveName=None, 37 closable=False, initiallyVisible=False )37 closable=False, initiallyVisible=False, screen=screen) 38 38 contentView = DefconAppKitInformationPopUpWindowContentView.alloc().init() 39 39 self._window.setContentView_(contentView) … … 175 175 contentViewClass = DefconAppKitInteractivePopUpWindowContentView 176 176 177 def __init__(self, posSize ):178 super(InteractivePopUpWindow, self).__init__(posSize )177 def __init__(self, posSize, screen=None): 178 super(InteractivePopUpWindow, self).__init__(posSize, screen=screen) 179 179 self._window.setMovableByWindowBackground_(True) 180 180
