You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
|
Apr
(45) |
May
(185) |
Jun
|
Jul
(36) |
Aug
(205) |
Sep
(98) |
Oct
(107) |
Nov
(6) |
Dec
(3) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(1) |
Feb
(2) |
Mar
(19) |
Apr
(26) |
May
(18) |
Jun
|
Jul
(12) |
Aug
(16) |
Sep
(22) |
Oct
(7) |
Nov
(11) |
Dec
(74) |
2006 |
Jan
(14) |
Feb
(1) |
Mar
(3) |
Apr
(3) |
May
(14) |
Jun
(5) |
Jul
(20) |
Aug
(10) |
Sep
(1) |
Oct
|
Nov
(4) |
Dec
(1) |
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(3) |
Jul
(14) |
Aug
|
Sep
|
Oct
(6) |
Nov
(1) |
Dec
|
From: Kevin A. <ka...@us...> - 2006-07-28 19:35:02
|
Update of /cvsroot/pythoncard/PythonCard/samples/iacGrid In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30246 Modified Files: iacGrid.py Log Message: comments about selections, removed crashing lines Index: iacGrid.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/samples/iacGrid/iacGrid.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** iacGrid.py 28 Jul 2006 15:37:29 -0000 1.3 --- iacGrid.py 28 Jul 2006 16:22:30 -0000 1.4 *************** *** 29,32 **** --- 29,38 ---- self.mygrid = mygrid = self.components.mygrid + # KEA 2006-07-28 + # until we figure out dynamic resizing of the grid + # we could set the initial grid to a reasonably large + # value for in memory tests + # to support very large arbitrary size data sets will + # require the use of a wx.GridTableBase mygrid.CreateGrid(30, 6) *************** *** 46,50 **** # is first created in wxWidgets on the Mac which requires that this call # be done late rather than immediately after the grid creation ! mygrid.EnableEditing(False) --- 52,58 ---- # is first created in wxWidgets on the Mac which requires that this call # be done late rather than immediately after the grid creation ! # on Windows, even this caused a crash, so commenting it out until ! # I can figure out the problem ! ## mygrid.EnableEditing(False) *************** *** 54,57 **** --- 62,69 ---- for row, line in enumerate(open(filename)): fields = line.rstrip().split() + # KEA 2006-07-28 + # in order to dynamically size the grid + # according to the docs it looks like we would use AppendRows + # and AppendCols but this also appears to cause a crash ## if row >= mygrid.GetNumberRows(): ## print "adding row" *************** *** 65,72 **** --- 77,95 ---- + """ + KEA 2006-07-28 + in order to support discontinuous selections it appears + we need to check the grid for which cells are actually + selected on selectCell and rangeSelect and/or keep + an updated dictionary of cells after each selection is + made. GetSelectedCells() appears to only return an empty + list, which is probably another bug + """ + def on_mygrid_rangeSelect(self, event): if event.Selecting(): self.log.write("rangeSelect: top-left %s, bottom-right %s\n" % (event.GetTopLeftCoords(), event.GetBottomRightCoords())) + tl = r1, c1 = event.GetTopLeftCoords() br = r2, c2 = event.GetBottomRightCoords() |
From: Kevin A. <ka...@us...> - 2006-07-28 17:58:39
|
Update of /cvsroot/pythoncard/PythonCard/samples/iacGrid In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30837 Removed Files: iac.pyc Log Message: pyc shouldn't have been added --- iac.pyc DELETED --- |
From: Kevin A. <ka...@us...> - 2006-07-28 17:55:57
|
Update of /cvsroot/pythoncard/PythonCard/samples/iacGrid In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29638 Modified Files: .cvsignore Log Message: tweak Index: .cvsignore =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/samples/iacGrid/.cvsignore,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** .cvsignore 28 Jul 2006 03:01:16 -0000 1.1 --- .cvsignore 28 Jul 2006 16:21:15 -0000 1.2 *************** *** 2,4 **** --- 2,5 ---- *.pyc *.log + *.pyw .DS_Store |
From: Kevin A. <ka...@us...> - 2006-07-28 17:01:31
|
Update of /cvsroot/pythoncard/PythonCard In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4586 Modified Files: about.py Log Message: updated to show ansi or unicode version of wxPython Index: about.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/about.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** about.py 3 Oct 2004 18:53:22 -0000 1.6 --- about.py 28 Jul 2006 16:40:27 -0000 1.7 *************** *** 20,24 **** """ txt += "PythonCard version: %s\n" % __version__.VERSION_STRING ! txt += "wxPython version: %s\n" % wx.VERSION_STRING txt += "Python version: %s\n" % sys.version txt += "Platform: %s\n" % os.sys.platform --- 20,24 ---- """ txt += "PythonCard version: %s\n" % __version__.VERSION_STRING ! txt += "wxPython version: %s (%s)\n" % (wx.VERSION_STRING, wx.USE_UNICODE and 'unicode' or 'ansi') txt += "Python version: %s\n" % sys.version txt += "Platform: %s\n" % os.sys.platform |
From: Kevin A. <ka...@us...> - 2006-07-28 15:38:23
|
Update of /cvsroot/pythoncard/PythonCard In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14232 Modified Files: __version__.py Log Message: updated version number Index: __version__.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/__version__.py,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** __version__.py 19 Oct 2004 22:19:14 -0000 1.39 --- __version__.py 28 Jul 2006 15:38:20 -0000 1.40 *************** *** 13,16 **** """ ! VERSION = (0, 8, 2) VERSION_STRING = ".".join([str(digit) for digit in VERSION]) --- 13,16 ---- """ ! VERSION = (0, 8, 3) VERSION_STRING = ".".join([str(digit) for digit in VERSION]) |
From: Kevin A. <ka...@us...> - 2006-07-28 15:38:23
|
Update of /cvsroot/pythoncard/PythonCard/docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14232/docs Modified Files: changelog.txt Log Message: updated version number Index: changelog.txt =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/docs/changelog.txt,v retrieving revision 1.328 retrieving revision 1.329 diff -C2 -d -r1.328 -r1.329 *** changelog.txt 26 May 2006 01:22:20 -0000 1.328 --- changelog.txt 28 Jul 2006 15:38:21 -0000 1.329 *************** *** 9,12 **** --- 9,13 ---- Release 0.8.3 2006-06-?? + added iacGrid sample updated changelog.txt url |
From: Kevin A. <ka...@us...> - 2006-07-28 15:37:38
|
Update of /cvsroot/pythoncard/PythonCard/samples/iacGrid In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13799 Modified Files: iacGrid.py iacGrid.rsrc.py Log Message: added File->Open Index: iacGrid.rsrc.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/samples/iacGrid/iacGrid.rsrc.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** iacGrid.rsrc.py 28 Jul 2006 03:01:16 -0000 1.1 --- iacGrid.rsrc.py 28 Jul 2006 15:37:29 -0000 1.2 *************** *** 20,23 **** --- 20,27 ---- 'label':'&File', 'items': [ + {'type':'MenuItem', + 'name':'menuFileOpen', + 'label':'&Open\tCtrl+O', + }, { 'type':'MenuItem', 'name':'menuFileExit', Index: iacGrid.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/samples/iacGrid/iacGrid.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** iacGrid.py 28 Jul 2006 05:04:55 -0000 1.2 --- iacGrid.py 28 Jul 2006 15:37:29 -0000 1.3 *************** *** 30,34 **** mygrid.CreateGrid(30, 6) - ##mygrid.EnableEditing(False) self.populate_cells_from_file() --- 30,33 ---- *************** *** 42,45 **** --- 41,50 ---- self.panel.SetAutoLayout(True) self.panel.Layout() + + # KEA 2006-07-27 + # apparently there is a bug, probably a race condition when the control + # is first created in wxWidgets on the Mac which requires that this call + # be done late rather than immediately after the grid creation + mygrid.EnableEditing(False) *************** *** 49,52 **** --- 54,60 ---- for row, line in enumerate(open(filename)): fields = line.rstrip().split() + ## if row >= mygrid.GetNumberRows(): + ## print "adding row" + ## mygrid.AppendRows() for col, value in enumerate(fields): print row, col, value *************** *** 111,114 **** --- 119,132 ---- + def on_menuFileOpen_select(self, event): + wildcard = 'Text files (*.txt)|*.txt|All files (*.*)|*.*' + result = dialog.openFileDialog(None, 'Open File', '', '', wildcard) + if result.accepted: + path = result.paths[0] + # KEA 2006-07-27 + # this actually fails right now, units and other module + # globals probably need to be cleared + self.populate_cells_from_file(path) + if __name__ == '__main__': |
From: Kevin A. <ka...@us...> - 2006-07-28 05:05:02
|
Update of /cvsroot/pythoncard/PythonCard/samples/iacGrid In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6468 Modified Files: iac.pyc iacGrid.py Log Message: removed most of the extra event handlers and unneeded code for clarity Index: iac.pyc =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/samples/iacGrid/iac.pyc,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvs7EhPjr and /tmp/cvsBr0cLM differ Index: iacGrid.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/samples/iacGrid/iacGrid.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** iacGrid.py 28 Jul 2006 03:01:16 -0000 1.1 --- iacGrid.py 28 Jul 2006 05:04:55 -0000 1.2 *************** *** 6,16 **** """ ! from PythonCard import dialog, model import wx from wx import grid ! import sys import iac def colormap(intensity): if intensity < .03: --- 6,17 ---- """ ! import sys import wx from wx import grid ! from PythonCard import dialog, model import iac + def colormap(intensity): if intensity < .03: *************** *** 19,22 **** --- 20,24 ---- return (255, g, 0) + class Minimal(model.Background): *************** *** 24,83 **** self.log = sys.stdout self.moveTo = None - - ## wx.EVT_IDLE(self, self.OnIdle) self.mygrid = mygrid = self.components.mygrid ! mygrid.CreateGrid(30, 25) #, wxGrid.wxGridSelectRows) ##mygrid.EnableEditing(False) - - """ - # simple cell formatting - mygrid.SetColSize(3, 200) - mygrid.SetRowSize(4, 45) - mygrid.SetCellValue(0, 0, "First cell") - mygrid.SetCellValue(1, 1, "Another cell") - mygrid.SetCellValue(2, 2, "Yet another cell") - mygrid.SetCellValue(3, 3, "This cell is read-only") - mygrid.SetCellFont(0, 0, wx.Font(12, wx.ROMAN, wx.ITALIC, wx.NORMAL)) - mygrid.SetCellTextColour(1, 1, wx.RED) - mygrid.SetCellBackgroundColour(2, 2, wx.CYAN) - mygrid.SetReadOnly(3, 3, True) - - mygrid.SetCellEditor(5, 0, grid.GridCellNumberEditor(1,1000)) - mygrid.SetCellValue(5, 0, "123") - mygrid.SetCellEditor(6, 0, grid.GridCellFloatEditor()) - mygrid.SetCellValue(6, 0, "123.34") - mygrid.SetCellEditor(7, 0, grid.GridCellNumberEditor()) - - mygrid.SetCellValue(6, 3, "You can veto editing this cell") - - - # attribute objects let you keep a set of formatting values - # in one spot, and reuse them if needed - attr = grid.GridCellAttr() - attr.SetTextColour(wx.BLACK) - attr.SetBackgroundColour(wx.RED) - attr.SetFont(wx.Font(10, wx.SWISS, wx.NORMAL, wx.BOLD)) - - # you can set cell attributes for the whole row (or column) - mygrid.SetRowAttr(5, attr) - - mygrid.SetColLabelValue(0, "Custom") - mygrid.SetColLabelValue(1, "column") - mygrid.SetColLabelValue(2, "labels") - - mygrid.SetColLabelAlignment(wx.ALIGN_LEFT, wx.ALIGN_BOTTOM) - - #mygrid.SetDefaultCellOverflow(False) - #r = wx.GridCellAutoWrapStringRenderer() - #mygrid.SetCellRenderer(9, 1, r) - - # overflow cells - mygrid.SetCellValue( 9, 1, "This default cell will overflow into neighboring cells, but not if you turn overflow off."); - mygrid.SetCellSize(11, 1, 3, 3); - mygrid.SetCellAlignment(11, 1, wx.ALIGN_CENTRE, wx.ALIGN_CENTRE); - mygrid.SetCellValue(11, 1, "This cell is set to span 3 rows and 3 columns"); - """ self.populate_cells_from_file() --- 26,34 ---- self.log = sys.stdout self.moveTo = None self.mygrid = mygrid = self.components.mygrid ! mygrid.CreateGrid(30, 6) ##mygrid.EnableEditing(False) self.populate_cells_from_file() *************** *** 89,95 **** sizer1.SetSizeHints(self) self.panel.SetSizer(sizer1) ! self.panel.SetAutoLayout(1) self.panel.Layout() def populate_cells_from_file(self, filename='jets.txt'): iac.load(filename) --- 40,47 ---- sizer1.SetSizeHints(self) self.panel.SetSizer(sizer1) ! self.panel.SetAutoLayout(True) self.panel.Layout() + def populate_cells_from_file(self, filename='jets.txt'): iac.load(filename) *************** *** 105,160 **** - ## def OnCellLeftClick(self, event): - def on_mygrid_mouseClick(self, event): - self.log.write("mouseClick: (%d,%d) %s\n" % - (event.row, event.column, event.position)) - event.skip() - - def on_mygrid_mouseContextClick(self, event): - self.log.write("mouseContextClick: (%d,%d) %s\n" % - (event.row, event.column, event.position)) - event.skip() - - def on_mygrid_mouseDoubleClick(self, event): - self.log.write("mouseDoubleClick: (%d,%d) %s\n" % - (event.row, event.column, event.position)) - event.skip() - - def on_mygrid_mouseContextDoubleClick(self, event): - self.log.write("mouseContextDoubleClick: (%d,%d) %s\n" % - (event.row, event.column, event.position)) - event.skip() - - def on_mygrid_labelClick(self, event): - self.log.write("labelClick: (%d,%d) %s\n" % - (event.row, event.column, event.position)) - event.skip() - - def on_mygrid_labelContextClick(self, event): - self.log.write("labelContextClick: (%d,%d) %s\n" % - (event.row, event.column, event.position)) - event.skip() - - def on_mygrid_labelDoubleClick(self, event): - self.log.write("labelDoubleClick: (%d,%d) %s\n" % - (event.row, event.column, event.position)) - event.skip() - - def on_mygrid_labelContextDoubleClick(self, event): - self.log.write("labelContextDoubleClick: (%d,%d) %s\n" % - (event.row, event.column, event.position)) - event.skip() - - - def on_mygrid_rowSize(self, event): - self.log.write("rowSize: row %d, %s\n" % - (event.GetRowOrCol(), event.position)) - event.skip() - - def on_mygrid_columnSize(self, event): - self.log.write("columnSize: col %d, %s\n" % - (event.GetRowOrCol(), event.position)) - event.skip() - def on_mygrid_rangeSelect(self, event): if event.Selecting(): --- 57,60 ---- *************** *** 194,217 **** - def on_mygrid_cellChange(self, event): - self.log.write("cellChange: (%d,%d) %s\n" % - (event.row, event.column, event.position)) - - # Show how to stay in a cell that has bad data. We can't just - # call SetGridCursor here since we are nested inside one so it - # won't have any effect. Instead, set coordinants to move to in - # idle time. - value = self.components.mygrid.GetCellValue(event.row, event.column) - if value == 'no good': - self.moveTo = event.row, event.column - - - def on_idle(self, event): - if self.moveTo != None: - self.components.mygrid.SetGridCursor(self.moveTo[0], self.moveTo[1]) - self.moveTo = None - event.skip() - - def on_mygrid_selectCell(self, event): self.log.write("selectCell: (%d,%d) %s\n" % --- 94,97 ---- *************** *** 231,264 **** - def on_mygrid_editorShown(self, event): - if event.row == 6 and event.column == 3: - result = dialog.messageDialog(self, "Are you sure you wish to edit this cell?", - "Checking", wx.YES_NO) - if not result.accepted: - event.Veto() - return - - self.log.write("editorShown: (%d,%d) %s\n" % - (event.row, event.column, event.position)) - event.skip() - - - def on_mygrid_editorHidden(self, event): - if event.row == 6 and event.column == 3: - result = dialog.messageDialog(self, "Are you sure you wish to finish editing this cell?", - "Checking", wx.YES_NO) - if not result.accepted: - event.Veto() - return - - self.log.write("on_mygrid_editorHidden: (%d,%d) %s\n" % - (event.row, event.column, event.position)) - event.skip() - - - def on_mygrid_editorCreated(self, event): - self.log.write("on_mygrid_editorCreated: (%d, %d) %s\n" % - (event.row, event.column, event.GetControl())) - if __name__ == '__main__': --- 111,114 ---- |
From: Kevin A. <ka...@us...> - 2006-07-28 03:01:20
|
Update of /cvsroot/pythoncard/PythonCard/samples/iacGrid In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25741 Added Files: .cvsignore iac.py iac.pyc iacGrid.py iacGrid.rsrc.py jets.txt readme.txt Log Message: added iacGrid (probably needs a better name) --- NEW FILE: .cvsignore --- .cvsignore *.pyc *.log .DS_Store --- NEW FILE: iacGrid.rsrc.py --- { 'application':{ 'type':'Application', 'name':'SimpleGrid', 'backgrounds': [ { 'type':'Background', 'name':'bgMin', 'title':'Simple Grid PythonCard Application', 'size':( 600, 400 ), 'style':['resizeable'], 'menubar': { 'type':'MenuBar', 'menus': [ { 'type':'Menu', 'name':'menuFile', 'label':'&File', 'items': [ { 'type':'MenuItem', 'name':'menuFileExit', 'label':'E&xit\tAlt+X', 'command':'exit' } ] } ] }, 'components': [ { 'type':'Grid', 'name':'mygrid', 'position':(0, 0), 'size':(400, 300), }, ] } ] } } --- NEW FILE: iac.pyc --- (This appears to be a binary file; contents omitted.) --- NEW FILE: iacGrid.py --- #!/usr/bin/python """ __version__ = "$Revision: 1.1 $" __date__ = "$Date: 2006/07/28 03:01:16 $" """ from PythonCard import dialog, model import wx from wx import grid import sys import iac def colormap(intensity): if intensity < .03: return "white" g = int(255.99 * intensity) return (255, g, 0) class Minimal(model.Background): def on_initialize(self, event): self.log = sys.stdout self.moveTo = None ## wx.EVT_IDLE(self, self.OnIdle) self.mygrid = mygrid = self.components.mygrid mygrid.CreateGrid(30, 25) #, wxGrid.wxGridSelectRows) ##mygrid.EnableEditing(False) """ # simple cell formatting mygrid.SetColSize(3, 200) mygrid.SetRowSize(4, 45) mygrid.SetCellValue(0, 0, "First cell") mygrid.SetCellValue(1, 1, "Another cell") mygrid.SetCellValue(2, 2, "Yet another cell") mygrid.SetCellValue(3, 3, "This cell is read-only") mygrid.SetCellFont(0, 0, wx.Font(12, wx.ROMAN, wx.ITALIC, wx.NORMAL)) mygrid.SetCellTextColour(1, 1, wx.RED) mygrid.SetCellBackgroundColour(2, 2, wx.CYAN) mygrid.SetReadOnly(3, 3, True) mygrid.SetCellEditor(5, 0, grid.GridCellNumberEditor(1,1000)) mygrid.SetCellValue(5, 0, "123") mygrid.SetCellEditor(6, 0, grid.GridCellFloatEditor()) mygrid.SetCellValue(6, 0, "123.34") mygrid.SetCellEditor(7, 0, grid.GridCellNumberEditor()) mygrid.SetCellValue(6, 3, "You can veto editing this cell") # attribute objects let you keep a set of formatting values # in one spot, and reuse them if needed attr = grid.GridCellAttr() attr.SetTextColour(wx.BLACK) attr.SetBackgroundColour(wx.RED) attr.SetFont(wx.Font(10, wx.SWISS, wx.NORMAL, wx.BOLD)) # you can set cell attributes for the whole row (or column) mygrid.SetRowAttr(5, attr) mygrid.SetColLabelValue(0, "Custom") mygrid.SetColLabelValue(1, "column") mygrid.SetColLabelValue(2, "labels") mygrid.SetColLabelAlignment(wx.ALIGN_LEFT, wx.ALIGN_BOTTOM) #mygrid.SetDefaultCellOverflow(False) #r = wx.GridCellAutoWrapStringRenderer() #mygrid.SetCellRenderer(9, 1, r) # overflow cells mygrid.SetCellValue( 9, 1, "This default cell will overflow into neighboring cells, but not if you turn overflow off."); mygrid.SetCellSize(11, 1, 3, 3); mygrid.SetCellAlignment(11, 1, wx.ALIGN_CENTRE, wx.ALIGN_CENTRE); mygrid.SetCellValue(11, 1, "This cell is set to span 3 rows and 3 columns"); """ self.populate_cells_from_file() sizer1 = wx.BoxSizer(wx.VERTICAL) sizer1.Add(self.components.mygrid, 1, wx.EXPAND) sizer1.Fit(self) sizer1.SetSizeHints(self) self.panel.SetSizer(sizer1) self.panel.SetAutoLayout(1) self.panel.Layout() def populate_cells_from_file(self, filename='jets.txt'): iac.load(filename) mygrid = self.mygrid for row, line in enumerate(open(filename)): fields = line.rstrip().split() for col, value in enumerate(fields): print row, col, value mygrid.SetCellValue(row, col, value) self.rowcnt = row + 1 self.colcnt = col + 1 print self.rowcnt, self.colcnt ## def OnCellLeftClick(self, event): def on_mygrid_mouseClick(self, event): self.log.write("mouseClick: (%d,%d) %s\n" % (event.row, event.column, event.position)) event.skip() def on_mygrid_mouseContextClick(self, event): self.log.write("mouseContextClick: (%d,%d) %s\n" % (event.row, event.column, event.position)) event.skip() def on_mygrid_mouseDoubleClick(self, event): self.log.write("mouseDoubleClick: (%d,%d) %s\n" % (event.row, event.column, event.position)) event.skip() def on_mygrid_mouseContextDoubleClick(self, event): self.log.write("mouseContextDoubleClick: (%d,%d) %s\n" % (event.row, event.column, event.position)) event.skip() def on_mygrid_labelClick(self, event): self.log.write("labelClick: (%d,%d) %s\n" % (event.row, event.column, event.position)) event.skip() def on_mygrid_labelContextClick(self, event): self.log.write("labelContextClick: (%d,%d) %s\n" % (event.row, event.column, event.position)) event.skip() def on_mygrid_labelDoubleClick(self, event): self.log.write("labelDoubleClick: (%d,%d) %s\n" % (event.row, event.column, event.position)) event.skip() def on_mygrid_labelContextDoubleClick(self, event): self.log.write("labelContextDoubleClick: (%d,%d) %s\n" % (event.row, event.column, event.position)) event.skip() def on_mygrid_rowSize(self, event): self.log.write("rowSize: row %d, %s\n" % (event.GetRowOrCol(), event.position)) event.skip() def on_mygrid_columnSize(self, event): self.log.write("columnSize: col %d, %s\n" % (event.GetRowOrCol(), event.position)) event.skip() def on_mygrid_rangeSelect(self, event): if event.Selecting(): self.log.write("rangeSelect: top-left %s, bottom-right %s\n" % (event.GetTopLeftCoords(), event.GetBottomRightCoords())) tl = r1, c1 = event.GetTopLeftCoords() br = r2, c2 = event.GetBottomRightCoords() result = [] if r1 == r2: for col in range(c1, c2+1): result.append(self.mygrid.GetCellValue(r1, col)) elif c1 == c2: for row in range(r1, r2+1): result.append(self.mygrid.GetCellValue(row, c1)) else: for row in range(r1, r2+1): for col in range(c1, c2+1): result.append(self.mygrid.GetCellValue(row, col)) iac.reset() print 'Touching', ' '.join(result) iac.touch(' '.join(result), 1.0) response = iac.run() mygrid = self.mygrid rowcnt, colcnt = self.rowcnt, self.colcnt for r in xrange(rowcnt): for c in xrange(colcnt): neuron = mygrid.GetCellValue(r, c) intensity = max(0, response.get(neuron, 0)) color = colormap(intensity) mygrid.SetCellBackgroundColour(r, c, color) # force refresh mygrid.Refresh() mygrid.Update() event.skip() def on_mygrid_cellChange(self, event): self.log.write("cellChange: (%d,%d) %s\n" % (event.row, event.column, event.position)) # Show how to stay in a cell that has bad data. We can't just # call SetGridCursor here since we are nested inside one so it # won't have any effect. Instead, set coordinants to move to in # idle time. value = self.components.mygrid.GetCellValue(event.row, event.column) if value == 'no good': self.moveTo = event.row, event.column def on_idle(self, event): if self.moveTo != None: self.components.mygrid.SetGridCursor(self.moveTo[0], self.moveTo[1]) self.moveTo = None event.skip() def on_mygrid_selectCell(self, event): self.log.write("selectCell: (%d,%d) %s\n" % (event.row, event.column, event.position)) # Another way to stay in a cell that has a bad value... mygrid = self.components.mygrid row = mygrid.GetGridCursorRow() col = mygrid.GetGridCursorCol() if mygrid.IsCellEditControlEnabled(): mygrid.HideCellEditControl() mygrid.DisableCellEditControl() value = mygrid.GetCellValue(row, col) if value == 'no good 2': return # cancels the cell selection event.skip() def on_mygrid_editorShown(self, event): if event.row == 6 and event.column == 3: result = dialog.messageDialog(self, "Are you sure you wish to edit this cell?", "Checking", wx.YES_NO) if not result.accepted: event.Veto() return self.log.write("editorShown: (%d,%d) %s\n" % (event.row, event.column, event.position)) event.skip() def on_mygrid_editorHidden(self, event): if event.row == 6 and event.column == 3: result = dialog.messageDialog(self, "Are you sure you wish to finish editing this cell?", "Checking", wx.YES_NO) if not result.accepted: event.Veto() return self.log.write("on_mygrid_editorHidden: (%d,%d) %s\n" % (event.row, event.column, event.position)) event.skip() def on_mygrid_editorCreated(self, event): self.log.write("on_mygrid_editorCreated: (%d, %d) %s\n" % (event.row, event.column, event.GetControl())) if __name__ == '__main__': app = model.Application(Minimal) app.MainLoop() --- NEW FILE: readme.txt --- The example is taken from Parallel Distributed Processing, a classic text on neural networks. The field values represent neurons. The database rows represent excitory connections. The database columns represent inhibitory connections. The network is probed by applying a stimulus to a set of neurons. The output is a sorted list of neurons and their activation levels. The network can generalize from small datasets and is resiliant when information is missing. http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/496908 The grid code was derived from the simpleGrid sample. --- NEW FILE: jets.txt --- Art Jets 40 jh sing pusher Al Jets 30 jh mar burglar Sam Jets 20 col sing bookie Clyde Jets 40 jh sing bookie Mike Jets 30 jh sing bookie Jim Jets 20 jh div burglar Greg Jets 20 hs mar pusher John Jets 20 jh mar burglar Doug Jets 30 hs sing bookie Lance Jets 20 jh mar burglar George Jets 20 jh div burglar Pete Jets 20 hs sing bookie Fred Jets 20 hs sing pusher Gene Jets 20 col sing pusher Ralph Jets 30 jh sing pusher Phil Sharks 30 col mar pusher Ike Sharks 30 jh sing bookie Nick Sharks 30 hs sing pusher Don Sharks 30 col mar burglar Ned Sharks 30 col mar bookie Karl Sharks 40 hs mar bookie Ken Sharks 20 hs sing burglar Earl Sharks 40 hs mar burglar Rick Sharks 30 hs div burglar Ol Sharks 30 col mar pusher Neal Sharks 30 hs sing bookie Dave Sharks 30 hs div pusher --- NEW FILE: iac.py --- """ __version__ = "$Revision: 1.1 $" __date__ = "$Date: 2006/07/28 03:01:16 $" """ """ based on http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/496908 #modified to work with Python 2.3 Data Mining with Neural Nets Raymond Hettinger Apply the IAC (interactive-competition-and-activation) model to analyzing a database. """ # Constants defining the neuron's response curve minact, rest, thresh, decay, maxact = -0.2, -0.1, 0.0, 0.1, 1.0 alpha, gamma, estr = 0.1, 0.1, 0.4 units = [] pools = [] unitbyname = {} def sorted(s, reverse=False): s = list(s) s.sort() if reverse: s.reverse() return s from sets import Set as set class Unit(object): __slots__ = ['name', 'pool', 'extinp', 'activation', 'output', 'exciters', 'newact'] def __init__(self, name, pool): self.name = name self.pool = pool self.reset() self.exciters = [] unitbyname[name] = self def reset(self): self.setext(0.0) self._setactivation() def setext(self, weight=1.0): self.extinp = weight def _setactivation(self, val=rest): self.activation = val self.output = max(thresh, val) def addexciter(self, aunit): self.exciters.append(aunit) def remove(self, aunit): self.exciters.remove(aunit) def computenewact(self): ai = self.activation plus = sum([exciter.output for exciter in self.exciters]) minus = self.pool.sum - self.output netinput = alpha*plus - gamma*minus + estr*self.extinp if netinput > 0: ai = (maxact-ai)*netinput - decay*(ai-rest) + ai else: ai = (ai-minact)*netinput - decay*(ai-rest) + ai self.newact = max(min(ai, maxact), minact) def commitnewact(self): self._setactivation(self.newact) class Pool(object): __slots__ = ['sum', 'members'] def __init__(self): self.sum = 0.0 self.members = set() def addmember(self, member): self.members.add(member) def updatesum(self): self.sum = sum([member.output for member in self.members]) def display(self): result = sorted([(unit.activation, unit.name) for unit in self.members], reverse=True) for i, (act, unitbyname) in enumerate(result): print '%s: %.2f\t' % (unitbyname, act), if i % 4 == 3: print print '\n' def getpooldict(self): return dict([(unit.name, unit.activation) for unit in self.members]) def load(filename): """Load in a database and interpret it as a network First column must be unique keys which define the instance units. Each column is a pool (names, gangs, ages, etc). Every row is mutually excitory. """ units[:] = [] pools[:] = [] for line in open(filename): relatedunits = line.split() if not len(relatedunits): continue key = len(units) for poolnum, name in enumerate(relatedunits): if poolnum >= len(pools): pools.append(Pool()) pool = pools[poolnum] if name in unitbyname: unit = unitbyname[name] else: unit = Unit(name, pool) units.append(unit) pool.addmember(unit) if poolnum > 0: units[key].addexciter(unit) unit.addexciter(units[key]) def reset(): for unit in units: unit.reset() def depair(i, j): unitbyname[i].remove(unitbyname[j]) unitbyname[j].remove(unitbyname[i]) def touch(itemstr, weight=1.0): for name in itemstr.split(): unitbyname[name].setext(weight) def run(times=100): """Run n-cycles and display result""" for i in xrange(times): for pool in pools: pool.updatesum() for unit in units: unit.computenewact() for unit in units: unit.commitnewact() print '-' * 20 for pool in pools: pool.display() d = {} for pool in pools: d.update(pool.getpooldict()) print d return d |
From: Kevin A. <ka...@us...> - 2006-07-28 02:58:33
|
Update of /cvsroot/pythoncard/PythonCard/samples/iacGrid In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25169/iacGrid Log Message: Directory /cvsroot/pythoncard/PythonCard/samples/iacGrid added to the repository |
From: Alex T. <ale...@us...> - 2006-06-13 16:12:09
|
Update of /cvsroot/pythoncard/PythonCard/tools/oneEditor In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32049 Modified Files: tabcodeEditor.py Log Message: Remove spurious debug lines. Index: tabcodeEditor.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/tools/oneEditor/tabcodeEditor.py,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** tabcodeEditor.py 13 Jun 2006 16:01:15 -0000 1.17 --- tabcodeEditor.py 13 Jun 2006 16:11:45 -0000 1.18 *************** *** 396,402 **** if 'line_numbers' in self.config: self.menuBar.setChecked('menuViewLineNumbers', self.config['line_numbers']) - if self.config['line_numbers'] == 0: - self.menuBar.setChecked('menuViewLineNumbers', False) - if 'folding' in self.config: self.menuBar.setChecked('menuViewCodeFolding', self.config['folding']) --- 396,399 ---- |
From: Alex T. <ale...@us...> - 2006-06-13 16:01:41
|
Update of /cvsroot/pythoncard/PythonCard/tools/oneEditor In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27115 Modified Files: tabcodeEditor.py Log Message: Fix failures to save config with "view" settings, and to set these for each page. Fix problem that reading menu resource was over-riding what was set in the config file. Fix setting right-edge indicator for each page. Index: tabcodeEditor.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/tools/oneEditor/tabcodeEditor.py,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** tabcodeEditor.py 26 May 2006 11:32:50 -0000 1.16 --- tabcodeEditor.py 13 Jun 2006 16:01:15 -0000 1.17 *************** *** 175,178 **** --- 175,181 ---- wx.FutureCall(1, self.SetSize, (w, h - 1)) wx.FutureCall(1, self.SetSize, (w, h)) + # although we loaded config above, the menu checked setting will be overwritten + # when the menu resource is read in - so repeat it later ... + wx.FutureCall(1, self.loadConfig) *************** *** 384,404 **** self.fileHistory.AddFileToHistory(h) if 'view_white_space' in self.config: - self.currentDocument.SetViewWhiteSpace(self.config['view_white_space']) self.menuBar.setChecked('menuViewWhitespace', self.config['view_white_space']) if 'indentation_guides' in self.config: - self.currentDocument.SetIndentationGuides(self.config['indentation_guides']) self.menuBar.setChecked('menuViewIndentationGuides', self.config['indentation_guides']) if 'right_edge_guide' in self.config: - self.currentDocument.SetEdgeMode(self.config['right_edge_guide']) self.menuBar.setChecked('menuViewRightEdgeIndicator', self.config['right_edge_guide']) if 'view_EOL' in self.config: - self.currentDocument.SetViewEOL(self.config['view_EOL']) self.menuBar.setChecked('menuViewEndOfLineMarkers', self.config['view_EOL']) if 'line_numbers' in self.config: - self.currentDocument.lineNumbersVisible = self.config['line_numbers'] self.menuBar.setChecked('menuViewLineNumbers', self.config['line_numbers']) if 'folding' in self.config: - self.currentDocument.codeFoldingVisible = self.config['folding'] self.menuBar.setChecked('menuViewCodeFolding', self.config['folding']) if 'macros' in self.config: --- 387,405 ---- self.fileHistory.AddFileToHistory(h) if 'view_white_space' in self.config: self.menuBar.setChecked('menuViewWhitespace', self.config['view_white_space']) if 'indentation_guides' in self.config: self.menuBar.setChecked('menuViewIndentationGuides', self.config['indentation_guides']) if 'right_edge_guide' in self.config: self.menuBar.setChecked('menuViewRightEdgeIndicator', self.config['right_edge_guide']) if 'view_EOL' in self.config: self.menuBar.setChecked('menuViewEndOfLineMarkers', self.config['view_EOL']) if 'line_numbers' in self.config: self.menuBar.setChecked('menuViewLineNumbers', self.config['line_numbers']) + if self.config['line_numbers'] == 0: + self.menuBar.setChecked('menuViewLineNumbers', False) + if 'folding' in self.config: self.menuBar.setChecked('menuViewCodeFolding', self.config['folding']) + self.setConfigPerPage() if 'macros' in self.config: *************** *** 424,427 **** --- 425,444 ---- except: self.config = {} + + def setConfigPerPage(self): + if not self.currentDocument: + return + if 'view_white_space' in self.config: + self.currentDocument.SetViewWhiteSpace(self.config['view_white_space']) + if 'indentation_guides' in self.config: + self.currentDocument.SetIndentationGuides(self.config['indentation_guides']) + if 'right_edge_guide' in self.config: + self.currentDocument.SetEdgeMode(self.config['right_edge_guide']) + if 'view_EOL' in self.config: + self.currentDocument.SetViewEOL(self.config['view_EOL']) + if 'line_numbers' in self.config: + self.currentDocument.lineNumbersVisible = self.config['line_numbers'] + if 'folding' in self.config: + self.currentDocument.codeFoldingVisible = self.config['folding'] def saveConfig(self): *************** *** 568,572 **** size = self.pages[-1].size wx.CallAfter(self.pages[-1].SetSize, size) ! def openFile(self, path): # need a new tab page in notebook if --- 585,590 ---- size = self.pages[-1].size wx.CallAfter(self.pages[-1].SetSize, size) ! wx.CallAfter(self.setConfigPerPage) ! def openFile(self, path): # need a new tab page in notebook if *************** *** 588,591 **** --- 606,610 ---- wx.CallAfter(win.openFile, path) wx.CallAfter(self.setResourceFile) + wx.CallAfter(self.setConfigPerPage) *************** *** 915,919 **** else: for page in self.pages: ! page.document.SetEdgeMode(stc.STC_EDGE_NONE) def on_menuViewEndOfLineMarkers_select(self, event): --- 934,938 ---- else: for page in self.pages: ! page.components.document.SetEdgeMode(stc.STC_EDGE_NONE) def on_menuViewEndOfLineMarkers_select(self, event): |
From: Phil E. <l2...@us...> - 2006-06-06 02:43:19
|
Update of /cvsroot/pythoncard/PythonCard/samples In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3568 Modified Files: samples.rsrc.py Log Message: New sample (sysTray) showing how to use the system tray in a PythonCard application Index: samples.rsrc.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/samples/samples.rsrc.py,v retrieving revision 1.62 retrieving revision 1.63 diff -C2 -d -r1.62 -r1.63 *** samples.rsrc.py 29 Sep 2005 22:08:38 -0000 1.62 --- samples.rsrc.py 5 Jun 2006 12:12:12 -0000 1.63 *************** *** 6,11 **** 'title':'PythonCard Samples Launcher', 'size':(600, 502), - 'style':['resizeable'], 'visible':0, 'menubar': {'type':'MenuBar', --- 6,11 ---- 'title':'PythonCard Samples Launcher', 'size':(600, 502), 'visible':0, + 'style':['resizeable'], 'menubar': {'type':'MenuBar', *************** *** 57,71 **** 'position':(0, 0), 'size':(150, 218), ! 'items':['addresses', 'ataxx', 'chat', 'companies', 'conversions', 'custdb', 'dbBrowser', \ ! 'dialogs', 'doodle', 'flatfileDatabase', 'flock', 'gadflyDatabase', 'gravity', \ ! 'hopalong', 'jabberChat', 'life', 'lsystem', 'minimal', 'minimalList', 'minimalTree', \ ! 'moderator', 'montyhall', 'mp3player', 'multicolumnexample', 'noresource', \ ! 'pictureViewer', 'proof', 'pysshed', 'radioclient', 'redemo', 'reversi', 'rpn', \ ! 'samples', 'saveClipboardBitmap', 'searchexplorer', \ ! 'simpleBrowser', 'simpleIEBrowser', 'slideshow', 'sounds', 'SourceForgeTracker', \ ! 'spirograph', 'spirographInteractive', 'stockprice', 'sudoku', 'textIndexer', 'textRouter', \ ! 'tictactoe', 'turtle', 'twistedEchoClient', \ ! 'webgrabber', 'webserver', 'widgets', 'worldclock'], ! 'stringSelection':'minimal', }, --- 57,61 ---- 'position':(0, 0), 'size':(150, 218), ! 'items':[u'addresses', u'ataxx', u'chat', u'companies', u'conversions', u'custdb', u'dbBrowser', u'dialogs', u'doodle', u'flatfileDatabase', u'flock', u'gadflyDatabase', u'gravity', u'hopalong', u'jabberChat', u'life', u'lsystem', u'minimal', u'minimalList', u'minimalTree', u'moderator', u'montyhall', u'mp3player', u'multicolumnexample', u'noresource', u'pictureViewer', u'proof', u'pysshed', u'radioclient', u'redemo', u'reversi', u'rpn', u'samples', u'saveClipboardBitmap', u'searchexplorer', u'simpleBrowser', u'simpleIEBrowser', u'slideshow', u'sounds', u'SourceForgeTracker', u'spirograph', u'spirographInteractive', u'stockprice', u'sudoku', u'sysTray', u'textIndexer', u'textRouter', u'tictactoe', u'turtle', u'twistedEchoClient', u'webgrabber', u'webserver', u'widgets', u'worldclock'], }, *************** *** 73,77 **** 'name':'chkDebugMenu', 'position':(160, 22), ! 'label':'Debug Menu (-d)', }, --- 63,67 ---- 'name':'chkDebugMenu', 'position':(160, 22), ! 'label':u'Debug Menu (-d)', }, *************** *** 79,83 **** 'name':'chkLogging', 'position':(160, 22), ! 'label':'Logging (-l)', }, --- 69,73 ---- 'name':'chkLogging', 'position':(160, 22), ! 'label':u'Logging (-l)', }, *************** *** 85,89 **** 'name':'stcCmdLineArgs', 'position':(160, 2), ! 'text':'Command line options', }, --- 75,79 ---- 'name':'stcCmdLineArgs', 'position':(160, 2), ! 'text':u'Command line options', }, *************** *** 91,95 **** 'name':'chkMessageWatcher', 'position':(160, 46), ! 'label':'Message Watcher (-m)', }, --- 81,85 ---- 'name':'chkMessageWatcher', 'position':(160, 46), ! 'label':u'Message Watcher (-m)', }, *************** *** 97,101 **** 'name':'chkNamespaceViewer', 'position':(160, 72), ! 'label':'Namespace Viewer (-n)', }, --- 87,91 ---- 'name':'chkNamespaceViewer', 'position':(160, 72), ! 'label':u'Namespace Viewer (-n)', }, *************** *** 103,107 **** 'name':'chkPropertyEditor', 'position':(160, 98), ! 'label':'Property Editor (-p)', }, --- 93,97 ---- 'name':'chkPropertyEditor', 'position':(160, 98), ! 'label':u'Property Editor (-p)', }, *************** *** 109,113 **** 'name':'chkShell', 'position':(160, 126), ! 'label':'Shell (-s)', }, --- 99,103 ---- 'name':'chkShell', 'position':(160, 126), ! 'label':u'Shell (-s)', }, *************** *** 115,120 **** 'name':'btnLaunch', 'position':(158, 194), ! 'label':'Launch', ! 'command':'launch' }, --- 105,110 ---- 'name':'btnLaunch', 'position':(158, 194), ! 'command':'launch', ! 'label':u'Launch', }, *************** *** 123,127 **** 'position':(268, 194), 'command':'showDescription', ! 'label':'Show Description', }, --- 113,117 ---- 'position':(268, 194), 'command':'showDescription', ! 'label':u'Show Description', }, *************** *** 130,134 **** 'position':(378, 194), 'command':'showSource', ! 'label':'Show Source', }, --- 120,124 ---- 'position':(378, 194), 'command':'showSource', ! 'label':u'Show Source', }, *************** *** 137,141 **** 'position':(488, 194), 'command':'showResource', ! 'label':'Show Resource', }, --- 127,131 ---- 'position':(488, 194), 'command':'showResource', ! 'label':u'Show Resource', }, *************** *** 143,147 **** 'name':'stcDescription', 'position':(1, 230), ! 'text':'Description', }, --- 133,137 ---- 'name':'stcDescription', 'position':(1, 230), ! 'text':u'Description', }, *************** *** 150,154 **** 'position':(1, 246), 'size':(594, 211), ! 'editable':0, }, --- 140,144 ---- 'position':(1, 246), 'size':(594, 211), ! 'editable':False, }, *************** *** 157,162 **** 'position':(1, 246), 'size':(594, 211), ! 'editable':0, ! 'visible':0, }, --- 147,153 ---- 'position':(1, 246), 'size':(594, 211), ! 'backgroundColor':(255, 255, 255), ! 'editable':False, ! 'visible':False, }, |
Update of /cvsroot/pythoncard/PythonCard/samples/sysTray In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3111 Added Files: icon-off.ico icon-off.png icon-on.ico icon-on.png readme.txt sysTray.py sysTray.rsrc.py Log Message: New sample showing how to use the system tray in a PythonCard application --- NEW FILE: icon-off.ico --- (This appears to be a binary file; contents omitted.) --- NEW FILE: icon-off.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: icon-on.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: sysTray.rsrc.py --- {'application':{'type':'Application', 'name':'Template', 'backgrounds': [ {'type':'Background', 'name':'bgMain', 'title':u'sysTray Example', 'size':(325, 240), 'statusBar':1, 'menubar': {'type':'MenuBar', 'menus': [ {'type':'Menu', 'name':'menuFile', 'label':'&File', 'items': [ {'type':'MenuItem', 'name':'menuFileExit', 'label':'E&xit', }, ] }, ] }, 'components': [ {'type':'TextArea', 'name':'TextArea1', 'position':(5, 10), 'size':(311, 132), 'editable':False, 'text':u'This sample shows how to use a combination of raw wxPython and normal PythonCard code to produce an app which integrates into the system tray. The system tray icon has a context menu which pops up when the icon is right-clicked.', }, {'type':'Button', 'name':'bQuit', 'position':(235, 150), 'label':u'Quit', }, ] # end components } # end background ] # end backgrounds } } --- NEW FILE: sysTray.py --- #!/usr/bin/python # PythonCard example showing system tray integration # # Copyright (c) 2001-2005 PythonCard developers # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # 3. The name of the author may not be used to endorse or promote products # derived from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT # OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY # WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # # vim: ai et sw=4 ts=4 # standard imports import sys # pythoncard imports import wx from PythonCard import dialog, model, util class sysTray(model.Background): def on_initialize(self, event): #make the TaskBar icon self.tbIcon = wx.TaskBarIcon() if "wxMSW" in wx.PlatformInfo: self.icon0 = wx.Icon('icon-off.ico', wx.BITMAP_TYPE_ICO) self.icon1 = wx.Icon('icon-on.ico', wx.BITMAP_TYPE_ICO) elif "wxGTK" in wx.PlatformInfo: self.icon0 = wx.Icon('icon-off.png', wx.BITMAP_TYPE_PNG) self.icon1 = wx.Icon('icon-on.png', wx.BITMAP_TYPE_PNG) self.tbIcon.SetIcon(self.icon1, "PythonCard system tray sample") # build the popup context menu self.TBMENU_RESTORE = wx.NewId() self.TBMENU_CLOSE = wx.NewId() self.TBMENU_ITEM1 = wx.NewId() self.TBMENU_ITEM2 = wx.NewId() self.contextMenu = wx.Menu() self.contextMenu.Append(self.TBMENU_RESTORE, "Restore Window") self.contextMenu.AppendSeparator() self.contextMenu.Append(self.TBMENU_ITEM1, "Menu Item 1") self.contextMenu.Append(self.TBMENU_ITEM2, "Menu Item 2") self.contextMenu.AppendSeparator() self.contextMenu.Append(self.TBMENU_CLOSE, "Close Application") wx.EVT_TASKBAR_LEFT_DCLICK(self.tbIcon, self.on_TaskBarActivate) wx.EVT_TASKBAR_RIGHT_UP(self.tbIcon, self.on_TaskBarMenu) # bind some events to the menu items wx.EVT_MENU(self, self.TBMENU_RESTORE, self.on_TaskBarActivate) wx.EVT_MENU(self, self.TBMENU_CLOSE, self.on_TaskBarClose) wx.EVT_MENU(self, self.TBMENU_ITEM1, self.onContextMenu_Item1) wx.EVT_MENU(self, self.TBMENU_ITEM2, self.onContextMenu_Item2) self.reallyClose = False self.closeWarningSeen = False def onContextMenu_Item1(self, event): # these context menu event handlers don't work in quite the way I # expected on Linux. With the systray application minimized down to # the system tray, if you pop up the context menu and select item1 # or item2, the main window re-appears behind the alertDialog - this # happens on Linux but not on Windows. Dunno why... bull = dialog.alertDialog(self, 'Menu Item 1 Selected', 'Context Menu') def onContextMenu_Item2(self, event): bull = dialog.alertDialog(self, 'Menu Item 2 Selected', 'Context Menu') def on_TaskBarActivate(self, event): self.Iconize(False) self.Show(True) self.Raise() self.tbIcon.SetIcon(self.icon1, "PythonCard system tray sample") event.Skip() def on_TaskBarMenu(self, event): self.PopupMenu(self.contextMenu, wx.Point(-1, -1)) def on_TaskBarClose(self, event): self.reallyClose = True self.tbIcon.Destroy() self.Iconize(False) self.Show(True) self.Close() def on_minimize(self, event): self.reallyClose = False event.Skip() def on_close(self, event): if self.reallyClose: event.Skip() else: if not self.closeWarningSeen: title = 'Please Note:' txt = 'The application can only be closed by clicking\n' txt += ' the \'Quit\' button on the main window. It\n' txt += ' will now minimize to the system tray. Note\n' txt += ' also how the system tray icon changes when\n' txt += ' the app is minimized. This message will not\n' txt += ' be shown again until the program is restarted.' bull = dialog.alertDialog(self, txt, title) self.closeWarningSeen = True self.Iconize(True) self.Show(False) self.Hide() self.tbIcon.SetIcon(self.icon0, "PythonCard system tray sample") def on_bQuit_mouseClick(self, event): self.reallyClose = True self.tbIcon.Destroy() self.Close() if __name__=='__main__': app = model.Application(sysTray) app.MainLoop() --- NEW FILE: icon-on.ico --- (This appears to be a binary file; contents omitted.) --- NEW FILE: readme.txt --- PythonCard system tray integration sample. This sample shows how to use a combination of raw wxPython code and normal PythonCard code to produce an app which integrates into the system tray. It demonstrates a number of ideas: 1. The system tray icon provided has a context menu associated with it. The menu pops up when the icon is right-clicked, and items on the menu can be clicked and have their own associated event handlers. 2. When the application is minimized to the system tray, the icon is changed and will change back to the original icon when the main window is restored. 3. By intercepting the 'on_close' event in PythonCard, the application can be made to minimize to the system tray instead of shutting down. To really close the application, you have to click the 'Quit' button on the main window. |
From: Phil E. <l2...@us...> - 2006-06-06 00:49:22
|
Update of /cvsroot/pythoncard/PythonCard/samples/sysTray In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1891/sysTray Log Message: Directory /cvsroot/pythoncard/PythonCard/samples/sysTray added to the repository |
From: Alex T. <ale...@us...> - 2006-05-26 16:00:31
|
Update of /cvsroot/pythoncard/PythonCard/tools/resourceEditor/modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24717 Modified Files: multipropertyEditor.py multipropertyEditor.rsrc.py Log Message: Tweaks to layout of propertyEditor for Mac: - apparently cannot dynamically decrease size for static text, so make smaller to begin - checkbox must fit both box and label within a single space, so hack to make it bigger. Index: multipropertyEditor.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/tools/resourceEditor/modules/multipropertyEditor.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** multipropertyEditor.py 27 Oct 2005 22:54:41 -0000 1.5 --- multipropertyEditor.py 26 May 2006 16:00:16 -0000 1.6 *************** *** 632,637 **** self.add_chk("chk"+propName, (fx, y), (fsx,fsy)) else: self.components["chk"+propName].position = (fx, y) ! self.components["chk"+propName].size = (fsx, fsy) y += fsy + 5 self.components["chk"+propName].label = propName --- 632,638 ---- self.add_chk("chk"+propName, (fx, y), (fsx,fsy)) else: + # AGT make check items bigger - box+label must all fit in this space self.components["chk"+propName].position = (fx, y) ! self.components["chk"+propName].size = (fsx+100, fsy) y += fsy + 5 self.components["chk"+propName].label = propName Index: multipropertyEditor.rsrc.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/tools/resourceEditor/modules/multipropertyEditor.rsrc.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** multipropertyEditor.rsrc.py 26 May 2006 13:10:32 -0000 1.4 --- multipropertyEditor.rsrc.py 26 May 2006 16:00:17 -0000 1.5 *************** *** 284,288 **** 'name':'txtborder', 'position':(160, 215), ! 'size':(84, -1), 'alignment':'right', 'text':'Border', --- 284,288 ---- 'name':'txtborder', 'position':(160, 215), ! 'size':(64, -1), 'alignment':'right', 'text':'Border', |
From: Alex T. <ale...@us...> - 2006-05-26 13:10:49
|
Update of /cvsroot/pythoncard/PythonCard/tools/resourceEditor/modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21358 Modified Files: multipropertyEditor.rsrc.py Log Message: Fix order of components to ensure that the Static Box comes before the enclosed controls. Previously, on Mac, this prevented the "nudge" controls from being active (note - this 'fix' is not guaranteed, since overlapping widgets are not guaranteed to be properly supported). Index: multipropertyEditor.rsrc.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/tools/resourceEditor/modules/multipropertyEditor.rsrc.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** multipropertyEditor.rsrc.py 22 Feb 2006 14:21:22 -0000 1.3 --- multipropertyEditor.rsrc.py 26 May 2006 13:10:32 -0000 1.4 *************** *** 428,431 **** --- 428,438 ---- }, + {'type':'StaticBox', + 'name':'stbNudge', + 'position':(3, 377), + 'size':(141, 130), + 'label':'NUDGE', + }, + {'type':'ImageButton', 'name':'nudgeDown', *************** *** 478,488 **** }, - {'type':'StaticBox', - 'name':'stbNudge', - 'position':(3, 377), - 'size':(141, 130), - 'label':'NUDGE', - }, - {'type':'Button', 'name':'wUpdate', --- 485,488 ---- |
From: Alex T. <ale...@us...> - 2006-05-26 11:39:06
|
Update of /cvsroot/pythoncard/PythonCard/tools/resourceEditor In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14192 Modified Files: layoutEditor.py Log Message: Another hack for Mac - can get drag events without a preceding mouseDown event, when re-focusing into this window to immediately drag a resizing handle (the mousedown is swallowed by system to trigger focus into the window). Index: layoutEditor.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/tools/resourceEditor/layoutEditor.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** layoutEditor.py 13 Jan 2006 07:28:59 -0000 1.1 --- layoutEditor.py 26 May 2006 11:38:51 -0000 1.2 *************** *** 1021,1024 **** --- 1021,1034 ---- # AGT 2005-05-17 Removed obsolete Windows variant globalPosition = wx.GetMousePosition() + # AGT 2006-05-26 another hack for Mac - can get drag events without a preceding + # mouseDown event, when re-focusing into this window to immediately drag a + # resizing handle + if not self.resizingHandleTarget: + self.resizingHandleTarget = event.target.name + self.hideSizingHandles() + self.startPosition = self.components[self.startName].position + self.startSize = self.components[self.startName].size + self.offset = event.target.ScreenToClient(globalPosition) + x, y = self.components[self.resizingHandleTarget].ScreenToClient(globalPosition) xOffset = x - self.offset[0] |
From: Alex T. <ale...@us...> - 2006-05-26 11:32:57
|
Update of /cvsroot/pythoncard/PythonCard/tools/oneEditor In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10364 Modified Files: tabcodeEditor.py Log Message: Prevent error on call to setDefaulStyles() - it is within the page of the notebook, so call must be adjusted accordingly. Index: tabcodeEditor.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/tools/oneEditor/tabcodeEditor.py,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** tabcodeEditor.py 29 Dec 2005 02:48:25 -0000 1.15 --- tabcodeEditor.py 26 May 2006 11:32:50 -0000 1.16 *************** *** 120,123 **** --- 120,124 ---- self.cmdLineArgs = {'debugmenu':False, 'logging':False, 'messagewatcher':False, 'namespaceviewer':False, 'propertyeditor':False, + 'indicatesizers':False, 'shell':False, 'otherargs':''} self.lastFind = {'searchText':'', 'replaceText':'', 'wholeWordsOnly':False, 'caseSensitive':False} *************** *** 954,958 **** finally: dlg.Destroy() os.chdir(cwd) ! self.setDefaultStyles() def on_menuFormatWrap_select(self, event): --- 955,959 ---- finally: dlg.Destroy() os.chdir(cwd) ! self.currentPage.setDefaultStyles() def on_menuFormatWrap_select(self, event): |
From: Kevin A. <ka...@us...> - 2006-05-26 01:35:02
|
Update of /cvsroot/pythoncard/PythonCard/docs/html In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7898/docs/html Modified Files: index.html Log Message: fixed samples.html url typo bug #1494743 Index: index.html =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/docs/html/index.html,v retrieving revision 1.66 retrieving revision 1.67 diff -C2 -d -r1.66 -r1.67 *** index.html 25 Dec 2005 14:05:34 -0000 1.66 --- index.html 26 May 2006 01:34:56 -0000 1.67 *************** *** 44,48 **** <ul> <li><a href="http://sourceforge.net/project/showfiles.php?group_id=19015">Download</a> the latest version of the package</li> ! <li>View some <a href="http://pythoncard.soureforge.net/samples/samples.html">screenshots</a> of the sample applications</li> </ul> --- 44,48 ---- <ul> <li><a href="http://sourceforge.net/project/showfiles.php?group_id=19015">Download</a> the latest version of the package</li> ! <li>View some <a href="http://pythoncard.sourceforge.net/samples/samples.html">screenshots</a> of the sample applications</li> </ul> |
From: Kevin A. <ka...@us...> - 2006-05-26 01:22:28
|
Update of /cvsroot/pythoncard/PythonCard/docs/html In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2709/html Modified Files: documentation.html Log Message: added 0.8.3 section and updated changelog.txt url for new cvs url Index: documentation.html =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/docs/html/documentation.html,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** documentation.html 27 Dec 2005 03:51:32 -0000 1.24 --- documentation.html 26 May 2006 01:22:20 -0000 1.25 *************** *** 65,69 **** program as shown by the dbBrowser sample.</p> <h2><a name="changelog">Revision History (Changelog)</a></h2> ! <p>The <a href="http://cvs.sourceforge.net/viewcvs.py/pythoncard/PythonCard/docs/changelog.txt?view=markup">changelog.txt</a> file documents the revision history of PythonCard.</p> <?php include "footer.php" ?> --- 65,69 ---- program as shown by the dbBrowser sample.</p> <h2><a name="changelog">Revision History (Changelog)</a></h2> ! <p>The <a href="http://pythoncard.cvs.sourceforge.net/pythoncard/PythonCard/docs/changelog.txt?view=markup">changelog.txt</a> file documents the revision history of PythonCard.</p> <?php include "footer.php" ?> |
From: Kevin A. <ka...@us...> - 2006-05-26 01:22:28
|
Update of /cvsroot/pythoncard/PythonCard/docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2709 Modified Files: changelog.txt Log Message: added 0.8.3 section and updated changelog.txt url for new cvs url Index: changelog.txt =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/docs/changelog.txt,v retrieving revision 1.327 retrieving revision 1.328 diff -C2 -d -r1.327 -r1.328 *** changelog.txt 18 May 2006 21:15:00 -0000 1.327 --- changelog.txt 26 May 2006 01:22:20 -0000 1.328 *************** *** 8,11 **** --- 8,15 ---- + Release 0.8.3 2006-06-?? + updated changelog.txt url + + Release 0.8.2 2006-05-18 added minimized and maximized attributes to Background class |
From: Alex T. <ale...@us...> - 2006-05-24 23:14:34
|
Update of /cvsroot/pythoncard/PythonCard/docs/html In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30248/docs/html Modified Files: sidebar.php Log Message: Correct the version for the web site. Index: sidebar.php =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/docs/html/sidebar.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** sidebar.php 4 Apr 2005 20:27:22 -0000 1.7 --- sidebar.php 24 May 2006 23:14:27 -0000 1.8 *************** *** 10,14 **** <input type="submit" id="submit" name="submit" value="Search" style="margin: 0.3em;" /> </form> ! <p>Latest release: 0.8.1</p> <h4>General</h4> <ul> --- 10,14 ---- <input type="submit" id="submit" name="submit" value="Search" style="margin: 0.3em;" /> </form> ! <p>Latest release: 0.8.2</p> <h4>General</h4> <ul> |
From: Alex T. <ale...@us...> - 2006-05-18 21:15:11
|
Update of /cvsroot/pythoncard/PythonCard/docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29975/docs Modified Files: changelog.txt Log Message: Update ready for 0.8.2 release. Index: changelog.txt =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/docs/changelog.txt,v retrieving revision 1.326 retrieving revision 1.327 diff -C2 -d -r1.326 -r1.327 *** changelog.txt 6 Apr 2006 11:00:23 -0000 1.326 --- changelog.txt 18 May 2006 21:15:00 -0000 1.327 *************** *** 8,12 **** ! Release 0.8.2 2006-04-06 added minimized and maximized attributes to Background class created documentation.py module to hold code previously in widgets.py --- 8,12 ---- ! Release 0.8.2 2006-05-18 added minimized and maximized attributes to Background class created documentation.py module to hold code previously in widgets.py *************** *** 18,22 **** renamed samples.py to samples.pyw added work-in-progress version of multiresourceEditor ! (tools/resourceEditor/multirwesourceEditor) renamed to layoutEditor support customizable window styles in backgroundInfo of resourceEditor --- 18,22 ---- renamed samples.py to samples.pyw added work-in-progress version of multiresourceEditor ! (tools/resourceEditor/multiresourceEditor) renamed to layoutEditor support customizable window styles in backgroundInfo of resourceEditor *************** *** 25,28 **** --- 25,30 ---- added sample for sudoku solver/helper (samples/sudoku) replaced StringType with StringTypes to handle Unicode better + Major update standaloneBuilder, including support for py2exe + allow for Python2.4 or Python 2.5 on Mac |
From: Alex T. <ale...@us...> - 2006-05-18 21:11:57
|
Update of /cvsroot/pythoncard/PythonCard In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28658 Modified Files: util.py Log Message: Handle later versions of Python for Mac. Index: util.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/util.py,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** util.py 18 May 2005 22:12:17 -0000 1.38 --- util.py 18 May 2006 21:11:49 -0000 1.39 *************** *** 15,19 **** if sys.platform == 'darwin': # this is a temporary hack for bundlebuilder ! return not sys.executable == '/System/Library/Frameworks/Python.framework/Versions/2.3/Resources/Python.app/Contents/MacOS/Python' else: return (hasattr(sys, "frozen") or # new py2exe, McMillan --- 15,21 ---- if sys.platform == 'darwin': # this is a temporary hack for bundlebuilder ! return not (sys.executable == '/System/Library/Frameworks/Python.framework/Versions/2.3/Resources/Python.app/Contents/MacOS/Python' or \ ! sys.executable == '/Library/Frameworks/Python.framework/Versions/2.4/Resources/Python.app/Contents/MacOS/Python' or \ ! sys.executable == '/Library/Frameworks/Python.framework/Versions/2.5/Resources/Python.app/Contents/MacOS/Python') else: return (hasattr(sys, "frozen") or # new py2exe, McMillan |