Python wx.NO_BORDER Examples
The following are 19
code examples of wx.NO_BORDER().
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: trelby.py From trelby with GNU General Public License v2.0 | 7 votes |
def __init__(self, parent, id): style = wx.WANTS_CHARS | wx.FULL_REPAINT_ON_RESIZE | wx.NO_BORDER wx.Control.__init__(self, parent, id, style = style) self.panel = parent wx.EVT_SIZE(self, self.OnSize) wx.EVT_PAINT(self, self.OnPaint) wx.EVT_ERASE_BACKGROUND(self, self.OnEraseBackground) wx.EVT_LEFT_DOWN(self, self.OnLeftDown) wx.EVT_LEFT_UP(self, self.OnLeftUp) wx.EVT_LEFT_DCLICK(self, self.OnLeftDown) wx.EVT_RIGHT_DOWN(self, self.OnRightDown) wx.EVT_MOTION(self, self.OnMotion) wx.EVT_MOUSEWHEEL(self, self.OnMouseWheel) wx.EVT_CHAR(self, self.OnKeyChar) self.createEmptySp() self.updateScreen(redraw = False)
Example #2
Source File: StatusLight.py From BitTorrent with GNU General Public License v3.0 | 6 votes |
def __init__(self, parent, wxid=wx.ID_ANY): images = {} tips = {} a = wx.GetApp() for k in self.states.keys(): i = a.theme_library.get(('statuslight', self.states[k][0])) b = wx.BitmapFromImage(i) images[k] = b _StatusLight.__init__(self) wx.Panel.__init__(self, parent, id=wxid, style=wx.NO_BORDER) self.SetSize(wx.Size(24,24)) self.bitmap = wx.StaticBitmap(self, wx.ID_ANY) self.images = images self.tips = tips self.Fit() self.change_state()
Example #3
Source File: SearchResultPanel.py From OpenPLC_Editor with GNU General Public License v3.0 | 6 votes |
def _init_ctrls(self, prnt): self.HeaderLabel = wx.StaticText(id=ID_SEARCHRESULTPANELHEADERLABEL, name='HeaderLabel', parent=self, pos=wx.Point(0, 0), size=wx.Size(0, 17), style=0) search_results_tree_style = CT.TR_HAS_BUTTONS | CT.TR_NO_LINES | CT.TR_HAS_VARIABLE_ROW_HEIGHT self.SearchResultsTree = CT.CustomTreeCtrl(id=ID_SEARCHRESULTPANELSEARCHRESULTSTREE, name="SearchResultsTree", parent=self, pos=wx.Point(0, 0), style=search_results_tree_style) if wx.VERSION >= (2, 8, 11): self.SearchResultsTree.SetAGWWindowStyleFlag(search_results_tree_style) self.Bind(wx.EVT_TREE_ITEM_ACTIVATED, self.OnSearchResultsTreeItemActivated, id=ID_SEARCHRESULTPANELSEARCHRESULTSTREE) self.ResetButton = wx.lib.buttons.GenBitmapButton( self, bitmap=GetBitmap("reset"), size=wx.Size(28, 28), style=wx.NO_BORDER) self.ResetButton.SetToolTipString(_("Reset search result")) self.Bind(wx.EVT_BUTTON, self.OnResetButton, self.ResetButton) self._init_sizers()
Example #4
Source File: __init__.py From EventGhost with GNU General Public License v2.0 | 6 votes |
def __init__(self, plugin, pos, alwaysOnTop): style = wx.SYSTEM_MENU|wx.MINIMIZE_BOX|wx.CLIP_CHILDREN|wx.CLOSE_BOX if not plugin.showInTaskbar: style |= wx.FRAME_NO_TASKBAR if plugin.windowStyle == 0: style |= wx.CAPTION elif plugin.windowStyle == 1: style |= wx.RAISED_BORDER elif plugin.windowStyle == 2: style |= wx.NO_BORDER|wx.FRAME_SHAPED if alwaysOnTop: style |= wx.STAY_ON_TOP wx.Frame.__init__( self, None, title=plugin.caption, pos=pos, style=style ) self.SetBackgroundColour(plugin.windowColour)
Example #5
Source File: __init__.py From EventGhost with GNU General Public License v2.0 | 6 votes |
def __init__(self, size=(-1, -1), pic_path=None, display=0): wx.Frame.__init__( self, None, -1, "ShowPictureFrame", style=wx.NO_BORDER | wx.FRAME_NO_TASKBAR #| wx.STAY_ON_TOP ) self.SetBackgroundColour(wx.Colour(0, 0, 0)) self.Bind(wx.EVT_LEFT_DCLICK, self.LeftDblClick) self.Bind(wx.EVT_CLOSE, self.OnClose) bitmap = wx.EmptyBitmap(1, 1) self.staticBitmap = wx.StaticBitmap(self, -1, bitmap) self.staticBitmap.Bind(wx.EVT_LEFT_DCLICK, self.LeftDblClick) self.staticBitmap.Bind(wx.EVT_MOTION, self.ShowCursor) self.timer = Timer(2.0, self.HideCursor)
Example #6
Source File: ShowOSD.py From EventGhost with GNU General Public License v2.0 | 6 votes |
def __init__(self, parent): wx.Frame.__init__( self, parent, -1, "OSD Window", size=(0, 0), style=( wx.FRAME_SHAPED | wx.NO_BORDER | wx.FRAME_NO_TASKBAR | wx.STAY_ON_TOP ) ) self.hwnd = self.GetHandle() self.bitmap = wx.EmptyBitmap(0, 0) # we need a timer to possibly cancel it self.timer = threading.Timer(0.0, eg.DummyFunc) self.Bind(wx.EVT_PAINT, self.OnPaint) self.Bind(wx.EVT_CLOSE, self.OnClose)
Example #7
Source File: trelby.py From trelby with GNU General Public License v2.0 | 6 votes |
def __init__(self, parent, id): wx.Panel.__init__( self, parent, id, # wxMSW/Windows does not seem to support # wx.NO_BORDER, which sucks style = wx.WANTS_CHARS | wx.NO_BORDER) hsizer = wx.BoxSizer(wx.HORIZONTAL) self.scrollBar = wx.ScrollBar(self, -1, style = wx.SB_VERTICAL) self.ctrl = MyCtrl(self, -1) hsizer.Add(self.ctrl, 1, wx.EXPAND) hsizer.Add(self.scrollBar, 0, wx.EXPAND) wx.EVT_COMMAND_SCROLL(self, self.scrollBar.GetId(), self.ctrl.OnScroll) wx.EVT_SET_FOCUS(self.scrollBar, self.OnScrollbarFocus) self.SetSizer(hsizer) # we never want the scrollbar to get the keyboard focus, pass it on to # the main widget
Example #8
Source File: mainframe.py From youtube-dl-gui with The Unlicense | 5 votes |
def _create_bitmap_button(self, icon, size=(-1, -1), handler=None): button = wx.BitmapButton(self._panel, bitmap=icon, size=size, style=wx.NO_BORDER) if handler is not None: button.Bind(wx.EVT_BUTTON, handler) return button
Example #9
Source File: activities_dashboard.py From grass-tangible-landscape with GNU General Public License v2.0 | 5 votes |
def __init__(self, parent, fontsize, average, maximum, title, formatting_string, vertical=False, grid=False): wx.Frame.__init__(self, parent, style=wx.NO_BORDER) self.panel = wx.Panel(parent=self) self.fontsize = fontsize self.average = average self.vertical = vertical self.grid = grid # grid layout may not be implemented in webkit # TODO: average not used yet here # TODO: vertical not supported # maximum, title and formatting_string are lists self.list_maximum = maximum self.list_title = title self.list_formatting_string = formatting_string self.sizer = wx.BoxSizer(wx.VERTICAL) if webview: self.textCtrl = webview.WebView.New(self) values=[None] * len(title) html = self._content_grid(values) if self.grid else self._content_table(values) self.textCtrl.SetPage(html, '') self.sizer.Add(self.textCtrl, 1, wx.ALL | wx.ALIGN_CENTER | wx.EXPAND, 5) self.SetSizer(self.sizer) self.sizer.Fit(self.panel)
Example #10
Source File: new_properties.py From wxGlade with MIT License | 5 votes |
def create_editor(self, panel, sizer): label = self._find_label() style = wx.RA_SPECIFY_COLS | wx.NO_BORDER | wx.CLIP_CHILDREN self.options = wx.RadioBox(panel, -1, label, choices=self.labels, majorDimension=self.columns, style=style) sizer.Add(self.options, 0, wx.EXPAND) if self.tooltips: for i,tooltip in enumerate(self.tooltips): if tooltip: self.options.SetItemToolTip(i, tooltip) else: self._set_tooltip(self.options) self.update_display(True) self.options.Bind(wx.EVT_RADIOBOX, self.on_radio)
Example #11
Source File: StaticTextBox.py From EventGhost with GNU General Public License v2.0 | 5 votes |
def __init__(self, parent, id=-1, label='', pos=(-1, -1), size=(-1, -1)): wx.PyWindow.__init__( self, parent, id, pos, size, style=wx.SUNKEN_BORDER ) self.SetMinSize(self.GetSize()) sizer = wx.BoxSizer(wx.VERTICAL) textCtrl = wx.TextCtrl( self, -1, label, style=( wx.TE_MULTILINE | wx.TE_NO_VSCROLL | wx.NO_BORDER | wx.TE_READONLY ) ) textCtrl.SetBackgroundColour(self.GetBackgroundColour()) #sizer.Add((0,0), 1, wx.EXPAND) sizer.Add(textCtrl, 0, wx.EXPAND | wx.ALL, 3) sizer.Add((0, 0), 1, wx.EXPAND) self.SetSizer(sizer) self.Bind(wx.EVT_SIZE, self.OnSize) self.textCtrl = textCtrl
Example #12
Source File: guicontrols.py From wfuzz with GNU General Public License v2.0 | 5 votes |
def CreateNotebook(self): bookStyle = aui.AUI_NB_DEFAULT_STYLE # bookStyle &= ~(aui.AUI_NB_CLOSE_ON_ACTIVE_TAB) bookStyle = aui.AUI_NB_DEFAULT_STYLE | aui.AUI_NB_TAB_EXTERNAL_MOVE | wx.NO_BORDER client_size = self.GetClientSize() nb = aui.AuiNotebook(self, -1, wx.Point(client_size.x, client_size.y), wx.Size(430, 200), agwStyle=bookStyle) nb.AddPage(ListPanel(self, self, self.controller._model, self.controller._interp), "Main") return nb
Example #13
Source File: __init__.py From EventGhost with GNU General Public License v2.0 | 5 votes |
def __init__(self, parent=None): wx.Frame.__init__( self, parent, style=wx.NO_BORDER|wx.FRAME_NO_TASKBAR|wx.CLIP_CHILDREN ) self.drawing = None self.displayNum = 0 self.Bind(wx.EVT_PAINT, self.OnPaint) self.Bind(wx.EVT_LEFT_DCLICK, self.LeftDblClick) self.Bind(wx.EVT_KEY_DOWN, self.OnChar) self.Bind(wx.EVT_MOTION, self.ShowCursor) self.timer = None self.SetBackgroundColour((0, 0, 0))
Example #14
Source File: recipe-577951.py From code with MIT License | 5 votes |
def __init__(self, parent, id=wx.ID_ANY, label="", pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.NO_BORDER, validator=wx.DefaultValidator, name="roundbutton"): """ Default class constructor. :param `parent`: the L{RoundButton} parent; :param `id`: window identifier. A value of -1 indicates a default value; :param `label`: the button text label; :param `pos`: the control position. A value of (-1, -1) indicates a default position, chosen by either the windowing system or wxPython, depending on platform; :param `size`: the control size. A value of (-1, -1) indicates a default size, chosen by either the windowing system or wxPython, depending on platform; :param `style`: the button style (unused); :param `validator`: the validator associated to the button; :param `name`: the button name. """ wx.PyControl.__init__(self, parent, id, pos, size, style, validator, name) self.Bind(wx.EVT_PAINT, self.OnPaint) self.Bind(wx.EVT_ERASE_BACKGROUND, lambda event: None) self.Bind(wx.EVT_SIZE, self.OnSize) self.Bind(wx.EVT_LEFT_DOWN, self.OnLeftDown) self.Bind(wx.EVT_LEFT_UP, self.OnLeftUp) self.Bind(wx.EVT_LEAVE_WINDOW, self.OnMouseLeave) self.Bind(wx.EVT_ENTER_WINDOW, self.OnMouseEnter) self.Bind(wx.EVT_SET_FOCUS, self.OnGainFocus) self.Bind(wx.EVT_KILL_FOCUS, self.OnLoseFocus) self.Bind(wx.EVT_KEY_DOWN, self.OnKeyDown) self.Bind(wx.EVT_KEY_UP, self.OnKeyUp) self.Bind(wx.EVT_LEFT_DCLICK, self.OnLeftDown) self._mouseAction = None self._hasFocus = False self._buttonRadius = 0 self.SetLabel(label) self.InheritAttributes() self.SetInitialSize(size)
Example #15
Source File: wm_legend.py From wafer_map with GNU General Public License v3.0 | 5 votes |
def _init_ui(self): """Initialize UI components.""" # Add layout management self.hbox = wx.BoxSizer(wx.HORIZONTAL) self.fgs = wx.FlexGridSizer(rows=self.n_items, cols=2, vgap=0, hgap=2) # Create items to add for _i, (key, value) in enumerate(zip(self.labels, self.colors)): self.label = wx.StaticText(self, label=str(key), style=wx.ALIGN_LEFT, ) self.colorbox = csel.ColourSelect(self, _i, "", tuple(value), style=wx.NO_BORDER, size=(20, 20)) self.Bind(csel.EVT_COLOURSELECT, self.on_color_pick, id=_i) self.fgs.Add(self.label, flag=wx.ALIGN_CENTER_VERTICAL) self.fgs.Add(self.colorbox) # Add our items to the layout manager and set the sizer. self.hbox.Add(self.fgs) self.SetSizer(self.hbox)
Example #16
Source File: ConfTreeNodeEditor.py From OpenPLC_Editor with GNU General Public License v3.0 | 5 votes |
def GenerateMethodButtonSizer(self): normal_bt_font = wx.Font(faces["size"] // 3, wx.DEFAULT, wx.NORMAL, wx.NORMAL, faceName=faces["helv"]) mouseover_bt_font = wx.Font(faces["size"] // 3, wx.DEFAULT, wx.NORMAL, wx.NORMAL, faceName=faces["helv"], underline=True) msizer = wx.BoxSizer(wx.HORIZONTAL) for confnode_method in self.Controler.ConfNodeMethods: if "method" in confnode_method and confnode_method.get("shown", True): button = GenBitmapTextButton(self.Editor, bitmap=GetBitmap(confnode_method.get("bitmap", "Unknown")), label=confnode_method["name"], style=wx.NO_BORDER) button.SetFont(normal_bt_font) button.SetToolTipString(confnode_method["tooltip"]) if confnode_method.get("push", False): button.Bind(wx.EVT_LEFT_DOWN, self.GetButtonCallBackFunction(confnode_method["method"], True)) else: button.Bind(wx.EVT_BUTTON, self.GetButtonCallBackFunction(confnode_method["method"]), button) # a fancy underline on mouseover def setFontStyle(b, s): def fn(event): b.SetFont(s) b.Refresh() event.Skip() return fn button.Bind(wx.EVT_ENTER_WINDOW, setFontStyle(button, mouseover_bt_font)) button.Bind(wx.EVT_LEAVE_WINDOW, setFontStyle(button, normal_bt_font)) # hack to force size to mini if not confnode_method.get("enabled", True): button.Disable() msizer.AddWindow(button, flag=wx.ALIGN_CENTER) return msizer
Example #17
Source File: activities_dashboard.py From grass-tangible-landscape with GNU General Public License v2.0 | 4 votes |
def __init__(self, parent, fontsize, maximum, title, formatting_string, vertical=False): wx.Frame.__init__(self, parent, style=wx.NO_BORDER) if isinstance(maximum, list): self.list_maximum = maximum self.list_title = title self.list_formatting_string = formatting_string else: self.list_maximum = [maximum] self.list_title = [title] self.list_formatting_string = [formatting_string] self.labels = [] self.titles = [] self.gauges = [] self.sizer = wx.GridBagSizer(5, 5) for i in range(len(self.list_maximum)): if vertical: if title: self.titles.append(wx.StaticText(self, label=self.list_title[i] + ':', style=wx.ALIGN_LEFT)) self.labels.append(wx.StaticText(self, style=wx.ALIGN_RIGHT)) self.gauges.append(wx.Gauge(self, range=self.list_maximum[i])) else: if title: self.titles.append(wx.StaticText(self, label=self.list_title[i], style=wx.ALIGN_CENTER)) self.labels.append(wx.StaticText(self, style=wx.ALIGN_CENTRE_HORIZONTAL)) self.gauges.append(wx.Gauge(self, range=self.list_maximum[i], style=wx.GA_VERTICAL)) font = wx.Font(fontsize, wx.DEFAULT, wx.NORMAL, wx.BOLD) self.labels[i].SetFont(font) if title: self.titles[i].SetFont(font) if vertical: if title: self.sizer.Add(self.titles[i], pos=(i, 0), flag=wx.ALL|wx.ALIGN_BOTTOM) self.sizer.Add(self.gauges[i], pos=(i, 1), flag=wx.ALL|wx.EXPAND) self.sizer.Add(self.labels[i], pos=(i, 2), flag=wx.ALL|wx.ALIGN_BOTTOM) else: if title: self.sizer.Add(self.titles[i], pos=(0, i), flag=wx.ALL|wx.ALIGN_CENTER) extra = wx.BoxSizer(wx.HORIZONTAL) extra.AddStretchSpacer() extra.Add(self.gauges[i], flag=wx.EXPAND) extra.AddStretchSpacer() self.sizer.Add(extra, pos=(1, i), flag=wx.ALL|wx.EXPAND) self.sizer.Add(self.labels[i], pos=(2, i), flag=wx.ALL|wx.ALIGN_CENTER) self.sizer.AddGrowableCol(i, 0) if vertical: self.sizer.AddGrowableCol(1, 1) else: self.sizer.AddGrowableRow(1) self.SetSizer(self.sizer) self.sizer.Fit(self)
Example #18
Source File: splash.py From trelby with GNU General Public License v2.0 | 4 votes |
def __init__(self, parent, delay): wx.Frame.__init__( self, parent, -1, "Splash", style = wx.FRAME_FLOAT_ON_PARENT | wx.NO_BORDER) if not SplashWindow.inited: SplashWindow.inited = True wx.Image_AddHandler(wx.JPEGHandler()) self.loadQuotes(parent) self.pickRandomQuote() self.pic = misc.getBitmap("resources/logo.jpg") if self.pic.Ok(): w, h = (self.pic.GetWidth(), self.pic.GetHeight()) else: w, h = (375, 300) util.setWH(self, w, h) self.CenterOnScreen() self.textColor = wx.Colour(0, 0, 0) self.font = util.createPixelFont( 14, wx.FONTFAMILY_MODERN, wx.NORMAL, wx.NORMAL) self.quoteFont = util.createPixelFont( 16, wx.FONTFAMILY_DEFAULT, wx.NORMAL, wx.NORMAL) self.sourceFont = util.createPixelFont( 15, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_ITALIC, wx.NORMAL) if delay != -1: self.timer = wx.Timer(self) wx.EVT_TIMER(self, -1, self.OnTimer) self.timer.Start(delay, True) wx.EVT_LEFT_DOWN(self, self.OnClick) wx.EVT_PAINT(self, self.OnPaint) wx.EVT_CLOSE(self, self.OnCloseWindow)
Example #19
Source File: FileManagementPanel.py From OpenPLC_Editor with GNU General Public License v3.0 | 4 votes |
def _init_Editor(self, parent): self.Editor = wx.Panel(parent) main_sizer = wx.BoxSizer(wx.HORIZONTAL) left_sizer = wx.BoxSizer(wx.VERTICAL) main_sizer.AddSizer(left_sizer, 1, border=5, flag=wx.GROW | wx.ALL) managed_dir_label = wx.StaticText(self.Editor, label=_(self.TagName) + ":") left_sizer.AddWindow(managed_dir_label, border=5, flag=wx.GROW | wx.BOTTOM) FILTER = _("All files (*.*)|*.*|CSV files (*.csv)|*.csv") self.ManagedDir = FolderTree(self.Editor, self.Folder, FILTER) left_sizer.AddWindow(self.ManagedDir, 1, flag=wx.GROW) managed_treectrl = self.ManagedDir.GetTreeCtrl() self.Bind(wx.EVT_TREE_SEL_CHANGED, self.OnTreeItemChanged, managed_treectrl) if self.EnableDragNDrop: self.Bind(wx.EVT_TREE_BEGIN_DRAG, self.OnTreeBeginDrag, managed_treectrl) button_sizer = wx.BoxSizer(wx.VERTICAL) main_sizer.AddSizer(button_sizer, border=5, flag=wx.ALL | wx.ALIGN_CENTER_VERTICAL) for idx, (name, bitmap, help) in enumerate([ ("DeleteButton", "remove_element", _("Remove file from left folder")), ("LeftCopyButton", "LeftCopy", _("Copy file from right folder to left")), ("RightCopyButton", "RightCopy", _("Copy file from left folder to right")), ("EditButton", "edit", _("Edit file"))]): button = wx.lib.buttons.GenBitmapButton( self.Editor, bitmap=GetBitmap(bitmap), size=wx.Size(28, 28), style=wx.NO_BORDER) button.SetToolTipString(help) setattr(self, name, button) if idx > 0: flag = wx.TOP else: flag = 0 self.Bind(wx.EVT_BUTTON, getattr(self, "On" + name), button) button_sizer.AddWindow(button, border=20, flag=flag) right_sizer = wx.BoxSizer(wx.VERTICAL) main_sizer.AddSizer(right_sizer, 1, border=5, flag=wx.GROW | wx.ALL) if wx.Platform == '__WXMSW__': system_dir_label = wx.StaticText(self.Editor, label=_("My Computer:")) else: system_dir_label = wx.StaticText(self.Editor, label=_("Home Directory:")) right_sizer.AddWindow(system_dir_label, border=5, flag=wx.GROW | wx.BOTTOM) self.SystemDir = FolderTree(self.Editor, self.HomeDirectory, FILTER, False) right_sizer.AddWindow(self.SystemDir, 1, flag=wx.GROW) system_treectrl = self.SystemDir.GetTreeCtrl() self.Bind(wx.EVT_TREE_SEL_CHANGED, self.OnTreeItemChanged, system_treectrl) self.Editor.SetSizer(main_sizer)