def __init__(
self, parent=None, id=-1, pos=wx.DefaultPosition,
size=wx.DefaultSize,
style=wx.TAB_TRAVERSAL|wx.NO_BORDER|wx.FULL_REPAINT_ON_RESIZE,
name='SquareMap', model = None,
adapter = None,
labels = True, # set to True to draw textual labels within the boxes
highlight = True, # set to False to turn of highlighting
padding = 2, # amount to reduce the children's box from the parent's box
):
super( SquareMap, self ).__init__(
parent, id, pos, size, style, name
)
self.model = model
self.padding = padding
self.labels = labels
self.highlight = highlight
self.selectedNode = None
self.highlightedNode = None
self.Bind( wx.EVT_PAINT, self.OnPaint)
self.Bind( wx.EVT_SIZE, self.OnSize )
if highlight:
self.Bind( wx.EVT_MOTION, self.OnMouse )
self.Bind( wx.EVT_LEFT_UP, self.OnClickRelease )
self.Bind( wx.EVT_LEFT_DCLICK, self.OnDoubleClick )
self.Bind( wx.EVT_KEY_UP, self.OnKeyUp )
self.hot_map = []
self.adapter = adapter or DefaultAdapter()
self.DEFAULT_PEN = wx.Pen( wx.BLACK, 1, wx.SOLID )
self.SELECTED_PEN = wx.Pen( wx.WHITE, 2, wx.SOLID )
self.OnSize(None)
squaremap.py 文件源码
python
阅读 23
收藏 0
点赞 0
评论 0
评论列表
文章目录