You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
|
Apr
(45) |
May
(185) |
Jun
|
Jul
(36) |
Aug
(205) |
Sep
(98) |
Oct
(107) |
Nov
(6) |
Dec
(3) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(1) |
Feb
(2) |
Mar
(19) |
Apr
(26) |
May
(18) |
Jun
|
Jul
(12) |
Aug
(16) |
Sep
(22) |
Oct
(7) |
Nov
(11) |
Dec
(74) |
2006 |
Jan
(14) |
Feb
(1) |
Mar
(3) |
Apr
(3) |
May
(14) |
Jun
(5) |
Jul
(20) |
Aug
(10) |
Sep
(1) |
Oct
|
Nov
(4) |
Dec
(1) |
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(3) |
Jul
(14) |
Aug
|
Sep
|
Oct
(6) |
Nov
(1) |
Dec
|
From: Kevin A. <ka...@us...> - 2004-10-11 01:55:45
|
Update of /cvsroot/pythoncard/PythonCard/samples/flock In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16314/flock Log Message: Directory /cvsroot/pythoncard/PythonCard/samples/flock added to the repository |
From: Kevin A. <ka...@us...> - 2004-10-11 01:53:36
|
Update of /cvsroot/pythoncard/PythonCard/tools/oneEditor In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15881 Modified Files: tabcodeEditor.py Log Message: further protection for missing pageChanged event on Mac Index: tabcodeEditor.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/tools/oneEditor/tabcodeEditor.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** tabcodeEditor.py 10 Oct 2004 23:51:00 -0000 1.8 --- tabcodeEditor.py 11 Oct 2004 01:53:25 -0000 1.9 *************** *** 536,540 **** selection = self.components.notebook.GetSelection() #print selection, len(self.pages) ! if selection <= len(self.pages) - 1: self.currentPageNumber = selection self.currentPage = self.pages[selection] --- 536,540 ---- selection = self.components.notebook.GetSelection() #print selection, len(self.pages) ! if selection != -1 and selection <= (len(self.pages) - 1): self.currentPageNumber = selection self.currentPage = self.pages[selection] |
From: Kevin A. <ka...@us...> - 2004-10-10 23:55:57
|
Update of /cvsroot/pythoncard/PythonCard/tools/oneEditor In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24248 Modified Files: todo.txt Log Message: notes for Alex, running off to dinner :) Index: todo.txt =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/tools/oneEditor/todo.txt,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** todo.txt 10 Oct 2004 23:02:08 -0000 1.2 --- todo.txt 10 Oct 2004 23:55:44 -0000 1.3 *************** *** 6,8 **** Problem with syntax check untitled doc which is then saved. syntax message goes into statusBar, but because the text ! has changed (new file name), on_idle overwrites the error message. \ No newline at end of file --- 6,20 ---- Problem with syntax check untitled doc which is then saved. syntax message goes into statusBar, but because the text ! has changed (new file name), on_idle overwrites the error message. ! - fix History, probably add document to history on closeTab as well ! as when closing application ! - on_menuFileOpen_select is currently broken, history selection works ! Traceback (most recent call last): ! File "/Users/altis/python/PythonCard/menu.py", line 205, in _dispatch ! handler(background, aWxEvent) ! File "/Users/altis/python/PythonCard/tools/oneEditor/tabcodeEditor.py", line 695, in on_menuFileOpen_select ! self.openFile(path) ! File "/Users/altis/python/PythonCard/tools/oneEditor/tabcodeEditor.py", line 570, in openFile ! if (not self.currentPage or ! AttributeError: 'NoneType' object has no attribute 'GetModify' ! |
From: Kevin A. <ka...@us...> - 2004-10-10 23:51:12
|
Update of /cvsroot/pythoncard/PythonCard/tools/oneEditor In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23090 Modified Files: tabcodeEditor.py Log Message: added workaround for pageChanged event not firing on Mac wxPython 2.5.2.8 Index: tabcodeEditor.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/tools/oneEditor/tabcodeEditor.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** tabcodeEditor.py 10 Oct 2004 23:02:08 -0000 1.7 --- tabcodeEditor.py 10 Oct 2004 23:51:00 -0000 1.8 *************** *** 525,530 **** --- 525,548 ---- def closeTab(self): + self.pageChangedFired = False + del self.pages[self.currentPageNumber] self.components.notebook.DeletePage(self.currentPageNumber) + + # KEA 2004-10-10 + # workaround pageChanged event not firing on Mac OS X + # when it gets fixed, this code should be harmless + if not self.pageChangedFired: + selection = self.components.notebook.GetSelection() + #print selection, len(self.pages) + if selection <= len(self.pages) - 1: + self.currentPageNumber = selection + self.currentPage = self.pages[selection] + self.currentDocument = self.currentPage.components.document + self.currentPage.becomeFocus() + self.updateStatusBar() + self.updateTitleBar() + self.setResourceFile() + if len(self.pages) == 0: if NEVER_BLANK: *************** *** 1236,1239 **** --- 1254,1258 ---- def on_notebook_pageChanged(self, event): + self.pageChangedFired = True #rint "pageChanged - oldSelection: %d, selection: %d" % (event.oldSelection, event.selection) if event.selection <= len(self.pages)-1: |
From: Alex T. <ale...@us...> - 2004-10-10 23:38:40
|
Update of /cvsroot/pythoncard/PythonCard/tools/oneEditor In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20828/tools/oneEditor Modified Files: codePage.py Log Message: Remove debug aids - put if True ..... else ... back to try ... except ... Index: codePage.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/tools/oneEditor/codePage.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** codePage.py 10 Oct 2004 23:02:08 -0000 1.3 --- codePage.py 10 Oct 2004 23:38:29 -0000 1.4 *************** *** 122,126 **** def saveFile(self, path): ! if True: f = open(path, 'wb') try: --- 122,126 ---- def saveFile(self, path): ! try: f = open(path, 'wb') try: *************** *** 135,139 **** self.setEditorStyle() self.topLevelParent.setTitleBar(os.path.split(path)[-1]) ! else: pass --- 135,139 ---- self.setEditorStyle() self.topLevelParent.setTitleBar(os.path.split(path)[-1]) ! except: pass |
From: Alex T. <ale...@us...> - 2004-10-10 23:05:16
|
Update of /cvsroot/pythoncard/PythonCard/tools/oneEditor In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11705/tools/oneEditor Modified Files: codePage.py tabcodeEditor.py todo.txt Log Message: Allow saveFile to work in CheckSyntax; fix syntax error production. Index: tabcodeEditor.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/tools/oneEditor/tabcodeEditor.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** tabcodeEditor.py 9 Oct 2004 18:31:08 -0000 1.6 --- tabcodeEditor.py 10 Oct 2004 23:02:08 -0000 1.7 *************** *** 229,232 **** --- 229,233 ---- self.currentDocument.LineFromPosition(pos) + 1, self.currentDocument.GetColumn(pos) + 1) + #print "updatestatusbar", self.lastPos, pos, self.lastStatus, newText if self.lastStatus != newText: self.statusBar.text = newText *************** *** 1082,1092 **** else: if self.on_menuFileSaveAs_select(None): ! scriptutils.CheckFile(self, self.currentPage.documentPath) self.lastPos = self.currentDocument.GetCurrentPos() else: if self.currentDocument.GetModify(): # auto-save ! self.saveFile(self.currentPage.documentPath) ! scriptutils.CheckFile(self, self.currentPage.documentPath) self.lastPos = self.currentDocument.GetCurrentPos() --- 1083,1093 ---- else: if self.on_menuFileSaveAs_select(None): ! scriptutils.CheckFile(self.statusBar, self.currentDocument, self.currentPage.documentPath) self.lastPos = self.currentDocument.GetCurrentPos() else: if self.currentDocument.GetModify(): # auto-save ! self.currentPage.saveFile(self.currentPage.documentPath) ! scriptutils.CheckFile(self.statusBar, self.currentDocument, self.currentPage.documentPath) self.lastPos = self.currentDocument.GetCurrentPos() *************** *** 1118,1122 **** elif self.currentDocument.GetModify(): # auto-save ! self.saveFile(self.currentPage.documentPath) # this algorithm, taken from samples.py assumes the rsrc.py file and the main --- 1119,1123 ---- elif self.currentDocument.GetModify(): # auto-save ! self.currentPage.saveFile(self.currentPage.documentPath) # this algorithm, taken from samples.py assumes the rsrc.py file and the main Index: todo.txt =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/tools/oneEditor/todo.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** todo.txt 3 Oct 2004 23:58:01 -0000 1.1 --- todo.txt 10 Oct 2004 23:02:08 -0000 1.2 *************** *** 1,4 **** ! - figure out initial sizing issues ! - close button / menu item to close current page - add menu and command items to drop-downs - key / shortcut to take you to the drop-down (if possible) ? --- 1,8 ---- ! - figure out initial sizing issues DONE ! - close button / menu item to close current page DONE - add menu and command items to drop-downs - key / shortcut to take you to the drop-down (if possible) ? + - statusBar and title mechanism. + Problem with syntax check untitled doc which is then saved. + syntax message goes into statusBar, but because the text + has changed (new file name), on_idle overwrites the error message. \ No newline at end of file Index: codePage.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/tools/oneEditor/codePage.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** codePage.py 5 Oct 2004 12:08:22 -0000 1.2 --- codePage.py 10 Oct 2004 23:02:08 -0000 1.3 *************** *** 122,126 **** def saveFile(self, path): ! try: f = open(path, 'wb') try: --- 122,126 ---- def saveFile(self, path): ! if True: f = open(path, 'wb') try: *************** *** 131,139 **** os.chdir(os.path.dirname(self.documentPath)) self.components.document.SetSavePoint() - self.title = os.path.split(path)[-1] + ' - ' + self.startTitle #self.statusBar.text = path self.lastStatus = None self.setEditorStyle() ! except: pass --- 131,139 ---- os.chdir(os.path.dirname(self.documentPath)) self.components.document.SetSavePoint() #self.statusBar.text = path self.lastStatus = None self.setEditorStyle() ! self.topLevelParent.setTitleBar(os.path.split(path)[-1]) ! else: pass |
From: Alex T. <ale...@us...> - 2004-10-10 23:03:25
|
Update of /cvsroot/pythoncard/PythonCard/tools/oneEditor/modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11705/tools/oneEditor/modules Modified Files: scriptutils.py Log Message: Allow saveFile to work in CheckSyntax; fix syntax error production. Index: scriptutils.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/tools/oneEditor/modules/scriptutils.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** scriptutils.py 3 Oct 2004 23:58:01 -0000 1.1 --- scriptutils.py 10 Oct 2004 23:02:09 -0000 1.2 *************** *** 12,23 **** # KEA 2002-05-08 # should probably refactor this so we're not passing around the background ! def CheckFile(background, pathName): what = "check" ! background.statusBar.text = what.capitalize()+'ing module...' try: f = open(pathName) except IOError, details: ! background.statusBar.text = "Cant open file '%s' - %s" % (pathName, details) return try: --- 12,25 ---- # KEA 2002-05-08 # should probably refactor this so we're not passing around the background + # AGT 2004-10-10 + # should refactor whis so we're not passing around 'statusBar' and 'document' ! def CheckFile(statusBar, document, pathName): what = "check" ! statusBar.text = what.capitalize()+'ing module...' try: f = open(pathName) except IOError, details: ! statusBar.text = "Cant open file '%s' - %s" % (pathName, details) return try: *************** *** 27,38 **** try: codeObj = compile(code, pathName,'exec') ! if RunTabNanny(background, pathName): #win32ui.SetStatusText("Python and the TabNanny successfully checked the file '"+os.path.basename(pathName)+"'") ! background.statusBar.text = "Python and the TabNanny successfully checked the file '"+os.path.basename(pathName)+"'" except SyntaxError: #background.statusBar.text = 'SyntaxError' ! _HandlePythonFailure(background, what, pathName) ! def RunTabNanny(background, filename): import cStringIO import tabnanny --- 29,40 ---- try: codeObj = compile(code, pathName,'exec') ! if RunTabNanny(statusBar, document, pathName): #win32ui.SetStatusText("Python and the TabNanny successfully checked the file '"+os.path.basename(pathName)+"'") ! statusBar.text = "Python and the TabNanny successfully checked the file '"+os.path.basename(pathName)+"'" except SyntaxError: #background.statusBar.text = 'SyntaxError' ! _HandlePythonFailure(statusBar, document, what, pathName) ! def RunTabNanny(statusBar, document, filename): import cStringIO import tabnanny *************** *** 52,56 **** lineno = data.split()[1] lineno = int(lineno) ! _JumpToPosition(background, filename, lineno) try: # Try and display whitespace #GetActiveEditControl().SCISetViewWS(1) --- 54,58 ---- lineno = data.split()[1] lineno = int(lineno) ! _JumpToPosition(document, filename, lineno) try: # Try and display whitespace #GetActiveEditControl().SCISetViewWS(1) *************** *** 59,73 **** pass #win32ui.SetStatusText("The TabNanny found trouble at line %d" % lineno) ! background.statusBar.text = "The TabNanny found trouble at line %d" % lineno except (IndexError, TypeError, ValueError): ! background.statusBar.text = "The tab nanny complained, but I cant see where!" print data return 0 return 1 ! def _JumpToPosition(background, fileName, lineno, col = 1): #JumpToDocument(fileName, lineno, col) #print fileName, lineno, col ! doc = background.components.document doc.GotoLine(lineno - 1) if col == 1: --- 61,75 ---- pass #win32ui.SetStatusText("The TabNanny found trouble at line %d" % lineno) ! statusBar.text = "The TabNanny found trouble at line %d" % lineno except (IndexError, TypeError, ValueError): ! statusBar.text = "The tab nanny complained, but I cant see where!" print data return 0 return 1 ! def _JumpToPosition(doc, fileName, lineno, col = 1): #JumpToDocument(fileName, lineno, col) #print fileName, lineno, col ! ###doc = document doc.GotoLine(lineno - 1) if col == 1: *************** *** 81,85 **** ! def _HandlePythonFailure(background, what, syntaxErrorPathName = None): typ, details, tb = sys.exc_info() if typ == SyntaxError: --- 83,87 ---- ! def _HandlePythonFailure(statusBar, document, what, syntaxErrorPathName = None): typ, details, tb = sys.exc_info() if typ == SyntaxError: *************** *** 88,96 **** if (not fileName or fileName =="<string>") and syntaxErrorPathName: fileName = syntaxErrorPathName ! _JumpToPosition(background, fileName, line, col) except (TypeError, ValueError): msg = str(details) #win32ui.SetStatusText('Failed to ' + what + ' - syntax error - %s' % msg) ! background.statusBar.text = 'Failed to ' + what + ' - syntax error - %s' % msg else: traceback.print_exc() --- 90,98 ---- if (not fileName or fileName =="<string>") and syntaxErrorPathName: fileName = syntaxErrorPathName ! _JumpToPosition(document, fileName, line, col) except (TypeError, ValueError): msg = str(details) #win32ui.SetStatusText('Failed to ' + what + ' - syntax error - %s' % msg) ! statusBar.text = 'Failed to ' + what + ' - syntax error - %s' % msg else: traceback.print_exc() *************** *** 108,115 **** try: msg, (fileName, line, col, text) = details ! _JumpToPosition(background, fileName, line, col) except: pass ! background.statusBar.text = 'Failed to ' + what + ' - ' + str(details) tb = None # Clean up a cycle. --- 110,117 ---- try: msg, (fileName, line, col, text) = details ! _JumpToPosition(document, fileName, line, col) except: pass ! statusBar.text = 'Failed to ' + what + ' - ' + str(details) tb = None # Clean up a cycle. |
From: Kevin A. <ka...@us...> - 2004-10-10 02:32:28
|
Update of /cvsroot/pythoncard/PythonCard/components In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28014/components Modified Files: bitmapcanvas.py Log Message: added (x, y) and (width, height) args to getBitmap with smart defaults Index: bitmapcanvas.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/components/bitmapcanvas.py,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** bitmapcanvas.py 10 Oct 2004 01:20:20 -0000 1.44 --- bitmapcanvas.py 10 Oct 2004 02:32:18 -0000 1.45 *************** *** 460,469 **** evt.Skip() ! def getBitmap(self): ! size = self.GetClientSizeTuple() memory = wx.MemoryDC() ! bitmap = wx.EmptyBitmap(size[0], size[1]) memory.SelectObject(bitmap) ! memory.BlitPointSize((0, 0), size, self._bufImage, (0, 0)) memory.SelectObject(wx.NullBitmap) return bitmap --- 460,473 ---- evt.Skip() ! def getBitmap(self, xy=(0, 0), widthHeight=(-1, -1)): ! w, h = self.GetClientSizeTuple() ! if widthHeight[0] != -1: ! w = widthHeight[0] ! if widthHeight[1] != -1: ! h = widthHeight[1] memory = wx.MemoryDC() ! bitmap = wx.EmptyBitmap(w, h) memory.SelectObject(bitmap) ! memory.BlitPointSize((0, 0), (w, h), self._bufImage, xy) memory.SelectObject(wx.NullBitmap) return bitmap |
From: Kevin A. <ka...@us...> - 2004-10-10 01:22:07
|
Update of /cvsroot/pythoncard/PythonCard/samples/turtle In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16484/samples/turtle Modified Files: turtle.py Log Message: fixed missing wx import Index: turtle.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/samples/turtle/turtle.py,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** turtle.py 12 Aug 2004 19:19:04 -0000 1.24 --- turtle.py 10 Oct 2004 01:21:56 -0000 1.25 *************** *** 12,15 **** --- 12,16 ---- """ + import wx from PythonCard import configuration, dialog, model, turtle import os |
From: Kevin A. <ka...@us...> - 2004-10-10 01:20:48
|
Update of /cvsroot/pythoncard/PythonCard/samples/turtle/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15974/samples/turtle/scripts Modified Files: goldenSection.py Log Message: added fileMode, fillColor, logicalCopyMode attributes to BitmapCanvas removed setFillMode, setFillColor, setCopyMode methods Index: goldenSection.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/samples/turtle/scripts/goldenSection.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** goldenSection.py 17 May 2004 16:43:54 -0000 1.1 --- goldenSection.py 10 Oct 2004 01:20:21 -0000 1.2 *************** *** 35,39 **** # color args need to be ints where 0 <= c <=s 255 c = min(255 * i / 360.0, 255) ! canvas.setFillColor((c, c, blue)) canvas.drawEllipse((round(cx-(radius/2) + 0.25*i*math.cos(temp)), round(cy-(radius/2) + 0.25*i*math.sin(temp))), --- 35,39 ---- # color args need to be ints where 0 <= c <=s 255 c = min(255 * i / 360.0, 255) ! canvas.fillColor = (c, c, blue) canvas.drawEllipse((round(cx-(radius/2) + 0.25*i*math.cos(temp)), round(cy-(radius/2) + 0.25*i*math.sin(temp))), |
From: Kevin A. <ka...@us...> - 2004-10-10 01:20:47
|
Update of /cvsroot/pythoncard/PythonCard/samples/testNotebook In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15974/samples/testNotebook Modified Files: widgets.py Log Message: added fileMode, fillColor, logicalCopyMode attributes to BitmapCanvas removed setFillMode, setFillColor, setCopyMode methods Index: widgets.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/samples/testNotebook/widgets.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** widgets.py 14 Sep 2004 17:28:46 -0000 1.1 --- widgets.py 10 Oct 2004 01:20:21 -0000 1.2 *************** *** 57,61 **** canvas.drawRotatedText('Rotated', (60, 40), 90) canvas.foregroundColor = 'gray' ! canvas.setFillColor('gray') canvas.drawEllipse((80, 5), (30, 30)) --- 57,61 ---- canvas.drawRotatedText('Rotated', (60, 40), 90) canvas.foregroundColor = 'gray' ! canvas.fillColor = 'gray' canvas.drawEllipse((80, 5), (30, 30)) |
From: Kevin A. <ka...@us...> - 2004-10-10 01:20:46
|
Update of /cvsroot/pythoncard/PythonCard/samples/widgets In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15974/samples/widgets Modified Files: widgets.py Log Message: added fileMode, fillColor, logicalCopyMode attributes to BitmapCanvas removed setFillMode, setFillColor, setCopyMode methods Index: widgets.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/samples/widgets/widgets.py,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** widgets.py 24 Aug 2004 06:48:40 -0000 1.42 --- widgets.py 10 Oct 2004 01:20:22 -0000 1.43 *************** *** 57,61 **** canvas.drawRotatedText('Rotated', (60, 40), 90) canvas.foregroundColor = 'gray' ! canvas.setFillColor('gray') canvas.drawEllipse((80, 5), (30, 30)) --- 57,61 ---- canvas.drawRotatedText('Rotated', (60, 40), 90) canvas.foregroundColor = 'gray' ! canvas.fillColor = 'gray' canvas.drawEllipse((80, 5), (30, 30)) |
From: Kevin A. <ka...@us...> - 2004-10-10 01:20:31
|
Update of /cvsroot/pythoncard/PythonCard/samples/ataxx In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15974/samples/ataxx Modified Files: ataxx.py Log Message: added fileMode, fillColor, logicalCopyMode attributes to BitmapCanvas removed setFillMode, setFillColor, setCopyMode methods Index: ataxx.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/samples/ataxx/ataxx.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ataxx.py 25 Aug 2004 20:45:41 -0000 1.3 --- ataxx.py 10 Oct 2004 01:20:20 -0000 1.4 *************** *** 169,182 **** else: color = 'blue' ! view.setFillColor(color) view.foregroundColor = 'black' center = (x * CELLWIDTH + CELLWIDTH / 2 + 1, y * CELLHEIGHT + CELLHEIGHT / 2 + 1) view.drawCircle(center, round((CELLWIDTH / 2.0) - 3)) elif state == BLOCK: ! view.setFillColor(BLOCKCOLOR) view.foregroundColor = BLOCKCOLOR view.drawRectangle((x * CELLWIDTH + 3, y * CELLHEIGHT + 3), (CELLWIDTH - 5, CELLHEIGHT - 5)) else: ! view.setFillColor(BOARDCOLOR) view.foregroundColor = BOARDCOLOR view.drawRectangle((x * CELLWIDTH + 1, y * CELLHEIGHT + 1), (CELLWIDTH - 2, CELLHEIGHT - 2)) --- 169,182 ---- else: color = 'blue' ! view.fillColor = color view.foregroundColor = 'black' center = (x * CELLWIDTH + CELLWIDTH / 2 + 1, y * CELLHEIGHT + CELLHEIGHT / 2 + 1) view.drawCircle(center, round((CELLWIDTH / 2.0) - 3)) elif state == BLOCK: ! view.fillColor = BLOCKCOLOR view.foregroundColor = BLOCKCOLOR view.drawRectangle((x * CELLWIDTH + 3, y * CELLHEIGHT + 3), (CELLWIDTH - 5, CELLHEIGHT - 5)) else: ! view.fillColor = BOARDCOLOR view.foregroundColor = BOARDCOLOR view.drawRectangle((x * CELLWIDTH + 1, y * CELLHEIGHT + 1), (CELLWIDTH - 2, CELLHEIGHT - 2)) |
From: Kevin A. <ka...@us...> - 2004-10-10 01:20:31
|
Update of /cvsroot/pythoncard/PythonCard/components In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15974/components Modified Files: bitmapcanvas.py Log Message: added fileMode, fillColor, logicalCopyMode attributes to BitmapCanvas removed setFillMode, setFillColor, setCopyMode methods Index: bitmapcanvas.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/components/bitmapcanvas.py,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** bitmapcanvas.py 28 Sep 2004 03:12:55 -0000 1.43 --- bitmapcanvas.py 10 Oct 2004 01:20:20 -0000 1.44 *************** *** 31,81 **** ! """ ! wxAND src AND dst ! wxAND_INVERT (NOT src) AND dst ! wxAND_REVERSE src AND (NOT dst) ! wxCLEAR 0 ! wxCOPY src ! wxEQUIV (NOT src) XOR dst ! wxINVERT NOT dst ! wxNAND (NOT src) OR (NOT dst) ! wxNOR (NOT src) AND (NOT dst) ! wxNO_OP dst ! wxOR src OR dst ! wxOR_INVERT (NOT src) OR dst ! wxOR_REVERSE src OR (NOT dst) ! wxSET 1 ! wxSRC_INVERT NOT src ! wxXOR src XOR dst ! """ ! LogicalCopyModes = { ! "AND" : wx.AND, ! "AND_INVERT" : wx.AND_INVERT, ! "AND_REVERSE": wx.AND_REVERSE, ! "CLEAR" : wx.CLEAR, ! "COPY": wx.COPY, ! "EQUIV" : wx.EQUIV, ! "INVERT": wx.INVERT, ! "NAND" : wx.NAND, ! "NOR" : wx.NOR, ! "NO_OP" : wx.NO_OP, ! "OR" : wx.OR, ! "OR_INVERT" : wx.OR_INVERT, ! "OR_REVERSE" : wx.OR_REVERSE, ! "SET" : wx.SET, ! "SRC_INVERT" : wx.SRC_INVERT, ! "XOR" : wx.XOR, } BrushFillStyleList = { ! "Transparent" : wx.TRANSPARENT, ! "Solid" : wx.SOLID, ! "BiDiagonalHatch": wx.BDIAGONAL_HATCH, ! "CrossDiagHatch" : wx.CROSSDIAG_HATCH, ! "FDiagonal_Hatch": wx.FDIAGONAL_HATCH, ! "CrossHatch" : wx.CROSS_HATCH, ! "HorizontalHatch": wx.HORIZONTAL_HATCH, ! "VerticalHatch" : wx.VERTICAL_HATCH } --- 31,64 ---- ! # are NOR and NAND descriptions reversed?! ! # double-check wxWidgets docs and/or wxPython source again LogicalCopyModes = { ! "AND" : wx.AND, # src AND dst ! "AND_INVERT" : wx.AND_INVERT, # (NOT src) AND dst ! "AND_REVERSE" : wx.AND_REVERSE, # src AND (NOT dst) ! "CLEAR" : wx.CLEAR, # 0 ! "COPY" : wx.COPY, # src ! "EQUIV" : wx.EQUIV, # (NOT src) XOR dst ! "INVERT" : wx.INVERT, # NOT dst ! "NAND" : wx.NAND, # (NOT src) OR (NOT dst) ! "NOR" : wx.NOR, # (NOT src) AND (NOT dst) ! "NO_OP" : wx.NO_OP, # dst ! "OR" : wx.OR, # src OR dst ! "OR_INVERT" : wx.OR_INVERT, # (NOT src) OR dst ! "OR_REVERSE" : wx.OR_REVERSE, # src OR (NOT dst) ! "SET" : wx.SET, # 1 ! "SRC_INVERT" : wx.SRC_INVERT, # NOT src ! "XOR" : wx.XOR, # src XOR dst } BrushFillStyleList = { ! "TRANSPARENT" : wx.TRANSPARENT, ! "SOLID" : wx.SOLID, ! "BDIAGONAL_HATCH": wx.BDIAGONAL_HATCH, ! "CROSSDIAG_HATCH" : wx.CROSSDIAG_HATCH, ! "FDIAGONAL_HATCH": wx.FDIAGONAL_HATCH, ! "CROSS_HATCH" : wx.CROSS_HATCH, ! "HORIZONTAL_HATCH": wx.HORIZONTAL_HATCH, ! "VERTICAL_HATCH" : wx.VERTICAL_HATCH } *************** *** 120,123 **** --- 103,110 ---- self.clear() self._setForegroundColor((0,0,0)) # 'black' + # these are the defaults for a new MemoryDC + self._fillColor = 'WHITE' + self._fillMode = 'SOLID' + self._logicalCopyMode = 'COPY' self._bindEvents(event.WIDGET_EVENTS) *************** *** 130,143 **** event.Skip() ! def setCopyMode(self, copyMode): ! self._bufImage.SetLogicalFunction(LogicalCopyModes[copyMode.upper()]) ! def _getBackgroundColor( self ) : if self._bufImage is not None: brush = self._bufImage.GetBackground() return brush.GetColour() ! def _setBackgroundColor( self, aColor ) : ! aColor = self._getDefaultColor( aColor ) if self._bufImage is not None: brush = self._bufImage.GetBackground() --- 117,133 ---- event.Skip() ! def _getLogicalCopyMode(self): ! return self._logicalCopyMode ! ! def _setLogicalCopyMode(self, logicalCopyMode): ! self._bufImage.SetLogicalFunction(LogicalCopyModes[logicalCopyMode.upper()]) ! def _getBackgroundColor(self): if self._bufImage is not None: brush = self._bufImage.GetBackground() return brush.GetColour() ! def _setBackgroundColor(self, aColor): ! aColor = self._getDefaultColor(aColor) if self._bufImage is not None: brush = self._bufImage.GetBackground() *************** *** 145,150 **** self._bufImage.SetBackground(brush) ! def setFillColor(self, aColor): ! aColor = self._getDefaultColor( aColor ) if self._bufImage is not None: # KEA 2004-03-01 --- 135,143 ---- self._bufImage.SetBackground(brush) ! def _getFillColor(self): ! return self._fillColor ! ! def _setFillColor(self, aColor): ! aColor = self._getDefaultColor(aColor) if self._bufImage is not None: # KEA 2004-03-01 *************** *** 162,174 **** self._bufImage.SetBrush(nb) ! def setFillMode(self, fillStyle): brush = self._bufImage.GetBrush() ! brush.SetStyle(BrushFillStyleList[fillStyle]) self._bufImage.SetBrush(brush) ! def _getForegroundColor( self ) : return self._penColor ! def _setForegroundColor( self, aColor ) : aColor = self._getDefaultColor( aColor ) self._penColor = aColor --- 155,170 ---- self._bufImage.SetBrush(nb) ! def _getFillMode(self): ! return self._fillMode ! ! def _setFillMode(self, fillStyle): brush = self._bufImage.GetBrush() ! brush.SetStyle(BrushFillStyleList[fillStyle.upper()]) self._bufImage.SetBrush(brush) ! def _getForegroundColor(self): return self._penColor ! def _setForegroundColor(self, aColor): aColor = self._getDefaultColor( aColor ) self._penColor = aColor *************** *** 474,479 **** --- 470,478 ---- backgroundColor = property(_getBackgroundColor, _setBackgroundColor) + fillColor = property(_getFillColor, _setFillColor) + fillMode = property(_getFillMode, _setFillMode) font = property(_getFont, _setFont) foregroundColor = property(_getForegroundColor, _setForegroundColor) + logicalCopyMode = property(_getLogicalCopyMode, _setLogicalCopyMode) thickness = property(_getThickness, _setThickness) |
From: Kevin A. <ka...@us...> - 2004-10-10 01:20:31
|
Update of /cvsroot/pythoncard/PythonCard/samples/life In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15974/samples/life Modified Files: life.py Log Message: added fileMode, fillColor, logicalCopyMode attributes to BitmapCanvas removed setFillMode, setFillColor, setCopyMode methods Index: life.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/samples/life/life.py,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** life.py 28 Sep 2004 05:05:08 -0000 1.46 --- life.py 10 Oct 2004 01:20:21 -0000 1.47 *************** *** 103,107 **** color = 'blue' ! canvas.setFillColor(color) canvas.foregroundColor = color --- 103,107 ---- color = 'blue' ! canvas.fillColor = color canvas.foregroundColor = color *************** *** 248,252 **** oldColor = canvas.foregroundColor canvas.foregroundColor = canvas.backgroundColor ! canvas.setFillColor(canvas.backgroundColor) if cellWidth == 1: --- 248,252 ---- oldColor = canvas.foregroundColor canvas.foregroundColor = canvas.backgroundColor ! canvas.fillColor = canvas.backgroundColor if cellWidth == 1: *************** *** 258,262 **** # need to restore the colors canvas.foregroundColor = oldColor ! canvas.setFillColor(oldColor) def on_bufOff_mouseDown(self, event): --- 258,262 ---- # need to restore the colors canvas.foregroundColor = oldColor ! canvas.fillColor = oldColor def on_bufOff_mouseDown(self, event): |
From: Kevin A. <ka...@us...> - 2004-10-10 01:20:31
|
Update of /cvsroot/pythoncard/PythonCard/samples/reversi In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15974/samples/reversi Modified Files: reversi.py Log Message: added fileMode, fillColor, logicalCopyMode attributes to BitmapCanvas removed setFillMode, setFillColor, setCopyMode methods Index: reversi.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/samples/reversi/reversi.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** reversi.py 17 Jul 2004 17:20:10 -0000 1.3 --- reversi.py 10 Oct 2004 01:20:21 -0000 1.4 *************** *** 230,238 **** else: color = 'white' ! view.setFillColor(color) center = (x * CELLWIDTH + CELLWIDTH / 2 + 1, y * CELLHEIGHT + CELLHEIGHT / 2 + 1) view.drawCircle(center, round((CELLWIDTH / 2.0) - 3)) else: ! view.setFillColor(BOARDCOLOR) view.foregroundColor = BOARDCOLOR view.drawRectangle((x * CELLWIDTH + 1, y * CELLHEIGHT + 1), (CELLWIDTH - 2, CELLHEIGHT - 2)) --- 230,238 ---- else: color = 'white' ! view.fillColor = color center = (x * CELLWIDTH + CELLWIDTH / 2 + 1, y * CELLHEIGHT + CELLHEIGHT / 2 + 1) view.drawCircle(center, round((CELLWIDTH / 2.0) - 3)) else: ! view.fillColor = BOARDCOLOR view.foregroundColor = BOARDCOLOR view.drawRectangle((x * CELLWIDTH + 1, y * CELLHEIGHT + 1), (CELLWIDTH - 2, CELLHEIGHT - 2)) |
From: Kevin A. <ka...@us...> - 2004-10-10 01:20:30
|
Update of /cvsroot/pythoncard/PythonCard/docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15974/docs Modified Files: changelog.txt Log Message: added fileMode, fillColor, logicalCopyMode attributes to BitmapCanvas removed setFillMode, setFillColor, setCopyMode methods Index: changelog.txt =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/docs/changelog.txt,v retrieving revision 1.314 retrieving revision 1.315 diff -C2 -d -r1.314 -r1.315 *** changelog.txt 4 Oct 2004 19:18:23 -0000 1.314 --- changelog.txt 10 Oct 2004 01:20:20 -0000 1.315 *************** *** 8,11 **** --- 8,16 ---- Release 0.8.1 2004-10-?? + added fileMode, fillColor, logicalCopyMode attributes to BitmapCanvas + removed setFillMode, setFillColor, setCopyMode methods + the resourceEditor property editor now updates attributes automatically + but you can still click the Update button (this is mostly useful + on the Mac when editing text) resourceEditor (resourceOutput module) no longer saves background position in resource files |
From: Kevin A. <ka...@us...> - 2004-10-10 01:20:30
|
Update of /cvsroot/pythoncard/PythonCard/samples/gravity In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15974/samples/gravity Modified Files: gravity.py Log Message: added fileMode, fillColor, logicalCopyMode attributes to BitmapCanvas removed setFillMode, setFillColor, setCopyMode methods Index: gravity.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/samples/gravity/gravity.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** gravity.py 28 Sep 2004 16:43:04 -0000 1.5 --- gravity.py 10 Oct 2004 01:20:20 -0000 1.6 *************** *** 90,94 **** def draw(self): ! self.canvas.setFillColor(self.color) #self.canvas.foregroundColor = self.color self.canvas.drawCircle((self.x, self.y), self.radius) --- 90,94 ---- def draw(self): ! self.canvas.fillColor = self.color #self.canvas.foregroundColor = self.color self.canvas.drawCircle((self.x, self.y), self.radius) |
From: Alex T. <ale...@us...> - 2004-10-09 18:31:22
|
Update of /cvsroot/pythoncard/PythonCard/tools/oneEditor In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28112/tools/oneEditor Modified Files: tabcodeEditor.py Log Message: Protect against setResource|File being called before openFile is completed. Index: tabcodeEditor.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/tools/oneEditor/tabcodeEditor.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** tabcodeEditor.py 5 Oct 2004 17:32:54 -0000 1.5 --- tabcodeEditor.py 9 Oct 2004 18:31:08 -0000 1.6 *************** *** 570,592 **** self.components.popComponentNames.items = [] self.components.popComponentEvents.items = [] ! if not self.currentPage: return ! try: ! self.resourceFilename = getResourceFilename(self.currentPage.documentPath) ! self.rsrc = resource.ResourceFile(self.resourceFilename).getResource() ! self.rsrcComponents = {} ! if hasattr(self.rsrc, 'application'): ! components = self.rsrc.application.backgrounds[0].components ! else: ! # CustomDialog ! components = self.rsrc.components ! for c in components: ! self.rsrcComponents[c.name] = c.type ! items = self.rsrcComponents.keys() ! items.sort() ! self.components.popComponentNames.items = items ! except: ! pass def fillEventNames(self, componentName): r = registry.Registry.getInstance() componentType = self.rsrcComponents[componentName] --- 570,601 ---- self.components.popComponentNames.items = [] self.components.popComponentEvents.items = [] ! if self.currentPageNumber >= 0: ! self.currentPage = self.pages[self.currentPageNumber] ! if self.currentPage: ! try: ! self.resourceFilename = getResourceFilename(self.currentPage.documentPath) ! self.rsrc = resource.ResourceFile(self.resourceFilename).getResource() ! self.rsrcComponents = {} ! if hasattr(self.rsrc, 'application'): ! components = self.rsrc.application.backgrounds[0].components ! else: ! # CustomDialog ! components = self.rsrc.components ! for c in components: ! self.rsrcComponents[c.name] = c.type ! items = self.rsrcComponents.keys() ! items.sort() ! self.components.popComponentNames.items = items ! self.components.popComponentNames.visible = True ! self.components.popComponentEvents.visible = False ! return ! except: ! pass ! # no page, or no components on page ! self.components.popComponentNames.visible = False ! self.components.popComponentEvents.visible = False def fillEventNames(self, componentName): + self.components.popComponentEvents.visible = True r = registry.Registry.getInstance() componentType = self.rsrcComponents[componentName] *************** *** 603,608 **** eventNames.append(' ' + e) # should we try and save and restore the current selection? ! if self.components.popComponentEvents.items != eventNames: ! self.components.popComponentEvents.items = eventNames def on_popComponentNames_select(self, event): --- 612,621 ---- eventNames.append(' ' + e) # should we try and save and restore the current selection? ! # AGT 2004-10-09 Changing between two components of same type ! # should reset the even selection ! ## if self.components.popComponentEvents.items != eventNames: ! ## self.components.popComponentEvents.items = eventNames ! self.components.popComponentEvents.items = eventNames ! def on_popComponentNames_select(self, event): |
From: Kevin A. <ka...@us...> - 2004-10-09 00:33:30
|
Update of /cvsroot/pythoncard/PythonCard/samples/gravity In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21770 Added Files: floatgravity.py floatgravity.rsrc.py Log Message: gravity done with FloatCanvas - incomplete --- NEW FILE: floatgravity.py --- #!/usr/bin/python """ __version__ = "$Revision: 1.1 $" __date__ = "$Date: 2004/10/09 00:33:18 $" """ # KEA 2004-09-25 # based on the excellent work by Keith Peters # http://www.bit-101.com/tutorials/gravity.html # I started with the doodle sample, so this sample still # contains some cruft # the big missing item is that I'm not currently doing hit # detection on the individual balls so they go right through each # other. I guess that needs to be part of the move method # with a reference back to the sprites list, but I have # a feeling it will be more complicated because if ball 1 # runs into ball 2, then they both need to react... from PythonCard import clipboard, dialog, graphic, model, util import wx import os import random # helper functions def pointInRect(xy, rect): x, y = xy left, top, right, bottom = rect if x >= left and x <= right and y >= top and y <= bottom: return True else: return False def randomColor(): return (random.randint(0, 255), random.randint(0, 255), random.randint(0, 255)) class Sprite(object): def __init__(self, canvas): self.canvas = canvas class BallSprite(Sprite): def __init__(self, canvas, x, y, radius, color='red'): Sprite.__init__(self, canvas) self.x = x self.y = y self.oldx = x self.oldy = y self.radius = radius self.color = color self.xspeed = random.random() * 30 self.yspeed = random.random() * 30 self.gravity = 2 self.drag = .98 self.bounce = .9 self.dragging = False self.circle = canvas.AddCircle(x, y, radius * 2, LineWidth=1, LineColor='black',FillColor=color) print self.circle print dir(self.circle) def move(self): # this is sort of pointless right now # but maybe the dragging code could be moved # into the class in which case we might need # to know if we're dragging if not self.dragging: self.x += self.xspeed self.y += self.yspeed rightedge, bottomedge = self.canvas.size # bounce when we hit the edge if (self.x - self.radius) < 0: self.x = self.radius self.xspeed = -self.xspeed * self.bounce elif (self.x + self.radius) > rightedge: self.x = rightedge - self.radius self.xspeed = -self.xspeed * self.bounce if (self.y - self.radius) < 0: self.y = self.radius self.yspeed = -self.yspeed * self.bounce elif (self.y + self.radius) > bottomedge: self.y = bottomedge - self.radius self.yspeed = -self.yspeed * self.bounce self.xspeed = self.xspeed * self.drag self.yspeed = self.yspeed * self.drag + self.gravity else: self.xspeed = self.x - self.oldx self.yspeed = self.y - self.oldy self.oldx = self.x self.oldy = self.y #print "speed", self.xspeed, self.yspeed self.draw() def draw(self): ## self.canvas.setFillColor(self.color) #self.canvas.foregroundColor = self.color ## self.canvas.drawCircle((self.x, self.y), self.radius) self.circle.SetXY(self.x, self.y) class Gravity(model.Background): def on_initialize(self, event): self.x = 0 self.y = 0 self.dragging = False self.animate = False self.filename = None # leave it black for now #self.components.bufOff.foregroundColor = self.color self.sprites = [] self.initSizers() canvas = self.components.bufOff canvas.ClearAll() canvas.SetProjectionFun(None) # go ahead and create one ball to get started # if you want to stress the animation loop # uncomment the loop below # my Win2K box can do approximately 130 balls and still # maintain 30 (29.9...) FPS, but above that and it starts # to slow down ## for i in range(130): ## self.sprites.append(BallSprite(self.components.bufOff, 20, 20, 15, randomColor())) self.on_btnNewBall_mouseClick(None) def initSizers(self): sizer1 = wx.BoxSizer(wx.VERTICAL) sizer2 = wx.BoxSizer(wx.HORIZONTAL) comp = self.components flags = wx.ALL | wx.ALIGN_CENTER_VERTICAL padding = 7 sizer2.Add(comp.btnNewBall, 0, flags, padding) sizer2.Add(comp.btnAnimate, 0, flags, padding) sizer2.Add(comp.btnStop, 0, flags, padding) sizer1.Add(sizer2, 0) sizer1.Add(comp.bufOff, 1, wx.EXPAND) sizer1.Fit(self) sizer1.SetSizeHints(self) self.panel.SetSizer(sizer1) self.panel.SetAutoLayout(1) self.panel.Layout() def on_btnNewBall_mouseClick(self, event): canvas = self.components.bufOff self.sprites.append(BallSprite(canvas, 20, 20, 15, randomColor())) if not self.animate: ## canvas.clear() for ball in self.sprites: ball.draw() canvas.redraw() self.statusBar.text = "Balls: %d" % len(self.sprites) def on_btnAnimate_mouseClick(self, event): event.target.enabled = False canvas = self.components.bufOff ## canvas.autoRefresh = False self.animate = True avgfps = 0 frame = 0 seconds = util.time() # number of frames to display a second # on faster boxes this will throttle the number # of frames calculated and displayed, but on slower # boxes it won't prevent slowdown fps = 30 # amount of time that should pass before drawing another frame timePerFrame = 1.0 / fps #print timePerFrame # hack to force a difference # between time and startTime # to avoid a division by zero exception on fast machines # aka my Windows box ;-) startTime = util.time() - 0.001 while self.animate: newSeconds = util.time() if newSeconds - seconds >= timePerFrame: seconds = newSeconds ## canvas.clear() for ball in self.sprites: ball.move() if wx.Platform == '__WXMAC__': canvas.redraw() else: ## canvas.refresh() pass frame += 1 self.statusBar.text = "Average FPS: %.4f Balls: %d" % (frame / (seconds - startTime), len(self.sprites)) # give the user a chance to click Stop wx.SafeYield(self, True) def on_btnStop_mouseClick(self, event): self.animate = False self.components.btnAnimate.enabled = True def on_close(self, event): self.animate = False event.skip() def on_bufOff_mouseDown(self, event): #event.target.drawLine((self.x, self.y), (self.x + 1, self.y + 1)) # figure out which ball the user clicked on, if any # i want to search the list from back to front # but I don't change the list in place, so I make a copy # is there a way to iterate over a list in reverse without # using something awkward like # for i in range(len(self.sprites) - 1, -1, -1): sprites = self.sprites[:] sprites.reverse() for ball in sprites: radius = ball.radius x = ball.x y = ball.y #print "point", event.position #print "rect", x - radius, y - radius, x + radius, y + radius if pointInRect(event.position, (x - radius, y - radius, x + radius, y + radius)): self.dragging = ball ball.dragging = True x, y = event.position self.dx = ball.x - x self.dy = ball.y - y #print self.dx, self.dy break # on a mouseLeave we will no longer # get drag messages, so we could end dragging # at that point, just keep the current behavior def on_bufOff_mouseDrag(self, event): if self.dragging: x, y = event.position ball = self.dragging ball.x = x + self.dx ball.y = y + self.dy # reraw all the objects self.components.bufOff.clear() for ball in self.sprites: ball.move() if wx.Platform == '__WXMAC__': self.components.bufOff.redraw() else: self.components.bufOff.refresh() def on_bufOff_mouseUp(self, event): if self.dragging: self.dragging.dragging = False self.dragging = None # older Doodle code # I'm keeping it around in case I need it later def on_bufOff_mouseEnter(self, event): self.x, self.y = event.position ## def on_bufOff_mouseDown(self, event): ## self.x, self.y = event.position ## event.target.drawLine((self.x, self.y), (self.x + 1, self.y + 1)) ## ## def on_bufOff_mouseDrag(self, event): ## x, y = event.position ## event.target.drawLine((self.x, self.y), (x, y)) ## self.x = x ## self.y = y def on_btnColor_mouseClick(self, event): result = dialog.colorDialog(self, color=self.color) if result.accepted: #self.components.bufOff.foregroundColor = result.color event.target.backgroundColor = result.color self.color = result.color def openFile(self): result = dialog.openFileDialog(None, "Import which file?") if result.accepted: path = result.paths[0] os.chdir(os.path.dirname(path)) self.filename = path bmp = graphic.Bitmap(self.filename) self.components.bufOff.drawBitmap(bmp, (0, 0)) def on_menuFileOpen_select(self, event): self.openFile() def on_menuFileSaveAs_select(self, event): if self.filename is None: path = '' filename = '' else: path, filename = os.path.split(self.filename) result = dialog.saveFileDialog(None, "Save As", path, filename) if result.accepted: path = result.paths[0] fileType = graphic.bitmapType(path) print fileType, path try: bmp = self.components.bufOff.getBitmap() bmp.SaveFile(path, fileType) return 1 except: return 0 else: return 0 def on_menuEditCopy_select(self, event): clipboard.setClipboard(self.components.bufOff.getBitmap()) def on_menuEditPaste_select(self, event): bmp = clipboard.getClipboard() if isinstance(bmp, wx.Bitmap): self.components.bufOff.drawBitmap(bmp) def on_editClear_command(self, event): self.components.bufOff.clear() if __name__ == '__main__': app = model.Application(Gravity) app.MainLoop() --- NEW FILE: floatgravity.rsrc.py --- { 'application':{ 'type':'Application', 'name':'Doodle', 'backgrounds': [ { 'type':'Background', 'name':'bgDoodle', 'title':'Doodle PythonCard Application', 'size':( 310, 300 ), 'style':['resizeable'], 'statusBar':1, 'menubar': { 'type':'MenuBar', 'menus': [ { 'type':'Menu', 'name':'menuFile', 'label':'&File', 'items': [ { 'type':'MenuItem', 'name':'menuFileOpen', 'label':'&Open...\tCtrl+O' }, { 'type':'MenuItem', 'name':'menuFileSaveAs', 'label':'Save &As...' }, { 'type':'MenuItem', 'name':'fileSep1', 'label':'-' }, { 'type':'MenuItem', 'name':'menuFileExit', 'label':'E&xit\tAlt+X', 'command':'exit' } ] }, { 'type':'Menu', 'name':'menuEdit', 'label':'&Edit', 'items': [ { 'type':'MenuItem', 'name':'menuEditCopy', 'label':'&Copy\tCtrl+C'}, { 'type':'MenuItem', 'name':'menuEditPaste', 'label':'&Paste\tCtrl+V'}, { 'type':'MenuItem', 'name':'editSep1', 'label':'-' }, { 'type':'MenuItem', 'name':'menuEditClear', 'label':'&Clear', 'command':'editClear'} ] } ] }, 'components': [ { 'type':'Button', 'name':'btnNewBall', 'position':(5, 5), 'label':'New Ball' }, { 'type':'Button', 'name':'btnAnimate', 'position':(100, 5), 'label':'Animate' }, { 'type':'Button', 'name':'btnStop', 'position':(200, 5), 'label':'Stop' }, { 'type':'FloatCanvas', 'name':'bufOff', 'position':(0, 30), 'size':(300, 230) }, ] } ] } } |
From: Kevin A. <ka...@us...> - 2004-10-07 21:46:08
|
Update of /cvsroot/pythoncard/PythonCard/samples/gravity In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8476 Added Files: readme.txt Log Message: added minimal readme.txt --- NEW FILE: readme.txt --- Conversion of Flash animation to PythonCard. http://www.bit-101.com/tutorials/gravity.html |
From: Kevin A. <ka...@us...> - 2004-10-07 21:38:43
|
Update of /cvsroot/pythoncard/PythonCard/samples/gravity In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6565 Removed Files: imagegravity.py imagegravity.rsrc.py Log Message: removed imagegravity --- imagegravity.py DELETED --- --- imagegravity.rsrc.py DELETED --- |
From: Kevin A. <ka...@us...> - 2004-10-05 23:44:07
|
Update of /cvsroot/pythoncard/PythonCard/tools/findfiles In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19108 Modified Files: findfiles.py Log Message: changed spacing for Mac Index: findfiles.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/tools/findfiles/findfiles.py,v retrieving revision 1.85 retrieving revision 1.86 diff -C2 -d -r1.85 -r1.86 *** findfiles.py 5 Oct 2004 23:35:14 -0000 1.85 --- findfiles.py 5 Oct 2004 23:43:54 -0000 1.86 *************** *** 86,91 **** comp = self.components ! w, h = comp.lblSearchFor.size ! sizer3.Add((w + 10, 5), 0) # spacer sizer3.Add(comp.chkCaseSensitive, 0, chkSizerAttrs, 20) sizer3.Add(comp.chkSearchSubdirectories, 0, chkSizerAttrs, 20) --- 86,93 ---- comp = self.components ! # sadly this doesn't look good on the Mac ! #w, h = comp.lblSearchFor.size ! #sizer3.Add((w + 10, 5), 0) # spacer ! sizer3.Add((5, 5), 0) # spacer sizer3.Add(comp.chkCaseSensitive, 0, chkSizerAttrs, 20) sizer3.Add(comp.chkSearchSubdirectories, 0, chkSizerAttrs, 20) |
From: Kevin A. <ka...@us...> - 2004-10-05 23:35:33
|
Update of /cvsroot/pythoncard/PythonCard/tools/findfiles In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17000/tools/findfiles Modified Files: findfiles.py findfiles.rsrc.py Log Message: added chkOpenWithResourceEditor button revised layout; I hate sizers! Index: findfiles.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/tools/findfiles/findfiles.py,v retrieving revision 1.84 retrieving revision 1.85 diff -C2 -d -r1.84 -r1.85 *** findfiles.py 5 Oct 2004 23:03:11 -0000 1.84 --- findfiles.py 5 Oct 2004 23:35:14 -0000 1.85 *************** *** 76,80 **** def sizerLayout(self): sizer1 = wx.BoxSizer(wx.VERTICAL) ! sizer2 = wx.FlexGridSizer(5, 4, 3, 10) sizer3 = wx.BoxSizer(wx.HORIZONTAL) --- 76,80 ---- def sizerLayout(self): sizer1 = wx.BoxSizer(wx.VERTICAL) ! sizer2 = wx.FlexGridSizer(3, 4, 3, 10) sizer3 = wx.BoxSizer(wx.HORIZONTAL) *************** *** 86,92 **** --- 86,95 ---- comp = self.components + w, h = comp.lblSearchFor.size + sizer3.Add((w + 10, 5), 0) # spacer sizer3.Add(comp.chkCaseSensitive, 0, chkSizerAttrs, 20) sizer3.Add(comp.chkSearchSubdirectories, 0, chkSizerAttrs, 20) #sizer3.Add(comp.chkVerbose, 0, chkSizerAttrs, 20) + sizer3.Add(comp.chkOpenWithResourceEditor, 0, chkSizerAttrs, 20) sizer3.Add(comp.btnViewFile, 0, chkSizerAttrs, 20) *************** *** 106,119 **** sizer2.Add((5, 5), 0) # spacer - sizer2.Add((5, 5), 0) # spacer - sizer2.Add((5, 5), 0) # spacer - sizer2.Add((5, 5), 0) # spacer - sizer2.Add((5, 5), 0) # spacer - - sizer2.Add((5, 5), 0) # spacer - sizer2.Add(sizer3, 0, vertFlags) - sizer1.Add(sizer2, 0, vertFlags) sizer1.Add((5, 5), 0) # spacer sizer1.Add(comp.listResults, 1, wx.EXPAND) --- 109,116 ---- sizer2.Add((5, 5), 0) # spacer sizer1.Add(sizer2, 0, vertFlags) sizer1.Add((5, 5), 0) # spacer + sizer1.Add(sizer3, 0, vertFlags) + sizer1.Add((5, 5), 0) # spacer sizer1.Add(comp.listResults, 1, wx.EXPAND) *************** *** 387,403 **** # the list of extensions and associated programs to # open with should be user settable ! ## if os.path.splitext(filename)[-1] in ['.py', '.pyw']: ! # KEA 2004-09-30 ! # just use the codeEditor, it is a better text editor anyway ! # though I will probably add an option to open the file with ! # the resourceEditor as well ! program = os.path.join("..", "codeEditor", "codeEditor.pyw") ! if not os.path.exists(program): ! program = os.path.join("..", "codeEditor", "codeEditor.py") ! ## else: ! ## program = os.path.join("..", "textEditor", "textEditor.pyw") ! ## if not os.path.exists(program): ! ## program = os.path.join("..", "textEditor", "textEditor.py") ! # throw an exception if textEditor can't be found? log.debug('program: ' + program) --- 384,396 ---- # the list of extensions and associated programs to # open with should be user settable ! if self.components.chkOpenWithResourceEditor.checked and filename.endswith('.rsrc.py'): ! program = os.path.join("..", "resourceEditor", "resourceEditor.pyw") ! if not os.path.exists(program): ! program = os.path.join("..", "resourceEditor", "resourceEditor.py") ! else: ! program = os.path.join("..", "codeEditor", "codeEditor.pyw") ! if not os.path.exists(program): ! program = os.path.join("..", "codeEditor", "codeEditor.py") ! # throw an exception if program can't be found? log.debug('program: ' + program) Index: findfiles.rsrc.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/tools/findfiles/findfiles.rsrc.py,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** findfiles.rsrc.py 5 Oct 2004 21:49:07 -0000 1.25 --- findfiles.rsrc.py 5 Oct 2004 23:35:14 -0000 1.26 *************** *** 132,138 **** }, {'type':'Button', 'name':'btnViewFile', ! 'position':(341, 90), 'label':'Open Selected File', }, --- 132,145 ---- }, + {'type':'CheckBox', + 'name':'chkOpenWithResourceEditor', + 'position':(341, 90), + 'checked':0, + 'label':'Open .rsrc.py files with resourceEditor', + }, + {'type':'Button', 'name':'btnViewFile', ! 'position':(541, 90), 'label':'Open Selected File', }, |
From: Kevin A. <ka...@us...> - 2004-10-05 23:03:31
|
Update of /cvsroot/pythoncard/PythonCard/tools/findfiles In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6966/tools/findfiles Modified Files: findfiles.py Log Message: refactored Search/Cancel toggle, added filename display to search Index: findfiles.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/tools/findfiles/findfiles.py,v retrieving revision 1.83 retrieving revision 1.84 diff -C2 -d -r1.83 -r1.84 *** findfiles.py 5 Oct 2004 21:49:06 -0000 1.83 --- findfiles.py 5 Oct 2004 23:03:11 -0000 1.84 *************** *** 235,242 **** pass ! def doSearch(self): ! self.components.btnSearch.enabled = False ! self.components.btnCancel.enabled = True log.info("Grep for %s in %s" % (self.greppattern, self.filpattern)) log.info('#Search '+self.dirpattern) --- 235,245 ---- pass ! def toggleSearchCancel(self, state): ! self.components.btnSearch.enabled = state ! self.components.btnCancel.enabled = not state + def doSearch(self): + self.toggleSearchCancel(False) + log.info("Grep for %s in %s" % (self.greppattern, self.filpattern)) log.info('#Search '+self.dirpattern) *************** *** 265,275 **** if self.SearchFile(filename): found += 1 ! self.statusBar.text = "Files found: %d" % found ! if self.stopSearching: ! break ! wx.SafeYield(self, True) ! if self.statusBar.text == "Searching...": ! self.statusBar.text = "Files found: 0" ! self.components.btnSearch.enabled = True def SearchFile(self, filename): --- 268,278 ---- if self.SearchFile(filename): found += 1 ! if self.stopSearching: ! break ! else: ! self.statusBar.text = "Files found: %d Searching: %s" % (found, filename) ! wx.SafeYield(self, True) ! self.statusBar.text = "Files found: %d" % found ! self.toggleSearchCancel(True) def SearchFile(self, filename): *************** *** 322,327 **** def on_btnCancel_mouseClick(self, event): self.stopSearching = True ! self.components.btnCancel.enabled = False ! self.components.btnSearch.enabled = True def on_btnAddDirs_mouseClick(self, event): --- 325,329 ---- def on_btnCancel_mouseClick(self, event): self.stopSearching = True ! self.toggleSearchCancel(True) def on_btnAddDirs_mouseClick(self, event): |