• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python wrappermap.wrapper函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中miro.plat.frontends.widgets.wrappermap.wrapper函数的典型用法代码示例。如果您正苦于以下问题:Python wrapper函数的具体用法?Python wrapper怎么用?Python wrapper使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了wrapper函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: buttonChanged_

 def buttonChanged_(self, button):
     if button.state() == NSOnState:
         self.addSubview_(self.content_view)
     else:
         self.content_view.removeFromSuperview()
     if self.window():
         wrappermap.wrapper(self).invalidate_size_request()
开发者ID:jcooley,项目名称:miro,代码行数:7,代码来源:layout.py


示例2: mouseDown_

 def mouseDown_(self, event):
     self.releaseInbounds = self.stopTracking = self.firedOnce = False
     self.cell().trackMouse_inRect_ofView_untilMouseUp_(event,
             self.bounds(), self, YES)
     if self.releaseInbounds:
         if self.firedOnce:
             wrappermap.wrapper(self).emit('released')
         else:
             wrappermap.wrapper(self).emit('clicked')
开发者ID:nxmirrors,项目名称:miro,代码行数:9,代码来源:customcontrol.py


示例3: textDidEndEditing_

    def textDidEndEditing_(self, notification):
        # Handle the user stopping typing.
        text_movement = notification.userInfo().get('NSTextMovement')
        if text_movement == NSReturnTextMovement:
            # user hit return, emit 'validate'
            wrappermap.wrapper(self).emit('validate')

        # HACK: not sure exactly why this line has an effect, but it prevents
        # 17195
        self.stringValue()
开发者ID:codito,项目名称:miro,代码行数:10,代码来源:control.py


示例4: mouseUp_

 def mouseUp_(self, event):
     if self.hotspot_tracker is not None:
         point = self.convertPoint_fromView_(event.locationInWindow(), nil)
         self.hotspot_tracker.update_position(point)
         self.hotspot_tracker.update_hit()
         if self.hotspot_tracker.hit:
             wrappermap.wrapper(self).send_hotspot_clicked()
         self.hotspot_tracker.redraw_cell()
         self.hotspot_tracker = None
     else:
         self.SuperClass.mouseUp_(self, event)
开发者ID:nxmirrors,项目名称:miro,代码行数:11,代码来源:tableview.py


示例5: drawRect_

    def drawRect_(self, rect):
        context = drawing.DrawingContext(self, self.bounds(), rect)
        context.style = drawing.DrawingStyle()
        wrapper = wrappermap.wrapper(self)
        if self.state() == NSOnState:
            wrapper.state = 'pressed'
        elif self.mouse_inside:
            wrapper.state = 'hover'
        else:
            wrapper.state = 'normal'

        wrappermap.wrapper(self).draw(context, self.layout_manager)
        self.layout_manager.reset()
开发者ID:nxmirrors,项目名称:miro,代码行数:13,代码来源:customcontrol.py


示例6: continueTracking_at_inView_

 def continueTracking_at_inView_(self, lastPoint, at, view):
     if view.isVertical():
         pos = at.y
         size = view.bounds().size.height
     else:
         pos = at.x
         size = view.bounds().size.width
     slider_amount = self.calc_slider_amount(view, pos, size)
     value = (self.maxValue() - self.minValue()) * slider_amount
     self.setFloatValue_(value)
     wrappermap.wrapper(view).emit('moved', value)
     if self.isContinuous():
         wrappermap.wrapper(view).emit('changed', value)
     return YES
开发者ID:nxmirrors,项目名称:miro,代码行数:14,代码来源:customcontrol.py


示例7: mouseDown_

    def mouseDown_(self, event):
        if event.modifierFlags() & NSControlKeyMask:
            self.handleContextMenu_(event)
            self.handled_last_mouse_down = True
            return

        point = self.convertPoint_fromView_(event.locationInWindow(), nil)

        if event.clickCount() == 2:
            if self.handled_last_mouse_down:
                return
            wrapper = wrappermap.wrapper(self)
            row = self.rowAtPoint_(point)
            if row != -1:
                iter = wrapper.model.iter_for_row(self, row)
                wrapper.emit('row-double-clicked', iter)
            return

        hotspot_tracker = HotspotTracker(self, point)
        if hotspot_tracker.hit:
            self.hotspot_tracker = hotspot_tracker
            self.hotspot_tracker.redraw_cell()
            self.handled_last_mouse_down = True
        else:
            self.handled_last_mouse_down = False
            self.SuperClass.mouseDown_(self, event)
开发者ID:nxmirrors,项目名称:miro,代码行数:26,代码来源:tableview.py


示例8: outlineView_toolTipForCell_rect_tableColumn_row_mouseLocation_

 def outlineView_toolTipForCell_rect_tableColumn_row_mouseLocation_(self, tableview, cell, rect, column, row, location):
     wrapper = wrappermap.wrapper(tableview)
     iter = tableview.dataSource().model.iter_for_row(tableview, row)
     for wrapper_column in wrapper.columns:
         if wrapper_column._column is column:
             break
     return (wrapper.get_tooltip(iter, wrapper_column), rect)
开发者ID:nxmirrors,项目名称:miro,代码行数:7,代码来源:tableview.py


示例9: sendAction_to_

 def sendAction_to_(self, action, to):
     # only send the click event if we didn't send a
     # dragged-left/dragged-right event
     wrapper = wrappermap.wrapper(self)
     if self.last_drag_event is None and not wrapper.get_disabled():
         wrapper.emit('clicked')
     return YES
开发者ID:bbucommander,项目名称:miro,代码行数:7,代码来源:customcontrol.py


示例10: tabView_willSelectTabViewItem_

 def tabView_willSelectTabViewItem_(self, tab_view, tab_view_item):
     try:
         wrapper = wrappermap.wrapper(tab_view)
     except KeyError:
         pass # The NSTabView hasn't been placed yet, don't worry about it.
     else:
         wrapper.place_child_with_item(tab_view_item)
开发者ID:jcooley,项目名称:miro,代码行数:7,代码来源:layout.py


示例11: viewport_created

    def viewport_created(self):
        self.video_window = VideoWindow.alloc().initWithContentRect_styleMask_backing_defer_(self.view.frame(), NSBorderlessWindowMask, NSBackingStoreBuffered, NO)
        self.video_window.setContentView_(self.video_view)

        self.adjust_video_frame()
        self.view.window().addChildWindow_ordered_(self.video_window, NSWindowAbove)
        self.video_window.orderFront_(nil)
        self.window_moved_handler = wrappermap.wrapper(self.view.window()).connect('did-move', self.on_window_moved)
开发者ID:CodeforEvolution,项目名称:miro,代码行数:8,代码来源:video.py


示例12: highlightSelectionInClipRect_

 def highlightSelectionInClipRect_(self, rect):
     if wrappermap.wrapper(self).draws_selection:
         if not self.gradientHighlight:
             return self.SuperClass.highlightSelectionInClipRect_(self,
                     rect)
         context = NSGraphicsContext.currentContext()
         focused = self.isDescendantOf_(self.window().firstResponder())
         for row in tablemodel.list_from_nsindexset(self.selectedRowIndexes()):
             self.drawBackgroundGradient(context, focused, row)
开发者ID:nxmirrors,项目名称:miro,代码行数:9,代码来源:tableview.py


示例13: tile

 def tile(self):
     NSScrollView.tile(self)
     # tile is called when we need to layout our child view and scrollers.
     # This probably means that we've either hidden or shown a scrollbar so
     # call invalidate_size_request to ensure that things get re-layed out
     # correctly.  (#see 13842)
     wrapper = wrappermap.wrapper(self)
     if wrapper is not None:
         wrapper.invalidate_size_request()
开发者ID:jcooley,项目名称:miro,代码行数:9,代码来源:layout.py


示例14: _calc_current_focus_wrapper

 def _calc_current_focus_wrapper(self):
     responder = self.firstResponder()
     while responder:
         wrapper = wrappermap.wrapper(responder)
         # check if we have a wrapper for the view, if not try the parent
         # view
         if wrapper is not None:
             return wrapper
         responder = responder.superview()
     return None
开发者ID:CodeforEvolution,项目名称:miro,代码行数:10,代码来源:window.py


示例15: validateDrop_dragInfo_parentIter_position_

 def validateDrop_dragInfo_parentIter_position_(self, view, drag_info, 
         parent, position):
     typ = self.calcType_(drag_info)
     if typ:
         wrapper = wrappermap.wrapper(view)
         return self.drag_dest.validate_drop(wrapper, self.model, typ,
                 drag_info.draggingSourceOperationMask(), parent,
                 position)
     else:
         return NSDragOperationNone
开发者ID:cool-RR,项目名称:Miro,代码行数:10,代码来源:tablemodel.py


示例16: stopTracking_at_inView_mouseIsUp_

 def stopTracking_at_inView_mouseIsUp_(self, lastPoint, at, tableview, mouseIsUp):
     if mouseIsUp:
         column = tableview.columnAtPoint_(at)
         row = tableview.rowAtPoint_(at)
         if column != -1 and row != -1:
             wrapper = wrappermap.wrapper(tableview)
             column = wrapper.columns[column]
             itr = wrapper.model.iter_for_row(tableview, row)
             column.renderer.emit('clicked', itr)
     return NSButtonCell.stopTracking_at_inView_mouseIsUp_(self, lastPoint,
             at, tableview, mouseIsUp)
开发者ID:nxmirrors,项目名称:miro,代码行数:11,代码来源:tableview.py


示例17: acceptDrop_dragInfo_parentIter_position_

 def acceptDrop_dragInfo_parentIter_position_(self, view, drag_info,
         parent, position):
     typ = self.calcType_(drag_info)
     if typ:
         data = drag_info.draggingPasteboard().stringForType_(typ)
         wrapper = wrappermap.wrapper(view)
         return self.drag_dest.accept_drop(wrapper, self.model, typ, 
                 drag_info.draggingSourceOperationMask(), parent,
                 position, data)
     else:
         return NO
开发者ID:cool-RR,项目名称:Miro,代码行数:11,代码来源:tablemodel.py


示例18: view_writeColumnData_ToPasteboard_

 def view_writeColumnData_ToPasteboard_(self, view, data, pasteboard):
     if not self.drag_source:
         return NO
     wrapper = wrappermap.wrapper(view)
     drag_data = self.drag_source.begin_drag(wrapper, data)
     if not drag_data:
         return NO
     pasteboard.declareTypes_owner_(drag_data.keys(), self)
     for typ, value in drag_data.items():
         pasteboard.setString_forType_(value, typ)
     return YES
开发者ID:cool-RR,项目名称:Miro,代码行数:11,代码来源:tablemodel.py


示例19: drawRect_

 def drawRect_(self, rect):
     NSTableHeaderView.drawRect_(self, rect)
     wrapper = wrappermap.wrapper(self.tableView())
     # Manually handle sort column drawing
     for i, column in enumerate(wrapper.columns):
         if column.sort_indicator_visible:
             cell = column._column.headerCell()
             frame = self.headerRectOfColumn_(i)
             cell.highlight_withFrame_inView_(True, frame, self)
             cell.drawSortIndicatorWithFrame_inView_ascending_priority_(
                     frame, self, column.sort_order_ascending, 0)
开发者ID:nxmirrors,项目名称:miro,代码行数:11,代码来源:tableview.py


示例20: view_writeColumnData_ToPasteboard_

 def view_writeColumnData_ToPasteboard_(self, view, data, pasteboard):
     if not self.drag_source:
         return NO
     wrapper = wrappermap.wrapper(view)
     drag_data = self.drag_source.begin_drag(wrapper, data)
     if not drag_data:
         return NO
     pasteboard.declareTypes_owner_((MIRO_DND_ITEM_LOCAL,), self)
     for typ, value in drag_data.items():
         stringval = repr((repr(value), typ))
         pasteboard.setString_forType_(stringval, MIRO_DND_ITEM_LOCAL)
     return YES
开发者ID:ShriramK,项目名称:miro,代码行数:12,代码来源:tablemodel.py



注:本文中的miro.plat.frontends.widgets.wrappermap.wrapper函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python resources.app_root函数代码示例发布时间:2022-05-27
下一篇:
Python timer.add函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap