def on_pasteAndGoButton_mouseClick(self, event): self.components.urlArea1.text = clipboard.getClipboard() self.components.urlArea1.setFocus() if not process(self.components.urlArea1.text): self.components.urlArea1.setFocus() self.components.urlArea1.text = clipboard.getClipboard() time.sleep(1) self.components.urlArea1.text = _(u'Sorry. not yet supported ...')
def on_menuFileSaveAs_select(self, event): self.bmp = clipboard.getClipboard() if not isinstance(self.bmp, wx.Bitmap): return if self.filename is None: path = '' filename = '' else: path, filename = os.path.split(self.filename) # wxPython can't save GIF due to the license issues # but we can save most other formats, so this list can be expanded wildcard = "PNG files (*.png)|*.PNG;*.png" + \ "|JPG files (*.jpg;*.jpeg)|*.jpeg;*.JPG;*.JPEG;*.jpg" + \ "|BMP files (*.bmp)|*.BMP;*.bmp" + \ "|All Files (*.*)|*.*" result = dialog.saveFileDialog(None, "Save As", path, filename, wildcard) if result.accepted: path = result.paths[0] fileType = graphic.bitmapType(path) #print fileType, path self.filename = path self.bmp.SaveFile(path, fileType) return True else: return False
def on_menuEditPaste_select(self, event): data = clipboard.getClipboard() if isinstance(data, str): description, patterns, topLeft, size = lifeutil.translateClipboardPattern( data) print description print "topLeft:", topLeft, "size", size self.initAndPlacePatterns(patterns, topLeft, size)
def on_menuEditPaste_select(self, event): widget = self.findFocus() if hasattr(widget, 'editable') and widget.canPaste(): widget.paste() else: bmp = clipboard.getClipboard() if isinstance(bmp, wx.Bitmap): self.components.bufOff.drawBitmap(bmp)
def shell_run_clipboard(shell): '''Run contents of clipboard as shell commands. Careful what you run! #>>> clipboard.setClipboard('print "clipping"') #>>> shell_run_clipboard(shell) #>>> print "clipping" #clipping It will freeze on inputs that freeze execution, such as rendering Ogre indefinitely. ''' lines_string = clipboard.getClipboard() shell_run_lines(shell, lines_string)
def on_menuEditPaste_select(self, event): bmp = clipboard.getClipboard() if isinstance(bmp, wx.Bitmap): self.components.bufOff.drawBitmap(bmp)