bugged
stringlengths
4
228k
fixed
stringlengths
0
96.3M
__index_level_0__
int64
0
481k
def ShowPosition(self, pos): line = self.LineFromPosition(pos) self.EnsureVisible(line)
def ShowPosition(self, pos): line = self.LineFromPosition(pos) self.EnsureVisible(line)
32,000
def SetUpEditor(self): """ This method carries out the work of setting up the demo editor. It's seperate so as not to clutter up the init code. """ import keyword self.SetLexer(stc.STC_LEX_PYTHON) self.SetKeyWords(0, " ".join(keyword.kwlist))
def SetUpEditor(self): """ This method carries out the work of setting up the demo editor. It's seperate so as not to clutter up the init code. """ import keyword self.SetLexer(stc.STC_LEX_PYTHON) self.SetKeyWords(0, " ".join(keyword.kwlist))
32,001
def OnSave(self, event): if self.demoModules.Exists(modModified): if self.demoModules.GetActiveID() == modOriginal: overwriteMsg = "You are about to overwrite an already existing modified copy\n" + \ "Do you want to continue?" dlg = wx.MessageDialog(self, overwriteMsg, "wxPython Demo", wx.YES_NO | wx.NO_DEFAULT| wx.ICO...
def OnSave(self, event): if self.demoModules.Exists(modModified): if self.demoModules.GetActiveID() == modOriginal: overwriteMsg = "You are about to overwrite an already existing modified copy\n" + \ "Do you want to continue?" dlg = wx.MessageDialog(self, overwriteMsg, "wxPython Demo", wx.YES_NO | wx.NO_DEFAULT| wx.ICO...
32,002
def LoadFromFile(self, modID, filename): self.modules[modID][2] = filename file = open(filename, "r") self.LoadFromSource(modID, file.read()) file.close()
def LoadFromFile(self, modID, filename): self.modules[modID][2] = filename file = open(filename, "rt") self.LoadFromSource(modID, file.read()) file.close()
32,003
def UpdateFile(self, modID = None): """Updates the file from which a module was loaded with (possibly updated) source""" if modID is None: modID = self.modActive
def UpdateFile(self, modID = None): """Updates the file from which a module was loaded with (possibly updated) source""" if modID is None: modID = self.modActive
32,004
def EmptyHandler(evt): pass
def EmptyHandler(evt): pass
32,005
def RunModule(self): """Runs the active module"""
def prevSelect = self.UpdateNotebook() RunModule(self): prevSelect = self.UpdateNotebook() """Runs prevSelect = self.UpdateNotebook() the prevSelect = self.UpdateNotebook() active prevSelect = self.UpdateNotebook() module"""
32,006
def RunModule(self): """Runs the active module"""
def RunModule(self): """Runs the active module"""
32,007
def UpdatePage(page, pageText): pageExists = False pagePos = -1 for i in range(nb.GetPageCount()): if nb.GetPageText(i) == pageText: pageExists = True pagePos = i break if page: if not pageExists: # Add a new page
def UpdatePage(page, pageText): pageExists = False pagePos = -1 for i in range(nb.GetPageCount()): if nb.GetPageText(i) == pageText: pageExists = True pagePos = i break if page: if not pageExists: # Add a new page
32,008
def draw(self, dc, printerScale, coord= None): colour = self.attributes['colour'] width = self.attributes['width'] * printerScale style= self.attributes['style'] dc.SetPen(wx.Pen(wx.NamedColour(colour), int(width), style)) if coord == None: dc.DrawLines(self.scaled) else: dc.DrawLines(coord) # draw legend line
def draw(self, dc, printerScale, coord= None): colour = self.attributes['colour'] width = self.attributes['width'] * printerScale style= self.attributes['style'] pen = wx.Pen(wx.NamedColour(colour), width, style) pen.SetCap(wx.CAP_BUTT) dc.SetPen(pen) if coord == None: dc.DrawLines(self.scaled) else: dc.DrawLines(coord...
32,009
def draw(self, dc, printerScale, coord= None): colour = self.attributes['colour'] width = self.attributes['width'] * printerScale size = self.attributes['size'] * printerScale fillcolour = self.attributes['fillcolour'] fillstyle = self.attributes['fillstyle'] marker = self.attributes['marker']
def draw(self, dc, printerScale, coord= None): colour = self.attributes['colour'] width = self.attributes['width'] * printerScale size = self.attributes['size'] * printerScale fillcolour = self.attributes['fillcolour'] fillstyle = self.attributes['fillstyle'] marker = self.attributes['marker']
32,010
def Draw(self, graphics, xAxis = None, yAxis = None, dc = None): """Draw objects in graphics with specified x and y axis. graphics- instance of PlotGraphics with list of PolyXXX objects xAxis - tuple with (min, max) axis range to view yAxis - same as xAxis dc - drawing context - doesn't have to be specified. If it's no...
def Draw(self, graphics, xAxis = None, yAxis = None, dc = None): """Draw objects in graphics with specified x and y axis. graphics- instance of PlotGraphics with list of PolyXXX objects xAxis - tuple with (min, max) axis range to view yAxis - same as xAxis dc - drawing context - doesn't have to be specified. If it's no...
32,011
def _point2ClientCoord(self, corner1, corner2): """Converts user point coords to client screen int coords x,y,width,height""" c1= Numeric.array(corner1) c2= Numeric.array(corner2) # convert to screen coords pt1= c1*self._pointScale+self._pointShift pt2= c2*self._pointScale+self._pointShift # make height and width posit...
def _point2ClientCoord(self, corner1, corner2): """Converts user point coords to client screen int coords x,y,width,height""" c1= Numeric.array(corner1) c2= Numeric.array(corner2) # convert to screen coords pt1= c1*self._pointScale+self._pointShift pt2= c2*self._pointScale+self._pointShift # make height and width posit...
32,012
def _drawAxes(self, dc, p1, p2, scale, shift, xticks, yticks): penWidth= self.printerScale # increases thickness for printing only dc.SetPen(wx.Pen(wx.NamedColour('BLACK'),int(penWidth))) # set length of tick marks--long ones make grid if self._gridEnabled: x,y,width,height= self._point2ClientCoord(p1,p2) yTic...
def _drawAxes(self, dc, p1, p2, scale, shift, xticks, yticks): penWidth= self.printerScale # increases thickness for printing only dc.SetPen(wx.Pen(wx.NamedColour('BLACK'), penWidth)) # set length of tick marks--long ones make grid if self._gridEnabled: x,y,width,height= self._point2ClientCoord(p1,p2) yTickLen...
32,013
def OnPrintPage(self, page): dc = FloatDCWrapper(self.GetDC()) # allows using floats for certain functions
def OnPrintPage(self, page): dc = self.GetDC() # allows using floats for certain functions
32,014
def OnPrintPage(self, page): dc = FloatDCWrapper(self.GetDC()) # allows using floats for certain functions
def OnPrintPage(self, page): dc = FloatDCWrapper(self.GetDC()) # allows using floats for certain functions
32,015
def OnSizingBeginDragLeft(self, pt, x, y, keys = 0, attachment = 0): self._canvas.CaptureMouse()
def OnSizingBeginDragLeft(self, pt, x, y, keys = 0, attachment = 0): self._canvas.CaptureMouse()
32,016
def __init__(self, parent): wx.Panel.__init__(self, parent, -1, style=wx.SUNKEN_BORDER)
def __init__(self, parent): wx.Panel.__init__(self, parent, -1, style=wx.SUNKEN_BORDER)
32,017
def CalcMin( self ): items = self.GetChildren() if not items: return wxSize(10, 10)
def CalcMin( self ): items = self.GetChildren() if not items: return wxSize(10, 10)
32,018
def GetPageInfo(self): return (0, 1, 1, 1) # disable page numbers
def GetPageInfo(self): return (1, 1, 1, 1) # disable page numbers
32,019
def Update(self, ft): #icon = ft.GetIcon() info = ft.GetIconInfo() if info is None: bmp = MyBitmapsFunc(0) ##print bmp.Ok(), bmp.GetWidth(), bmp.GetHeight() self.GetIconBmp().SetBitmap(bmp) self.GetIconFileTxt().SetValue("") self.GetIconIndexTxt().SetValue("") else: icon, file, idx = info #bmp = wxBitmapFromIcon(icon) ...
def Update(self, ft): #icon = ft.GetIcon() info = ft.GetIconInfo() if info is None: bmp = MyBitmapsFunc(0) ##print bmp.Ok(), bmp.GetWidth(), bmp.GetHeight() self.GetIconBmp().SetBitmap(bmp) self.GetIconFileTxt().SetValue("") self.GetIconIndexTxt().SetValue("") else: icon, file, idx = info #bmp = wxBitmapFromIcon(icon) ...
32,020
def findDialog(parent=None, searchText='', wholeWordsOnly=0, caseSensitive=0): dlg = wx.Dialog(parent, -1, "Find", wx.DefaultPosition, (370, 120)) wx.StaticText(dlg, -1, 'Find what:', (7, 10)) wSearchText = wx.TextCtrl(dlg, -1, searchText, (70, 7), (195, -1)) wSearchText.SetValue(searchText) wx.wxButton(dlg, wx.ID_OK,...
def findDialog(parent=None, searchText='', wholeWordsOnly=0, caseSensitive=0): dlg = wx.Dialog(parent, -1, "Find", wx.DefaultPosition, (370, 120)) wx.StaticText(dlg, -1, 'Find what:', (7, 10)) wSearchText = wx.TextCtrl(dlg, -1, searchText, (70, 7), (195, -1)) wSearchText.SetValue(searchText) wx.Button(dlg, wx.ID_OK, "...
32,021
def OnInit(self): frame = wx.Frame(None, -1, "Dialogs", size=(400, 200)) panel = wx.Panel(frame, -1) self.panel = panel
def OnInit(self): self.frame = frame = wx.Frame(None, -1, "Dialogs", size=(400, 200)) panel = wx.Panel(frame, -1) self.panel = panel
32,022
def OnInit(self): frame = wx.Frame(None, -1, "Dialogs", size=(400, 200)) panel = wx.Panel(frame, -1) self.panel = panel
def OnInit(self): frame = wx.Frame(None, -1, "Dialogs", size=(400, 200)) panel = wx.Panel(frame, -1) self.panel = panel
32,023
def OnInit(self): frame = wx.Frame(None, -1, "Dialogs", size=(400, 200)) panel = wx.Panel(frame, -1) self.panel = panel
def OnInit(self): frame = wx.Frame(None, -1, "Dialogs", size=(400, 200)) panel = wx.Panel(frame, -1) self.panel = panel
32,024
def OnInit(self): frame = wx.Frame(None, -1, "Dialogs", size=(400, 200)) panel = wx.Panel(frame, -1) self.panel = panel
def OnInit(self): frame = wx.Frame(None, -1, "Dialogs", size=(400, 200)) panel = wx.Panel(frame, -1) self.panel = panel
32,025
def OnInit(self): frame = wx.Frame(None, -1, "Dialogs", size=(400, 200)) panel = wx.Panel(frame, -1) self.panel = panel
defframe.Show(1) OnInit(self):frame.Show(1) frameframe.Show(1) =frame.Show(1) wx.Frame(None,frame.Show(1) -1,frame.Show(1) "Dialogs",frame.Show(1) size=(400,frame.Show(1) 200))frame.Show(1) panelframe.Show(1) =frame.Show(1) wx.Panel(frame,frame.Show(1) -1)frame.Show(1) self.panelframe.Show(1) =frame.Show(1) panel
32,026
def OnNameListSelected(self, evt): import pprint sel = evt.GetString() result = None if sel == 'alertDialog': result = alertDialog(message='Danger Will Robinson') elif sel == 'colorDialog': result = colorDialog() elif sel == 'directoryDialog': result = directoryDialog() elif sel == 'fileDialog': wildcard = "JPG files (...
def OnNameListSelected(self, evt): import pprint sel = evt.GetString() result = None if sel == 'alertDialog': result = alertDialog(message='Danger Will Robinson') elif sel == 'colorDialog': result = colorDialog() elif sel == 'directoryDialog': result = directoryDialog() elif sel == 'fileDialog': wildcard = "JPG files (...
32,027
def CreateView(self, document, flags=0): """ Creates a new view for the given document. If more than one view is allowed for the document (by virtue of multiple templates mentioning the same document type), a choice of view is presented to the user. """ templates = [] for temp in self._templates: if temp.IsVisible(): i...
def CreateView(self, doc, flags=0): """ Creates a new view for the given document. If more than one view is allowed for the document (by virtue of multiple templates mentioning the same document type), a choice of view is presented to the user. """ templates = [] for temp in self._templates: if temp.IsVisible(): if tem...
32,028
def OnInit(self): # Call the super - this is important!!! pydocview.DocApp.OnInit(self)
def OnInit(self): # Call the super - this is important!!! pydocview.DocApp.OnInit(self)
32,029
def OnInit(self): # Call the super - this is important!!! pydocview.DocApp.OnInit(self)
def OnInit(self): # Call the super - this is important!!! pydocview.DocApp.OnInit(self)
32,030
def OnInit(self): # Call the super - this is important!!! pydocview.DocApp.OnInit(self)
def OnInit(self): # Call the super - this is important!!! pydocview.DocApp.OnInit(self)
32,031
def __init__(self,*_args,**_kwargs): """ In addition to the usual arguments, wxFloatBar accepts keyword args of: title(string): the title that should appear on the toolbar's frame when it is floating. floatable(bool): whether user actions (i.e., dragging) can float the toolbar or not. """ args = (self,) + _args apply(...
def __init__(self,*_args,**_kwargs): """ wxToolBar subclass which can be dragged off its frame and later replaced there. Drag on the toolbar to release it, close it like a normal window to make it return to its original position. Programmatically, call SetFloatable(true) and then Float(true) to float, Float(false) to ...
32,032
def __init__(self,*_args,**_kwargs): """ In addition to the usual arguments, wxFloatBar accepts keyword args of: title(string): the title that should appear on the toolbar's frame when it is floating. floatable(bool): whether user actions (i.e., dragging) can float the toolbar or not. """ args = (self,) + _args apply(...
def __init__(self,*_args,**_kwargs): """ In addition to the usual arguments, wxFloatBar accepts keyword args of: title(string): the title that should appear on the toolbar's frame when it is floating. floatable(bool): whether user actions (i.e., dragging) can float the toolbar or not. """ args = (self,) + _args apply(...
32,033
def Float(self, bool): "Floats or docks the toolbar programmatically." if bool: self.parentframe = wxPyTypeCast(self.GetParent(), 'wxFrame') print self.title if self.title: useStyle = wxDEFAULT_FRAME_STYLE else: useStyle = wxTHICK_FRAME self.floatframe = wxFrame(self.parentframe, -1, self.title, style = useStyle)
def Float(self, bool): "Floats or docks the toolbar programmatically." if bool: self.parentframe = wxPyTypeCast(self.GetParent(), 'wxFrame') print self.title if self.title: useStyle = wxDEFAULT_FRAME_STYLE else: useStyle = wxTHICK_FRAME self.floatframe = wxFrame(self.parentframe, -1, self.title, style = useStyle)
32,034
def OnMouse(self, e): if not self.IsFloatable(): e.Skip() return
def OnMouse(self, e): if not self.IsFloatable(): e.Skip() return
32,035
def _SetFauxBarVisible(self, vis): return if vis: if self.parentframe.GetToolBar() == None: if not hasattr(self, 'nullbar'): self.nullbar = wxToolBar(self.parentframe, -1) print "Adding fauxbar." self.nullbar.Reparent(self.parentframe) print "Reparented." self.parentframe.SetToolBar(self.nullbar) print "Set toolbar" co...
def _SetFauxBarVisible(self, vis): return if vis: if self.parentframe.GetToolBar() == None: if not hasattr(self, 'nullbar'): self.nullbar = wxToolBar(self.parentframe, -1) print "Adding fauxbar." self.nullbar.Reparent(self.parentframe) print "Reparented." self.parentframe.SetToolBar(self.nullbar) print "Set toolbar" co...
32,036
def __init__(self): wx.Frame.__init__(self, None, -1, "Widget Layout Tester")
def __init__(self): wx.Frame.__init__(self, None, -1, "Widget Layout Tester")
32,037
def __init__(self): wx.Frame.__init__(self, None, -1, "Widget Layout Tester")
def __init__(self): wx.Frame.__init__(self, None, -1, "Widget Layout Tester")
32,038
def GetSelection(self): """ Extend GetSelection to never return the root item if the root item is hidden. """ selection = super(IterableTreeCtrl, self).GetSelection() if selection == self.GetRootItem() and \ (self.GetWindowStyle() & wx.TR_HIDE_ROOT): return wx.TreeItemId() # Return an invalid TreeItemId else: return se...
def GetSelection(self): """ Extend GetSelection to never return the root item if the root item is hidden. """ selection = super(IterableTreeCtrl, self).GetSelection() if selection == self.GetRootItem() and \ (self.GetWindowStyle() & wx.TR_HIDE_ROOT): return wx.TreeItemId() # Return an invalid TreeItemId else: return se...
32,039
def Notify(self): """ The timer has expired so call the callable. """ if self.callable and getattr(self.callable, 'im_self', True): self.runCount += 1 self.running = False self.result = self.callable(*self.args, **self.kwargs) self.hasRun = True if not self.running: # if it wasn't restarted, then cleanup wx.CallAfter(s...
def Notify(self): """ The timer has expired so call the callable. """ if self.callable and getattr(self.callable, 'im_self', True): self.runCount += 1 self.running = False self.result = self.callable(*self.args, **self.kwargs) self.hasRun = True if not self.running: # if it wasn't restarted, then cleanup wx.CallAfter(s...
32,040
def __init__(self, parent, frame, log): wx.Panel.__init__(self, parent, -1) self.log = log self.frame = frame
defself.printData.SetPrintMode(wx.PRINT_MODE_PRINTER) __init__(self,self.printData.SetPrintMode(wx.PRINT_MODE_PRINTER) parent,self.printData.SetPrintMode(wx.PRINT_MODE_PRINTER) frame,self.printData.SetPrintMode(wx.PRINT_MODE_PRINTER) log):self.printData.SetPrintMode(wx.PRINT_MODE_PRINTER) wx.Panel.__init__(self,se...
32,041
def __init__(self, parent, frame, log): wx.Panel.__init__(self, parent, -1) self.log = log self.frame = frame
def __init__(self, parent, frame, log): wx.Panel.__init__(self, parent, -1) self.log = log self.frame = frame
32,042
def __init__(self, parent, frame, log): wx.Panel.__init__(self, parent, -1) self.log = log self.frame = frame
def __init__(self, parent, frame, log): wx.Panel.__init__(self, parent, -1) self.log = log self.frame = frame
32,043
def __init__(self, parent, frame, log): wx.Panel.__init__(self, parent, -1) self.log = log self.frame = frame
def __init__(self, parent, frame, log): wx.Panel.__init__(self, parent, -1) self.log = log self.frame = frame
32,044
def OnPrintSetup(self, event): printerDialog = wx.PrintDialog(self) printerDialog.GetPrintDialogData().SetPrintData(self.printData) printerDialog.GetPrintDialogData().SetSetupDialog(True) printerDialog.ShowModal(); self.printData = printerDialog.GetPrintDialogData().GetPrintData() printerDialog.Destroy()
def OnPrintSetup(self, event): data = wx.PrintDialogData(self.printData) printerDialog = wx.PrintDialog(self, data) printerDialog.GetPrintDialogData().SetSetupDialog(True) printerDialog.ShowModal(); self.printData = printerDialog.GetPrintDialogData().GetPrintData() printerDialog.Destroy()
32,045
def OnPrintPreview(self, event): self.log.WriteText("OnPrintPreview\n") printout = MyPrintout(self.canvas, self.log) printout2 = MyPrintout(self.canvas, self.log) self.preview = wx.PrintPreview(printout, printout2, self.printData)
def OnPrintPreview(self, event): self.log.WriteText("OnPrintPreview\n") printout = MyPrintout(self.canvas, self.log) printout2 = MyPrintout(self.canvas, self.log) self.preview = wx.PrintPreview(printout, printout2, self.printData)
32,046
def OnDoPrint(self, event): pdd = wx.PrintDialogData() pdd.SetPrintData(self.printData) printer = wx.Printer(pdd) printout = MyPrintout(self.canvas, self.log)
def OnDoPrint(self, event): pdd = wx.PrintDialogData(self.printData) pdd.SetToPage(2) printer = wx.Printer(pdd) printout = MyPrintout(self.canvas, self.log)
32,047
def OnDoPrint(self, event): pdd = wx.PrintDialogData() pdd.SetPrintData(self.printData) printer = wx.Printer(pdd) printout = MyPrintout(self.canvas, self.log)
def OnDoPrint(self, event): pdd = wx.PrintDialogData() pdd.SetPrintData(self.printData) printer = wx.Printer(pdd) printout = MyPrintout(self.canvas, self.log)
32,048
def __init__ (self, parent, id= -1, pos = wx.DefaultPosition, size = wx.DefaultSize, style = wx.TAB_TRAVERSAL, labelText= "File Entry:", buttonText= "Browse", toolTip= "Type filename or click browse to choose file", # following are the values for a file dialog box dialogTitle = "Choose a file", startDirectory = ".", in...
def __init__ (self, parent, id= -1, pos = wx.DefaultPosition, size = wx.DefaultSize, style = wx.TAB_TRAVERSAL, labelText= "File Entry:", buttonText= "Browse", toolTip= "Type filename or click browse to choose file", # following are the values for a file dialog box dialogTitle = "Choose a file", startDirectory = ".", in...
32,049
def __init__ (self, parent, id= -1, pos = wx.DefaultPosition, size = wx.DefaultSize, style = wx.TAB_TRAVERSAL, labelText= "File Entry:", buttonText= "Browse", toolTip= "Type filename or click browse to choose file", # following are the values for a file dialog box dialogTitle = "Choose a file", startDirectory = ".", in...
defself.labelWidth = labelWidth __init__self.labelWidth = labelWidth (self,self.labelWidth = labelWidth parent,self.labelWidth = labelWidth id=self.labelWidth = labelWidth -1,self.labelWidth = labelWidth posself.labelWidth = labelWidth =self.labelWidth = labelWidth wx.DefaultPosition,self.labelWidth = labelWidth sizese...
32,050
def createLabel( self ): """Create the label/caption""" label = wx.StaticText(self, -1, self.labelText, style =wx.ALIGN_RIGHT ) font = label.GetFont() w, h, d, e = self.GetFullTextExtent(self.labelText, font) label.SetSize((w+5, h)) return label
def createLabel( self ): """Create the label/caption""" label = wx.StaticText(self, -1, self.labelText, style =wx.ALIGN_RIGHT ) font = label.GetFont() w, h, d, e = self.GetFullTextExtent(self.labelText, font) if self.labelWidth > 0: label.SetSize((self.labelWidth+5, h)) else: label.SetSize((w+5, h)) return label
32,051
def OnSizingBeginDragLeft(self, pt, x, y, keys = 0, attachment = 0): self._canvas.CaptureMouse()
def OnSizingBeginDragLeft(self, pt, x, y, keys = 0, attachment = 0): self._canvas.CaptureMouse()
32,052
def DrawArcToEllipse(x1, y1, width1, height1, x2, y2, x3, y3): a1 = width1 / 2 b1 = height1 / 2 # Check that x2 != x3 if abs(x2 - x3)<0.05: x4 = x2 if y3>y2: y4 = y1 - sqrt((b1 * b1 - (((x2 - x1) * (x2 - x1)) * (b1 * b1) / (a1 * a1)))) else: y4 = y1 + sqrt((b1 * b1 - (((x2 - x1) * (x2 - x1)) * (b1 * b1) / (a1 * a1))))...
def DrawArcToEllipse(x1, y1, width1, height1, x2, y2, x3, y3): a1 = width1 / 2 b1 = height1 / 2 # Check that x2 != x3 if abs(x2 - x3)<0.05: x4 = x2 if y3>y2: y4 = y1 - sqrt((b1 * b1 - (((x2 - x1) * (x2 - x1)) * (b1 * b1) / (a1 * a1)))) else: y4 = y1 + sqrt((b1 * b1 - (((x2 - x1) * (x2 - x1)) * (b1 * b1) / (a1 * a1))))...
32,053
def __init__(self, parent, log): wx.Panel.__init__(self, parent, -1) self.log = log
def __init__(self, parent, log): wx.Panel.__init__(self, parent, -1) self.log = log
32,054
def __init__(self, parent, log): wx.Panel.__init__(self, parent, -1) self.log = log
def __init__(self, parent, log): wx.Panel.__init__(self, parent, -1) self.log = log
32,055
def __init__(self, parent, log): wx.Panel.__init__(self, parent, -1) self.log = log
def __init__(self, parent, log): wx.Panel.__init__(self, parent, -1) self.log = log
32,056
def __init__(self, parent, log, factor=1, thingToWatch=None, bgColor=None, active=1, size=(38,38), borderWidth=3): wx.Panel.__init__(self, parent, -1, size=size, style=wx.CLIP_CHILDREN) self.tile = InnerTile(self, log, factor, thingToWatch, bgColor) self.log = log sizer = wx.BoxSizer(wx.HORIZONTAL) sizer.Add(self.tile...
def __init__(self, parent, log, factor=1, thingToWatch=None, bgColor=None, active=1, size=(38,38), borderWidth=3): wx.Window.__init__(self, parent, -1, size=size, style=wx.CLIP_CHILDREN) self.tile = InnerTile(self, log, factor, thingToWatch, bgColor) self.log = log sizer = wx.BoxSizer(wx.HORIZONTAL) sizer.Add(self.til...
32,057
def __init__(self, parent, log, factor=1, thingToWatch=None, bgColor=None, active=1, size=(38,38), borderWidth=3): wx.Panel.__init__(self, parent, -1, size=size, style=wx.CLIP_CHILDREN) self.tile = InnerTile(self, log, factor, thingToWatch, bgColor) self.log = log sizer = wx.BoxSizer(wx.HORIZONTAL) sizer.Add(self.tile...
def __init__(self, parent, log, factor=1, thingToWatch=None, bgColor=None, active=1, size=(38,38), borderWidth=3): wx.Panel.__init__(self, parent, -1, size=size, style=wx.CLIP_CHILDREN) self.tile = InnerTile(self, log, factor, thingToWatch, bgColor) self.log = log sizer = wx.BoxSizer(wx.HORIZONTAL) sizer.Add(self.tile...
32,058
def setNormal(self, event): self.SetBackgroundColour(Tile.normal) self.Refresh()
def setNormal(self, event): self.SetBackgroundColour(Tile.normal) self.Refresh()
32,059
def __init__(self, parent, log, factor, thingToWatch=None, bgColor=None): wx.Panel.__init__(self, parent, -1) self.log=log if bgColor: self.SetBackgroundColour(bgColor) if thingToWatch: self.factor = factor self.thingToWatch = thingToWatch self.state = 0 self.toggleOnOff() # Watch for the mouse click to en...
def __init__(self, parent, log, factor, thingToWatch=None, bgColor=None): wx.Window.__init__(self, parent, -1) self.log=log if bgColor: self.SetBackgroundColour(bgColor) if thingToWatch: self.factor = factor self.thingToWatch = thingToWatch self.state = 0 self.toggleOnOff() # Watch for the mouse click to e...
32,060
def __del__(self): if hasattr(self, "set_colour_val"): del self.set_colour_val
def __del__(self): if hasattr(self, "set_colour_val"): del self.set_colour_val
32,061
def SetColourValue(self, bcolour): self.set_colour_val = wxColour(bcolour[0], bcolour[1], bcolour[2]) self.set_colour = bcolour
def SetColourValue(self, bcolour): self.set_colour = bcolour
32,062
def SetColourValue(self, bcolour): self.set_colour_val = wxColour(bcolour[0], bcolour[1], bcolour[2]) self.set_colour = bcolour
def SetColourValue(self, bcolour): self.set_colour_val = wxColour(bcolour[0], bcolour[1], bcolour[2]) self.set_colour = bcolour
32,063
def GetHistory( self ): """Return the current history list""" if self.historyCallBack != None: return self.historyCallBack() else: return list( self.history )
def GetHistory( self ): """Return the current history list""" if self.historyCallBack != None: return self.historyCallBack() else: return list( self.history )
32,064
def findDialog(parent=None, searchText='', wholeWordsOnly=0, caseSensitive=0): dlg = wx.Dialog(parent, -1, "Find", wx.DefaultPosition, (380, 120)) wx.StaticText(dlg, -1, 'Find what:', (7, 10)) wSearchText = wx.TextCtrl(dlg, -1, searchText, (80, 7), (195, -1)) wSearchText.SetValue(searchText) wx.Button(dlg, wx.ID_OK, "...
def findDialog(parent=None, searchText='', wholeWordsOnly=0, caseSensitive=0): dlg = wx.Dialog(parent, -1, "Find", wx.DefaultPosition, (380, 120)) wx.StaticText(dlg, -1, 'Find what:', (7, 10)) wSearchText = wx.TextCtrl(dlg, -1, searchText, (80, 7), (195, -1)) wSearchText.SetValue(searchText) wx.Button(dlg, wx.ID_OK, "...
32,065
def fontDialog(parent=None, fontData=None, font=None): if fontData is None: fontData = wx.FontData() fontData.SetColour(wx.BLACK) fontData.SetInitialFont(wx.SystemSettings.GetFont(wx.SYS_DEFAULT_GUI_FONT)) if font is not None: aFontData.SetInitialFont(font) dialog = wx.FontDialog(parent, fontData) result = DialogResu...
def fontDialog(parent=None, fontData=None, font=None): if fontData is None: fontData = wx.FontData() fontData.SetColour(wx.BLACK) fontData.SetInitialFont(wx.SystemSettings.GetFont(wx.SYS_DEFAULT_GUI_FONT)) if font is not None: fontData.SetInitialFont(font) dialog = wx.FontDialog(parent, fontData) result = DialogResul...
32,066
def singleChoiceDialog(parent=None, message='', title='', lst=[], style=wx.OK | wx.CANCEL | wx.CENTRE): dialog = wx.SingleChoiceDialog(parent, message, title, lst, style) result = DialogResults(dialog.ShowModal()) result.selection = dialog.GetStringSelection() dialog.Destroy() return result
def singleChoiceDialog(parent=None, message='', title='', lst=[], style=wx.OK | wx.CANCEL | wx.CENTRE): dialog = wx.SingleChoiceDialog(parent, message, title, list(lst), style | wx.DEFAULT_DIALOG_STYLE) result = DialogResults(dialog.ShowModal()) result.selection = dialog.GetStringSelection() dialog.Destroy() return res...
32,067
def OnInit(self): self.frame = frame = wx.Frame(None, -1, "Dialogs", size=(400, 200)) panel = wx.Panel(frame, -1) self.panel = panel
def OnInit(self): self.frame = frame = wx.Frame(None, -1, "Dialogs", size=(400, 240)) panel = wx.Panel(frame, -1) self.panel = panel
32,068
def __del__(self): try: self.RestoreStdio() # Just in case the MainLoop was overridden finally: wx.PyApp.__del__(self)
def __del__(self): try: self.RestoreStdio() # Just in case the MainLoop was overridden finally: wx.PyApp.__del__(self)
32,069
def RestoreStdio(self): _sys.stdout, _sys.stderr = self.saveStdio
def RestoreStdio(self): _sys.stdout, _sys.stderr = self.saveStdio
32,070
def OnMouseEvent(self, evt): dc = wx.ClientDC(self) self.PrepareDC(dc) x, y = evt.GetLogicalPosition(dc)
def OnMouseEvent(self, evt): dc = wx.ClientDC(self) self.PrepareDC(dc) x, y = evt.GetLogicalPosition(dc)
32,071
def selectNewest(minVersion): """ Selects a version of wxPython that has a version number greater than or equal to the version given. If a matching version is not found then instead of raising an exception like select() does this function will inform the user of that fact with a message dialog, open the system's defau...
def selectNewest(minVersion): """ Selects a version of wxPython that has a version number greater than or equal to the version given. If a matching version is not found then instead of raising an exception like select() does this function will inform the user of that fact with a message dialog, open the system's defau...
32,072
def __init__(self): wx.Frame.__init__(self, None, -1, "Widget Layout Tester")
def __init__(self): wx.Frame.__init__(self, None, -1, "Widget Layout Tester")
32,073
def OnHistorySelect(self, evt): idx = self.testHistory.GetSelection() if idx != wx.NOT_FOUND: item = self.history[idx] self.moduleName.SetValue(item[0]) self.className.SetValue(item[1]) self.parameters.SetValue(item[2]) self.postCreate.SetValue(item[3])
def OnHistorySelect(self, evt): idx = evt.GetInt() if idx != wx.NOT_FOUND: item = self.history[idx] self.moduleName.SetValue(item[0]) self.className.SetValue(item[1]) self.parameters.SetValue(item[2]) self.postCreate.SetValue(item[3])
32,074
def Clear(self): self._fgtxt.SetValue("") self._bgtxt.SetValue("") self._fgclr.SetBackgroundColour(self.GetBackgroundColour()) self._bgclr.SetBackgroundColour(self.GetBackgroundColour()) self._fgclr.Refresh() self._bgclr.Refresh()
def Clear(self): self._fgtxt.SetValue("") self._bgtxt.SetValue("") self._fgclr.SetBackgroundColour(self.GetBackgroundColour()) self._bgclr.SetBackgroundColour(self.GetBackgroundColour()) self._fgclr.Refresh() self._bgclr.Refresh()
32,075
def run(self): if os.name == 'nt': return headers = self.distribution.headers if not headers: return
def run(self): if os.name == 'nt': return headers = self.distribution.headers if not headers: return
32,076
def __init__(self, parent, log): self.log = log wx.Panel.__init__(self, parent, -1)
def __init__(self, parent, log): self.log = log wx.Panel.__init__(self, parent, -1)
32,077
def MakeControlPoints(self): """Make handle control points.""" if self._canvas and self._lineControlPoints: first = self._lineControlPoints[0] last = self._lineControlPoints[-1]
def MakeControlPoints(self): """Make handle control points.""" if self._canvas and self._lineControlPoints: first = self._lineControlPoints[0] last = self._lineControlPoints[-1]
32,078
def MakeControlPoints(self): """Make handle control points.""" if self._canvas and self._lineControlPoints: first = self._lineControlPoints[0] last = self._lineControlPoints[-1]
def MakeControlPoints(self): """Make handle control points.""" if self._canvas and self._lineControlPoints: first = self._lineControlPoints[0] last = self._lineControlPoints[-1]
32,079
def MakeControlPoints(self): """Make handle control points.""" if self._canvas and self._lineControlPoints: first = self._lineControlPoints[0] last = self._lineControlPoints[-1]
def MakeControlPoints(self): """Make handle control points.""" if self._canvas and self._lineControlPoints: first = self._lineControlPoints[0] last = self._lineControlPoints[-1]
32,080
def SetValue(self, value): self.freeze = True if not value: value = [] self.value = value repr_ = reduce(lambda a,b: '%s|%s' % (a,b), value) self.text.SetValue(repr_) # update text ctrl self.freeze = False
def SetValue(self, value): self.freeze = True if not value: value = [] self.value = value if value: repr_ = reduce(lambda a,b: '%s|%s' % (a,b), value) else: repr_ = '' self.text.SetValue(repr_) # update text ctrl self.freeze = False
32,081
def AppendWindow(self, window, sashPos=-1): """ Add a new window to the splitter at the right side or bottom of the window stack. If sashPos is given then it is used to size the new window. """ self.InsertWindow(sys.maxint, window, sashPos)
def AppendWindow(self, window, sashPos=-1): """ Add a new window to the splitter at the right side or bottom of the window stack. If sashPos is given then it is used to size the new window. """ self.InsertWindow(sys.maxint, window, sashPos)
32,082
def _draw(self, dc, shadow=False): ends = [int(x) for x in strftime("%I %M %S", localtime()).split()]
def _draw(self, dc, shadow=False): ends = [int(x) for x in strftime("%I %M %S", localtime()).split()]
32,083
def AddIcon(self, icon, mask = wxNullBitmap): '''Add an icon to the image list, or get the index if already there''' index = self.__magicImageListMapping.get (id (icon)) if index is None: if isinstance( icon, wxIconPtr ): index = self.__magicImageList.AddIcon( icon ) elif isinstance( icon, wxBitmapPtr ): if isinstance(...
def AddIcon(self, icon, mask = wxNullBitmap): '''Add an icon to the image list, or get the index if already there''' index = self.__magicImageListMapping.get (id (icon)) if index is None: if isinstance( icon, wxIconPtr ): index = self.__magicImageList.AddIcon( icon ) elif isinstance( icon, wxBitmapPtr ): if isinstance(...
32,084
def __init__(self): """ Standard initialiser. """ self._lastColMinWidth = None
def __init__(self): """ Standard initialiser. """ self._lastColMinWidth = None
32,085
def resizeLastColumn(self, minWidth): """ Resize the last column appropriately.
def resizeLastColumn(self, minWidth): """ Resize the last column appropriately.
32,086
def _doResize(self): """ Resize the last column as appropriate.
def _doResize(self): """ Resize the last column as appropriate.
32,087
def _doResize(self): """ Resize the last column as appropriate.
def _doResize(self): """ Resize the last column as appropriate.
32,088
def _doResize(self): """ Resize the last column as appropriate.
def _doResize(self): """ Resize the last column as appropriate.
32,089
def _doResize(self): """ Resize the last column as appropriate.
def _doResize(self): """ Resize the last column as appropriate.
32,090
def make_editor(self, col_style=wx.LIST_FORMAT_LEFT): editor = wx.PreTextCtrl() style =wx.TE_PROCESS_ENTER|wx.TE_PROCESS_TAB|wx.TE_RICH2 style |= {wx.LIST_FORMAT_LEFT: wx.TE_LEFT, wx.LIST_FORMAT_RIGHT: wx.TE_RIGHT, wx.LIST_FORMAT_CENTRE : wx.TE_CENTRE}[col_style] editor.Create(self, -1, style=style) editor.SetBackgro...
def make_editor(self, col_style=wx.LIST_FORMAT_LEFT): editor = wx.PreTextCtrl() style =wx.TE_PROCESS_ENTER|wx.TE_PROCESS_TAB|wx.TE_RICH2 style |= {wx.LIST_FORMAT_LEFT: wx.TE_LEFT, wx.LIST_FORMAT_RIGHT: wx.TE_RIGHT, wx.LIST_FORMAT_CENTRE : wx.TE_CENTRE }[col_style] editor.Create(self, -1, style=style) editor.SetBackgr...
32,091
def OpenEditor(self, col, row): ''' Opens an editor at the current position. '''
def OpenEditor(self, col, row): ''' Opens an editor at the current position. '''
32,092
def __init__(self, parent, log): wx.Panel.__init__(self, parent, -1) self.log = log self.count = 0
def __init__(self, parent, log): wx.Panel.__init__(self, parent, -1) self.log = log self.count = 0
32,093
def __init__(self, parent, log): wx.Panel.__init__(self, parent, -1) self.log = log self.count = 0
def __init__(self, parent, log): wx.Panel.__init__(self, parent, -1) self.log = log self.count = 0
32,094
def DrawSavedLines(self, dc): dc.BeginDrawing() dc.SetPen(wx.Pen(wx.BLUE, 3)) for line in self.lines: for coords in line: dc.DrawLineXY(*coords) dc.EndDrawing()
def DrawSavedLines(self, dc): dc.BeginDrawing() dc.SetPen(wx.Pen(wx.BLUE, 3)) for line in self.lines: for coords in line: dc.DrawLine(*coords) dc.EndDrawing()
32,095
def OnMotion(self, event): if event.Dragging() and not self.mode == "Drag": dc = wx.ClientDC(self) dc.BeginDrawing() dc.SetPen(wx.Pen(wx.BLUE, 3)) coords = ((self.x, self.y), event.GetPosition()) self.curLine.append(coords) dc.DrawLineXY(*coords) self.x, self.y = event.GetPositionTuple() dc.EndDrawing()
def OnMotion(self, event): if event.Dragging() and not self.mode == "Drag": dc = wx.ClientDC(self) dc.BeginDrawing() dc.SetPen(wx.Pen(wx.BLUE, 3)) coords = ((self.x, self.y), event.GetPositionTuple()) self.curLine.append(coords) dc.DrawLineXY(*coords) self.x, self.y = event.GetPositionTuple() dc.EndDrawing()
32,096
def OnMotion(self, event): if event.Dragging() and not self.mode == "Drag": dc = wx.ClientDC(self) dc.BeginDrawing() dc.SetPen(wx.Pen(wx.BLUE, 3)) coords = ((self.x, self.y), event.GetPosition()) self.curLine.append(coords) dc.DrawLineXY(*coords) self.x, self.y = event.GetPositionTuple() dc.EndDrawing()
def OnMotion(self, event): if event.Dragging() and not self.mode == "Drag": dc = wx.ClientDC(self) dc.BeginDrawing() dc.SetPen(wx.Pen(wx.BLUE, 3)) coords = ((self.x, self.y), event.GetPosition()) self.curLine.append(coords) dc.DrawLine(*coords) self.x, self.y = event.GetPositionTuple() dc.EndDrawing()
32,097
def OnData(self, x, y, d): self.log.WriteText("OnData: %d, %d, %d\n" % (x, y, d))
def OnData(self, x, y, d): self.log.WriteText("OnData: %d, %d, %d\n" % (x, y, d))
32,098
def DrawSavedLines(self, dc): dc.BeginDrawing() dc.SetPen(wx.Pen(wx.RED, 3))
def DrawSavedLines(self, dc): dc.BeginDrawing() dc.SetPen(wx.Pen(wx.RED, 3))
32,099