本文整理汇总了Python中wx.BG_STYLE_CUSTOM属性的典型用法代码示例。如果您正苦于以下问题:Python wx.BG_STYLE_CUSTOM属性的具体用法?Python wx.BG_STYLE_CUSTOM怎么用?Python wx.BG_STYLE_CUSTOM使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类wx
的用法示例。
在下文中一共展示了wx.BG_STYLE_CUSTOM属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: create_widget
# 需要导入模块: import wx [as 别名]
# 或者: from wx import BG_STYLE_CUSTOM [as 别名]
def create_widget(self):
if self.overlapped and self.parent._IS_GRIDBAG: return
style = wx.FULL_REPAINT_ON_RESIZE
if self.parent.CHILDREN in (-1, 1): # e.g. Panel in a Frame
size = self.parent.widget.GetClientSize()
else:
size = (20, 20)
self.widget = wx.Window(self.parent_window.widget, -1, size=size, style=style)
self.widget.SetBackgroundStyle(wx.BG_STYLE_CUSTOM)
#self.widget.SetAutoLayout(True)
self.widget.Bind(wx.EVT_PAINT, self.on_paint)
self.widget.Bind(wx.EVT_ERASE_BACKGROUND, self.on_erase_background)
self.widget.Bind(wx.EVT_RIGHT_DOWN, self.popup_menu)
self.widget.Bind(wx.EVT_LEFT_DOWN, self.on_drop_widget)
self.widget.Bind(wx.EVT_MIDDLE_DOWN, misc.exec_after(self.on_select_and_paste))
self.widget.Bind(wx.EVT_ENTER_WINDOW, self.on_enter)
self.widget.Bind(wx.EVT_LEAVE_WINDOW, self.on_leave)
#self.widget.Bind(wx.EVT_CHAR_HOOK, misc.on_key_down_event) # catch cursor keys XXX still required?
示例2: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import BG_STYLE_CUSTOM [as 别名]
def __init__(self, parent, tip, restricted=True):
"""
Constructor
@param parent: Parent window
@param tip: Tip text (may be multiline)
@param restricted: Tool tip must follow size restriction in line and
characters number defined (default True)
"""
wx.PopupWindow.__init__(self, parent)
self.Restricted = restricted
self.SetBackgroundStyle(wx.BG_STYLE_CUSTOM)
self.SetTip(tip)
# Initialize text font style
self.Font = wx.Font(
faces["size"],
wx.SWISS,
wx.NORMAL,
wx.NORMAL,
faceName=faces["mono"])
self.Bind(wx.EVT_PAINT, self.OnPaint)
示例3: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import BG_STYLE_CUSTOM [as 别名]
def __init__(self, parent):
super(View, self).__init__(parent)
self.SetBackgroundStyle(wx.BG_STYLE_CUSTOM)
self.Bind(wx.EVT_SIZE, self.on_size)
self.Bind(wx.EVT_PAINT, self.on_paint)
self.Bind(wx.EVT_CHAR_HOOK, self.on_char)
self.index = -1
self.weights = {}
self.model = None
self.bitmap = None
wx.CallAfter(self.next)