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: Andy T. <an...@us...> - 2005-09-18 03:59:39
|
Update of /cvsroot/pythoncard/PythonCard/samples/stockprice In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9735/samples/stockprice Modified Files: stockprice.py Log Message: Making blanket except clauses more specific Index: stockprice.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/samples/stockprice/stockprice.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** stockprice.py 5 May 2004 16:53:47 -0000 1.11 --- stockprice.py 18 Sep 2005 03:59:22 -0000 1.12 *************** *** 20,28 **** from SOAP import SOAPProxy FOUND_SOAP = 1 ! except: try: from SOAPpy import SOAPProxy FOUND_SOAP = 1 ! except: FOUND_SOAP = 0 --- 20,28 ---- from SOAP import SOAPProxy FOUND_SOAP = 1 ! except ImportError, msg: try: from SOAPpy import SOAPProxy FOUND_SOAP = 1 ! except ImportError, msg: FOUND_SOAP = 0 *************** *** 64,68 **** namespace='urn:xmethods-delayed-quotes') price = server.getQuote(symbol) ! except: pass return price --- 64,68 ---- namespace='urn:xmethods-delayed-quotes') price = server.getQuote(symbol) ! except Exception, msg: pass return price |
From: Andy T. <an...@us...> - 2005-09-18 03:59:39
|
Update of /cvsroot/pythoncard/PythonCard/samples/webserver In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9735/samples/webserver Modified Files: oldModsWebserver.py webserver.py Log Message: Making blanket except clauses more specific Index: webserver.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/samples/webserver/webserver.py,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** webserver.py 3 Nov 2004 19:50:58 -0000 1.26 --- webserver.py 18 Sep 2005 03:59:22 -0000 1.27 *************** *** 88,92 **** try: self.validIPList.append(socket.gethostbyname(socket.gethostname())) ! except: pass self.allowAny = 0 --- 88,92 ---- try: self.validIPList.append(socket.gethostbyname(socket.gethostname())) ! except Exception, msg: pass self.allowAny = 0 Index: oldModsWebserver.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/samples/webserver/oldModsWebserver.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** oldModsWebserver.py 28 Jul 2004 17:05:54 -0000 1.1 --- oldModsWebserver.py 18 Sep 2005 03:59:22 -0000 1.2 *************** *** 204,208 **** os.dup2(self.wfile.fileno(), 1) os.execve(scriptfile, args, env) ! except: self.server.handle_error(self.request, self.client_address) os._exit(127) --- 204,208 ---- os.dup2(self.wfile.fileno(), 1) os.execve(scriptfile, args, env) ! except Exception, msg: # Should test for a particular Exception self.server.handle_error(self.request, self.client_address) os._exit(127) *************** *** 228,232 **** try: nbytes = int(length) ! except: nbytes = 0 files = popenx(cmdline, 'b') --- 228,232 ---- try: nbytes = int(length) ! except Exception, msg: # Should test for a particular Exception nbytes = 0 files = popenx(cmdline, 'b') *************** *** 335,339 **** lastModified = date_time_string(s[8]) size = str(s[6]) ! except: mdt = None lastModified = None --- 335,339 ---- lastModified = date_time_string(s[8]) size = str(s[6]) ! except Exception, msg: # Should test for a particular exception mdt = None lastModified = None |
From: Andy T. <an...@us...> - 2005-09-18 03:59:39
|
Update of /cvsroot/pythoncard/PythonCard/samples/spirographInteractive In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9735/samples/spirographInteractive Modified Files: spirographInteractive.py Log Message: Making blanket except clauses more specific Index: spirographInteractive.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/samples/spirographInteractive/spirographInteractive.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** spirographInteractive.py 12 Aug 2004 19:19:02 -0000 1.3 --- spirographInteractive.py 18 Sep 2005 03:59:22 -0000 1.4 *************** *** 157,161 **** bmp = graphic.Bitmap(self.filename) self.components.bufOff.drawBitmap(bmp, (0, 0)) ! except: pass --- 157,161 ---- bmp = graphic.Bitmap(self.filename) self.components.bufOff.drawBitmap(bmp, (0, 0)) ! except IOError, msg: pass *************** *** 190,194 **** bmp.SaveFile(path, fileType) return True ! except: return False else: --- 190,194 ---- bmp.SaveFile(path, fileType) return True ! except IOError, msg: return False else: |
From: Andy T. <an...@us...> - 2005-09-18 03:59:38
|
Update of /cvsroot/pythoncard/PythonCard In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9735 Modified Files: model.py sound.py Log Message: Making blanket except clauses more specific Index: sound.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/sound.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** sound.py 14 Apr 2004 00:17:43 -0000 1.6 --- sound.py 18 Sep 2005 03:59:21 -0000 1.7 *************** *** 7,10 **** --- 7,13 ---- import sndhdr + class SoundFileError(Exception): + pass + class Sound: """ *************** *** 29,33 **** self._sndType = None if not self._sndType: ! raise def play(self, async=True, looped=False) : --- 32,36 ---- self._sndType = None if not self._sndType: ! raise SoundFileError, 'This is not a valid sound file' def play(self, async=True, looped=False) : Index: model.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/model.py,v retrieving revision 1.192 retrieving revision 1.193 diff -C2 -d -r1.192 -r1.193 *** model.py 17 May 2005 16:35:52 -0000 1.192 --- model.py 18 Sep 2005 03:59:21 -0000 1.193 *************** *** 21,25 **** import wx assert wx.VERSION >= (2, 5, 2, 8) ! except: from wxPython.wx import wxPySimpleApp, wxFrame, wxMessageDialog, wxICON_EXCLAMATION, wxOK, wxVERSION_STRING app = wxPySimpleApp() --- 21,25 ---- import wx assert wx.VERSION >= (2, 5, 2, 8) ! except AssertionError: from wxPython.wx import wxPySimpleApp, wxFrame, wxMessageDialog, wxICON_EXCLAMATION, wxOK, wxVERSION_STRING app = wxPySimpleApp() |
From: Andy T. <an...@us...> - 2005-09-18 03:59:38
|
Update of /cvsroot/pythoncard/PythonCard/samples/textIndexer In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9735/samples/textIndexer Modified Files: textIndexer.py Log Message: Making blanket except clauses more specific Index: textIndexer.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/samples/textIndexer/textIndexer.py,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** textIndexer.py 12 Aug 2004 19:19:02 -0000 1.27 --- textIndexer.py 18 Sep 2005 03:59:22 -0000 1.28 *************** *** 343,350 **** else: ins = widget.getInsertionPoint() ! try: ! widget.replace(ins, ins + 1, '') ! except: ! pass def on_editSelectAll_command(self, event): --- 343,347 ---- else: ins = widget.getInsertionPoint() ! widget.replace(ins, ins + 1, '') def on_editSelectAll_command(self, event): |
From: Andy T. <an...@us...> - 2005-09-18 03:59:38
|
Update of /cvsroot/pythoncard/PythonCard/samples/widgets In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9735/samples/widgets Modified Files: widgets.py Log Message: Making blanket except clauses more specific Index: widgets.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/samples/widgets/widgets.py,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** widgets.py 10 Oct 2004 01:20:22 -0000 1.43 --- widgets.py 18 Sep 2005 03:59:22 -0000 1.44 *************** *** 392,398 **** f.write(toc) f.close() - #except: - # pass - if __name__ == '__main__': --- 392,395 ---- |
From: Andy T. <an...@us...> - 2005-09-18 03:59:38
|
Update of /cvsroot/pythoncard/PythonCard/samples/sounds In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9735/samples/sounds Modified Files: sounds.py Log Message: Making blanket except clauses more specific Index: sounds.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/samples/sounds/sounds.py,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** sounds.py 12 Aug 2004 19:19:01 -0000 1.14 --- sounds.py 18 Sep 2005 03:59:22 -0000 1.15 *************** *** 18,22 **** snd = sound.Sound(filename) snd.play(async, loop) ! except: base = os.path.basename(filename) dialog.alertDialog(self, 'The sound file "%s" is not in a format I can understand.' % base, 'Unknown File Type') --- 18,22 ---- snd = sound.Sound(filename) snd.play(async, loop) ! except sound.SoundFileError: base = os.path.basename(filename) dialog.alertDialog(self, 'The sound file "%s" is not in a format I can understand.' % base, 'Unknown File Type') |
From: Andy T. <an...@us...> - 2005-09-18 03:59:37
|
Update of /cvsroot/pythoncard/PythonCard/samples/dbBrowser In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9735/samples/dbBrowser Modified Files: dbBrowser2.py dbLogin.py readme.txt Log Message: Making blanket except clauses more specific Index: dbLogin.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/samples/dbBrowser/dbLogin.py,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** dbLogin.py 17 May 2005 20:33:53 -0000 1.12 --- dbLogin.py 18 Sep 2005 03:59:22 -0000 1.13 *************** *** 37,56 **** dbHandler = __import__(dbHandlers[self.components.choice.stringSelection]) dbClass = dbHandler.browse ! if self.components.choice.stringSelection == 'Gadfly': ! self.parent.connection={'databasename':self.components["txtUsername"].text, ! 'directory':self.components["txtPassword"].text} ! elif self.components.choice.stringSelection == 'MetaKit': ! self.parent.connection={'databasename':self.components["txtUsername"].text, ! 'directory':self.components["txtPassword"].text} ! elif self.components.choice.stringSelection == 'PySQLite' or self.components.choice.stringSelection == 'PySQLite2': ! self.parent.connection={'databasename':self.components["txtUsername"].text, ! 'directory':self.components["txtPassword"].text} ! elif self.components.choice.stringSelection == 'CSV': ! self.parent.connection={'databasename':self.components["txtUsername"].text, ! 'directory':self.components["txtPassword"].text} else: ! self.parent.connection={'username':self.components["txtUsername"].text, ! 'password':self.components["txtPassword"].text, ! 'database':self.components["txtDatabase"].text} # Get the choice widget and add the available database tables to it self.parent._database=dbClass(self.parent.connection) --- 37,50 ---- dbHandler = __import__(dbHandlers[self.components.choice.stringSelection]) dbClass = dbHandler.browse ! selection = self.components.choice.stringSelection ! connection = {} ! if selection in ('Gadfly', 'Metakit', 'PySQLite', 'PySQLite2', 'CSV'): ! connection['databasename'] = self.components['txtUsername'].text ! connection['directory'] = self.components['txtPassword'].text else: ! connection['username'] = self.components['txtUsername'].text ! connection['password'] = self.components['txtPassword'].text ! connection['database'] = self.components['txtDatabase'].text ! self.parent.connection = connection # Get the choice widget and add the available database tables to it self.parent._database=dbClass(self.parent.connection) *************** *** 68,74 **** event.skip() - #def on_btnCancel_mouseClick(self, event): - # event.skip() - def on_btnFile_mouseClick(self, event): if self.components.choice.stringSelection == 'Gadfly': --- 62,65 ---- *************** *** 77,81 **** elif self.components.choice.stringSelection == 'CSV': wildcard = "CSV files (*.csv)|*.csv" - ## wildcard = "*.csv" result = dialog.openFileDialog(wildcard=wildcard) else: --- 68,71 ---- *************** *** 89,93 **** def on_choice_select(self, event): ! "When we select 'Gadfly' change the available widgets'" if self.components.choice.stringSelection in ('Gadfly', 'MetaKit', 'PySQLite', 'PySQLite2'): self.components.lblUsername.text = 'DB Name' --- 79,83 ---- def on_choice_select(self, event): ! "Display the appropriate widgets for the selected database" if self.components.choice.stringSelection in ('Gadfly', 'MetaKit', 'PySQLite', 'PySQLite2'): self.components.lblUsername.text = 'DB Name' *************** *** 108,116 **** self.components.txtDatabase.visible = True self.components.btnFile.visible = False - - # KEA 2004-04-24 - # what is this supposed to do? - # historical cruft that should go away? - def OnCloseWindow(self, event): - self.close() event.skip() --- 98,100 ---- Index: dbBrowser2.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/samples/dbBrowser/dbBrowser2.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** dbBrowser2.py 24 Apr 2004 21:09:18 -0000 1.8 --- dbBrowser2.py 18 Sep 2005 03:59:22 -0000 1.9 *************** *** 25,29 **** from PythonCard import model, dialog - # dont need config import os import dbLogin --- 25,28 ---- Index: readme.txt =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/samples/dbBrowser/readme.txt,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** readme.txt 17 May 2005 20:33:53 -0000 1.15 --- readme.txt 18 Sep 2005 03:59:22 -0000 1.16 *************** *** 6,10 **** dbBrowser is a client for viewing data from relational databases. Once you connect to a database, select a table and the rows of data from it are available for you to view. ! The current version of dbBrowser works with MySQL, Gadfly, SQLite, Metakit, PySQLite, PySQLite2, PostgreSQL and Oracle. The code is stable but thi is still an alpha release so if you are not already using any of these databases it is probably best to give this a miss until it is more stable. The current distribution includes an alternative version of dbBrowser (called dbBrowser2) which uses a wxGrid to display the results of your queries rather than the row at a time of dbBrowser. --- 6,10 ---- dbBrowser is a client for viewing data from relational databases. Once you connect to a database, select a table and the rows of data from it are available for you to view. ! The current version of dbBrowser works with MySQL, Gadfly, SQLite, Metakit, PySQLite, PySQLite2, PostgreSQL and Oracle. The code is stable but this is still an alpha release so if you are not already using any of these databases it is probably best to give this a miss until it is more stable. The current distribution includes an alternative version of dbBrowser (called dbBrowser2) which uses a wxGrid to display the results of your queries rather than the row at a time of dbBrowser. *************** *** 56,59 **** --- 56,60 ---- Change Notices -------------- + 16.08.2005 - Clean up and re-factoring 17.05.2005 - Added PySQLite2 support, including script to create a test database from a csv file. ??.09.2004 - Added CSV support, including a testfile.csv test sample. |
From: Andy T. <an...@us...> - 2005-09-18 03:59:37
|
Update of /cvsroot/pythoncard/PythonCard/samples/worldclock In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9735/samples/worldclock Modified Files: worldclock.py Log Message: Making blanket except clauses more specific Index: worldclock.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/samples/worldclock/worldclock.py,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** worldclock.py 30 Aug 2004 14:50:08 -0000 1.27 --- worldclock.py 18 Sep 2005 03:59:22 -0000 1.28 *************** *** 26,30 **** from PythonCard import graphic, log, model, timer - #from PythonCard.log import Log import xearth --- 26,29 ---- *************** *** 34,44 **** def on_initialize(self, event): self.url = '' - - # Enable logging - ###self.log = Log.getInstance() - # self.log.enable() - # Normally we enable only ERROR and WARNING messages - ###self.log.enableLevels( [ Log.ERROR, Log.WARNING, Log.DEBUG, Log.INFO ] ) - # KEA 2002-05-27 # switched to timer events --- 33,36 ---- *************** *** 51,55 **** self.updateImage() - def on_staticTextClock_timer(self, event): self.updateDateAndTime() --- 43,46 ---- *************** *** 59,63 **** if t[0] == "0": t = t[1:] - if self.components.staticTextClock.text != t: self.components.staticTextClock.text = t --- 50,53 ---- *************** *** 71,89 **** def updateImage(self): log.info("interval is up...") - # try: - # jScript = "cscript //nologo xearth.js" - # file = os.popen(jScript) - # s = file.read() - # url = "http://www.time.gov/" + s - # except: - # url = "http://www.time.gov/images/xearths/night.jpg" - # #url = "http://www.time.gov/images/xearths/11N/100N.jpg" url = "http://www.time.gov/" + xearth.getLatLong() - if url == self.url: return - self.url = url - ###self.log.info( "updating image ", url ) log.info("updating image ", url) --- 61,68 ---- *************** *** 93,109 **** jpg = fp.read() fp.close() ! except: return wImageButtonWorld = self.components.imageButtonWorld - # pre wxPython 2.3.3.1 the image data - # had to be written to disk first - #f = open('night2.jpg', "wb") - #f.write(jpg) - #f.close() - - #newBitmap = graphic.Bitmap('night2.jpg') - # with wxPython 2.3.3.1 and above it is no longer # necessary to write the file to disk before displaying it --- 72,80 ---- jpg = fp.read() fp.close() ! except Exception, msg: return wImageButtonWorld = self.components.imageButtonWorld # with wxPython 2.3.3.1 and above it is no longer # necessary to write the file to disk before displaying it *************** *** 120,124 **** event.skip() - if __name__ == '__main__': app = model.Application(WorldClock) --- 91,94 ---- |
From: Andy T. <an...@us...> - 2005-09-18 03:59:37
|
Update of /cvsroot/pythoncard/PythonCard/samples/testNotebook In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9735/samples/testNotebook Modified Files: doodle.py widgets.py Log Message: Making blanket except clauses more specific Index: widgets.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/samples/testNotebook/widgets.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** widgets.py 10 Oct 2004 01:20:21 -0000 1.2 --- widgets.py 18 Sep 2005 03:59:22 -0000 1.3 *************** *** 393,399 **** f.write(toc) f.close() - #except: - # pass - if __name__ == '__main__': --- 393,396 ---- Index: doodle.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/samples/testNotebook/doodle.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** doodle.py 16 Sep 2004 16:11:34 -0000 1.1 --- doodle.py 18 Sep 2005 03:59:22 -0000 1.2 *************** *** 77,81 **** bmp.SaveFile(path, fileType) return 1 ! except: return 0 else: --- 77,81 ---- bmp.SaveFile(path, fileType) return 1 ! except IOError, msg: return 0 else: |
From: Alex T. <ale...@us...> - 2005-09-12 19:58:50
|
Update of /cvsroot/pythoncard/PythonCard/samples/flock In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29249 Modified Files: flock.rsrc.py Log Message: Fix up title and name (remove crufty references to "Doodle"). Index: flock.rsrc.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/samples/flock/flock.rsrc.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** flock.rsrc.py 11 Oct 2004 02:09:12 -0000 1.2 --- flock.rsrc.py 12 Sep 2005 19:58:42 -0000 1.3 *************** *** 1,11 **** { 'application':{ 'type':'Application', ! 'name':'Doodle', 'backgrounds': [ { 'type':'Background', ! 'name':'bgDoodle', ! 'title':'Doodle PythonCard Application', 'size':( 310, 300 ), 'style':['resizeable'], --- 1,11 ---- { 'application':{ 'type':'Application', ! 'name':'Flock', 'backgrounds': [ { 'type':'Background', ! 'name':'bgFlock', ! 'title':'Flock PythonCard Application', 'size':( 310, 300 ), 'style':['resizeable'], |
From: Alex T. <ale...@us...> - 2005-09-12 19:57:04
|
Update of /cvsroot/pythoncard/PythonCard/samples/gravity In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28931 Modified Files: floatgravity.rsrc.py gravity.rsrc.py Log Message: Fix up title and name for app (cruft remaining from "Doodle"). Index: gravity.rsrc.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/samples/gravity/gravity.rsrc.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** gravity.rsrc.py 26 Sep 2004 00:10:41 -0000 1.2 --- gravity.rsrc.py 12 Sep 2005 19:56:56 -0000 1.3 *************** *** 1,5 **** { 'application':{ 'type':'Application', ! 'name':'Doodle', 'backgrounds': --- 1,5 ---- { 'application':{ 'type':'Application', ! 'name':'Gravity', 'backgrounds': *************** *** 7,11 **** { 'type':'Background', 'name':'bgDoodle', ! 'title':'Doodle PythonCard Application', 'size':( 310, 300 ), 'style':['resizeable'], --- 7,11 ---- { 'type':'Background', 'name':'bgDoodle', ! 'title':'Gravity PythonCard Application', 'size':( 310, 300 ), 'style':['resizeable'], Index: floatgravity.rsrc.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/samples/gravity/floatgravity.rsrc.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** floatgravity.rsrc.py 9 Oct 2004 00:33:18 -0000 1.1 --- floatgravity.rsrc.py 12 Sep 2005 19:56:56 -0000 1.2 *************** *** 1,5 **** { 'application':{ 'type':'Application', ! 'name':'Doodle', 'backgrounds': --- 1,5 ---- { 'application':{ 'type':'Application', ! 'name':'Gravity', 'backgrounds': *************** *** 7,11 **** { 'type':'Background', 'name':'bgDoodle', ! 'title':'Doodle PythonCard Application', 'size':( 310, 300 ), 'style':['resizeable'], --- 7,11 ---- { 'type':'Background', 'name':'bgDoodle', ! 'title':'Gravity PythonCard Application', 'size':( 310, 300 ), 'style':['resizeable'], |
From: Phil E. <l2...@us...> - 2005-09-09 12:32:18
|
Update of /cvsroot/pythoncard/PythonCard/tools/standaloneBuilder In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6191 Modified Files: standaloneBuilder.py standaloneBuilder.rsrc.py Added Files: standaloneBuilder.gtk.rsrc.py Log Message: Bug fix to project save routine, and add a button to allow editing of the main script Index: standaloneBuilder.rsrc.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/tools/standaloneBuilder/standaloneBuilder.rsrc.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** standaloneBuilder.rsrc.py 5 May 2005 12:50:24 -0000 1.5 --- standaloneBuilder.rsrc.py 9 Sep 2005 12:32:08 -0000 1.6 *************** *** 1,530 **** ! {'application':{'type':'Application', ! 'name':'Template', ! 'backgrounds': [ ! {'type':'Background', ! 'name':'standaloneBuilder', ! 'title':'PythonCard standaloneBuilder', ! 'size':(800, 594), ! 'statusBar':1, ! ! 'menubar': {'type':'MenuBar', [...1146 lines suppressed...] ! {'type':'StaticText', ! 'name':'StaticText7', ! 'position':(15, 95), ! 'labelSpecified':0, ! 'nameSpecified':0, ! 'text':'Base directory', ! }, ! ! {'type':'StaticText', ! 'name':'StaticText6', ! 'position':(15, 65), ! 'labelSpecified':0, ! 'nameSpecified':0, ! 'text':'Name', ! }, ! ! ] # end components ! } # end background ! ] # end backgrounds ! } } --- NEW FILE: standaloneBuilder.gtk.rsrc.py --- {'application':{'type':'Application', 'name':'Template', 'backgrounds': [ {'type':'Background', 'name':'standaloneBuilder', 'title':u'PythonCard standaloneBuilder', 'size':(800, 610), 'statusBar':1, 'menubar': {'type':'MenuBar', 'menus': [ {'type':'Menu', 'name':'menuFile', 'label':'&File', 'items': [ {'type':'MenuItem', 'name':'menuFileNew', 'label':'&New\tCtrl+N', 'command':'newBtn', }, {'type':'MenuItem', 'name':'menuFileOpen', 'label':'&Open\tCtrl+O', }, {'type':'MenuItem', 'name':'menuFileSave', 'label':'&Save\tCtrl+S', }, {'type':'MenuItem', 'name':'menuFileSaveAs', 'label':'Save &As...', }, {'type':'MenuItem', 'name':'fileSep2', 'label':'-', }, {'type':'MenuItem', 'name':'menuFileExit', 'label':'E&xit\tAlt+X', }, ] }, {'type':'Menu', 'name':'Edit', 'label':'&Edit', 'items': [ {'type':'MenuItem', 'name':'menuEditUndo', 'label':'&Undo\tCtrl+Z', }, {'type':'MenuItem', 'name':'menuEditRedo', 'label':'&Redo\tCtrl+Y', }, {'type':'MenuItem', 'name':'editSep1', 'label':'-', }, {'type':'MenuItem', 'name':'menuEditCut', 'label':'Cu&t\tCtrl+X', }, {'type':'MenuItem', 'name':'menuEditCopy', 'label':'&Copy\tCtrl+C', }, {'type':'MenuItem', 'name':'menuEditPaste', 'label':'&Paste\tCtrl+V', }, {'type':'MenuItem', 'name':'editSep2', 'label':'-', }, {'type':'MenuItem', 'name':'menuEditClear', 'label':'Cle&ar\tDel', }, {'type':'MenuItem', 'name':'menuEditSelectAll', 'label':'Select A&ll\tCtrl+A', }, ] }, {'type':'Menu', 'name':'menoTools', 'label':'&Tools', 'items': [ {'type':'MenuItem', 'name':'menuToolsLogAdd', 'label':'A&dd changelog entry\tShift++', 'command':'menuToolsLogAdd', }, {'type':'MenuItem', 'name':'menuToolsLogEdit', 'label':'E&dit Changelog\tCtrl+E', 'command':'menuToolsLogEdit', }, {'type':'MenuItem', 'name':'toolSep1', 'label':'-', }, {'type':'MenuItem', 'name':'menuToolsRebuild', 'label':'R&ebuild\tCtrl+R', }, {'type':'MenuItem', 'name':'menuToolsRelease', 'label':'M&ake release\tCtrl+M', }, ] }, {'type':'Menu', 'name':'menuHelp', 'label':'&Help', 'items': [ {'type':'MenuItem', 'name':'menuHelpAbout', 'label':'&About ...', 'command':'doHelpAbout', }, ] }, ] }, 'strings': { u'testString':u'This is a test string', }, 'components': [ {'type':'Button', 'name':'mainScriptEditBtn', 'position':(375, 120), 'size':(52, 25), 'actionBindings':{}, 'font':{'faceName': u'Sans', 'size': 8}, 'label':'Edit...', 'toolTip':'Edit the main script', }, {'type':'StaticText', 'name':'versionString', 'position':(560, 125), 'actionBindings':{}, 'text':'n/a', }, {'type':'ImageButton', 'name':'newBtn', 'position':(5, 5), 'size':(38, 38), 'actionBindings':{}, 'backgroundColor':(255, 255, 255), 'border':'3d', 'command':'newBtn', 'file':'pixmaps/new.png', 'toolTip':'Create a new project', 'userdata':'frozen', }, {'type':'ImageButton', 'name':'openBtn', 'position':(40, 5), 'size':(38, 38), 'actionBindings':{}, 'backgroundColor':(255, 255, 255), 'border':'3d', 'command':'openBtn', 'file':'pixmaps/open.png', 'toolTip':'Open an existing project', 'userdata':'frozen', }, {'type':'ImageButton', 'name':'saveBtn', 'position':(75, 5), 'size':(38, 38), 'actionBindings':{}, 'backgroundColor':(255, 255, 255), 'border':'3d', 'command':'saveBtn', 'file':'pixmaps/save.png', 'toolTip':'Save the current project', 'userdata':'frozen', }, {'type':'ImageButton', 'name':'prefsBtn', 'position':(705, 5), 'size':(38, 38), 'actionBindings':{}, 'backgroundColor':(255, 255, 255), 'border':'3d', 'command':'prefsBtn', 'file':'pixmaps/prefs.png', 'toolTip':'standaloneBuilder preferences', 'userdata':'frozen', }, {'type':'ImageButton', 'name':'quitBtn', 'position':(750, 5), 'size':(38, 38), 'actionBindings':{}, 'backgroundColor':(255, 255, 255), 'border':'3d', 'command':'quitBtn', 'file':'pixmaps/exit.png', 'toolTip':'Quit the program', 'userdata':'frozen', }, {'type':'TextField', 'name':'projectName', 'position':(95, 60), 'size':(250, -1), 'actionBindings':{}, }, {'type':'TextField', 'name':'projectIcon', 'position':(500, 60), 'size':(250, -1), 'actionBindings':{}, }, {'type':'Button', 'name':'iconBtn', 'position':(755, 60), 'size':(25, 25), 'actionBindings':{}, 'label':'...', }, {'type':'TextField', 'name':'baseDir', 'position':(95, 90), 'size':(250, -1), 'actionBindings':{}, }, {'type':'Button', 'name':'baseDirBtn', 'position':(350, 90), 'size':(25, 25), 'actionBindings':{}, 'label':'...', }, {'type':'TextField', 'name':'projectDesc', 'position':(500, 90), 'size':(250, -1), 'actionBindings':{}, }, {'type':'TextField', 'name':'mainScript', 'position':(95, 120), 'size':(250, -1), 'actionBindings':{}, }, {'type':'Button', 'name':'mainScriptBtn', 'position':(350, 120), 'size':(25, 25), 'actionBindings':{}, 'label':'...', }, {'type':'StaticBox', 'name':'StaticBox2', 'position':(5, 165), 'size':(380, 160), 'actionBindings':{}, 'label':'Script files:', }, {'type':'List', 'name':'scriptList', 'position':(15, 180), 'size':(360, 100), 'actionBindings':{}, 'items':[], }, {'type':'Button', 'name':'scriptAddBtn', 'position':(15, 285), 'actionBindings':{}, 'label':'Add...', }, {'type':'Button', 'name':'scriptDelBtn', 'position':(100, 285), 'actionBindings':{}, 'label':'Remove', }, {'type':'Button', 'name':'scriptEditBtn', 'position':(185, 285), 'actionBindings':{}, 'label':'Edit...', }, {'type':'Button', 'name':'scriptDelAllBtn', 'position':(295, 285), 'actionBindings':{}, 'label':'Clear all', }, {'type':'StaticBox', 'name':'StaticBox3', 'position':(405, 165), 'size':(380, 160), 'actionBindings':{}, 'label':'Resource files:', }, {'type':'List', 'name':'resList', 'position':(415, 180), 'size':(360, 100), 'actionBindings':{}, 'items':[], }, {'type':'Button', 'name':'resAddBtn', 'position':(415, 285), 'actionBindings':{}, 'label':'Add..', }, {'type':'Button', 'name':'resDelBtn', 'position':(500, 285), 'actionBindings':{}, 'label':'Remove', }, {'type':'Button', 'name':'resEditBtn', 'position':(585, 285), 'actionBindings':{}, 'label':'Edit...', }, {'type':'Button', 'name':'resDelAllBtn', 'position':(695, 285), 'actionBindings':{}, 'label':'Clear all', }, {'type':'StaticBox', 'name':'StaticBox4', 'position':(5, 325), 'size':(380, 160), 'actionBindings':{}, 'label':'Pixmap files:', }, {'type':'List', 'name':'pixmapList', 'position':(15, 340), 'size':(360, 100), 'actionBindings':{}, 'items':[], }, {'type':'Button', 'name':'pixmapAddBtn', 'position':(15, 445), 'actionBindings':{}, 'label':'Add...', }, {'type':'Button', 'name':'pixmapDelBtn', 'position':(100, 445), 'actionBindings':{}, 'label':'Remove', }, {'type':'Button', 'name':'pixmapEditBtn', 'position':(185, 445), 'actionBindings':{}, 'label':'Edit...', }, {'type':'Button', 'name':'pixmapDelAllBtn', 'position':(295, 445), 'actionBindings':{}, 'label':'Clear all', }, {'type':'StaticBox', 'name':'StaticBox5', 'position':(405, 325), 'size':(380, 160), 'actionBindings':{}, 'label':'Other files:', }, {'type':'List', 'name':'otherList', 'position':(415, 340), 'size':(360, 100), 'actionBindings':{}, 'items':[], }, {'type':'Button', 'name':'docAddBtn', 'position':(415, 445), 'actionBindings':{}, 'label':'Add...', }, {'type':'Button', 'name':'docDelBtn', 'position':(500, 445), 'actionBindings':{}, 'label':'Remove', }, {'type':'Button', 'name':'docEditBtn', 'position':(585, 445), 'actionBindings':{}, 'label':'Edit...', }, {'type':'Button', 'name':'docDelAllBtn', 'position':(695, 445), 'actionBindings':{}, 'label':'Clear all', }, {'type':'Button', 'name':'propertiesBtn', 'position':(15, 490), 'size':(85, -1), 'actionBindings':{}, 'label':'Properties...', 'toolTip':'Change your projects properties', }, {'type':'Button', 'name':'changelogBtn', 'position':(100, 490), 'size':(85, -1), 'actionBindings':{}, 'command':'changeLogBtn', 'label':'Changelog...', 'toolTip':'Edit the changelog file', }, {'type':'Button', 'name':'readmeBtn', 'position':(100, 525), 'actionBindings':{}, 'label':'README...', 'toolTip':'Edit the README file', }, {'type':'Button', 'name':'specBtn', 'position':(185, 490), 'actionBindings':{}, 'label':'Spec file...', 'toolTip':'Edit the applications spec file', }, {'type':'Button', 'name':'innoBtn', 'position':(185, 525), 'size':(85, -1), 'actionBindings':{}, 'label':'Inno script...', 'toolTip':'Edit the Inno setup script for your application', }, {'type':'Button', 'name':'runBtn', 'position':(270, 490), 'actionBindings':{}, 'label':'Run...', 'toolTip':'Run the application', }, {'type':'Button', 'name':'rebuildBtn', 'position':(695, 490), 'actionBindings':{}, 'label':'Rebuild', 'toolTip':'Rebuild the standalone version of your application', 'userdata':'frozen', }, {'type':'Button', 'name':'releaseBtn', 'position':(695, 525), 'actionBindings':{}, 'label':'Release', 'toolTip':'Make a release of your finished application', 'userdata':'frozen', }, {'type':'StaticBox', 'name':'StaticBox1', 'position':(5, 45), 'size':(780, 115), 'actionBindings':{}, 'label':'Project:', }, {'type':'StaticText', 'name':'StaticText5', 'position':(15, 125), 'actionBindings':{}, 'text':'Main script', }, {'type':'StaticText', 'name':'StaticText4', 'position':(420, 95), 'actionBindings':{}, 'text':'Description', }, {'type':'StaticText', 'name':'StaticText9', 'position':(430, 65), 'actionBindings':{}, 'text':'Icon (Win)', }, {'type':'StaticText', 'name':'StaticText8', 'position':(500, 125), 'actionBindings':{}, 'text':'Version', }, {'type':'StaticText', 'name':'StaticText7', 'position':(15, 95), 'actionBindings':{}, 'text':'Directory', }, {'type':'StaticText', 'name':'StaticText6', 'position':(15, 65), 'actionBindings':{}, 'text':'Name', }, ] # end components } # end background ] # end backgrounds } } Index: standaloneBuilder.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/tools/standaloneBuilder/standaloneBuilder.py,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** standaloneBuilder.py 12 May 2005 19:34:04 -0000 1.12 --- standaloneBuilder.py 9 Sep 2005 12:32:08 -0000 1.13 *************** *** 250,253 **** --- 250,261 ---- self.documentChanged = True self.updateStatusBar() + + def on_mainScriptEditBtn_mouseClick(self, event): + editor = self.cfg.get('ConfigData', 'codeeditor') + item = self.pathJoin(self.components.mainScript.text) + item = os.path.join(self.components.baseDir.text, item) + item = os.path.join(self.cfg.get('ConfigData', 'projects'), item) + print editor + ' ' + item + os.system(editor + ' ' + item) def on_scriptAddBtn_mouseClick(self, event): *************** *** 325,329 **** def on_pixmapAddBtn_mouseClick(self, event): ! # add a resource file to the project title = 'Select pixmap file' basepath = os.path.join(self.cfg.get('ConfigData', 'projects'), self.components.baseDir.text) --- 333,337 ---- def on_pixmapAddBtn_mouseClick(self, event): ! # add a pixmap file to the project title = 'Select pixmap file' basepath = os.path.join(self.cfg.get('ConfigData', 'projects'), self.components.baseDir.text) *************** *** 1284,1288 **** self.project.set('Project', 'fixnumber', str(vstring[2])) self.project.set('Project', 'name', self.components.projectName.text) ! self.project.set('Project', 'basepath', self.getRelativePath(self.cfg.get('ConfigData', 'projects'), self.components.baseDir.text)) self.project.set('Project', 'projectdesc', self.components.projectDesc.text) self.project.set('Project', 'mainscript', self.pathSplit(self.components.mainScript.text)) --- 1292,1296 ---- self.project.set('Project', 'fixnumber', str(vstring[2])) self.project.set('Project', 'name', self.components.projectName.text) ! self.project.set('Project', 'basepath', self.getRelativePath(self.cfg.get('ConfigData', 'projects'), self.pathSplit(self.components.baseDir.text))) self.project.set('Project', 'projectdesc', self.components.projectDesc.text) self.project.set('Project', 'mainscript', self.pathSplit(self.components.mainScript.text)) |
From: Phil E. <l2...@us...> - 2005-09-09 12:31:51
|
Update of /cvsroot/pythoncard/PythonCard/tools/standaloneBuilder In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6080 Modified Files: changelog.txt Log Message: Bug fix to project save routine, and add a button to allow editing of the main script Index: changelog.txt =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/tools/standaloneBuilder/changelog.txt,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** changelog.txt 12 May 2005 19:34:04 -0000 1.8 --- changelog.txt 9 Sep 2005 12:31:43 -0000 1.9 *************** *** 1,4 **** --- 1,7 ---- standaloneBuilder version Version 0.1.1 release date TBA -------------------------------------------------------- + - Added a button to allow the main script to be edited + - Project base direcotry was not being saved correctly under certain + circumstances - Now gives a warning message if you try to release a project with the console and/or debug options switched on |
From: Alex T. <ale...@us...> - 2005-08-24 13:57:41
|
Update of /cvsroot/pythoncard/PythonCard/tools/resourceEditor In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5046 Modified Files: multiresourceEditor.py Log Message: Convert from CtlKey to CmdKey (== ctl on Win, == meta on Mac). Better handling of marquee selection when cursor leaves window : should always delete marquee rectangle if mouse is released while outside the window, acts like a mouse-release (but not until mouse re-enters window). Index: multiresourceEditor.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/tools/resourceEditor/multiresourceEditor.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** multiresourceEditor.py 16 Aug 2005 10:17:07 -0000 1.4 --- multiresourceEditor.py 24 Aug 2005 13:57:27 -0000 1.5 *************** *** 14,17 **** --- 14,19 ---- import wx + import time + from PythonCard import about, clipboard, configuration, dialog, graphic, log from PythonCard import menu, model, registry, resource, util *************** *** 168,171 **** --- 170,175 ---- wx.EVT_LEFT_UP(self.panel, self.on_mouseUp) wx.EVT_MOTION(self.panel, self.on_mouseDrag) + wx.EVT_LEAVE_WINDOW(self.panel, self.on_mouseLeaveWindow) + wx.EVT_ENTER_WINDOW(self.panel, self.on_mouseEnterWindow) wx.EVT_CHAR(self.panel, self.on_keyPress) *************** *** 577,581 **** globalPosition = wx.GetMousePosition() ! ctlKey = event.ControlDown() control = event.GetEventObject() --- 581,585 ---- globalPosition = wx.GetMousePosition() ! cmdKey = event.CmdDown() control = event.GetEventObject() *************** *** 604,608 **** return else: ! #print control.name, ctlKey clientPosition = self.panel.ScreenToClient(wx.GetMousePosition()) # AGT 04-2005 --- 608,612 ---- return else: ! #print control.name, cmdKey clientPosition = self.panel.ScreenToClient(wx.GetMousePosition()) # AGT 04-2005 *************** *** 636,640 **** # so we must have selected one of the user's components ! if ctlKey: if self.startName == target.name: return #print "ctl-select", target.name, self.multipleComponents --- 640,644 ---- # so we must have selected one of the user's components ! if cmdKey: if self.startName == target.name: return #print "ctl-select", target.name, self.multipleComponents *************** *** 724,730 **** self.drawTheRect() self.movingComponent = True ! def on_mouseDrag(self, event): - ##print "on_mouseDrag", event.Dragging() # protect against double-clicks in the open file dialog # when switching rsrc.py files --- 728,744 ---- self.drawTheRect() self.movingComponent = True ! ! def on_mouseLeaveWindow(self, event): ! #print "leave" ! pass ! ! def on_mouseEnterWindow(self, event): ! if not self.marquee: return ! #rint "enter window", event.LeftIsDown() ! if not event.LeftIsDown(): ! # mouse has been released ! self.terminate_marquee(event.CmdDown(), event.m_shiftDown) ! def on_mouseDrag(self, event): # protect against double-clicks in the open file dialog # when switching rsrc.py files *************** *** 842,846 **** def on_keyPress(self, event): keyCode = event.GetKeyCode() ! ctlKey = event.ControlDown() shiftKey = event.ShiftDown() keyDeltas = {wx.WXK_LEFT: (-1,0), wx.WXK_UP: (0,-1), --- 856,860 ---- def on_keyPress(self, event): keyCode = event.GetKeyCode() ! cmdKey = event.CmdDown() shiftKey = event.ShiftDown() keyDeltas = {wx.WXK_LEFT: (-1,0), wx.WXK_UP: (0,-1), *************** *** 852,856 **** grid = False step = 1 ! if ctlKey or self.alignToGrid: step = 2 grid = True --- 866,870 ---- grid = False step = 1 ! if cmdKey or self.alignToGrid: step = 2 grid = True *************** *** 861,929 **** ! def on_mouseUp(self, event): ! # protect against double-clicks in the open file dialog ! # when switching rsrc.py files ! ####print "on_mouseUp BEFORE", self.rect ! ctlKey = event.ControlDown() ! shiftKey = event.ShiftDown() ! if self.marquee: ! # erase the last rect ## print self.marqueeSize ! self.dc.DrawRectanglePointSize((self.marqueeBase[0], self.marqueeBase[1]), ! (self.marqueeSize[0], self.marqueeSize[1])) ! if self.marqueeSize == (0,0) and not shiftKey and not ctlKey: ! # just a click - deselect anything ! if self.multipleSelected: ! self.clearMultipleComponentSelection() ! # but remain in multi mode ! # self.multipleSelected = False ! ## and switch back to single-mode, with the last select comp if known. ! self.multipleSelected = False ! self.propertyEditorWindow.clearComponentList() ! self.propertyEditorWindow.displayComponents(self.components) ! if self.startName: ! name = self.startName else: ! s = self.lastSelection ! if s: ! name, klass = s.split(" : ") ! else: ! name = None ! if self.startName <> name: ! self.startName = name ! if self.application.pw is not None and name: ! self.application.pw.selectComponentsList(name, klass) ! # KEA 2002-02-23 ! if name: self.propertyEditorWindow.selectComponentList(name, klass) - elif self.startName: - self.hideSizingHandles() - self.startName = None - return - #print "selct anything within", self.startGlobalPosition, self.marqueeSize - res = self.controlInRect(self.startGlobalPosition, self.marqueeSize) - self.marquee = False - #print "we found", res - if res == []: return - self.switchToMultipleMode() ! # new selection - delete any existing selections ! if not shiftKey and not ctlKey: ! self.clearMultipleComponentSelection() ! ! for name in res: ! index = self.prefixIndexForComp(name) ! if index == -1: # not already there - add unless "remove only" ! if not (ctlKey and shiftKey): self.multipleComponents.append( (name, self.makeNewHandles(name))) ! else: # already there - remove if toggle or remove ! if ctlKey: ! prefix = self.multipleComponents[index][1] ! for sizingHandle in self.sizingHandleNames: ! del self.components[prefix+sizingHandle] ! del self.multipleComponents[index] ! ! self.propertyEditorWindow.updateComponentList() return --- 875,949 ---- ! def terminate_marquee(self, cmdKey, shiftKey): ! # erase the last rect ## print self.marqueeSize ! self.dc.DrawRectanglePointSize((self.marqueeBase[0], self.marqueeBase[1]), ! (self.marqueeSize[0], self.marqueeSize[1])) ! if self.marqueeSize == (0,0) and not shiftKey and not cmdKey: ! # just a click - deselect anything ! if self.multipleSelected: ! self.clearMultipleComponentSelection() ! # but remain in multi mode ! # self.multipleSelected = False ! ## and switch back to single-mode, with the last select comp if known. ! self.multipleSelected = False ! self.propertyEditorWindow.clearComponentList() ! self.propertyEditorWindow.displayComponents(self.components) ! if self.startName: ! name = self.startName ! else: ! s = self.lastSelection ! if s: ! name, klass = s.split(" : ") else: ! name = None ! if self.startName <> name: ! self.startName = name ! if self.application.pw is not None and name: ! self.application.pw.selectComponentsList(name, klass) ! # KEA 2002-02-23 ! if name: self.propertyEditorWindow.selectComponentList(name, klass) ! ! ! elif self.startName: ! self.hideSizingHandles() ! self.startName = None ! return ! #print "selct anything within", self.startGlobalPosition, self.marqueeSize ! res = self.controlInRect(self.startGlobalPosition, self.marqueeSize) ! self.marquee = False ! #print "we found", res ! if res == []: return ! ! self.switchToMultipleMode() ! ! # new selection - delete any existing selections ! if not shiftKey and not cmdKey: ! self.clearMultipleComponentSelection() ! ! for name in res: ! index = self.prefixIndexForComp(name) ! if index == -1: # not already there - add unless "remove only" ! if not (cmdKey and shiftKey): self.multipleComponents.append( (name, self.makeNewHandles(name))) ! else: # already there - remove if toggle or remove ! if cmdKey: ! prefix = self.multipleComponents[index][1] ! for sizingHandle in self.sizingHandleNames: ! del self.components[prefix+sizingHandle] ! del self.multipleComponents[index] + self.propertyEditorWindow.updateComponentList() + return ! def on_mouseUp(self, event): ! # protect against double-clicks in the open file dialog ! # when switching rsrc.py files ! ####print "on_mouseUp BEFORE", self.rect ! cmdKey = event.CmdDown() ! shiftKey = event.ShiftDown() ! if self.marquee: ! self.terminate_marquee(cmdKey, shiftKey) return |
From: Alex T. <ale...@us...> - 2005-08-21 22:57:42
|
Update of /cvsroot/pythoncard/PythonCard/docs/html In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19175 Modified Files: walkthrough2.html Log Message: Updated screenshots, minor tweaks to text. Index: walkthrough2.html =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/docs/html/walkthrough2.html,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** walkthrough2.html 26 Jul 2004 15:35:32 -0000 1.11 --- walkthrough2.html 21 Aug 2005 22:57:34 -0000 1.12 *************** *** 46,50 **** make a few observations about other things that I could have done that would make the example more instructive or interesting. Note that this tutorial ! describes how this process is handled in PythonCardPrototype 0.6.4. Continuing enhancements to the UI, especially in the resourceEditor, will make the process more and more streamlined over time.</p> --- 46,50 ---- make a few observations about other things that I could have done that would make the example more instructive or interesting. Note that this tutorial ! describes how this process is handled in PythonCardPrototype 0.8.1. Continuing enhancements to the UI, especially in the resourceEditor, will make the process more and more streamlined over time.</p> *************** *** 55,59 **** The buttons add 1 to the current value displayed in the field, subtract 1 from that field's value, and reset the field's value to 0.</p> ! <p class="imageCaption"><img src="images/wt2fig1.png" alt="Finished Counter Application" width="200" height="158" /><br /> Figure 1. Finished Counter Walk-Through Application</p> <h3>The Application Creation Process</h3> --- 55,59 ---- The buttons add 1 to the current value displayed in the field, subtract 1 from that field's value, and reset the field's value to 0.</p> ! <p class="imageCaption"><img src="images/wt2fig1.png" alt="Finished Counter Application" /><br /> Figure 1. Finished Counter Walk-Through Application</p> <h3>The Application Creation Process</h3> *************** *** 69,75 **** <li>Lay out the application's window in Resource Editor. </li> <li>Script the components that will trigger actions (buttons and/or menus)</li> ! <li>Cleaning up artifacts of the copied program. Let's go through those ! steps with my simple Counter tutorial.</li> </ol> <h4>A. Run resourceEditor to modify an existing application. </h4> <ol> --- 69,75 ---- <li>Lay out the application's window in Resource Editor. </li> <li>Script the components that will trigger actions (buttons and/or menus)</li> ! <li>Cleaning up artifacts of the copied program. </li> </ol> + <p>Let's go through those steps with my simple Counter tutorial.</p> <h4>A. Run resourceEditor to modify an existing application. </h4> <ol> *************** *** 86,93 **** we are running resourceEditor at the moment) rather than the Counter application's menu bar. Figure 2 depicts this start-up situation. ! resourceEditor is a "live" editor; the application is running ! while you edit it.</li> </ol> ! <p class="imageCaption"><img src="images/wt2fig2.png" alt="Startup Screen for Walk-Through" width="199" height="101" /><br /> Figure 2. Startup Screen for Walk-Through Counter Application</p> <h4>B. Laying out the window for the counter tutorial application.</h4> --- 86,93 ---- we are running resourceEditor at the moment) rather than the Counter application's menu bar. Figure 2 depicts this start-up situation. ! resourceEditor is a "live" editor; the GUI components of the ! application are running while you edit the window layout.</li> </ol> ! <p class="imageCaption"><img src="images/wt2fig2.png" alt="Startup Screen for Walk-Through" /><br /> Figure 2. Startup Screen for Walk-Through Counter Application</p> <h4>B. Laying out the window for the counter tutorial application.</h4> *************** *** 143,147 **** </ol> <p>Your project should now look like Figure 3.</p> ! <p class="imageCaption"><img src="images/wt2fig3.png" alt="Project With Buttons Added" width="200" height="158" /><br /> Figure 3. Project With Buttons Added</p> <h4>C. Scripting the Buttons</h4> --- 143,147 ---- </ol> <p>Your project should now look like Figure 3.</p> ! <p class="imageCaption"><img src="images/wt2fig3.png" alt="Project With Buttons Added" /><br /> Figure 3. Project With Buttons Added</p> <h4>C. Scripting the Buttons</h4> *************** *** 154,160 **** user selecting Exit from the File menu). codeEditor is found in the tools directory of your PythonCard distribution.</li> ! <li>Position your cursor below the last line of the <span class="code">on_menuFileExit_select(self, event):</span> handler.</li> <li>Enter the following script, remembering that Python is white-space ! aware so that indentations of lines are significant.</li> </ol> <p class="code"> def on_incrBtn_mouseClick(self, event):<br /> --- 154,162 ---- user selecting Exit from the File menu). codeEditor is found in the tools directory of your PythonCard distribution.</li> ! <li>Delete the last line of the class definition, which currently says <span class="code">pass</span>.</li> <li>Enter the following script, remembering that Python is white-space ! aware so that indentations of lines are significant. Since this is a definition ! of a method of the class, the first line will be indented, and subsequent ! lines will be indented twice.</li> </ol> <p class="code"> def on_incrBtn_mouseClick(self, event):<br /> *************** *** 186,190 **** begins "app = ". The result should look like Figure 4.</li> </ol> ! <p class="imageCaption"><img src="images/wt2fig4.png" alt="Code Changes in counter.py" width="508" height="502" /><br /> Figure 4. Code Changes in counter.py</p> <ol start="5"> --- 188,192 ---- begins "app = ". The result should look like Figure 4.</li> </ol> ! <p class="imageCaption"><img src="images/wt2fig4.png" alt="Code Changes in counter.py" /><br /> Figure 4. Code Changes in counter.py</p> <ol start="5"> *************** *** 205,209 **** self.components.field1.text = "0"</p> <p>Figure 5 shows you what your editor window should look like now.</p> ! <p class="imageCaption"><img src="images/wt2fig5.png" alt="Editor Showing Final Code Changes" width="521" height="619" /><br /> Figure 5. Editor Showing Final Code Changes</p> <ol start="12"> --- 207,211 ---- self.components.field1.text = "0"</p> <p>Figure 5 shows you what your editor window should look like now.</p> ! <p class="imageCaption"><img src="images/wt2fig5.png" alt="Editor Showing Final Code Changes" /><br /> Figure 5. Editor Showing Final Code Changes</p> <ol start="12"> *************** *** 230,234 **** displaying the line where we created the intentional typo. (See Figure 6)</li> </ol> ! <p class="imageCaption"><img src="images/wt2fig6.png" alt="Error Shown in Console Window" width="457" height="320" /><br /> Figure 6. Error Shown in Console Window</p> <ol start="6"> --- 232,236 ---- displaying the line where we created the intentional typo. (See Figure 6)</li> </ol> ! <p class="imageCaption"><img src="images/wt2fig6.png" alt="Error Shown in Console Window" /><br /> Figure 6. Error Shown in Console Window</p> <ol start="6"> *************** *** 260,264 **** a single menu choice.</li> </ol> ! <p class="imageCaption"><img src="images/wt2fig7.png" alt="Opening Screen of Menu Editor" width="480" height="300" /><br /> Figure 7. Opening Screen of Menu Editor</p> <ol start="3"> --- 262,266 ---- a single menu choice.</li> </ol> ! <p class="imageCaption"><img src="images/wt2fig7.png" alt="Opening Screen of Menu Editor" /><br /> Figure 7. Opening Screen of Menu Editor</p> <ol start="3"> *************** *** 266,270 **** in Figure 8.</li> </ol> ! <p class="imageCaption"><img src="images/wt2fig8.png" alt="New Menu Dialog Box" width="480" height="300" /><br /> Figure 8. New Menu Item Dialog Box</p> <ol start="4"> --- 268,272 ---- in Figure 8.</li> </ol> ! <p class="imageCaption"><img src="images/wt2fig8.png" alt="New Menu Dialog Box" /><br /> Figure 8. New Menu Item Dialog Box</p> <ol start="4"> *************** *** 277,281 **** work should look something like Figure 9.</li> </ol> ! <p class="imageCaption"><img src="images/wt2fig9.png" alt="Menu Editor With All Menu Items Defined" width="480" height="300" /><br /> Figure 9. Menu Editor With All Menu Items Defined</p> <ol start="7"> --- 279,283 ---- work should look something like Figure 9.</li> </ol> ! <p class="imageCaption"><img src="images/wt2fig9.png" alt="Menu Editor With All Menu Items Defined" width="480" /><br /> Figure 9. Menu Editor With All Menu Items Defined</p> <ol start="7"> *************** *** 293,297 **** Figure 10.</li> </ol> ! <p class="imageCaption"><img src="images/wt2fig10.png" alt="All Menu Items Programmed and Ready to Go" width="521" height="634" /><br /> Figure 10. All Menu Items Programmed and Ready to Go</p> <ol start="11"> --- 295,299 ---- Figure 10.</li> </ol> ! <p class="imageCaption"><img src="images/wt2fig10.png" alt="All Menu Items Programmed and Ready to Go" /><br /> Figure 10. All Menu Items Programmed and Ready to Go</p> <ol start="11"> *************** *** 305,309 **** expected.</li> </ol> ! <p class="imageCaption"><img src="images/wt2fig11.png" alt="Finished C ounter Application With Counter Menu" width="200" height="158" /><br /> Figure 11. Finished Counter Application With Counter Menu</p> <p>(<strong>NOTE</strong> that it would obviously be better design to factor --- 307,311 ---- expected.</li> </ol> ! <p class="imageCaption"><img src="images/wt2fig11.png" alt="Finished C ounter Application With Counter Menu" /><br /> Figure 11. Finished Counter Application With Counter Menu</p> <p>(<strong>NOTE</strong> that it would obviously be better design to factor |
From: Alex T. <ale...@us...> - 2005-08-21 22:57:42
|
Update of /cvsroot/pythoncard/PythonCard/docs/html/images In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19175/images Modified Files: wt2fig1.png wt2fig10.png wt2fig2.png wt2fig4.png wt2fig5.png wt2fig6.png Log Message: Updated screenshots, minor tweaks to text. Index: wt2fig2.png =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/docs/html/images/wt2fig2.png,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvsP14O7X and /tmp/cvswTGdGu differ Index: wt2fig1.png =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/docs/html/images/wt2fig1.png,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvsxEqLw1 and /tmp/cvs7yGW7x differ Index: wt2fig6.png =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/docs/html/images/wt2fig6.png,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvs3Cb1p0 and /tmp/cvsR85f4w differ Index: wt2fig5.png =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/docs/html/images/wt2fig5.png,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 Binary files /tmp/cvsL3TEQ4 and /tmp/cvsqSNeGB differ Index: wt2fig4.png =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/docs/html/images/wt2fig4.png,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 Binary files /tmp/cvs8rMUG7 and /tmp/cvsOaNADE differ Index: wt2fig10.png =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/docs/html/images/wt2fig10.png,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 Binary files /tmp/cvsffQiQa and /tmp/cvs4POgPH differ |
From: Alex T. <ale...@us...> - 2005-08-21 18:48:08
|
Update of /cvsroot/pythoncard/PythonCard/docs/html In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv895 Modified Files: walkthrough1.html Log Message: New screenshots for current version; minor tweaks to description. Index: walkthrough1.html =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/docs/html/walkthrough1.html,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** walkthrough1.html 14 Aug 2005 16:55:48 -0000 1.17 --- walkthrough1.html 21 Aug 2005 18:47:59 -0000 1.18 *************** *** 121,125 **** systems, you may also see an operating system console window when the application launches. You can just minimize this window.)</p> ! <p class="imageCaption"><img height="503" alt="Screen shot of PythonCard Samples Launcher" src="images/wt1fig1.png" width="602" /><br /> Figure 1. Screen Shot of PythonCard's Samples Launcher</p> <p>In the scrolling list of applications, select "minimal." Read the --- 121,125 ---- systems, you may also see an operating system console window when the application launches. You can just minimize this window.)</p> ! <p class="imageCaption"><img alt="Screen shot of PythonCard Samples Launcher" src="images/wt1fig1.png" /><br /> Figure 1. Screen Shot of PythonCard's Samples Launcher</p> <p>In the scrolling list of applications, select "minimal." Read the *************** *** 142,146 **** functionality and want to close the application. You can either click the close box or choose Exit from the File Menu.</p> ! <p class="imageCaption"><img height="100" alt="Screen shot of minimal PythonCard application open window" src="images/wt1fig2.png" width="200" /><br /> Figure 2. Screen shot of minimal PythonCard application window</p> <p>Back in the Samples Launcher, select the sample called "dialogs." --- 142,146 ---- functionality and want to close the application. You can either click the close box or choose Exit from the File Menu.</p> ! <p class="imageCaption"><img alt="Screen shot of minimal PythonCard application open window" src="images/wt1fig2.png" /><br /> Figure 2. Screen shot of minimal PythonCard application window</p> <p>Back in the Samples Launcher, select the sample called "dialogs." *************** *** 148,157 **** When you're ready, click the "Launch" button. A window like the one in Figure 3 will appear.</p> ! <p class="imageCaption"><img height="410" alt="Screen shot of Dialogs launcher application in PythonCard" src="images/wt1fig3.png" width="500" /><br /> Figure 3. Screen Shot of Dialogs Launcher Application in PythonCard</p> ! <p>All of the dialog boxes you can see by clicking on buttons to the left of this window are built into PythonCard. Causing them to appear, and determining what the user selected or did with them, is, as you'll learn in a later ! walk-through, pretty straight-forward. Click on the "Alert" button. A small dialog appears. Click the "OK" button. Notice that in the Sample Dialogs window, you can see the name of the dialog (AlertDialog), and --- 148,157 ---- When you're ready, click the "Launch" button. A window like the one in Figure 3 will appear.</p> ! <p class="imageCaption"><img alt="Screen shot of Dialogs launcher application in PythonCard" src="images/wt1fig3.png" /><br /> Figure 3. Screen Shot of Dialogs Launcher Application in PythonCard</p> ! <p>All of the dialog boxes you can see by clicking on the text lines to the left of this window are built into PythonCard. Causing them to appear, and determining what the user selected or did with them, is, as you'll learn in a later ! walk-through, pretty straight-forward. Click on the "Alert" line. A small dialog appears. Click the "OK" button. Notice that in the Sample Dialogs window, you can see the name of the dialog (AlertDialog), and *************** *** 162,167 **** programming or scripting background, that may not be meaningful, but trust us, it's useful data.</p> ! <p>Now try the "Message" dialog. Run it twice, clicking "OK ! " once and "Cancel" the other time. Notice the differences in the information displayed in the Samples Launcher as a result.</p> <p>One more and then we'll go have some fun with this stuff. Click on the --- 162,167 ---- programming or scripting background, that may not be meaningful, but trust us, it's useful data.</p> ! <p>Now try the "Message" dialog. Run it three times, clicking "Yes ! " once, "No" once and "Cancel" the other time. Notice the differences in the information displayed in the Samples Launcher as a result.</p> <p>One more and then we'll go have some fun with this stuff. Click on the *************** *** 186,191 **** readable.) It's what we call an "event handler." It gets activated, or triggered, by the user causing some event. In this case, the user selects ! the File Menu's exit option and we do nothing (we "pass" the ! action).</p> <p>We're going to change what this menu choice does. You'd never handle an assignment the way we're going to show you here, but our purpose is just to --- 186,193 ---- readable.) It's what we call an "event handler." It gets activated, or triggered, by the user causing some event. In this case, the user selects ! the File Menu's "About" option and we do nothing (in Python, ! the "pass" statement does nothing; it's simply used as a ! placeholder where the syntax requires a ! statement but no action is needed).</p> <p>We're going to change what this menu choice does. You'd never handle an assignment the way we're going to show you here, but our purpose is just to |
From: Alex T. <ale...@us...> - 2005-08-21 18:48:08
|
Update of /cvsroot/pythoncard/PythonCard/docs/html/images In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv895/images Modified Files: wt1fig1.png wt1fig2.png wt1fig3.png Log Message: New screenshots for current version; minor tweaks to description. Index: wt1fig1.png =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/docs/html/images/wt1fig1.png,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 Binary files /tmp/cvswmo1GE and /tmp/cvs7BaUzY differ Index: wt1fig2.png =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/docs/html/images/wt1fig2.png,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 Binary files /tmp/cvsJbyp1D and /tmp/cvsJodtYX differ Index: wt1fig3.png =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/docs/html/images/wt1fig3.png,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 Binary files /tmp/cvssQfUTH and /tmp/cvsih0SU1 differ |
From: Alex T. <ale...@us...> - 2005-08-16 10:17:21
|
Update of /cvsroot/pythoncard/PythonCard/tools/resourceEditor In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5861 Modified Files: multiresourceEditor.py resourceEditor.py Log Message: Connect each editor (normal and multi) to the correct "readme" file. Index: multiresourceEditor.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/tools/resourceEditor/multiresourceEditor.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** multiresourceEditor.py 1 Aug 2005 11:18:14 -0000 1.3 --- multiresourceEditor.py 16 Aug 2005 10:17:07 -0000 1.4 *************** *** 75,79 **** try: ! self.readme = open('readme.txt').read() except: self.readme = '' --- 75,79 ---- try: ! self.readme = open('multireadme.txt').read() except: self.readme = '' Index: resourceEditor.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/tools/resourceEditor/resourceEditor.py,v retrieving revision 1.223 retrieving revision 1.224 diff -C2 -d -r1.223 -r1.224 *** resourceEditor.py 13 Aug 2005 14:53:48 -0000 1.223 --- resourceEditor.py 16 Aug 2005 10:17:07 -0000 1.224 *************** *** 66,70 **** try: ! self.readme = open('multireadme.txt').read() except: self.readme = '' --- 66,70 ---- try: ! self.readme = open('readme.txt').read() except: self.readme = '' |
From: Kevin A. <ka...@us...> - 2005-08-14 16:55:56
|
Update of /cvsroot/pythoncard/PythonCard/docs/html In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11425 Modified Files: walkthrough1.html Log Message: just updated samples.pyw filename Index: walkthrough1.html =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/docs/html/walkthrough1.html,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** walkthrough1.html 9 Feb 2005 08:17:54 -0000 1.16 --- walkthrough1.html 14 Aug 2005 16:55:48 -0000 1.17 *************** *** 113,117 **** than might be evident from these simple demonstrations.)</p> <p>In the directory Python23\Lib\site-packages\PythonCard\samples ! you'll find a file called samples.py. Double-click this application icon (or launch it in whatever way you're accustomed to on your system).</p> <p>In a few moments, you'll see a window open called "PythonCard Samples --- 113,117 ---- than might be evident from these simple demonstrations.)</p> <p>In the directory Python23\Lib\site-packages\PythonCard\samples ! you'll find a file called samples.pyw. Double-click this application icon (or launch it in whatever way you're accustomed to on your system).</p> <p>In a few moments, you'll see a window open called "PythonCard Samples |
From: Alex T. <ale...@us...> - 2005-08-13 14:53:56
|
Update of /cvsroot/pythoncard/PythonCard/tools/resourceEditor In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18240 Modified Files: resourceEditor.py Log Message: Check if Dialog has been modified before doing a "preview Dialog" Index: resourceEditor.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/tools/resourceEditor/resourceEditor.py,v retrieving revision 1.222 retrieving revision 1.223 diff -C2 -d -r1.222 -r1.223 *** resourceEditor.py 9 Aug 2005 13:56:51 -0000 1.222 --- resourceEditor.py 13 Aug 2005 14:53:48 -0000 1.223 *************** *** 1494,1504 **** dlg.destroy() ! def on_filePreviewDialog_command(self, event): ! # we should prompt to save the .rsrc.py file if needed ! # or in the case of a new file, do a save as before attempting ! # to do a preview ! self.previewDialog() ! ! def runScript(self, useInterpreter): # KEA 2004-05-08 # auto-save code taken from codeEditor --- 1494,1498 ---- dlg.destroy() ! def autoSaveFile(self): # KEA 2004-05-08 # auto-save code taken from codeEditor *************** *** 1507,1520 **** if save == "Cancel" or save == "No": # don't do anything, just go back to editing ! return else: if not self.on_menuFileSaveAs_select(None): # they didn't actually save, just go back # to editing ! return elif self.documentChanged: # auto-save self.saveFile() if self.filename is None: # KEA 2002-03-25 --- 1501,1529 ---- if save == "Cancel" or save == "No": # don't do anything, just go back to editing ! return False else: if not self.on_menuFileSaveAs_select(None): # they didn't actually save, just go back # to editing ! return False elif self.documentChanged: # auto-save self.saveFile() + return True + return True + + def on_filePreviewDialog_command(self, event): + # we should prompt to save the .rsrc.py file if needed + # or in the case of a new file, do a save as before attempting + # to do a preview + if not self.autoSaveFile(): return + if self.filename is None: + # KEA 2002-03-25 + # should probably present an error dialog here + return + self.previewDialog() + def runScript(self, useInterpreter): + if not self.autoSaveFile(): return if self.filename is None: # KEA 2002-03-25 |
From: Alex T. <ale...@us...> - 2005-08-13 14:39:50
|
Update of /cvsroot/pythoncard/PythonCard/docs/html In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15646 Modified Files: resource_editor_overview.html timers-threads.html Log Message: Updated to be current to PythonCard 0.8.1 Index: timers-threads.html =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/docs/html/timers-threads.html,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** timers-threads.html 26 Jul 2004 15:35:32 -0000 1.2 --- timers-threads.html 13 Aug 2005 14:39:41 -0000 1.3 *************** *** 14,18 **** <h2>Increasing Usefulness:Talking to program back-ends with Timers and Threads</h2> ! <h4>by David McNab</h4> <p>This walkthrough supplements the excellent existing PythonCard 'Getting Started' <a href="documentation.html">walkthroughs</a> by Dan Shafer and --- 14,18 ---- <h2>Increasing Usefulness:Talking to program back-ends with Timers and Threads</h2> ! <h4>by David McNab and Alex Tweedly.</h4> <p>This walkthrough supplements the excellent existing PythonCard 'Getting Started' <a href="documentation.html">walkthroughs</a> by Dan Shafer and *************** *** 20,29 **** Add a child window</a> lesson. It's based on techniques taken from the various PythonCard <a href="/samples/samples.html">sample programs</a>.</p> <hr /> <h3>Overview, Scope and Purpose</h3> ! <p><em>This walkthrough is targeted at PythonCard Version 0.7. As PythonCard grows, some of this walkthrough may go out of date, even fail - if this ! happens, please contact <strong>david at rebirthing dot co dot nz</strong>, ! and I'll update it.</em></p> <p>The purpose of this walkthrough is to empower you to make your PythonCard programs capable of much more meaningful work, by acquainting you with two --- 20,33 ---- Add a child window</a> lesson. It's based on techniques taken from the various PythonCard <a href="/samples/samples.html">sample programs</a>.</p> + <p>This walkthrough was originally written by David McNab + (<strong>david at rebirthing dot co dot nz</strong>), and was revised by, + and is currently maintained by, Alex Tweedly + (<strong>alex at tweedly dot net</strong>) <hr /> <h3>Overview, Scope and Purpose</h3> ! <p><em>This walkthrough is targeted at PythonCard Version 0.8.1. ! As PythonCard grows, some of this walkthrough may go out of date, even fail - if this ! happens, please contact me and I'll update it.</em></p> <p>The purpose of this walkthrough is to empower you to make your PythonCard programs capable of much more meaningful work, by acquainting you with two *************** *** 60,64 **** will automatically add 10 to the number in the counter field, doing this every 5 seconds.</p> ! <p>Firstly, you will need to add an <span class="code">on_openBackground </span> event handler to your main window. You may have already done this, while experimenting in your learning process during the earlier walkthroughs. --- 64,68 ---- will automatically add 10 to the number in the counter field, doing this every 5 seconds.</p> ! <p>Firstly, you will need to add an <span class="code">on_initialize </span> event handler to your main window. You may have already done this, while experimenting in your learning process during the earlier walkthroughs. *************** *** 66,103 **** <span class="code">Counter</span> class:</p> <p class="code"> ! def on_openBackground(self, event):<br /> ! print "Window opened"</p> <p>Not very significant - but do save your file, and run <span class="code"> counter.py</span>. You'll see a message on stdout when the window opens.</p> <p>So far, so good. Nice to know that we can receive an event when the window gets opened. But not very useful yet.</p> ! <p>Now, we need to use this <span class="code">openBackground</span> event handler as an opportunity to set up a timer.</p> <p>So change the event handler to the following:</p> <p class="code"> ! def on_openBackground(self, event):<br /> ! self.myTimer = wx.wxTimer(self.components.field1, -1) # create a timer<br /> ! self.myTimer.Start(5000) # launch timer, to fire every 5000ms (5 seconds)</p> ! <p>Here, we're making recourse to the wxPython classes underlying PythonCard. ! We need to do this because PythonCard doesn't yet have its own timer wrappers. ! You'll also notice from the <span class="code">self.components.field1</span> that the timer is being created in respect of the <span class="code">field1</span> widget. More on this later.</p> ! <p>Don't try to run this program yet - it will barf since <span class="code">wx</span> ! is an unknown symbol - we need to grab it into our namespace. To do this, add ! to the top of your <span class="code">counter.py</span> program the ! following:</p> ! <p class="code">from wxPython import wx</p> ! <p>so that <span class="code">wx</span> is a known symbol.</p> <p>Now, we have to make sure we can receive an event every time the clock 'ticks'.</p> ! <p>You'll see in the <span class="code">on_openBackground</span> event handler above that we've linked the timer to <span class="code">field1</span> While conceptually the timer applies to the window as a whole, there's a ! weird quirk in <span class="code">wx</span> which requires timers to be ! associated with specific window widgets. So we'll just appease ! <span class="code">wx</span> and get on with the job.</p> <p>To receive the clock tick events, we only have to add another handler.</p> <p>As per the event handler naming convention, (where widgets' handlers --- 70,105 ---- <span class="code">Counter</span> class:</p> <p class="code"> ! def on_initialize(self, event):<br /> ! print "Window opened"</p> <p>Not very significant - but do save your file, and run <span class="code"> counter.py</span>. You'll see a message on stdout when the window opens.</p> <p>So far, so good. Nice to know that we can receive an event when the window gets opened. But not very useful yet.</p> ! <p>Now, we need to use this <span class="code">initialize</span> event handler as an opportunity to set up a timer.</p> <p>So change the event handler to the following:</p> <p class="code"> ! def on_initialize(self, event):<br /> ! self.myTimer = timer.Timer(self.components.field1, -1) # create a timer<br /> ! self.myTimer.Start(5000) # launch timer, to fire every 5000ms (5 seconds)</p> ! <p>You'll also notice from the <span class="code">self.components.field1</span> that the timer is being created in respect of the <span class="code">field1</span> widget. More on this later.</p> ! <p>Don't try to run this program yet - it will barf since <span class="code">timer</span> ! is an unknown symbol - we need to grab it into our namespace. To do this, find ! the line at the top of your <span class="code">counter.py</span> program ! which currently says</p> ! <p class="code">from PythonCard import model</p> ! <p>and change it to say</p> ! <p class="code">from PythonCard import model, timer</p> <p>Now, we have to make sure we can receive an event every time the clock 'ticks'.</p> ! <p>You'll see in the <span class="code">on_initialize</span> event handler above that we've linked the timer to <span class="code">field1</span> While conceptually the timer applies to the window as a whole, there's a ! weird quirk in <span class="code">timers</span> which requires them to be ! associated with specific window widgets.</p> <p>To receive the clock tick events, we only have to add another handler.</p> <p>As per the event handler naming convention, (where widgets' handlers *************** *** 109,120 **** Counter</span>:</p> <p class="code"> ! def on_field1_timer(self, event):<br /> ! print "Got a timer event"<br /> ! startValue = int(self.components.field1.text)<br /> ! endValue = startValue + 10<br /> ! print "Got a timer event, value is now %d" % endValue<br /> ! self.components.field1.text = str(endValue)<br /> ! # uncomment the line below if you've already followed the 'child window' walkthrough<br /> ! #self.minimalWindow.components.field1.text = str(endValue)</p> <p><em>Note</em> - this is ugly, because there's a lot of duplicated functionality. We'll leave it to you to factorise your code appropriately, --- 111,122 ---- Counter</span>:</p> <p class="code"> ! def on_field1_timer(self, event):<br /> ! print "Got a timer event"<br /> ! startValue = int(self.components.field1.text)<br /> ! endValue = startValue + 10<br /> ! print "Got a timer event, value is now %d" % endValue<br /> ! self.components.field1.text = str(endValue)<br /> ! # uncomment the line below if you've already followed the 'child window' walkthrough<br /> ! #self.minimalWindow.components.field1.text = str(endValue)</p> <p><em>Note</em> - this is ugly, because there's a lot of duplicated functionality. We'll leave it to you to factorise your code appropriately, *************** *** 158,162 **** <p>The first thing you could do is disable the timer you set up in the previous section, by commenting out the <span class="code">self.myTimer.Start(5000)</span> ! statement in your <span class="code">on_openBackground</span> handler (see above). This will avoid confusion for now, since there won't be a running timer to complicate things.</p> --- 160,164 ---- <p>The first thing you could do is disable the timer you set up in the previous section, by commenting out the <span class="code">self.myTimer.Start(5000)</span> ! statement in your <span class="code">on_initialize</span> handler (see above). This will avoid confusion for now, since there won't be a running timer to complicate things.</p> *************** *** 195,199 **** global function, not a class method. This thread will periodically sends messages to our window</li> ! <li>In your <span class="code">on_openBackground</span> handler, launch your thread and pass it a handle to the message queue.</li> <li>Add an <strong>idle</strong> event handler, which picks up these --- 197,201 ---- global function, not a class method. This thread will periodically sends messages to our window</li> ! <li>In your <span class="code">on_initialize</span> handler, launch your thread and pass it a handle to the message queue.</li> <li>Add an <strong>idle</strong> event handler, which picks up these *************** *** 203,207 **** </ol> <h4>1. Add the message queue</h4> ! <p>Refer back to the <span class="code">on_openBackground(self, event)</span> handler above, and add the following statement:</p> <p class="code"> --- 205,209 ---- </ol> <h4>1. Add the message queue</h4> ! <p>Refer back to the <span class="code">on_initialize(self, event)</span> handler above, and add the following statement:</p> <p class="code"> *************** *** 230,234 **** x += 10</p> <h4>3. Launch the Thread</h4> ! <p>Add the following lines at the end of your <span class="code">on_openBackground</span> handler:</p> <p class="code"> --- 232,236 ---- x += 10</p> <h4>3. Launch the Thread</h4> ! <p>Add the following lines at the end of your <span class="code">on_initialize</span> handler:</p> <p class="code"> *************** *** 293,297 **** skill.</p> <p>Happy programming!</p> ! <p>Copyright (c) 2003 by David McNab, david at rebirthing dot co dot nz. Please feel free to mirror, copy, translate, upgrade and restribute this page, as long as you keep up to date with Python and PythonCard, and credit the --- 295,300 ---- skill.</p> <p>Happy programming!</p> ! <p>Copyright (c) 2003 by David McNab, david at rebirthing dot co dot nz<br> ! Copyright (c) 2005 by Alex Tweedly, alex at tweedly dot net<br> Please feel free to mirror, copy, translate, upgrade and restribute this page, as long as you keep up to date with Python and PythonCard, and credit the Index: resource_editor_overview.html =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/docs/html/resource_editor_overview.html,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** resource_editor_overview.html 26 Jul 2004 15:35:31 -0000 1.3 --- resource_editor_overview.html 13 Aug 2005 14:39:41 -0000 1.4 *************** *** 3,7 **** <head> <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" /> ! <meta name="author" content="Dan Shafer" /> <link rel="stylesheet" href="PythonCard.css" type="text/css" /> <title>PythonCard's resourceEditor: An Overview</title> --- 3,7 ---- <head> <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" /> ! <meta name="author" content="Dan Shafer + Alex Tweedly" /> <link rel="stylesheet" href="PythonCard.css" type="text/css" /> <title>PythonCard's resourceEditor: An Overview</title> *************** *** 16,23 **** <p>This document describes the resourceEditor which is used to design, lay out, and manipulate PythonCard applications' graphical components. ! It is current as of Version 0.6.7 of the PythonCard release, but given the ! state of flux in which PythonCard finds itself, you should expect the ! behavior of the resourceEditor to change between now and the 1.0 release of ! the product.</p> <p>This document is not so much about how to <em>use</em> the resourceEditor as it is an operational reference overview of the functionality it contains. --- 16,22 ---- <p>This document describes the resourceEditor which is used to design, lay out, and manipulate PythonCard applications' graphical components. ! It is current as of Version 0.8.1 of the PythonCard release; you should ! expect only minor changes in the behavior of the resourceEditor to ! change between now and release 1.0 of the product.</p> <p>This document is not so much about how to <em>use</em> the resourceEditor as it is an operational reference overview of the functionality it contains. *************** *** 27,40 **** to what you would consider a tutorial.</p> <p> For the most part, this discussion confines itself to the use of the ! resourceEditor in building applications on Windows platforms designed to ! run on Windows platforms. But PythonCard can be used on *nix systems and ! a version for Macintosh OS X is in beta test as this is being written. ! Applications written in PythonCard will be able to run on all of those ! systems unchanged once the deployment of wxPython (the cross-platform ! windowing toolkit on which PythonCard is based) is complete on all of those ! platforms.</p> <h2>Overview of resourceEditor</h2> <p>The resourceEditor is located in the tools directory of the PythonCard ! distribution.</p> <p>The resourceEditor is the most common starting point for constructing a PythonCard application. Using this tool, you can create, position, size, --- 26,38 ---- to what you would consider a tutorial.</p> <p> For the most part, this discussion confines itself to the use of the ! resourceEditor in building applications on Windows platforms. But ! PythonCard can also be used on *nix systems and Macintosh OS X. ! </p> <h2>Overview of resourceEditor</h2> <p>The resourceEditor is located in the tools directory of the PythonCard ! distribution. There is also an experimental version of the resourceEditor ! which presents the component properties in a very different format ! and allows a variety of operations on multiple components; ! this is in the same directory, but called multiresourceEditor.</p> <p>The resourceEditor is the most common starting point for constructing a PythonCard application. Using this tool, you can create, position, size, *************** *** 49,57 **** allow you to choose your favorite Python script editor to write the code that gives your application its intelligence and behavior. (We would ! recommend you look at the codeEditor sample application that comes with PythonCard. It is a very capable Python-aware editor and its source is available so you can change it to suit your tastes.)</p> <h3>The 10,000-Foot View of PythonCard Application Development</h3> ! <p>All PythonCard applications have at least two basic files.</p> <p>One file, which has a double file extension of ".rsrc.py" and is referred to as the "resource file", describes the user interface --- 47,57 ---- allow you to choose your favorite Python script editor to write the code that gives your application its intelligence and behavior. (We would ! recommend you look at the codeEditor application that comes with PythonCard. It is a very capable Python-aware editor and its source is available so you can change it to suit your tastes.)</p> <h3>The 10,000-Foot View of PythonCard Application Development</h3> ! <p>Most PythonCard applications have at least two basic files. It is ! possible to build a PythonCard application in a single file, see the ! "noresource" sample in the samples directory.</p> <p>One file, which has a double file extension of ".rsrc.py" and is referred to as the "resource file", describes the user interface *************** *** 65,69 **** <p>The second file is a standard Python script file ending with the extension .py (or .pyw depending on how you want it executed). It contains the code ! your application executes. This code of event-triggered methods and commands that will be executed as the user interacts with your PythonCard application.</p> --- 65,69 ---- <p>The second file is a standard Python script file ending with the extension .py (or .pyw depending on how you want it executed). It contains the code ! your application executes. This code consists of event-triggered methods and commands that will be executed as the user interacts with your PythonCard application.</p> *************** *** 117,124 **** <h3>The resourceEditor's User Interface</h3> <p>In its default configuration "out of the box," the ! resourceEditor, when you launch it, will open three windows plus a console ! window. The three windows are:</p> <ul> ! <li>the Template Resource window (see Figure 1), which is the default window in which you will begin constructing your UI unless you elect to open an existing resource file</li> --- 117,125 ---- <h3>The resourceEditor's User Interface</h3> <p>In its default configuration "out of the box," the ! resourceEditor, when you launch it, will open two windows plus a console ! window. The two windows are:</p> <ul> ! <li>the Standard Template with File->Exit Resource window (see Figure 1), ! which is the default window in which you will begin constructing your UI unless you elect to open an existing resource file</li> *************** *** 126,149 **** things as fonts, colors, sizes, positions, labels, names, and other details describing each component you add to the application's window</li> - <li>the read-only Position & Size window (Figure 3) which you can - use to assist you in placing components in the window</li> </ul> ! <p>The Property Editor window and the Position & Size window always ! reflect information about the currently selected component in the resource ! window.</p> ! <p class="imageCaption"><img src="images/resEditorFig1.png" alt="resourceEditor default resource window" width="402" height="294" /><br /> Figure 1. Default Resource Window in resourceEditor</p> ! <p class="imageCaption"><img src="images/resEditorFig2.png" alt="Property Editor Window" width="360" height="240" /><br /> Figure 2. Blank Property Editor Window (No Component Selected)</p> - <p class="imageCaption"><img src="images/resEditorFig3.png" alt="Size & Position Window" width="196" height="68" /><br /> - Figure 3. Blank Position & Size Window (No Component Selected)</p> <p>When you wish to edit elements of the user interface for which the resourceEditor does not automatically open a window, you will encounter two other windows: the menu editor and the background editor, shown, ! respectively, in Figures 4 and 5.</p> ! <p class="imageCaption"><img src="images/resEditorFig4.png" alt="background editor window" width="370" height="355" /><br /> ! Figure 4. Background Info Editor Window<br/> ! <img src="images/resEditorFig5.png" alt="menu editor window" width="480" height="300" /><br /> ! Figure 5. Menu Editor Window<br /></p> <p>We will look at each of these windows in greater detail in subsequent sections of this document.</p> --- 127,152 ---- things as fonts, colors, sizes, positions, labels, names, and other details describing each component you add to the application's window</li> </ul> ! <p>The Property Editor window always ! reflects information about the currently selected component in the resource ! window, including showing the size and position of the selected component ! in its status bar.</p> ! <p class="imageCaption"><img src="images/resEditorFig1.png" alt="resourceEditor default resource window" /><br /> Figure 1. Default Resource Window in resourceEditor</p> ! <p class="imageCaption"><img src="images/resEditorFig2.png" alt="Property Editor Window" /><br /> Figure 2. Blank Property Editor Window (No Component Selected)</p> <p>When you wish to edit elements of the user interface for which the resourceEditor does not automatically open a window, you will encounter two other windows: the menu editor and the background editor, shown, ! respectively, in Figures 3 and 4.</p> ! <p class="imageCaption"><img src="images/resEditorFig3.png" alt="background editor window" /><br /> ! Figure 3. Background Info Editor Window<br/> ! <img src="images/resEditorFig4.png" alt="menu editor window" /><br /> ! Figure 4. Menu Editor Window<br /></p> ! <p>There is also a String Editor which can be used to improve the ! flexibility and ease of internationalization of your application; ! this window is shown in Figure 5.</p> ! <p class="imageCaption"><img src="images/resEditorFig5.png" alt="string editor window" /><br /> ! Figure 5. String Editor Window<br /></p> <p>We will look at each of these windows in greater detail in subsequent sections of this document.</p> *************** *** 154,163 **** official release of PythonCard 1.0, you can choose one of four basic templates for creating a PythonCard application.</p> ! <p class="imageCaption"><img src="images/resEditorFig6.png" alt="dialog for using built-in templates" width="237" height="197" /><br /> Figure 6. Dialog for Selecting Built-In Templates as Starting Point for New Application</p> <p>The names of the templates describe the various options for creating a new ! application. Depending on your needs, you can select one of these or, for ! more completeness as a starting point, you can begin by copying an existing application and renaming files as outlined in walkthrough1 of the PythonCard documentation suite.</p> --- 157,166 ---- official release of PythonCard 1.0, you can choose one of four basic templates for creating a PythonCard application.</p> ! <p class="imageCaption"><img src="images/resEditorFig6.png" alt="dialog for using built-in templates" /><br /> Figure 6. Dialog for Selecting Built-In Templates as Starting Point for New Application</p> <p>The names of the templates describe the various options for creating a new ! application. You can select one of these, but it is oftne more productive to ! begin by copying an existing application and renaming files as outlined in walkthrough1 of the PythonCard documentation suite.</p> *************** *** 170,199 **** components supported in this release. All of these components are inherited from wxPython.</p> ! <p class="imageCaption"><img src="images/resEditorFig7.png" alt="component menu" width="404" height="409" /><br /> Figure 7. Component Menu in Resource Window</p> ! <p>When you select a component type, a new instance of that component gets ! placed in the window in the upper left corner. It is selected so that its ! properties are immediately available for editing in the Property Editor ! window and its size and position are reflected in the Size & Position ! window. Figure 8 shows a button placed in the window, while Figure 9 shows the Property Editor window's contents immediately after the initial placement ! of the button and Figure 10 shows the Size & Position window's contents ! at the same time.</p> ! <p class="imageCaption"><img src="images/resEditorFig8.png" alt="new button placed in resource window" width="402" height="294" /><br /> ! Figure 8. New Button Placed in Resource Editor Window<br /> ! <img src="images/resEditorFig9.png" alt="property editor window on new button" width="360" height="240" /><br /> ! Figure 9. Property Editor Window on Newly Placed Button<br /> ! <img src="images/resEditorFig10.png" alt="position & size editor on new button" width="196" height="68" /><br /> ! Figure 10. Position & Size Window on Newly Placed Button</p> ! <p>As you can see, the Property Editor Window shows, in its left-hand list, ! the name of the currently selected object ("Button1") and the name ! of its class ("Button"). The right-hand list lists all of the properties associated with the object. The bottom portion of the window ! changes depending on which property is being edited. Figure 11, for example, shows what the bottom area looks like if you select the button's "font" property. Notice the "Font..." button which, if clicked, will display the system's standard font dialog from which you can choose new settings.</p> ! <p class="imageCaption"><img src="images/resEditorFig11.png" alt="setting fonton newly placed button" width="360" height="240" /><br /> Figure 11. Property Editor Window Preparing to Edit Font of Selected Button</p> --- 173,213 ---- components supported in this release. All of these components are inherited from wxPython.</p> ! <p class="imageCaption"><img src="images/resEditorFig7.png" alt="component menu" /><br /> Figure 7. Component Menu in Resource Window</p> ! <p>When you select a component type, you are presented with a dialog to ! allow you to specify the name and, if appropriate, the label or text ! content for the new component. Figure 8 shows this name dialog; since it's ! a button component, it has a field for the Label as well as the one for ! the Name.</p> ! <p class="imageCaption"> ! <img src="images/resEditorFig8.png" alt="component name dialog" /><br /> ! Figure 8. Name and Label/Text dialog</p> ! <p>Once specified, the new instance of that component gets ! placed in the window in the upper left corner. Figure 9 shows a button ! placed in the top left of the Resource Editor Window</p> ! <p class="imageCaption"> ! <img src="images/resEditorFig9.png" alt="new button placed in resource window" /><br /> ! Figure 9. New Button Placed in Resource Editor Window</p> ! <p>It is selected so that its properties are immediately available for ! editing in the Property Editor window. Figure 10 shows the Property Editor window's contents immediately after the initial placement ! of the button, with the size and position shown in the window's status ! bar.</p> ! <p class="imageCaption"> ! <img src="images/resEditorFig10.png" alt="property editor window on new button" /><br /> ! Figure 10. Property Editor Window on Newly Placed Button</p> ! <p>The top left area of the Property Editor Window (Figure 10 above) ! shows the name ! of the currently selected object ("Button1") and the name ! of its class ("Button"). The top right area lists all of the properties associated with the object. The bottom portion of the window ! changes depending on which property is being edited. At the very bottom ! of the window, the status bar shows the component's position and size. ! Figure 11, for example, shows what the bottom area looks like if you select the button's "font" property. Notice the "Font..." button which, if clicked, will display the system's standard font dialog from which you can choose new settings.</p> ! <p class="imageCaption"><img src="images/resEditorFig11.png" alt="setting font on newly placed button" /><br /> Figure 11. Property Editor Window Preparing to Edit Font of Selected Button</p> *************** *** 203,207 **** in the Property Editor Window. Then you select the property you wish to change from the scrolling list of properties, make the appropriate adjustment ! to the setting, and click the "Update" button to instruct the resourceEditor to apply the new setting.</p> <p>Each component has a set of properties, some of which are shared with all --- 217,222 ---- in the Property Editor Window. Then you select the property you wish to change from the scrolling list of properties, make the appropriate adjustment ! to the setting, and either click the "Update" button or simply ! leave the edit field to instruct the resourceEditor to apply the new setting.</p> <p>Each component has a set of properties, some of which are shared with all *************** *** 209,213 **** component. These properties are delineated in the soon-to-be-published PythonCard Component Description document.</p> ! <p>The Size & Position Window displays those parameters for the selected window in your application or for the selected component in the window, but its contents are not editable. To change those properties, you must either --- 224,229 ---- component. These properties are delineated in the soon-to-be-published PythonCard Component Description document.</p> ! <p>The status bar of the Property Editor Window displays the size and ! position for the selected window in your application or for the selected component in the window, but its contents are not editable. To change those properties, you must either *************** *** 218,223 **** whole, and acts as the backdrop against which components are placed and which is the container of those components.</p> ! <p>As we saw in Figure 4, above, you can modify the properties of the ! application windows' backgrounds using the Background Information Editor, which is displayed by selecting "Background Info..." from the resourceEditor's "Edit" menu.</p> --- 234,239 ---- whole, and acts as the backdrop against which components are placed and which is the container of those components.</p> ! <p>As we saw in Figure 3, above, you can modify the properties of the ! application window's background using the Background Info Editor, which is displayed by selecting "Background Info..." from the resourceEditor's "Edit" menu.</p> *************** *** 230,241 **** opens, it will open at that location on the screen and at the indicated size. You'll find that if you resize the window and move it around on the ! screen, then reopen the Background Information Editor, it will update to reflect your changes.</p> - <p>(<strong>Note</strong> that in the current release of PythonCard, it is - not possible to make a fixed-size window that the user cannot resize. When - the user <em>does</em> resize a window, then exits the application, the - windows will restore themselves to their default sizes and positions on - restart unless you specifically write Python code to override those - settings.)</p> <p>You can alter the foreground and background colors of the window using standard color selector dialogs for your system. In this release, we --- 246,251 ---- opens, it will open at that location on the screen and at the indicated size. You'll find that if you resize the window and move it around on the ! screen, then reopen the Background Info Editor, it will update to reflect your changes.</p> <p>You can alter the foreground and background colors of the window using standard color selector dialogs for your system. In this release, we *************** *** 262,271 **** Menu Editor looks like when it has a complex set of menus defined. (It actually depicts the menus in the resourceEditor itself.)</p> ! <p class="imageCaption"><img src="images/resEditorFig12.png" alt="menu editor with full set of menus" width="480" height="300" /><br /> Figure 12. Menu Editor Showing Menus in resourceEditor's Resource File</p> <p>You can add a new menu by clicking on the New Menu button. The result looks like Figure 13. Notice that the new menu is called "New Menu" and appears at the bottom of the current list of menus in the application.</p> ! <p class="imageCaption"><img src="images/resEditorFig13.png" alt="menu editor with new menu defined" width="480" height="300" /><br /> Figure 13. Menu Editor Showing New Menu Being Defined</p> <p>By convention, you should name your menus starting with the word --- 272,281 ---- Menu Editor looks like when it has a complex set of menus defined. (It actually depicts the menus in the resourceEditor itself.)</p> ! <p class="imageCaption"><img src="images/resEditorFig12.png" alt="menu editor with full set of menus" /><br /> Figure 12. Menu Editor Showing Menus in resourceEditor's Resource File</p> <p>You can add a new menu by clicking on the New Menu button. The result looks like Figure 13. Notice that the new menu is called "New Menu" and appears at the bottom of the current list of menus in the application.</p> ! <p class="imageCaption"><img src="images/resEditorFig13.png" alt="menu editor with new menu defined" /><br /> Figure 13. Menu Editor Showing New Menu Being Defined</p> <p>By convention, you should name your menus starting with the word *************** *** 278,282 **** item at the bottom of the current list of menus and menu items, as shown in Figure 14.</p> ! <p class="imageCaption"><img src="images/resEditorFig14.png" alt="menu editor showing new menu item" width="480" height="300" /><br /> Figure 14. Menu Editor Showing New Menu Item Being Edited</p> <p>Again, naming conventions are useful. We recommend you name new menu items --- 288,292 ---- item at the bottom of the current list of menus and menu items, as shown in Figure 14.</p> ! <p class="imageCaption"><img src="images/resEditorFig14.png" alt="menu editor showing new menu item" /><br /> Figure 14. Menu Editor Showing New Menu Item Being Edited</p> <p>Again, naming conventions are useful. We recommend you name new menu items *************** *** 295,304 **** PythonCard places a text represetation of the key combination in the field.</p> ! <p class="imageOption"><img src="images/resEditorFig15.png" alt="menu editor showing menu item" width="480" height="300" /><br /> Figure 15. Menu Editor Showing Menu Item With Accelerator Key and Shortcut Defined</p> <p>You can also connect the menu to a command object defined in your Python script (see "Connecting Components and Menus to Scripts," below). ! In addition, you can determine whether the menu item is enabled when the application launches, whether it is checkable and whether its default condition is to be checked if it is checkable. PythonCard handles the --- 305,318 ---- PythonCard places a text represetation of the key combination in the field.</p> ! <p class="imageCaption"><img src="images/resEditorFig15.png" alt="menu editor showing menu item" /><br /> Figure 15. Menu Editor Showing Menu Item With Accelerator Key and Shortcut Defined</p> <p>You can also connect the menu to a command object defined in your Python script (see "Connecting Components and Menus to Scripts," below). ! Since many UIs have alternate ways to do the same operations available ! from the menu (e.g. command buttons, toolbars, etc.), a convenient way to ! do this is to use the command object, and connect to it from both the menu ! and the alternate button.</p> ! <p>In addition, you can determine whether the menu item is enabled when the application launches, whether it is checkable and whether its default condition is to be checked if it is checkable. PythonCard handles the *************** *** 320,324 **** Dialog" option from the File menu. The resulting editor looks like Figure 16.</p> ! <p class="imageCaption"><img src="images/resEditorFig16.png" alt="new dialog dialog" width="315" height="123" /><br /> Figure 16. Editing Window for New Dialog</p> <p>Notice that a new dialog template includes two buttons by default, one --- 334,338 ---- Dialog" option from the File menu. The resulting editor looks like Figure 16.</p> ! <p class="imageCaption"><img src="images/resEditorFig16.png" alt="new dialog dialog" /><br /> Figure 16. Editing Window for New Dialog</p> <p>Notice that a new dialog template includes two buttons by default, one *************** *** 333,337 **** dialogs).</li> </ul> ! <p class="imageCaption"><img src="images/resEditorFig17.png" alt="dialog info editor" width="370" height="170" /><br /> Figure 17. Dialog Information Editor Window</p> <p>A discussion of how to incorporate dialogs into your PythonCard --- 347,351 ---- dialogs).</li> </ul> ! <p class="imageCaption"><img src="images/resEditorFig17.png" alt="dialog info editor" /><br /> Figure 17. Dialog Information Editor Window</p> <p>A discussion of how to incorporate dialogs into your PythonCard *************** *** 342,351 **** <p>There are two ways to create a connection between an active component or menu item in your PythonCard application and the application's behavior as ! defined in your Python script file: events and commands. Since this document ! describes the resourceEditor and since scripting is conducted outside the ! resourceEditor, we will here consider only summarily the <em>process</em> by ! which these connections are made. For details and examples, see the tutorial ! walk-throughs, particularly <a href="walkthrough3.html">walkthrough3</a> ! and <a href="walkthrough4.html">walkthrough4</a></p> <h3>Events</h3> <p>When the user activates a component in your PythonCard application, that --- 356,367 ---- <p>There are two ways to create a connection between an active component or menu item in your PythonCard application and the application's behavior as ! defined in your Python script file: events and commands. (Remember that ! not all components need to have actions associated with them). ! The resourceEditor creates and manages the visual components of your ! application. Actions for these components are created in the associated ! Python script ... ! For details and examples, see the tutorial ! walk-throughs, particularly <a href="walkthrough2.html">walkthrough2</a> ! and <a href="walkthrough3.html">walkthrough3</a></p> <h3>Events</h3> <p>When the user activates a component in your PythonCard application, that *************** *** 389,393 **** command is the middle portion of the handler name, which in Figure 17 results in the object being told it is to execute the command editClear.</p> ! <p class="imageCaption"><img src="images/resEditorFig18.png" alt="connecting a button to a command" width="360" height="240" /><br /> Figure 18. Connecting a Button to the editClear Command</p> <h2>Additional Features</h2> --- 405,409 ---- command is the middle portion of the handler name, which in Figure 17 results in the object being told it is to execute the command editClear.</p> ! <p class="imageCaption"><img src="images/resEditorFig18.png" alt="connecting a button to a command" /><br /> Figure 18. Connecting a Button to the editClear Command</p> <h2>Additional Features</h2> *************** *** 408,412 **** with the running application. From the File menu, choose "Run options..." The dialog box shown in Figure 19 appears.</p> ! <p class="imageCaption"><img src="images/resEditorFig19.png" alt="run options dialog" width="200" height="220" /><br /> Figure 19. Run Options Dialog</p> <p>You can check any or all of the options in this dialog to affect the way --- 424,428 ---- with the running application. From the File menu, choose "Run options..." The dialog box shown in Figure 19 appears.</p> ! <p class="imageCaption"><img src="images/resEditorFig19.png" alt="run options dialog" /><br /> Figure 19. Run Options Dialog</p> <p>You can check any or all of the options in this dialog to affect the way *************** *** 429,437 **** pythoncard.log. An explanation of the log is beyond the scope of this document.</p> ! <p class="imageCaption"><img src="images/resEditorFig20.png" alt="sample debugging log file" width="656" height="250" /><br /> Figure 20. Sample Debugging Log File</p> <p>The Message Watcher runtime option opens a window (see Figure 21) that monitors messages as they are triggered inside your application.</p> ! <p class="imageCaption"><img src="images/resEditorFig21.png" alt="" width="200" height="300" /><br /> Figure 21. Message Watcher Window Showing Sample Message Information</p> <p>The checkboxes at the top of the window allow you to restrict the messages --- 445,453 ---- pythoncard.log. An explanation of the log is beyond the scope of this document.</p> ! <p class="imageCaption"><img src="images/resEditorFig20.png" alt="sample debugging log file" /><br /> Figure 20. Sample Debugging Log File</p> <p>The Message Watcher runtime option opens a window (see Figure 21) that monitors messages as they are triggered inside your application.</p> ! <p class="imageCaption"><img src="images/resEditorFig21.png" alt="message watcher window" /><br /> Figure 21. Message Watcher Window Showing Sample Message Information</p> <p>The checkboxes at the top of the window allow you to restrict the messages *************** *** 449,453 **** which is a tree outline and therefore can expand and collapse as desired -- displays appropriate information about them in the right text pane.</p> ! <p class="imageCaption"><img src="images/resEditorFig22.png" alt="namespace viewer" width="748" height="454" /><br /> Figure 22. Namespace Viewer Window With Representative Content</p> <p>If you check the "Property Editor" checkbox in the Run Options --- 465,469 ---- which is a tree outline and therefore can expand and collapse as desired -- displays appropriate information about them in the right text pane.</p> ! <p class="imageCaption"><img src="images/resEditorFig22.png" alt="namespace viewer" /><br /> Figure 22. Namespace Viewer Window With Representative Content</p> <p>If you check the "Property Editor" checkbox in the Run Options *************** *** 469,473 **** difficult-to-locate error. You can also use the Shell to send messages to your application manually.</p> ! <p class="imageCaption"><img src="images/resEditorFig23.png" alt="shell window open in application" width="500" height="200" /><br /> Figure 23. Shell Window Showing Interaction With Running Application</p> <h4>Debugging a Running PythonCard Application</h4> --- 485,489 ---- difficult-to-locate error. You can also use the Shell to send messages to your application manually.</p> ! <p class="imageCaption"><img src="images/resEditorFig23.png" alt="shell window open in application" /><br /> Figure 23. Shell Window Showing Interaction With Running Application</p> <h4>Debugging a Running PythonCard Application</h4> *************** *** 480,484 **** through them so you'll be sure you know how to use this powerful feature of PythonCard's resourceEditor.</p> ! <p class="imageCaption"><img src="images/resEditorFig24.png" alt="Debug menu in running application" width="242" height="227" /><br /> Figure 24. Debug Menu in Running PythonCard Application</p> <p>The first four items are toggles. If you wish to open the Message Watcher --- 496,500 ---- through them so you'll be sure you know how to use this powerful feature of PythonCard's resourceEditor.</p> ! <p class="imageCaption"><img src="images/resEditorFig24.png" alt="debug menu in running application" /><br /> Figure 24. Debug Menu in Running PythonCard Application</p> <p>The first four items are toggles. If you wish to open the Message Watcher *************** *** 543,547 **** application. Selecting that menu option produces a window something like the one shown in Figure 25.</p> ! <p class="imageCaption"><img src="images/resEditorFig25.png" alt="viewing the resource file" width="500" height="300" /><br /> Figure 25. Resource Viewer</p> <p>Examining the resource file, which as you can see stores a single Python --- 559,563 ---- application. Selecting that menu option produces a window something like the one shown in Figure 25.</p> ! <p class="imageCaption"><img src="images/resEditorFig25.png" alt="viewing the resource file" /><br /> Figure 25. Resource Viewer</p> <p>Examining the resource file, which as you can see stores a single Python *************** *** 561,569 **** background has its set of properties. Dealing with multiple-window applications in the resourceEditor has also not been addressed here. You'll ! find that in soon-to-be-published walkthrough4 of our tutorial series when it ! is available.</p> ! <p>The resourceEditor's UI is built in resourceEditor. You can examine it and, of course, in the grand tradition of Open Source, you are free to modify ! it, add to its functionality, change labels on things, etc.</p> <?php include "footer.php" ?> <p>$Revision$ : $Author$ : Last updated $Date$</p> --- 577,591 ---- background has its set of properties. Dealing with multiple-window applications in the resourceEditor has also not been addressed here. You'll ! find that in <a href="walkthrough3.html">walkthrough3</a> of our ! tutorial series.</p> ! <p>That concludes our tour of Pythoncard's resourceEditor. We hope it gets ! you on the way to being productive quickly.</p> ! <p>The resourceEditor's UI is built in resourceEditor. You are free to examine it and, of course, in the grand tradition of Open Source, you are free to modify ! it, add to its functionality. If you do this please feed changes back into ! the Pythoncard community and consider joining the development list: ! pyt...@li.... User questions are dealt with ! helpfully and promptly on the user list: ! pyt...@li....}</p> <?php include "footer.php" ?> <p>$Revision$ : $Author$ : Last updated $Date$</p> |
From: Alex T. <ale...@us...> - 2005-08-13 14:39:50
|
Update of /cvsroot/pythoncard/PythonCard/docs/html/images In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15646/images Modified Files: resEditorFig1.png resEditorFig10.png resEditorFig11.png resEditorFig17.png resEditorFig2.png resEditorFig3.png resEditorFig4.png resEditorFig5.png resEditorFig6.png resEditorFig7.png resEditorFig8.png resEditorFig9.png Log Message: Updated to be current to PythonCard 0.8.1 Index: resEditorFig5.png =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/docs/html/images/resEditorFig5.png,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvsU3a2vh and /tmp/cvsTBWLie differ Index: resEditorFig4.png =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/docs/html/images/resEditorFig4.png,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvsMIzNit and /tmp/cvsTdyE3q differ Index: resEditorFig7.png =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/docs/html/images/resEditorFig7.png,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvsg92NPw and /tmp/cvsLn5TDu differ Index: resEditorFig6.png =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/docs/html/images/resEditorFig6.png,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvsG7K6Vv and /tmp/cvsMOxQNt differ Index: resEditorFig1.png =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/docs/html/images/resEditorFig1.png,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvsAJwKbz and /tmp/cvsFKHP5w differ Index: resEditorFig3.png =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/docs/html/images/resEditorFig3.png,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvshkNxWx and /tmp/cvs8suaTv differ Index: resEditorFig2.png =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/docs/html/images/resEditorFig2.png,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvsTPMxQy and /tmp/cvsz09wPw differ Index: resEditorFig9.png =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/docs/html/images/resEditorFig9.png,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvsKzg7aC and /tmp/cvsr7KKcA differ Index: resEditorFig8.png =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/docs/html/images/resEditorFig8.png,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvsr19mQA and /tmp/cvsnxRmUy differ Index: resEditorFig11.png =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/docs/html/images/resEditorFig11.png,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 Binary files /tmp/cvsFSml0D and /tmp/cvsGZRE6B differ Index: resEditorFig10.png =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/docs/html/images/resEditorFig10.png,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvskMbO2E and /tmp/cvsWonRbD differ Index: resEditorFig17.png =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/docs/html/images/resEditorFig17.png,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvsHfgrTJ and /tmp/cvsmlfFeI differ |
From: Kevin A. <ka...@us...> - 2005-08-11 06:26:42
|
Update of /cvsroot/pythoncard/PythonCard In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14775 Modified Files: graphic.py Log Message: added saveWindowScreenshot function Index: graphic.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/graphic.py,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** graphic.py 24 Oct 2004 22:01:19 -0000 1.17 --- graphic.py 11 Aug 2005 06:26:32 -0000 1.18 *************** *** 77,80 **** --- 77,93 ---- + def saveWindowScreenshot(w, path): + bmp = wx.EmptyBitmap(w.size[0], w.size[1]) + memdc = wx.MemoryDC() + memdc.SelectObject(bmp) + dc = wx.WindowDC(w) + memdc.BlitPointSize((0, 0), w.size, dc, (0, 0)) + bmp.SaveFile(path, bitmapType(path)) + dc = None + memdc.SelectObject(wx.NullBitmap) + memdc = None + bmp = None + + class Bitmap : |