# 需要导入模块: import wx [as 别名]

# 或者: from wx import EVT_MIDDLE_DCLICK [as 别名]

def __init__(self, parent, id, figure):

"""

Initialise a FigureWx instance.

- Initialise the FigureCanvasBase and wxPanel parents.

- Set event handlers for:

EVT_SIZE (Resize event)

EVT_PAINT (Paint event)

"""

FigureCanvasBase.__init__(self, figure)

# Set preferred window size hint - helps the sizer (if one is

# connected)

l, b, w, h = figure.bbox.bounds

w = math.ceil(w)

h = math.ceil(h)

wx.Panel.__init__(self, parent, id, size=wx.Size(w, h))

# Create the drawing bitmap

self.bitmap = wx.Bitmap(w, h)

DEBUG_MSG("__init__() - bitmap w:%d h:%d" % (w, h), 2, self)

# TODO: Add support for 'point' inspection and plot navigation.

self._isDrawn = False

self.Bind(wx.EVT_SIZE, self._onSize)

self.Bind(wx.EVT_PAINT, self._onPaint)

self.Bind(wx.EVT_KEY_DOWN, self._onKeyDown)

self.Bind(wx.EVT_KEY_UP, self._onKeyUp)

self.Bind(wx.EVT_RIGHT_DOWN, self._onRightButtonDown)

self.Bind(wx.EVT_RIGHT_DCLICK, self._onRightButtonDClick)

self.Bind(wx.EVT_RIGHT_UP, self._onRightButtonUp)

self.Bind(wx.EVT_MOUSEWHEEL, self._onMouseWheel)

self.Bind(wx.EVT_LEFT_DOWN, self._onLeftButtonDown)

self.Bind(wx.EVT_LEFT_DCLICK, self._onLeftButtonDClick)

self.Bind(wx.EVT_LEFT_UP, self._onLeftButtonUp)

self.Bind(wx.EVT_MOTION, self._onMotion)

self.Bind(wx.EVT_LEAVE_WINDOW, self._onLeave)

self.Bind(wx.EVT_ENTER_WINDOW, self._onEnter)

# Add middle button events

self.Bind(wx.EVT_MIDDLE_DOWN, self._onMiddleButtonDown)

self.Bind(wx.EVT_MIDDLE_DCLICK, self._onMiddleButtonDClick)

self.Bind(wx.EVT_MIDDLE_UP, self._onMiddleButtonUp)

self.Bind(wx.EVT_MOUSE_CAPTURE_CHANGED, self._onCaptureLost)

self.Bind(wx.EVT_MOUSE_CAPTURE_LOST, self._onCaptureLost)

self.SetBackgroundStyle(wx.BG_STYLE_PAINT) # Reduce flicker.

self.SetBackgroundColour(wx.WHITE)

python中的middle_Python wx.EVT_MIDDLE_DCLICK属性代码示例相关推荐

  1. python中string.digits_Python string.hexdigits方法代码示例

    本文整理汇总了Python中string.hexdigits方法的典型用法代码示例.如果您正苦于以下问题:Python string.hexdigits方法的具体用法?Python string.he ...

  2. python中的scaler_Python preprocessing.MaxAbsScaler方法代码示例

    本文整理汇总了Python中sklearn.preprocessing.MaxAbsScaler方法的典型用法代码示例.如果您正苦于以下问题:Python preprocessing.MaxAbsSc ...

  3. python中weekday_Python calendar firstweekday()用法及代码示例

    日历模块允许输出类似于程序的日历,并提供与日历相关的其他有用功能. "日历"模块中定义的函数和类使用理想化的日历,当前的公历日历在两个方向上都无限期扩展. 在Python中,cal ...

  4. python中np zeros_Python numpy.zeros方法代码示例

    本文整理汇总了Python中numpy.zeros方法的典型用法代码示例.如果您正苦于以下问题:Python numpy.zeros方法的具体用法?Python numpy.zeros怎么用?Pyth ...

  5. python中perf_counter_Python time.perf_counter()用法及代码示例

    由于时间模块提供了各种与时间有关的功能.因此,有必要导入时间模块,否则会出错,因为时间模块中存在perf_counter()的定义. perf_counter()函数始终以秒为单位返回时间的浮点值.返 ...

  6. python中reshape_python numpy reshape用法及代码示例

    在不更改数据的情况下为数组赋予新的形状. 参数:a: : array_like 要重塑的数组. newshape: : int 或 tuple of ints 新形状应与原始形状兼容.如果是整数,则结 ...

  7. python settings模块_Python settings.VERSION属性代码示例

    # 需要导入模块: import settings [as 别名] # 或者: from settings import VERSION [as 别名] def test_version(self): ...

  8. python quit()讲解_Python locals.QUIT属性代码示例

    # 需要导入模块: from pygame import locals [as 别名] # 或者: from pygame.locals import QUIT [as 别名] def update( ...

  9. python colors后面_Python colors.BASE_COLORS属性代码示例

    # 需要导入模块: from matplotlib import colors [as 别名] # 或者: from matplotlib.colors import BASE_COLORS [as ...

最新文章

  1. 编程之美2.15 二维数组最大子数组的和(数组下标从(1,1)开始)
  2. 022变量,cp,mv,查看文本命令
  3. springboot整合oracle_SpringBoot2.x系列教程67--Spring Boot整合分布式事务简介
  4. android 退出app代码_uniapp退出APP应用(IOS+安卓)
  5. 测试工程师良品 —— Fiddler 工具简介
  6. 蓝牙的发展史及版本演进
  7. 从初恋到生子,聊聊我的十年爱情。
  8. c++折线平移算法_RSA笔记-蒙哥马利算法(1)
  9. python通过解释器来编译_python 解释器与编译过程,代码的搬运工
  10. textarea 的中文输入判断与搜狗输入法的特殊行为
  11. Hadoop开发环境搭建之Eclipse配置
  12. 3月28日服务器维护,4月28日服务器例行维护公告
  13. kali netstat使用教程
  14. Golang获取时间戳并增加一天
  15. 计算机识别人脸原理,深入浅出人脸识别原理
  16. 推荐几个练习键盘打字的工具【自己用过的】
  17. tipask访问不到地址,appach和linux的引用头不一样
  18. S-SDLC(Secure Software Development Lifecycle) 安全编码规范
  19. 常见的百度云搜索引擎入口合集
  20. keras入门教程 1.线性回归建模(快速入门)

热门文章

  1. js日期函数--getMonth
  2. Java虚拟机学习笔记(一)—Java虚拟机概述
  3. Oracle与SQL Server在企业应用中的比较(转)
  4. Lync Server 2010 呼叫寄存配置和启用
  5. Python代码太长换行
  6. 目前超级计算机国内外发展状况,浅谈超级计算机发展的过程及研究现状
  7. 情境领导者-第二章、领导风格
  8. 机器学习案例之Python中通过RF预测红酒质量
  9. 当生活真的过得很艰难的时候,你是怎么熬过来的?(内容来自知乎,用于自省)...
  10. Vuforia+Unity AR项目开发测试