Python wx.BG_STYLE_CUSTOM Examples
The following are 3
code examples of wx.BG_STYLE_CUSTOM().
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example.
You may also want to check out all available functions/classes of the module
wx
, or try the search function
.
Example #1
Source File: edit_base.py From wxGlade with MIT License | 6 votes |
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?
Example #2
Source File: CustomToolTip.py From OpenPLC_Editor with GNU General Public License v3.0 | 6 votes |
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)
Example #3
Source File: viewer.py From GraphLayout with MIT License | 5 votes |
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)