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: Alex T. <ale...@us...> - 2005-08-09 22:29:12
|
Update of /cvsroot/pythoncard/PythonCard/tools/resourceEditor In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19488 Modified Files: readme.txt Log Message: Minor changes to bring it up to date (largely to get the date to look recent, and hence avoid giving the impression that nothing is happening). Index: readme.txt =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/tools/resourceEditor/readme.txt,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** readme.txt 13 Apr 2002 16:57:44 -0000 1.11 --- readme.txt 9 Aug 2005 13:52:20 -0000 1.12 *************** *** 1,3 **** ! Last updated: 2002-04-13 This represents the beginnings of a GUI resource (layout) editor for PythonCard. --- 1,3 ---- ! Last updated: 2005-08-09 This represents the beginnings of a GUI resource (layout) editor for PythonCard. *************** *** 6,10 **** Known Bugs and Issues: ! There are no constraints applied when the shift key is held down, but there is there a grid for the widgets to "snap to". You can only select one widget at a time. --- 6,10 ---- Known Bugs and Issues: ! There are no constraints applied when the shift key is held down, but there is a grid for the widgets to "snap to". You can only select one widget at a time. *************** *** 14,20 **** Some of the components don't move or resize correctly all the time, you should report problems to the mailing list. The Choice component seems prone to this movement problem. If a component is difficult to select or move, you can always select it via the Property Editor and then change its position attribute via the Property Editor rather than trying to drag the control itself; the sizing handles should also work. - There is a bug that causes the top three sizing handles to appear incorrectly, usually when the widget y position is at -1. I am trying to determine if this is actually a problem with wxPython or some rare interaction in the resourceEditor code. [I think this is fixed as of release 0.6.2 -ka] - When editing a dialog or other window that doesn't have a menubar, you'll probably need to increase the vertical size of the window by 20 or 30 pixels to compensate for the resourceEditor menubar. Once your layout looks the way you want it you can subtract the pixel padding you added earlier. On Microsoft Windows, the menubar may wrap if the width of the window is not wide enough, in which case you'll need to add even more padding. ! The next revision of the resourceEditor will use a separate window for doing layout so that the size of a window is always accurate and shows the menubar of the app you're editing. --- 14,18 ---- Some of the components don't move or resize correctly all the time, you should report problems to the mailing list. The Choice component seems prone to this movement problem. If a component is difficult to select or move, you can always select it via the Property Editor and then change its position attribute via the Property Editor rather than trying to drag the control itself; the sizing handles should also work. When editing a dialog or other window that doesn't have a menubar, you'll probably need to increase the vertical size of the window by 20 or 30 pixels to compensate for the resourceEditor menubar. Once your layout looks the way you want it you can subtract the pixel padding you added earlier. On Microsoft Windows, the menubar may wrap if the width of the window is not wide enough, in which case you'll need to add even more padding. ! Some future revision of the resourceEditor will use a separate window for doing layout so that the size of a window is always accurate and shows the menubar of the app you're editing. |
From: Alex T. <ale...@us...> - 2005-08-09 19:55:32
|
Update of /cvsroot/pythoncard/PythonCard/tools/resourceEditor In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20465 Modified Files: resourceEditor.py Added Files: multireadme.txt Log Message: Added separate readme file for multiresourceEditor. Index: resourceEditor.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/tools/resourceEditor/resourceEditor.py,v retrieving revision 1.221 retrieving revision 1.222 diff -C2 -d -r1.221 -r1.222 *** resourceEditor.py 17 May 2005 14:25:21 -0000 1.221 --- resourceEditor.py 9 Aug 2005 13:56:51 -0000 1.222 *************** *** 66,70 **** try: ! self.readme = open('readme.txt').read() except: self.readme = '' --- 66,70 ---- try: ! self.readme = open('multireadme.txt').read() except: self.readme = '' --- NEW FILE: multireadme.txt --- Last updated: 2005-08-09 This represents the beginnings of a GUI resource (layout) editor for PythonCard. This experimental version (multiresourceEditor) allows various operations to be performed on multiple selected components (eg. move, align, distribute, etc.) You can view the attributes for all components and menus by selecting the Resource... menu item in the View menu prior to doing a Save or Save As... under the File menu to output a new file. Known Bugs and Issues: There are no constraints applied when the shift key is held down, but there is a grid for the widgets to "snap to". Sizers and anchors are not supported. It is likely anchors will be supported before sizers. Some of the components don't move or resize correctly all the time, you should report problems to the mailing list. The Choice component seems prone to this movement problem. If a component is difficult to select or move, you can always select it via the Property Editor and then change its position attribute via the Property Editor rather than trying to drag the control itself; the sizing handles should also work. When editing a dialog or other window that doesn't have a menubar, you'll probably need to increase the vertical size of the window by 20 or 30 pixels to compensate for the resourceEditor menubar. Once your layout looks the way you want it you can subtract the pixel padding you added earlier. On Microsoft Windows, the menubar may wrap if the width of the window is not wide enough, in which case you'll need to add even more padding. Some future revision of the resourceEditor will use a separate window for doing layout so that the size of a window is always accurate and shows the menubar of the app you're editing. |
From: Alex T. <ale...@us...> - 2005-08-01 18:09:40
|
Update of /cvsroot/pythoncard/PythonCard/samples/flock In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15440 Modified Files: readme.txt Log Message: Provide accurate description for this sample. Index: readme.txt =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/samples/flock/readme.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** readme.txt 11 Oct 2004 01:56:58 -0000 1.1 --- readme.txt 1 Aug 2005 18:09:30 -0000 1.2 *************** *** 1,3 **** ! Conversion of Flash animation to PythonCard. - http://www.bit-101.com/tutorials/gravity.html --- 1,5 ---- ! Builds on the "gravity" sample to show a simple animation of "boids"; shows simple emergent behaviour for a 2-D flock of "boids". ! ! This sampe uses two images to animate the movement of bird-like objects. ! |
From: Alex T. <ale...@us...> - 2005-08-01 11:18:22
|
Update of /cvsroot/pythoncard/PythonCard/tools/resourceEditor/modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1617/modules Modified Files: multipropertyEditor.py Log Message: Change label -> name derivation to use caseCapitalizedWords. Ensure checkable items are enabled in property display. Index: multipropertyEditor.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/tools/resourceEditor/modules/multipropertyEditor.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** multipropertyEditor.py 29 Jul 2005 01:22:23 -0000 1.3 --- multipropertyEditor.py 1 Aug 2005 11:18:14 -0000 1.4 *************** *** 632,635 **** --- 632,636 ---- self.components["chk"+propName].label = propName self.components["chk"+propName].visible = True + self.components["chk"+propName].enabled = True self.components["chk"+propName].checked = value else: |
From: Alex T. <ale...@us...> - 2005-08-01 11:18:22
|
Update of /cvsroot/pythoncard/PythonCard/tools/resourceEditor In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1617 Modified Files: multiresourceEditor.py Log Message: Change label -> name derivation to use caseCapitalizedWords. Ensure checkable items are enabled in property display. Index: multiresourceEditor.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/tools/resourceEditor/multiresourceEditor.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** multiresourceEditor.py 29 Jul 2005 01:22:23 -0000 1.2 --- multiresourceEditor.py 1 Aug 2005 11:18:14 -0000 1.3 *************** *** 1442,1446 **** def convertToValidName(self, v): # and make it into a valid name ! v = v.replace(' ', '_') newv = '' if v == "": v = "a" --- 1442,1450 ---- def convertToValidName(self, v): # and make it into a valid name ! parts = v.split(' ') ! if len(parts) > 1: ! newparts = [p.lower().capitalize() for p in parts] ! newparts[0] = newparts[0].lower() ! v = ''.join(newparts) newv = '' if v == "": v = "a" *************** *** 1461,1465 **** newv = self.convertToValidName(v) desc['name'] = newv - print v, "became", newv def deriveLabelFromName(self, desc): --- 1465,1468 ---- |
From: Alex T. <ale...@us...> - 2005-07-29 01:22:31
|
Update of /cvsroot/pythoncard/PythonCard/tools/resourceEditor/modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17836/modules Modified Files: multipropertyEditor.py Log Message: Install patch (modified) for Select-All and Delete (multiple components). (Thanks to Roberto Ropsario for the original version of this patch). Remove diagnostic prints for co-ordinates. Index: multipropertyEditor.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/tools/resourceEditor/modules/multipropertyEditor.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** multipropertyEditor.py 27 Jul 2005 22:54:34 -0000 1.2 --- multipropertyEditor.py 29 Jul 2005 01:22:23 -0000 1.3 *************** *** 593,597 **** fsx, fsy = self.components.fldbackgroundColor.GetBestSize() ## + (20,10) fx = fx + fdefx - fsx ! print fx, fy, fsx, fsy # Color buttons are odd, so use the font button for button positioning --- 593,597 ---- fsx, fsy = self.components.fldbackgroundColor.GetBestSize() ## + (20,10) fx = fx + fdefx - fsx ! #rint fx, fy, fsx, fsy # Color buttons are odd, so use the font button for button positioning *************** *** 599,606 **** bdefx, bdefy = self.components.fntfont.size bsx, bsy = self.components.fntfont.GetBestSize() ## + (20,10) ! print bx, by, bdefx, bdefy, bsx, bsy # bx = bx + bdefx - bsx bsx = bdefx ! print bx, by, bsx, bsy y = maxy+fsy --- 599,606 ---- bdefx, bdefy = self.components.fntfont.size bsx, bsy = self.components.fntfont.GetBestSize() ## + (20,10) ! #rint bx, by, bdefx, bdefy, bsx, bsy # bx = bx + bdefx - bsx bsx = bdefx ! #rint bx, by, bsx, bsy y = maxy+fsy |
From: Alex T. <ale...@us...> - 2005-07-29 01:22:31
|
Update of /cvsroot/pythoncard/PythonCard/tools/resourceEditor In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17836 Modified Files: multiresourceEditor.py multiresourceEditor.rsrc.py Log Message: Install patch (modified) for Select-All and Delete (multiple components). (Thanks to Roberto Ropsario for the original version of this patch). Remove diagnostic prints for co-ordinates. Index: multiresourceEditor.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/tools/resourceEditor/multiresourceEditor.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** multiresourceEditor.py 27 Jul 2005 21:45:54 -0000 1.1 --- multiresourceEditor.py 29 Jul 2005 01:22:23 -0000 1.2 *************** *** 1599,1608 **** aWidget = self.components[self.startName] msg = "Are you sure you want to delete %s %s?" % (aWidget.__class__.__name__, aWidget.name) ! result = dialog.messageDialog(self, msg, 'Delete Component', ! wx.ICON_INFORMATION | wx.YES_NO | wx.NO_DEFAULT) ! if result.accepted: ! self.hideSizingHandles() ! del self.components[aWidget.name] ! self.documentChanged = True def on_componentAdd_command(self, event): --- 1599,1621 ---- aWidget = self.components[self.startName] msg = "Are you sure you want to delete %s %s?" % (aWidget.__class__.__name__, aWidget.name) ! elif self.multipleSelected: ! if len(self.multipleComponents) == 0: return ! nameList = [ x[0] for x in self.multipleComponents ] ! if len(self.multipleComponents) == 1: ! msg = "Are you sure you want to Delete this component ?" ! else: ! msg = "Are you sure you want to Delete %d components?" % (len(self.multipleComponents)) ! result = dialog.messageDialog(self, msg, 'Delete Component', ! wx.ICON_INFORMATION | wx.YES_NO | wx.NO_DEFAULT) ! ! if result.accepted: ! if self.multipleSelected: ! self.hideMultiSizingHandles() ! for name in nameList: ! del self.components[name] ! else: ! self.hideSizingHandles() ! del self.components[aWidget.name] ! self.documentChanged = True def on_componentAdd_command(self, event): *************** *** 1693,1696 **** --- 1706,1731 ---- + def on_componentSelectAll_command(self, event): + #Reset component list on the property editor + self.clearMultipleComponentSelection() + self.multipleSelected = False + self.propertyEditorWindow.clearComponentList() + self.propertyEditorWindow.displayComponents(self.components) + + res = self.propertyEditorWindow.components.wComponentList.items + if res == []: return + + self.marquee = False + self.switchToMultipleMode() + self.clearMultipleComponentSelection() + + for ctrline in res: + name = ctrline.split(" : ")[0] + self.multipleComponents.append( (name, self.makeNewHandles(name))) + + self.propertyEditorWindow.updateComponentList() + return + + def on_displayAttributes_command(self, event): ##desc = self.resourceAttributes() Index: multiresourceEditor.rsrc.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/tools/resourceEditor/multiresourceEditor.rsrc.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** multiresourceEditor.rsrc.py 27 Jul 2005 21:46:37 -0000 1.1 --- multiresourceEditor.rsrc.py 29 Jul 2005 01:22:23 -0000 1.2 *************** *** 100,103 **** --- 100,108 ---- }, {'type':'MenuItem', + 'name':'menuSelectAll', + 'label':'Select All\tCtrl+A', + 'command':'componentSelectAll', + }, + {'type':'MenuItem', 'name':'componentSep2', 'label':'-', |
From: Alex T. <ale...@us...> - 2005-07-27 22:54:43
|
Update of /cvsroot/pythoncard/PythonCard/tools/resourceEditor/modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1228/modules Modified Files: multipropertyEditor.py Log Message: Restore the updating of the background colour of the buttons for controlling colour. Index: multipropertyEditor.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/tools/resourceEditor/modules/multipropertyEditor.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** multipropertyEditor.py 27 Jul 2005 21:47:51 -0000 1.1 --- multipropertyEditor.py 27 Jul 2005 22:54:34 -0000 1.2 *************** *** 717,721 **** self.components["clr"+propName].visible = True #rint propName, self.components["fld"+propName].text, value ! #self.components["clr"+propName].backgroundColor = util.colorFromString(value) self.components["txt"+propName].visible = True --- 717,721 ---- self.components["clr"+propName].visible = True #rint propName, self.components["fld"+propName].text, value ! self.components["clr"+propName].backgroundColor = util.colorFromString(value) self.components["txt"+propName].visible = True |
From: Alex T. <ale...@us...> - 2005-07-27 22:30:09
|
Update of /cvsroot/pythoncard/PythonCard/tools/resourceEditor/images In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27571 Added Files: move_back.png move_forward.png move_together.png nudge_down.png nudge_left.png nudge_right.png nudge_up.png relayer.png send_to_back.png send_to_front.png Log Message: Initial check-in for the multi-component resource Editor. --- NEW FILE: send_to_front.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: nudge_right.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: send_to_back.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: move_forward.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: nudge_up.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: nudge_down.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: relayer.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: move_together.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: nudge_left.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: move_back.png --- (This appears to be a binary file; contents omitted.) |
Update of /cvsroot/pythoncard/PythonCard/tools/resourceEditor/images In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27060 Added Files: dist_horiz_edge.png dist_horiz_space.png dist_vert_edge.png dist_vert_space.png equal_both.png equal_height.png equal_width.png Log Message: Initial check-in for the multi-component resource Editor. --- NEW FILE: equal_height.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: dist_vert_edge.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: equal_both.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: dist_horiz_edge.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: dist_horiz_space.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: dist_vert_space.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: equal_width.png --- (This appears to be a binary file; contents omitted.) |
Update of /cvsroot/pythoncard/PythonCard/tools/resourceEditor/images In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26649 Added Files: align_bottom.png align_horiz_centres.png align_left.png align_right.png align_top.png align_vert_centres.png Log Message: Initial check-in for the multi-component resource Editor. --- NEW FILE: align_top.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: align_left.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: align_vert_centres.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: align_right.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: align_horiz_centres.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: align_bottom.png --- (This appears to be a binary file; contents omitted.) |
From: Alex T. <ale...@us...> - 2005-07-27 21:51:39
|
Update of /cvsroot/pythoncard/PythonCard/tools/resourceEditor/modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18940/modules Added Files: multiresourceOutput.py Log Message: Initial check-in for the multi-component resource Editor. --- NEW FILE: multiresourceOutput.py --- """ __version__ = "$Revision: 1.1 $" __date__ = "$Date: 2005/07/27 21:51:30 $" """ import wx SPACES = ' ' def colorDescription(color): if isinstance(color, str): return "'%s'" % color else: return "%s" % str(color) # this is a complete hack job in order to avoid # outputting defaults def widgetAttributes(background, aWidget): # this might be overly aggressive # it could be that the normal default of white might be different on these # various widgets rather than being the same, so the wxTextCtrl is # not a good comparison flds = ['TextField', 'PasswordField', 'TextArea'] txtWidgets = ['TextField', 'PasswordField', 'TextArea', 'Choice', 'List', 'Calendar', 'ComboBox'] imgWidgets = ['Image', 'ImageButton'] comp = background.propertyEditorWindow.components dFgC = comp.wUpdate.foregroundColor.Get() dBgC = comp.wUpdate.backgroundColor.Get() dFont = repr(comp.wUpdate.font) dTextBgC = comp.fldname.backgroundColor.Get() # make sure these primary attributes show up # at the beginning of the listing # the remaining ones will be in alphabetical order dStr = "{'type':'%s', \n" % aWidget.__class__.__name__ # KEA 2002-03-24 # only save the special ids if background.editingDialog and aWidget.__class__.__name__ == 'Button': if aWidget.id in [wx.ID_OK, wx.ID_CANCEL, wx.ID_YES, wx.ID_NO]: dStr += " 'id':%d, \n" % aWidget.id dStr += " 'name':'%s', \n" % aWidget.name dStr += " 'position':%s, \n" % str(aWidget.position) # try and determine default sizes width, height = aWidget.size if aWidget.__class__.__name__ in imgWidgets: width, height = aWidget._size elif aWidget.__class__.__name__ not in ['BitmapCanvas', 'HtmlWindow', 'IEHtmlWindow', 'Gauge', 'StaticBox']: bestWidth, bestHeight = aWidget.GetBestSize() if bestWidth == width: width = -1 if bestHeight == height: height = -1 if width != -1 or height != -1: dStr += " 'size':(%d, %d), \n" % (width, height) #for key in aWidget._getAttributeNames(): attributes = aWidget._spec.getAttributes().keys() attributes.sort() for key in attributes: if key in ['id', 'bitmap', 'name', 'position', 'selection', 'size']: pass elif getattr(aWidget, key) is not None: #print aWidget.__class__.__name__, key, getattr(aWidget, key) value = getattr(aWidget, key) if key == 'file' and aWidget.__class__.__name__ in imgWidgets and value == '': dStr += " 'file':'', \n" continue if key == 'alignment' and \ aWidget.__class__.__name__ in ['StaticText', 'PasswordField', 'TextField', 'TextArea'] \ and value == 'left': continue if key == 'border' and aWidget.__class__.__name__ in txtWidgets and value == '3d': continue if key == 'backgroundColor' and \ aWidget.__class__.__name__ in txtWidgets and \ value.Get() == dTextBgC: continue if key == 'foregroundColor' and value.Get() == dFgC: continue if key == 'backgroundColor' and value.Get() == dBgC: continue if key == 'font' and repr(value) == dFont: continue if key == 'actionBindings' and value == {}: continue # KEA 2002-07-07 # what other Unicode strings do we need to deal with above? #print key, value, type(value) if isinstance(value, (str, unicode)): if isinstance(value, unicode): value = value.encode('ascii', 'ignore') # need to escape strings #pprint.pprint(value) if value != '': dStr += """ %s:%s, \n""" % (repr(key), repr(value)) else: if (key in ['editable', 'enabled', 'visible'] and value == True) or \ (key in ['checked', 'default', 'horizontalScrollbar'] and value == False): # don't include default values pass else: dStr += " '%s':%s, \n" % (key, value) dStr += ' },\n' return dStr def resourceMenuItemAttributes(menuItem): desc = SPACES * 4 + " {'type':'MenuItem',\n" desc += SPACES * 4 + " 'name':'%s',\n" % menuItem.name desc += SPACES * 4 + """ 'label':%s,\n""" % repr(menuItem.label) try: if menuItem.command is not None: desc += SPACES * 4 + " 'command':'%s',\n" % menuItem.command except: pass try: if not menuItem.enabled: desc += SPACES * 4 + " 'enabled':0,\n" except: pass try: if menuItem.checkable: desc += SPACES * 4 + " 'checkable':1,\n" if menuItem.checked: desc += SPACES * 4 + " 'checked':1,\n" except: pass desc += SPACES * 4 + " },\n" return desc def resourceMenuAttributes(menu): desc = SPACES * 3 + " {'type':'Menu',\n" desc += SPACES * 3 + " 'name':'%s',\n" % menu.name desc += SPACES * 3 + """ 'label':%s,\n""" % repr(menu.label) desc += SPACES * 3 + " 'items': [\n" for m in menu.items: desc += resourceMenuItemAttributes(m) desc += SPACES * 3 + " ]\n" desc += SPACES * 3 + " },\n" return desc def resourceMenubarAttributes(menubar): desc = SPACES * 2 + "'menubar': {'type':'MenuBar',\n" desc += SPACES * 2 + " 'menus': [\n" for m in menubar.menus: desc += resourceMenuAttributes(m) desc += SPACES * 2 + " ]\n" desc += SPACES + " },\n" return desc def resourceBackgroundAttributes(background, bg): desc = " {'type':'Background',\n" desc += " 'name':'%s',\n" % bg.name desc += """ 'title':%s,\n""" % repr(bg.title) # KEA 2004-10-04 # need a more sophisticated way of specifying an optional position # but just saving the position the user is editing the window at # is bad, so turn it off for now ## desc += " 'position':%s,\n" % str(background.GetPositionTuple()) desc += " 'size':%s,\n" % str(background.GetSizeTuple()) if bg.statusBar is not None and bg.statusBar: desc += " 'statusBar':1,\n" if bg.foregroundColor is not None: desc += " 'foregroundColor':" + colorDescription(bg.foregroundColor) + ",\n" if bg.backgroundColor is not None: desc += " 'backgroundColor':" + colorDescription(bg.backgroundColor) + ",\n" if bg.icon is not None: desc += " 'icon':'%s',\n" % bg.icon if bg.image is not None: desc += " 'image':'%s',\n" % bg.image if bg.tiled: desc += " 'tiled':1,\n" if not bg.visible: desc += " 'visible':0,\n" if bg.style != []: desc += " 'style':%s,\n" % str(bg.style) desc += "\n" try: desc += resourceMenubarAttributes(bg.menubar) except: pass # KEA 2002-05-15 # strings if bg.strings != {}: desc += " 'strings': {\n" for s in bg.strings.__dict__: desc += """ %s:%s,\n""" % (repr(s), repr(bg.strings.__dict__[s])) desc += " },\n\n" desc += " 'components': [\n\n" return desc def resourceStackAttributes(background): if background.rsrc is None: print "no rsrc" # we should probably blow up here desc = "{'application':{'type':'Application',\n" desc += " 'name':'%s',\n" % background.rsrc.application.name desc += " 'backgrounds': [\n" desc += resourceBackgroundAttributes(background, background.rsrc.application.backgrounds[0]) return desc def resourceDialogAttributes(background, bg): desc = "{'type':'CustomDialog',\n" desc += " 'name':'%s',\n" % bg.name desc += " 'title':'%s',\n" % bg.title desc += " 'position':%s,\n" % str(background.GetPositionTuple()) desc += " 'size':%s,\n" % str(background.GetSizeTuple()) #if bg.statusBar is not None and bg.statusBar: # desc += " 'statusBar':1,\n" #desc += "\n" #if bg.foregroundColor is not None: # desc += " 'foregroundColor':" + colorDescription(bg.foregroundColor) + ",\n" #if bg.backgroundColor is not None: # desc += " 'backgroundColor':" + colorDescription(bg.backgroundColor) + ",\n" #if bg.image is not None: # desc += " 'image':'%s',\n" % bg.image #if bg.tiled != 0: # desc += " 'tiled':1,\n" # KEA 2002-09-12 # strings if bg.strings != {}: desc += "\n 'strings': {\n" for s in bg.strings.__dict__: desc += """ %s:%s,\n""" % (repr(s), repr(bg.strings.__dict__[s])) desc += " },\n\n" desc += " 'components': [\n\n" return desc def resourceAttributes(background): # KEA 2002-03-24 """ editingDialog = 0 try: name = background.rsrc.application.name except: editingDialog = 1 """ if background.editingDialog: desc = resourceDialogAttributes(background, background.rsrc) for w in background.components.order: if w not in background.sizingHandleNames: if not background.isSizingHandle(w): desc += widgetAttributes(background, background.components[w]) + "\n" desc += "] # end components\n" desc += "} # end CustomDialog\n" else: desc = resourceStackAttributes(background) for w in background.components.order: if w not in background.sizingHandleNames: if not background.isSizingHandle(w): desc += widgetAttributes(background, background.components[w]) + "\n" desc += "] # end components\n" desc += "} # end background\n" desc += "] # end backgrounds\n" desc += "} }\n" return desc |
From: Alex T. <ale...@us...> - 2005-07-27 21:50:15
|
Update of /cvsroot/pythoncard/PythonCard/tools/resourceEditor/modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18656/modules Added Files: multiComponents.rsrc.py Log Message: Initial check-in for the multi-component resource Editor. --- NEW FILE: multiComponents.rsrc.py --- {'application':{'type':'Application', 'name':'Template', 'backgrounds': [ {'type':'Background', 'name':'bgTemplate', 'title':'resourceEditor Multiple Components Editor', 'size':(480, 577), 'statusBar':1, 'components': [ {'type':'StaticText', 'name':'stcNames', 'position':(10, 10), 'size':(84, -1), 'text':'Name : Class', }, {'type':'List', 'name':'wComponentList', 'position':(7, 26), 'size':(163, 172), 'items':[], }, {'type':'CheckBox', 'name':'Visible', 'position':(288, 27), 'size':(57, -1), 'label':'visible', }, {'type':'CheckBox', 'name':'Enabled', 'position':(201, 27), 'label':'enabled', }, {'type':'Button', 'name':'HorizontalCentres', 'position':(339, 142), 'size':(85, 25), 'label':'Centres', }, {'type':'Button', 'name':'VerticalCentres', 'position':(364, 65), 'size':(42, 69), 'label':'Centres', }, {'type':'Button', 'name':'Bottom', 'position':(243, 132), 'size':(53, -1), 'label':'Bottom', }, {'type':'Button', 'name':'Top', 'position':(244, 78), 'size':(53, -1), 'label':'Top', }, {'type':'Button', 'name':'Right', 'position':(287, 103), 'size':(53, -1), 'label':'Right', }, {'type':'Button', 'name':'Left', 'position':(200, 104), 'size':(52, -1), 'label':'Left', }, {'type':'StaticBox', 'name':'Align', 'position':(194, 53), 'size':(234, 132), 'label':'ALIGN', }, {'type':'ImageButton', 'name':'SendToBack', 'position':(15, 255), 'size':(18, 24), 'border':'transparent', 'command':'componentSendBack', 'file':'images/send_to_back.png', }, {'type':'ImageButton', 'name':'MoveBack', 'position':(45, 255), 'size':(18, 24), 'border':'transparent', 'command':'componentMoveBack', 'file':'images/move_back.png', }, {'type':'ImageButton', 'name':'MoveForward', 'position':(75, 255), 'size':(18, 24), 'border':'transparent', 'command':'componentMoveForward', 'file':'images/move_forward.png', }, {'type':'ImageButton', 'name':'SendToFront', 'position':(105, 255), 'size':(18, 24), 'border':'transparent', 'command':'componentBringFront', 'file':'images/send_to_front.png', }, ] # end components } # end background ] # end backgrounds } } |
From: Alex T. <ale...@us...> - 2005-07-27 21:49:50
|
Update of /cvsroot/pythoncard/PythonCard/tools/resourceEditor/modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18498/modules Added Files: multiComponents.py Log Message: Initial check-in for the multi-component resource Editor. --- NEW FILE: multiComponents.py --- #!/usr/bin/python """ __version__ = "$Revision: 1.1 $" __date__ = "$Date: 2005/07/27 21:49:41 $" """ from PythonCard import dialog, font, model, registry, util from PythonCard.event import ChangeListener import resourceOutput import time import os import string import wx class MultiComponents(model.Background, ChangeListener): def on_initialize(self, event): self._parent = self.GetParent() self._comp = self._parent.components self._updatingComponent = 0 ##self.components.addChangeEventListener(self) self._comp.addChangeEventListener(self) #self.displayComponents(self.components) self.displayComponents(self._comp) self.visible = True def on_componentSendBack_command(self, event): print "no re-layering yet" return self._parent.on_componentSendBack_command(event) def on_componentMoveBack_command(self, event): print "no re-layering yet" return self._parent.on_componentMoveBack_command(event) def on_componentMoveForward_command(self, event): print "no re-layering yet" return self._parent.on_componentMoveForward_command(event) def on_componentBringFront_command(self, event): print "no re-layering yet" return self._parent.on_componentBringFront_command(event) def addWidgetToComponentList(self, widget): wName = widget.name wClass = widget.__class__.__name__ self.components.wComponentList.Append(wName + " : " + wClass) # KEA 2002-02-23 # need to redo the logic below to avoid asserts in hybrid # versions of wxPython, but also be cleaner def deleteWidgetFromComponentList(self, wName, wClass): i = self.components.wComponentList.GetSelection() j = self.components.wComponentList.FindString(wName + " : " + wClass) if i == -1 or i != j: if j != -1: self.components.wComponentList.Delete(j) else: if j > 0: self.components.wComponentList.SetSelection(j - 1) if j != -1: self.components.wComponentList.Delete(j) if self.components.wComponentList.GetSelection() == -1: self.setValidProps("") else: wName, wClass = self.components.wComponentList.stringSelection.split(" : ") # deselect the name from properties list self.setValidProps(wClass) self.displayProperties(wName, wClass) def changed(self, event): print "multi changed", self._parent.multipleSelected, self._parent.multipleComponents def clearComponentList(self): self.components.wComponentList.Clear() self.statusBar.text = '' def displayComponents(self, components): self.components.wComponentList.Freeze() self.components.wComponentList.Clear() self._comp = components for c in components.order: #print "display", c, self._parent.isSizingHandle(c) if c not in self._parent.sizingHandleNames and not self._parent.isSizingHandle(c): self.addWidgetToComponentList(components[c]) self.components.wComponentList.Thaw() self.components.wComponentList.Refresh() self.components.wComponentList.Update() def on_close(self, event): self.visible = False parent = self.GetParent() parent.menuBar.setChecked('menuViewPropertyEditor', 0) |
From: Alex T. <ale...@us...> - 2005-07-27 21:47:59
|
Update of /cvsroot/pythoncard/PythonCard/tools/resourceEditor/modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18125/modules Added Files: multipropertyEditor.py multipropertyEditor.rsrc.py Log Message: Initial check-in for the multi-component resource Editor. --- NEW FILE: multipropertyEditor.py --- #!/usr/bin/python """ __version__ = "$Revision: 1.1 $" __date__ = "$Date: 2005/07/27 21:47:51 $" """ from PythonCard import dialog, font, model, registry, util from PythonCard.event import ChangeListener import multiresourceOutput import time import os import string import wx DO_TRICKY_NAME_DERIVATIONS = True # KEA this is a load of dingos' kidneys and needs to be rewritten # 2002-02-22 # now I'm compounding the problem by porting from the original # Property Editor to a PythonCard background class PropertyEditor(model.Background, ChangeListener): def on_initialize(self, event): self._parent = self.GetParent() self._comp = self._parent.components self._updatingComponent = 0 ##self.components.addChangeEventListener(self) self._comp.addChangeEventListener(self) self.checkItems = ['enabled', 'visible', 'editable', 'checked', 'default', \ 'allowNameLabelVariation', \ 'rules', 'labels', 'ticks', 'horizontalScrollbar'] self.popItems = ['layout', 'border', 'style', 'alignment', 'stringSelection'] self.cantModify = ['id', 'name', 'alignment', 'layout', 'style', 'border', \ 'horizontalScrollbar', 'min', 'max', 'columns', 'rules', 'labels', 'ticks'] self.standardProps = ['name', 'allowNameLabelVariation', \ 'enabled', 'visible', 'checked', 'backgroundColor', 'foregroundColor', 'font', 'position', 'size', 'label', 'text'] self.standardPrefixes = ["txt", "fld", "btn", "chk", "pop", "clr", "fnt"] self.multiCompControls = ['stbAlign', 'alignRight', 'alignLeft', 'alignTop', 'alignBottom', 'alignVerticalCentres','alignHorizontalCentres', 'stbEqualize', 'equalWidth', 'equalHeight', 'equalBoth', 'stbDistribute', 'distHorizFirstLast', 'distHorizEdge', 'distVertFirstLast', 'distVertEdge', ] ## 'stbNudge', 'nudgeDistance', ## 'nudgeLeft', 'nudgeRight', ## 'nudgeUp', 'nudgeDown' ## ] # KEA 2001-08-14 # this was causing an assertion error with the hybrid wxPython #self.components.wComponentList.SetSelection(0) if self.components.wComponentList.stringSelection == "": #multicol if self.components.wComponentList.getStringSelection() == []: wClass = "" else: wName, wClass = self.components.wComponentList.stringSelection.split(" : ") #multicol wName, wClass = self.components.wComponentList.getStringSelection()[0].split(" : ") self.setValidProps(wClass) #self.displayComponents(self.components) self.displayComponents(self._comp) self.visible = True # these functions for adding dynamically any property fields # not used for "standard" items, and used once only for others # thereafter, use hiding and repositioning. def add_field(self, pType, name, pos, siz, text, align): self.components[name] = {'type':pType, 'name':name, 'position':pos, 'size':siz, 'alignment':align, 'text':text} def add_chk(self, name, pos, siz): # NB - set the command option to trigger the event self.components[name] = {'type':"CheckBox", 'name':name, 'position':pos, 'command':'checkedProperty', 'size':siz} def add_pop(self, name, pos, siz): #rint "add_pop", name, pos, siz self.components[name] = {'type':"Choice", 'name':name, 'position':pos, 'size':siz} def add_btnFile(self, name, pos, siz): # NB - set the command option to trigger the event self.components[name] = {'type':"Button", 'name':name, 'position':pos, 'label':"File...", 'command':'btnFile', 'size':siz} def on_componentSendBack_command(self, event): self._parent.on_componentSendBack_command(event) def on_componentMoveBack_command(self, event): self._parent.on_componentMoveBack_command(event) def on_componentMoveTogether_command(self, event): self._parent.on_componentMoveTogether_command(event) def on_componentRelayer_command(self, event): self._parent.on_componentRelayer_command(event) def on_componentMoveForward_command(self, event): self._parent.on_componentMoveForward_command(event) def on_componentBringFront_command(self, event): self._parent.on_componentBringFront_command(event) # KEA 2004-08-23 # support updating of attributes without the need # for clicking the (no longer existent) Update button def on_closeField(self, event): which = event.target.name.replace("fld", "") self.updateComponent(which) def on_checkedProperty_command(self, event): which = event.target.name.replace("chk", "") self.updateComponent(which) def on_select(self, event): which = event.target.name.replace("pop", "") self.updateComponent(which) def on_color_command(self, event): which = event.target.name.replace("clr", "") result = dialog.colorDialog(self, color=util.colorFromString(self.components["fld"+which].text)) if result.accepted: self.components["fld"+which].text = str(result.color) self.components["clr"+which].backgroundColor = util.colorFromString(self.components["fld"+which].text) self.updateComponent(which) def on_changeFont_command(self, event): which = event.target.name.replace("fnt", "") wName, wClass = self.components.wComponentList.stringSelection.split(" : ") #multicol wName, wClass = self.components.wComponentList.getStringSelection()[0].split(" : ") widget = self._comp[wName] f = widget.font if f is None: desc = font.fontDescription(widget.GetFont()) f = font.Font(desc) result = dialog.fontDialog(self, f) if result.accepted: f = result.font self.components["fld"+which].text = "%s" % f self.updateComponent(which) def on_btnFile_command(self, event): which = event.target.name.replace("btn", "") path, filename = os.path.split(self.components["fld"+which].text) result = dialog.openFileDialog(self, directory=path, filename=filename) #rint result.paths[0] if result.accepted: self.components["fld"+which].text = util.relativePath(self._parent.filename, result.paths[0]) self.updateComponent(which) def addWidgetToComponentList(self, widget): wName = widget.name wClass = widget.__class__.__name__ self.components.wComponentList.Append(wName + " : " + wClass) # KEA 2002-02-23 # need to redo the logic below to avoid asserts in hybrid # versions of wxPython, but also be cleaner def deleteWidgetFromComponentList(self, wName, wClass): i = self.components.wComponentList.GetSelection() j = self.components.wComponentList.FindString(wName + " : " + wClass) if i == -1 or i != j: if j != -1: self.components.wComponentList.Delete(j) else: if j > 0: self.components.wComponentList.SetSelection(j - 1) if j != -1: self.components.wComponentList.Delete(j) if self.components.wComponentList.GetSelection() == -1: self.setValidProps("") else: wName, wClass = self.components.wComponentList.stringSelection.split(" : ") # deselect the name from properties list self.setValidProps(wClass) self.displayProperties(wName, wClass) def updateComponentList(self): if not self._parent.multipleSelected: return ###### multicol ###### lastList = self.components.wComponentList.getStringSelection() ###### if lastList: ###### for last in lastList: ###### self.components.wComponentList.SetStringSelection(last, 0) ###### #print "un setting", self.components.wComponentList.SetStringSelection(last, 0) ###### self.components.wComponentList.SetStringSelection(wName + " : " + wClass) ###### #print "setting", self.components.wComponentList.SetStringSelection(wName + " : " + wClass) self.components.wComponentList.Clear() self.PropertyListClear() for c in self.multiCompControls: self.components[c].visible = True for c,pref in self._parent.multipleComponents: self.addWidgetToComponentList(self._comp[c]) def selectComponentList(self, wName, wClass): if self._parent.multipleSelected: for c in self.multiCompControls: self.components[c].visible = False self.components.wComponentList.stringSelection = wName + " : " + wClass ###### multicol ###### lastList = self.components.wComponentList.getStringSelection() ###### if lastList: ###### for last in lastList: ###### self.components.wComponentList.SetStringSelection(last, 0) ###### #print "un setting", self.components.wComponentList.SetStringSelection(last, 0) ###### self.components.wComponentList.SetStringSelection(wName + " : " + wClass) ###### #print "setting", self.components.wComponentList.SetStringSelection(wName + " : " + wClass) self.setValidProps(wClass) self.components.chkallowNameLabelVariation.checked = not DO_TRICKY_NAME_DERIVATIONS self.displayProperties(wName, wClass) c = self._parent.components[wName] self._parent.setToolTipDrag(wName, c.position, c.size) def changed(self, event): ##comp = self.components if self._updatingComponent: # KEA 2003-01-04 # hack to speed up updates in place return comp = self._comp wName, wClass = event.getOldValue().split(",") if wName in comp: # new item added if not self._parent.isSizingHandle(wName): self.addWidgetToComponentList(comp[wName]) else: # item deleted self.deleteWidgetFromComponentList(wName, wClass) """ def on_wCopy_mouseClick(self, event): wName, wClass = self.components.wComponentList.stringSelection.split(" : ") # what needs to happen here is to have a method for the Widget class that # will provide a valid resource description, each subclass of widget would # override the method to deal with their specific resource attributes # the Widget class should provide some ordering so that 'type', # 'position', 'size' comes before less commonly used items, the actual # ordering could just be defined in a list, so it is easy to change # also, if the current values match the defaults for a widget attribute # then that attribute should not be provided as part of the output print "this is just a placeholder method right now," print "the resource is not actually copied to the clipboard yet" pprint.pprint(self._comp[wName]) """ def on_chkallowNameLabelVariation_mouseClick(self, event): if not self.components.chkallowNameLabelVariation.checked: # no longer allow them to be different # should we allow user to choose which one to keep ? # resolve if they are currently different # or simply leave as is ? wName, wClass = self.components.wComponentList.stringSelection.split(" : ") if 'label' in self.propertyList: propName = 'label' deriveName = self._parent.convertToValidName(self._comp[wName].label) else: propName = 'text' deriveName = self._parent.convertToValidName(self._comp[wName].text) # do they already match ? if wName == deriveName: self.components.chkallowNameLabelVariation.checked = False return result = dialog.messageDialog(self, 'Do you want '+propName+' to revert to reflect the name: '+wName, 'Empty '+propName, wx.ICON_QUESTION | wx.YES_NO | wx.NO_DEFAULT) if result.accepted: self.components['fld'+propName].text = wName # temporarily allow diff name/label to allow update to happen, then revert self.components.chkallowNameLabelVariation.checked = True self.updateComponent(propName) self.components.chkallowNameLabelVariation.checked = False else: self.components.chkallowNameLabelVariation.checked = True def updateComponent(self, which): wName, wClass = self.components.wComponentList.stringSelection.split(" : ") propName = which if propName in self.checkItems: value = self.components["chk"+propName].checked elif propName in self.popItems: value = self.components["pop"+propName].stringSelection elif propName in ('items', 'userdata') or (wClass == 'TextArea' and propName == 'text'): value = self.components["fld"+propName].text else: value = self.components["fld"+propName].text if propName == "textArea": propName = 'text' if propName not in ['name', 'label', 'stringSelection', 'text', 'toolTip', 'userdata']: try: value = eval(value) except: pass # KEA 2004-05-10 # need to figure out where to stick validation code # but for now just need to make sure that if we're changing the name # attribute that it is valid, but similar checks will be necessary for # integer fields, a list of items, etc. # also maybe each attribute should have a doc or help string displayed # saying what the attribute does, example values, etc. if propName == 'name': badValue = False # if it isn't valid then display an alert and exit # must start with a letter and only contain alphanumeric characters if value == "" or value[0] not in string.ascii_letters: badValue = True else: alphanumeric = string.ascii_letters + string.digits for c in value: if c not in alphanumeric: badValue = True break if badValue: dialog.alertDialog(None, "Name must start with a letter and only contain letters and numbers.", 'Error: Name is invalid') self.components["fld"+which].text = wName self.components["fld"+which].setFocus() self.components["fld"+which].setSelection(-1, -1) return # check for duplicate names is done below ##widget = self.components[wName] widget = self._comp[wName] # KEA 2002-02-23 # I can't remember why this is actually necessary if propName == 'size': width, height = value if wClass not in ['BitmapCanvas', 'HtmlWindow']: bestWidth, bestHeight = widget.GetBestSize() if width == -1: width = bestWidth if height == -1: height = bestHeight widget.size = (width, height) else: if (propName in self.cantModify) or \ (propName == 'items' and wClass == 'RadioGroup') or \ (propName in ['label', 'text']): if (propName == 'layout'): xx,yy = widget.size widget.size = yy, xx order = self._comp.order.index(wName) desc = multiresourceOutput.widgetAttributes(self._parent, widget) if desc.endswith(',\n'): desc = eval(desc[:-2]) else: desc = eval(desc) if propName == 'name': if value == wName: # user didn't actually change the name return elif value in self._comp: # we already have a component with that name dialog.alertDialog(self, 'Another component already exists with the name ' + value, 'Error: unable to rename component') self.components["fldname"].text = wName self.components["fldname"].setFocus() self.components["fldname"].setSelection(-1, -1) return if propName in ['label', 'text']: if not self.components.chkallowNameLabelVariation.checked: if value == "": result = dialog.messageDialog(self, 'To set '+propName+' to be empty, you must allow Name and '+propName+' to differ.\n'+ 'Do you want to allow that ?', 'Empty '+propName, wx.ICON_QUESTION | wx.YES_NO | wx.NO_DEFAULT) if result.accepted: self.components.chkallowNameLabelVariation.checked = True desc[propName] = value else: # don't allow this change #self.components["fldname"].text = wName self.components["fld"+propName].text = desc[propName] self.components["fld"+propName].setFocus() self.components["fld"+propName].setSelection(-1, -1) return else: oldval = desc[propName] desc[propName] = value self._parent.deriveNameFromLabel(desc) if desc['name'] in self._comp: # we already have a component with that name dialog.alertDialog(self, 'Another component already exists with the name ' + value, 'Error: unable to rename component') desc['name'] = wName desc[propName] = oldval self.components["fldname"].text = wName self.components["fld"+propName].text = desc[propName] self.components["fld"+propName].setFocus() self.components["fld"+propName].setSelection(-1, -1) return if value is None: desc[propName] = 'none' elif propName in ['min', 'max']: desc[propName] = int(value) else: desc[propName] = value # need to experiment with freeze and thaw to avoid # a lot of update events startTime = time.time() # this is going to trigger a changed event # as we delete the old component self._updatingComponent = True del self._comp[wName] if propName in ['name']: if not self.components.chkallowNameLabelVariation.checked: self._parent.deriveLabelFromName(desc) wName = desc['name'] elif propName in ['label', 'text']: if not self.components.chkallowNameLabelVariation: self._parent.deriveNameFromLabel(desc) wName = desc['name'] # this is going to trigger another changed event # as we create a new component with the changed attribute self._comp[wName] = desc c = self._comp[wName] wx.EVT_LEFT_DOWN(c, self._parent.on_mouseDown) wx.EVT_LEFT_UP(c, self._parent.on_mouseUp) wx.EVT_MOTION(c, self._parent.on_mouseDrag) # now restore the order of the component # have to update the startName in case the name was updated if propName == 'name': self._parent.startName = wName self._comp.order.remove(wName) self._comp.order.insert(order, wName) self._parent.fixComponentOrder(wName) self._updatingComponent = False endTime = time.time() #print "attribute change took:", endTime - startTime else: if wClass in ['Image', 'ImageButton'] and propName == 'file': cwd = os.getcwd() try: os.chdir(self._parent.filename) except: pass setattr(widget, propName, value) os.chdir(cwd) else: setattr(widget, propName, value) #print propName, value # KEA 2002-02-23 self._parent.showSizingHandles(wName) # and check if we now have matching name/label, and if so, assume they now maintain derivation self.determineNameLabelState(wName) def determineNameLabelState(self, wName): if 'label' in self.propertyList: deriveName = self._parent.convertToValidName(self._comp[wName].label) #rint wName, (self._comp[wName].label) elif 'text' in self.propertyList: deriveName = self._parent.convertToValidName(self._comp[wName].text) #rint wName, (self._comp[wName].text) else: return if wName <> deriveName or not DO_TRICKY_NAME_DERIVATIONS: self.components["chkallowNameLabelVariation"].checked = True def setValidProps(self, wClass): if wClass == "": self.PropertyListClear() else: # get the property (attribute) list from the spec klass = registry.Registry.getInstance().getComponentClass(wClass) props = klass._spec.getAttributes().keys() # KEA 2002-03-24 # only show the 'id' attribute for Button # and only when displaying dialog properties if not (self._parent.editingDialog and wClass == 'Button'): props.remove('id') props.sort() ##print "spec props", specProps self.PropertyListClear() self.PropertyListInsertItems(props) def PropertyListClear(self): self.propertyList = [] for name, c in self.components.iteritems(): prefix = name[:3] if prefix in self.standardPrefixes: self.components[name].visible = False self.components[name].enabled = False def PropertyListInsertItems(self, props): self.propertyList = props def updateSingleProperty(self, wName, propName, newValue): wClass = wName.__class__.__name__ if propName in ['label', 'stringSelection', 'text', 'toolTip'] or propName in self.checkItems: newValue = newValue #getattr(widget, propName) else: newValue = str(newValue) #str(getattr(widget, propName)) if propName in self.checkItems: self.components["chk"+propName].checked = newValue elif propName in self.popItems: self.components["pop"+propName].Clear() if propName == 'stringSelection': for v in widget.items: self.components["pop"+propName].Append(v) else: for v in widget._spec.getAttributes()[propName].values: self.components["pop"+propName].Append(v) try: self.components["pop"+propName].stringSelection = newValue except: # if value is empty or doesn't already exist pass elif propName in ('items', 'userdata') or (wClass == 'TextArea' and propName == 'text'): self.components["fld"+propName].text = newValue else: self.components["fld"+propName].text = newValue def displayProperties(self, wName, wClass): maxy = 0 for theprop in self.standardProps: prop = theprop if prop == "text" and wClass == "TextArea": prop = "textArea" if prop in self.propertyList: vis = True else: vis = False for prefix in self.standardPrefixes: if prefix+prop in self.components.iterkeys(): self.components[prefix+prop].visible = vis self.components[prefix+prop].enabled = vis maxy = max(maxy, self.components[prefix+prop].position[1]) #rint self.components[prefix+prop].name, self.components[prefix+prop].position, self.components[prefix+prop].size, self.components[prefix+prop].GetBestSize() x,y = self.components.Properties.position # get values from one of the standard fields - use backgroundCcolor # for text, field and button sizes # get the size as defined in the resource file, adjust for BestSize tx, ty = self.components.txtbackgroundColor.position tdefx, tdefy = self.components.txtbackgroundColor.size tsx, tsy = self.components.txtbackgroundColor.GetBestSize() ## + (20,10) tx = tx + tdefx - tsx fx, fy = self.components.fldbackgroundColor.position fdefx, fdefy = self.components.fldbackgroundColor.size fsx, fsy = self.components.fldbackgroundColor.GetBestSize() ## + (20,10) fx = fx + fdefx - fsx print fx, fy, fsx, fsy # Color buttons are odd, so use the font button for button positioning bx, by = self.components.fntfont.position bdefx, bdefy = self.components.fntfont.size bsx, bsy = self.components.fntfont.GetBestSize() ## + (20,10) print bx, by, bdefx, bdefy, bsx, bsy # bx = bx + bdefx - bsx bsx = bdefx print bx, by, bsx, bsy y = maxy+fsy if DO_TRICKY_NAME_DERIVATIONS and ('label' in self.propertyList or 'text' in self.propertyList): self.components["chkallowNameLabelVariation"].visible = True self.components["chkallowNameLabelVariation"].enabled = True self.determineNameLabelState(wName) else: self.components["chkallowNameLabelVariation"].visible = False self.components["chkallowNameLabelVariation"].enabled = True self.determineNameLabelState(wName) for propName in self.propertyList: widget = self._comp[wName] if propName in ['label', 'stringSelection', 'text', 'toolTip'] or propName in self.checkItems: value = getattr(widget, propName) else: value = str(getattr(widget, propName)) if propName in self.checkItems: if not propName in self.standardProps: if not "chk"+propName in self.components.iterkeys(): 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 self.components["chk"+propName].visible = True self.components["chk"+propName].checked = value else: self.components["chk"+propName].visible = True self.components["chk"+propName].checked = value elif propName in self.popItems: if not propName in self.standardProps: if not "txt"+propName in self.components.iterkeys(): self.add_field("StaticText", "txt"+propName, (tx, y), (tsx,tsy), propName, "right") else: self.components["txt"+propName].position = (tx, y) self.components["txt"+propName].size = (tsx, tsy) if not "pop"+propName in self.components.iterkeys(): self.add_pop("pop"+propName, (fx, y), (fsx,fsy)) else: self.components["pop"+propName].position = (fx, y) self.components["pop"+propName].size = (fsx, fsy) y += max(tsy, fsy) + 5 self.components["txt"+propName].visible = True self.components["txt"+propName].enabled = True self.components["pop"+propName].visible = True self.components["pop"+propName].enabled = True self.components["pop"+propName].Clear() if propName == 'stringSelection': for v in widget.items: self.components["pop"+propName].Append(v) else: for v in widget._spec.getAttributes()[propName].values: self.components["pop"+propName].Append(v) try: self.components["pop"+propName].stringSelection = value except: # if value is empty or doesn't already exist pass elif propName in ('items', 'userdata') or (wClass == 'TextArea' and propName == 'text'): if not propName in self.standardProps: if not "txt"+propName in self.components.iterkeys(): self.add_field("StaticText", "txt"+propName, (tx, y), (tsx,tsy), propName, "right") else: self.components["txt"+propName].position = (tx, y) self.components["txt"+propName].size = (tsx, tsy) if not "fld"+propName in self.components.iterkeys(): self.add_field("TextArea", "fld"+propName, (fx, y), (fsx,fsy*3), value, "left") else: self.components["fld"+propName].position = (fx, y) self.components["fld"+propName].size = (fsx, fsy*3) y += 3*fsy+5 if wClass == 'TextArea' and propName == 'text': propName = 'textArea' self.components["txt"+propName].visible = True self.components["txt"+propName].enabled = True self.components["fld"+propName].visible = True self.components["fld"+propName].enabled = True self.components["fld"+propName].text = value else: if not propName in self.standardProps: if not "txt"+propName in self.components.iterkeys(): self.add_field("StaticText", "txt"+propName, (tx, y), (tsx,tsy), propName, "right") else: self.components["txt"+propName].position = (tx, y) self.components["txt"+propName].size = (tsx, tsy) if not "fld"+propName in self.components.iterkeys(): self.add_field("TextField", "fld"+propName, (fx, y), (fsx,fsy), value, "left") else: self.components["fld"+propName].position = (fx, y) self.components["fld"+propName].size = (fsx, fsy) if propName == 'file': if not "btn"+propName in self.components.iterkeys(): self.add_btnFile("btn"+propName, (bx, y), (bsx,bsy)) else: self.components["btn"+propName].position = (bx, y) self.components["btn"+propName].size = (bsx, bsy) print "btn"+propName, bx, y, bsx, bsy self.components["btn"+propName].visible = True self.components["btn"+propName].enabled = True # allow extra space for the "file" button y += max(tsy, fsy, bsy) - max(tsy,fsy) y += max(tsy, fsy) + 5 else: # all colors and fonts are "standard" items if propName == 'foregroundColor' or propName == 'backgroundColor': self.components["clr"+propName].visible = True #rint propName, self.components["fld"+propName].text, value #self.components["clr"+propName].backgroundColor = util.colorFromString(value) self.components["txt"+propName].visible = True self.components["txt"+propName].enabled = True if propName == "font": self.components["fld"+propName].visible = False else: self.components["fld"+propName].visible = True self.components["fld"+propName].enabled = True self.components["fld"+propName].text = value ## self.components.wName.text = propName + ":" # KEA 2002-02-23 # I can't remember why this is actually necessary if propName == 'size': width, height = getattr(widget, propName) if wClass not in ['BitmapCanvas', 'HtmlWindow']: bestWidth, bestHeight = widget.GetBestSize() if width == bestWidth: width = -1 if height == bestHeight: height = -1 size = (width, height) value = str(size) self.components["fld"+propName].text = value # this should only display if the attribute is settable # so name, alignment, and others are read-only def on_wComponentList_select(self, event): #print 'selectComponentListEvent: %s\n' % event.GetString() #multicol print self.components.wComponentList.getStringSelection() #multicol print self.components.wComponentList.getStringSelection()[0] #multicol wName, wClass = self.components.wComponentList.getStringSelection()[0].split(" : ") wName, wClass = event.GetString().split(" : ") if self._parent.multipleSelected: return # cannot select from list while in multi-mode self.setValidProps(wClass) self.components.chkallowNameLabelVariation.checked = not DO_TRICKY_NAME_DERIVATIONS self.displayProperties(wName, wClass) self._parent.showSizingHandles(wName) c = self._parent.components[wName] self._parent.startName = wName self._parent.setToolTipDrag(wName, c.position, c.size) def clearComponentList(self): self.components.wComponentList.Clear() self.statusBar.text = '' def clearPropertyList(self): self.PropertyListClear() def displayComponents(self, components): self.components.wComponentList.Freeze() self.components.wComponentList.Clear() if self._parent.multipleSelected: for c in self.multiCompControls: self.components[c].visible = True for c,pref in self._parent.multipleComponents: self.addWidgetToComponentList(self._comp[c]) else: for c in self.multiCompControls: self.components[c].visible = False self._comp = components for c in components.order: #print "display", c, self._parent.isSizingHandle(c) if c not in self._parent.sizingHandleNames and not self._parent.isSizingHandle(c): self.addWidgetToComponentList(components[c]) self.components.wComponentList.Thaw() self.components.wComponentList.Refresh() self.components.wComponentList.Update() def on_close(self, event): self.visible = False parent = self.GetParent() parent.menuBar.setChecked('menuViewPropertyEditor', 0) def on_align_command(self, event): # offset is two x,y pairs # first pair is how far (whether) to move this dimension # second is how much of width to use # all numbers used to multiply the difference between moving comp and base # so (1,0,0,0) means make left X same as base, leave Y unchanged # (1,0,1,0) means make right X same as base, leave Y unchanged # (0,1,0,0.5) means make centre Y same as base, leave X unchanged alignOffsets = {'alignLeft': (1,0,0,0), 'alignRight': (1,0,1, 0), 'alignTop': (0,1,0,0), 'alignBottom': (0,1,0,1), 'alignHorizontalCentres': (1,0,0.5,0), 'alignVerticalCentres': (0,1,0,0.5)} if not self._parent.multipleComponents: return if not event.target.name in alignOffsets.keys(): return BX, BY, SX, SY = alignOffsets[event.target.name] count = 0 for c, pre in self._parent.multipleComponents: x,y = self._comp[c].position sx,sy = self._comp[c].size if count == 0: finalx = x + SX * sx finaly = y + SY * sy else: newx = x + BX * (finalx - SX*sx - x) newy = y + BY * (finaly - SY*sy - y) self._comp[c].position = (newx, newy) count += 1 if count > 0: self._parent.showMultiSizingHandles() def on_equal_command(self, event): # settings is a single X,Y pair # specifies how much of final result comes from base (remainder from original) # so (1,0) means make comp's X size (i.e. width) be same as base's equalSettings = {'equalWidth': (1,0), 'equalHeight': (0,1), 'equalBoth': (1,1)} if not self._parent.multipleComponents: return if not event.target.name in equalSettings.keys(): return # set up Base fraction and Own fraction BX, BY = equalSettings[event.target.name] OX, OY = (1-BX, 1-BY) count = 0 for c, pre in self._parent.multipleComponents: w,h = self._comp[c].size if count == 0: basew = w baseh = h else: neww,newh = (BX*basew + OX*w, BY*baseh+OY*h) self._comp[c].size = (neww, newh) count += 1 if count > 0: self._parent.showMultiSizingHandles() def on_nudge_command(self, event): # Offsets are distance to move in each of X,Y # distance = 1 = 1, 2(,3) = gridsize, 4 = gridsize * gridsize nudgeOffsets = {'nudgeUp': (0,-1), 'nudgeDown': (0,1), 'nudgeLeft': (-1,0), 'nudgeRight': (1,0)} # can be applied in single component mode ## if not self._parent.multipleComponents: ## return if not event.target.name in nudgeOffsets.keys(): return self._parent.nudge( nudgeOffsets[event.target.name], self.components.nudgeDistance.value) def on_distribute_command(self, event): # setting is x,y for which is to change, plus style distributeSettings = {'distHorizEdge': (1,0,'E'), 'distHorizFirstLast': (1,0,'F'), 'distVertEdge': (0,1,'E'), 'distVertFirstLast': (0,1,'F')} if not self._parent.multipleComponents: return if not event.target.name in distributeSettings.keys(): return BX, BY, style = distributeSettings[event.target.name] nameList = [ x[0] for x in self._parent.multipleComponents ] # Calculate First-to-Last. N = len(self._parent.multipleComponents) - 1 # number of gaps if style == "F": if N <= 1: return x1,y1 = self._comp[nameList[0]].position x2,y2 = self._comp[nameList[N]].position if BX*(x2-x1) + BY*(y2-y1) < 0: nameList.reverse() x1,y1 = self._comp[nameList[0]].position x2,y2 = self._comp[nameList[N]].position used = 0 for c in nameList: sx,sy = self._comp[c].size used = used + BX*sx + BY*sy gapSpace = BX*(x2-x1-used+sx) + BY*(y2-y1-used+sy) elif style == 'E': gapSpace = 0 else: return count = 0 for c in nameList: x,y = self._comp[c].position sx,sy = self._comp[c].size if count == 0: basex, basey = (x, y) nextx, nexty = (x+sx, y+sy) else: useup = gapSpace / N N = N-1 gapSpace = gapSpace - useup newx = BX * (nextx+useup) + (1-BX) * x newy = BY * (nexty+useup) + (1-BY) * y nextx, nexty = (newx+sx, newy+sy) self._comp[c].position = (newx, newy) count += 1 if count > 0: self._parent.showMultiSizingHandles() --- NEW FILE: multipropertyEditor.rsrc.py --- {'application':{'type':'Application', 'name':'Template', 'backgrounds': [ {'type':'Background', 'name':'bgTemplate', 'title':'resourceEditor Property Editor', 'size':(416, 619), 'statusBar':1, 'visible':0, 'components': [ {'type':'CheckBox', 'name':'chkallowNameLabelVariation', 'position':(149, 24), 'size':(70, -1), 'label':'Vary', }, {'type':'ImageButton', 'name':'SendToBack', 'position':(8, 244), 'size':(24, 32), 'border':'3d', 'command':'componentSendBack', 'file':'images/send_to_back.png', 'toolTip':'Send component(s) to back', }, {'type':'ImageButton', 'name':'MoveBack', 'position':(32, 244), 'size':(24, 32), 'border':'3d', 'command':'componentMoveBack', 'file':'images/move_back.png', 'toolTip':'Move component(s) towards back', }, {'type':'ImageButton', 'name':'reLayer', 'position':(56, 276), 'size':(32, 32), 'border':'3d', 'command':'componentRelayer', 'file':'images/relayer.png', 'toolTip':'Re-layer components, top-left to bottom right', }, {'type':'ImageButton', 'name':'MoveTogether', 'position':(56, 244), 'size':(32, 32), 'border':'3d', 'command':'componentMoveTogether', 'file':'images/move_together.png', 'toolTip':'Gather components together', }, {'type':'ImageButton', 'name':'MoveForward', 'position':(88, 244), 'size':(24, 32), 'border':'3d', 'command':'componentMoveForward', 'file':'images/move_forward.png', 'toolTip':'Move component(s) towards front', }, {'type':'ImageButton', 'name':'SendToFront', 'position':(112, 244), 'size':(24, 32), 'border':'3d', 'command':'componentBringFront', 'file':'images/send_to_front.png', 'toolTip':'Send component(s) to front', }, {'type':'StaticText', 'name':'Properties', 'position':(214, 6), 'text':'Properties', }, {'type':'StaticText', 'name':'txtname', 'position':(160, 24), 'size':(84, -1), 'alignment':'right', 'text':'name', }, {'type':'TextField', 'name':'fldname', 'position':(250, 20), 'size':(148, -1), }, {'type':'StaticText', 'name':'txtlabel', 'position':(160, 56), 'size':(84, -1), 'alignment':'right', 'text':'Label', }, {'type':'StaticText', 'name':'txttextArea', 'position':(160, 56), 'size':(84, -1), 'alignment':'right', 'text':'Text', }, {'type':'StaticText', 'name':'txttext', 'position':(160, 56), 'size':(84, -1), 'alignment':'right', 'text':'Text', }, {'type':'StaticBox', 'name':'stbAlign', 'position':(194, 59), 'size':(166, 114), 'label':'ALIGN', }, {'type':'TextField', 'name':'fldtext', 'position':(250, 52), 'size':(148, -1), }, {'type':'TextField', 'name':'fldlabel', 'position':(250, 52), 'size':(148, -1), }, {'type':'ImageButton', 'name':'alignTop', 'position':(236, 79), 'size':(24, 24), 'border':'3d', 'command':'align', 'file':'images/align_top.png', 'toolTip':'Align component tops', }, {'type':'TextArea', 'name':'fldtextArea', 'position':(250, 52), 'size':(148, 55), }, {'type':'ImageButton', 'name':'alignVerticalCentres', 'position':(315, 81), 'size':(24, 24), 'border':'3d', 'command':'align', 'file':'images/align_vert_centres.png', 'toolTip':'Align component centres in a vertical stack', }, {'type':'CheckBox', 'name':'chkenabled', 'position':(150, 115), 'size':(80, -1), 'command':'checkedProperty', 'label':'Enabled', }, {'type':'ImageButton', 'name':'alignLeft', 'position':(200, 112), 'size':(24, 24), 'border':'3d', 'command':'align', 'file':'images/align_left.png', 'toolTip':'Align component left edges', }, {'type':'CheckBox', 'name':'chkvisible', 'position':(230, 115), 'size':(80, -1), 'command':'checkedProperty', 'label':'Visible', }, {'type':'ImageButton', 'name':'alignRight', 'position':(270, 112), 'size':(24, 24), 'border':'3d', 'command':'align', 'file':'images/align_right.png', 'toolTip':'Align component right edges', }, {'type':'CheckBox', 'name':'chkchecked', 'position':(310, 115), 'size':(80, -1), 'command':'checkedProperty', 'label':'Checked', }, {'type':'StaticText', 'name':'txtbackgroundColor', 'position':(160, 160), 'size':(84, -1), 'alignment':'right', 'text':'backgroundColor', }, {'type':'ImageButton', 'name':'alignBottom', 'position':(236, 140), 'size':(24, 24), 'border':'3d', 'command':'align', 'file':'images/align_bottom.png', 'toolTip':'Align component bottoms', }, {'type':'ImageButton', 'name':'alignHorizontalCentres', 'position':(314, 139), 'size':(24, 24), 'border':'3d', 'command':'align', 'file':'images/align_horiz_centres.png', 'toolTip':'Align component centres in a horizontal line', }, {'type':'TextField', 'name':'fldbackgroundColor', 'position':(250, 160), 'text':'backgroundColor', }, {'type':'TextField', 'name':'fldforegroundColor', 'position':(250, 135), 'text':'foregroundColor', }, {'type':'Button', 'name':'clrforegroundColor', 'position':(356, 135), 'size':(35, -1), 'command':'color', 'label':'...', }, {'type':'Button', 'name':'clrbackgroundColor', 'position':(356, 160), 'size':(35, -1), 'command':'color', 'label':'...', }, {'type':'StaticText', 'name':'txtforegroundColor', 'position':(160, 140), 'size':(84, -1), 'alignment':'right', 'text':'foregroundColor', }, {'type':'StaticText', 'name':'txtborder', 'position':(160, 215), 'size':(84, -1), 'alignment':'right', 'text':'Border', }, {'type':'Choice', 'name':'popborder', 'position':(238, 210), 'size':(160, -1), 'items':[], }, {'type':'StaticText', 'name':'txtfont', 'position':(160, 240), 'size':(84, -1), 'alignment':'right', 'text':'Font', }, {'type':'TextField', 'name':'fldfont', 'position':(250, 234), 'size':(100, -1), }, {'type':'Button', 'name':'fntfont', 'position':(350, 232), 'size':(55, -1), 'command':'changeFont', 'label':'Font...', }, {'type':'StaticText', 'name':'txtposition', 'position':(150, 265), 'size':(42, -1), 'alignment':'right', 'text':'Position', }, {'type':'StaticBox', 'name':'stbDistribute', 'position':(197, 179), 'size':(166, 101), 'label':'DISTRIBUTE', }, {'type':'ImageButton', 'name':'distHorizEdge', 'position':(215, 199), 'size':(32, 32), 'border':'3d', 'command':'distribute', 'file':'images/dist_horiz_edge.png', 'toolTip':'Distribute horizontally, edge-to-edge', }, {'type':'ImageButton', 'name':'distVertEdge', 'position':(295, 199), 'size':(32, 32), 'border':'3d', 'command':'distribute', 'file':'images/dist_vert_edge.png', 'toolTip':'Distribute vertically, edge-to-edge', }, {'type':'TextField', 'name':'fldposition', 'position':(205, 260), 'size':(68, -1), }, {'type':'ImageButton', 'name':'distHorizFirstLast', 'position':(215, 234), 'size':(32, 32), 'border':'3d', 'command':'distribute', 'file':'images/dist_horiz_space.png', 'toolTip':'Distribute horizontally, first to last', }, {'type':'StaticText', 'name':'txtsize', 'position':(290, 265), 'size':(31, -1), 'alignment':'right', 'text':'Size', }, {'type':'ImageButton', 'name':'distVertFirstLast', 'position':(296, 233), 'size':(32, 32), 'border':'3d', 'command':'distribute', 'file':'images/dist_vert_space.png', 'toolTip':'Distribute vertically, first to last', }, {'type':'TextField', 'name':'fldsize', 'position':(330, 260), 'size':(68, -1), }, {'type':'StaticBox', 'name':'stbEqualize', 'position':(197, 290), 'size':(166, 62), 'label':'EQUALIZE', }, {'type':'ImageButton', 'name':'equalWidth', 'position':(214, 312), 'border':'3d', 'command':'equal', 'file':'images/equal_width.png', 'toolTip':'Equalize heights to those of the first component', }, {'type':'ImageButton', 'name':'equalHeight', 'position':(265, 312), 'size':(32, 32), 'border':'3d', 'command':'equal', 'file':'images/equal_height.png', 'toolTip':'Equalize heights to that of the first component', }, {'type':'ImageButton', 'name':'equalBoth', 'position':(316, 312), 'size':(32, 32), 'border':'3d', 'command':'equal', 'file':'images/equal_both.png', 'toolTip':'Equalize width & height to those of the first component', }, {'type':'ImageButton', 'name':'nudgeDown', 'position':(60, 454), 'size':(18, 24), 'border':'transparent', 'command':'nudge', 'file':'images/nudge_down.png', 'toolTip':'Nudge components down by specified distance', }, {'type':'ImageButton', 'name':'nudgeUp', 'position':(60, 399), 'size':(18, 24), 'border':'transparent', 'command':'nudge', 'file':'images/nudge_up.png', 'toolTip':'Nudge components up by specified distance', }, {'type':'Spinner', 'name':'nudgeDistance', 'position':(51, 430), 'size':(41, -1), 'max':4, 'min':1, 'toolTip':'Distance to nudge components', 'value':1, }, {'type':'ImageButton', 'name':'nudgeRight', 'position':(100, 429), 'size':(18, 24), 'border':'transparent', 'command':'nudge', 'file':'images/nudge_right.png', 'toolTip':'Nudge components to right by specified distance', }, {'type':'ImageButton', 'name':'nudgeLeft', 'position':(23, 430), 'size':(18, 24), 'border':'transparent', 'command':'nudge', 'file':'images/nudge_left.png', 'toolTip':'Nudge components to left by specified distance', }, {'type':'StaticBox', 'name':'stbNudge', 'position':(3, 377), 'size':(141, 130), 'label':'NUDGE', }, {'type':'Button', 'name':'wUpdate', 'position':(10, 518), 'label':'Update', 'toolTip':'Update changes', }, {'type':'List', 'name':'wComponentList', 'position':(5, 20), 'size':(134, 204), 'items':[], }, {'type':'StaticText', 'name':'stcNameClass', 'position':(5, 3), 'text':'Name : Class', }, ] # end components } # end background ] # end backgrounds } } |
From: Alex T. <ale...@us...> - 2005-07-27 21:46:46
|
Update of /cvsroot/pythoncard/PythonCard/tools/resourceEditor In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17725 Added Files: multiresourceEditor.rsrc.py Log Message: Initial check-in for the multi-component resource Editor. --- NEW FILE: multiresourceEditor.rsrc.py --- {'application':{'type':'Application', 'name':'ResEdit', 'backgrounds': [ {'type':'Background', 'name':'bgDrag', 'title':'Resource Editor', 'size':(316, 166), 'style':['resizeable'], 'menubar': {'type':'MenuBar', 'menus': [ {'type':'Menu', 'name':'menuFile', 'label':'&File', 'items': [ {'type':'MenuItem', 'name':'menuFileNew', 'label':'&New...\tCtrl+N', }, {'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':'menuFileRevert', 'label':'Revert', }, {'type':'MenuItem', 'name':'fileSep1', 'label':'-', }, {'type':'MenuItem', 'name':'menuFileRun', 'label':'&Run\tCtrl+R', 'command':'fileRun', }, {'type':'MenuItem', 'name':'menuFileRunWithInterpreter', 'label':'Run with &interpreter\tCtrl+Shift+R', 'command':'fileRunWithInterpreter', }, {'type':'MenuItem', 'name':'menuFileRunOptions', 'label':'Run Options...', 'command':'fileRunOptions', }, {'type':'MenuItem', 'name':'menuFilePreviewDialog', 'label':'Preview Dialog', 'command':'filePreviewDialog', }, {'type':'MenuItem', 'name':'fileSep2', 'label':'-', }, {'type':'MenuItem', 'name':'menuFileExit', 'label':'E&xit\tAlt+X', 'command':'exit', }, ] }, {'type':'Menu', 'name':'menuEdit', 'label':'&Edit', 'items': [ {'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':'editSep1', 'label':'-', }, {'type':'MenuItem', 'name':'menuComponentDuplicate', 'label':'&Duplicate\tCtrl+U', 'command':'componentDuplicate', }, {'type':'MenuItem', 'name':'menuComponentDelete', 'label':'Delete\tCtrl+D', 'command':'componentDelete', }, {'type':'MenuItem', 'name':'componentSep2', 'label':'-', }, {'type':'MenuItem', 'name':'menuEditBackgroundInfo', 'label':'Background Info...', 'command':'editBackgroundInfo', }, {'type':'MenuItem', 'name':'menuEditMenubar', 'label':'Menu Editor...', 'command':'editMenubar', }, {'type':'MenuItem', 'name':'menuEditStrings', 'label':'String Editor...', 'command':'editStrings', }, {'type':'MenuItem', 'name':'menuEditDialogInfo', 'label':'Dialog Info...', 'command':'editDialogInfo', }, ] }, {'type':'Menu', 'name':'menuComponent', 'label':'&Component', 'items': [] }, {'type':'Menu', 'name':'menuOptions', 'label':'&Options', 'items': [ {'type':'MenuItem', 'name':'menuOptionsGridSize', 'label':'Grid Size...', 'command':'optionGridSize', }, {'type':'MenuItem', 'name':'menuOptionsAlignToGrid', 'label':'Align Components to Grid\tCtrl+G', 'checkable':1, }, {'type':'MenuItem', 'name':'menuOptionsShowGridLines', 'label':'Show Grid Lines', 'checkable':1, 'checked':0, }, {'type':'MenuItem', 'name':'componentSep1', 'label':'-', }, {'type':'MenuItem', 'name':'menuComponentSendBack', 'label':'Send to Back\tCtrl+1', 'command':'componentSendBack', }, {'type':'MenuItem', 'name':'menuComponentMoveBack', 'label':'Move Backward\tCtrl+2', 'command':'componentMoveBack', }, {'type':'MenuItem', 'name':'menuComponentMoveForward', 'label':'Move Forward\tCtrl+3', 'command':'componentMoveForward', }, {'type':'MenuItem', 'name':'menuComponentBringFront', 'label':'Bring to Front\tCtrl+4', 'command':'componentBringFront', }, ] }, {'type':'Menu', 'name':'menuView', 'label':'&View', 'items': [ {'type':'MenuItem', 'name':'menuViewAttributes', 'label':'&Resource...', 'command':'displayAttributes', }, {'type':'MenuItem', 'name':'menuViewSep1', 'label':'-', }, {'type':'MenuItem', 'name':'menuViewPropertyEditor', 'label':'Property Editor\tCtrl+P', 'checkable':1, 'checked':1, }, ] }, {'type':'Menu', 'name':'menuHelp', 'label':'&Help', 'items': [ {'type':'MenuItem', 'name':'menuResourceEditorDocumentation', 'label':'&resourceEditor Documentation...\tF1', 'command':'showResourceEditorDocumentation', }, {'type':'MenuItem', 'name':'menuPythonCardDocumentation', 'label':'&PythonCard Documentation...', 'command':'showPythonCardDocumentation', }, {'type':'MenuItem', 'name':'helpSep1', 'label':'-', }, {'type':'MenuItem', 'name':'menuHelpAbout', 'label':'&About resourceEditor...', }, {'type':'MenuItem', 'name':'menuHelpAboutPythonCard', 'label':'About PythonCard...', 'command':'doHelpAboutPythonCard', }, ] }, ] }, 'components': [ ] # end components } # end background ] # end backgrounds } } |
From: Alex T. <ale...@us...> - 2005-07-27 21:46:03
|
Update of /cvsroot/pythoncard/PythonCard/tools/resourceEditor In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17479 Added Files: multiresourceEditor.py Log Message: Initial check-in for the multi-component resource Editor. --- NEW FILE: multiresourceEditor.py --- #!/usr/bin/python """ __version__ = "$Revision: 1.1 $" __date__ = "$Date: 2005/07/27 21:45:54 $" """ # TODO: Start using exceptions! import os, sys, string, copy import pprint import webbrowser import wx from PythonCard import about, clipboard, configuration, dialog, graphic, log from PythonCard import menu, model, registry, resource, util from PythonCard.templates.dialogs import runOptionsDialog [...2166 lines suppressed...] event.skip() except: event.skip() def on_showPythonCardDocumentation_command(self, event): global pythoncard_url webbrowser.open(pythoncard_url) def on_showResourceEditorDocumentation_command(self, event): global resourceeditor_url webbrowser.open(resourceeditor_url) if __name__ == '__main__': # now force the property editor to be enabled #configuration('showPropertyEditor', 1) #configuration('showShell', 1) app = model.Application(ResourceEditor) app.MainLoop() |
From: Alex T. <ale...@us...> - 2005-05-18 22:12:26
|
Update of /cvsroot/pythoncard/PythonCard In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17757 Modified Files: util.py Log Message: Fix silly typo. Index: util.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/util.py,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** util.py 11 May 2005 09:17:21 -0000 1.37 --- util.py 18 May 2005 22:12:17 -0000 1.38 *************** *** 390,394 **** # Protect against the case where one of the parameters is 'None' # e.g. in the resourceEditor before the resource file has been saved ! if not pi: p1 = '' if not p2: p2 = '' (common,l1,l2) = commonpath(pathsplit(p1), pathsplit(p2)) --- 390,394 ---- # Protect against the case where one of the parameters is 'None' # e.g. in the resourceEditor before the resource file has been saved ! if not p1: p1 = '' if not p2: p2 = '' (common,l1,l2) = commonpath(pathsplit(p1), pathsplit(p2)) |
From: Alex T. <ale...@us...> - 2005-05-17 20:34:04
|
Update of /cvsroot/pythoncard/PythonCard/samples/dbBrowser In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16079 Modified Files: dbLogin.py dbLogin.rsrc.py readme.txt Added Files: pysqlite2Browse.py Log Message: Added support for the new version of pySQLite (pysqlite2) Updated the readme.txt (for this and for last year's addition of CSV file support This includes a utility to convert CSV files to pysqlite2 databases, so is an example of how to use pysqlite2 (since the docs are so meagre). --- NEW FILE: pysqlite2Browse.py --- #!/usr/bin/python __version__="$Revision $"[11:-2] __date__="$Date $" __author__="Andy Todd <an...@ha...>" """ Module Name: pysqlite2Browse Description: Plug in for PythonCard application dbBrowse to provide pysqlite2 specific functionality Constant/configuration values are currently maintained in the source code. If we are to optimise this application they should be split into seperate configuration files (as per PythonCard/Webware style guidelines) The structure of this module should be replicated for different RDBMS so that they can be interchanged by dbBrowse - hopefully. """ # AGT 2005-05-17 # see http://www.pysqlite.org # see http://www.hwaci.com/sw/sqlite/faq.html from pysqlite2 import dbapi2 as sqlite import os class browse: # Connection should be a dictionary with at least two keys, # 'databasename' and 'directory' # This is wildly different to other database modules def __init__(self, connection): "Setup the database connection" self._system_tables=[] # Not providing a db name is guaranteed to ruin our connection if not connection['databasename']: raise ValueError filename = os.path.join(connection['directory'], connection['databasename']) # AGT 2005-05-15 single parameter, no mode on connect self._db = sqlite.connect(filename) self._cursor=self._db.cursor() # This one is used in getRow self._tableName='' def getTables(self): "Return a list of all of the non-system tables in <database>" ##stmt = "SELECT table_name FROM __table_names__" stmt = "SELECT name FROM sqlite_master WHERE type='table' ORDER BY name;" self._cursor.execute(stmt) # I'm using a list comprehension here instead of a for loop, # either will do but I think this is more concise (unlike this comment) return [ x[0] for x in self._cursor.fetchall() if x[0] not in self._system_tables ] def getColumns(self, tableName): "Get the definition of the columns in tableName" stmt = "select * from " + tableName self._cursor.execute(stmt) #row = self._cursor.fetchone() columnDefs = [] # AGT 2005-05-15 description is a list of item, not a dict for column in self._cursor.description: columnName = column[0] dataType, nullable, key, default = "varchar", "", "", "" # Dodgy default, but if works for me precision = 255 columnDefs.append((columnName, dataType, precision, nullable, key, default)) return columnDefs def getQueryString(self, tableName): "Return a SQL statement which queries all of the columns in tableName" tableStructure=self.getColumns(tableName) # Construct and return the string stmt='SELECT ' for columnList in tableStructure: stmt+=columnList[0]+', ' stmt=stmt[:-2]+' FROM '+tableName return stmt def getRow(self, tableName): "Get a row from tableName" # When we upgrade to 2.2 this will be a great candidate for a # generator/iterator. In the meantime we use self._tableName to keep # track of what we are doing if tableName!=self._tableName: self._tableName=tableName self._cursor.execute(self.getQueryString(tableName)) try: result = self._cursor.fetchone() except: print "AGT argh" result=[] return result def getRows(self, tableName): "Get all of the rows from tableName" if tableName!=self._tableName: self._tableName=tableName self._cursor.execute(self.getQueryString(tableName)) try: result=self._cursor.fetchall() except: result=[] return result if __name__ == '__main__': # We are in an interactive session so run our test routines # Connect to the database ##connection={ 'databasename':'andy' ## ,'directory':'E:\Gadfly'} print os.getcwd() connection={'databasename':'calflora.db', 'directory':'.'} dbHolder = browse(connection) # Return all of our table names into user_tables user_tables = dbHolder.getTables() # Print out the structure of each table and its first row print "--------------------------------------------------" for table in user_tables: print "table:", table print dbHolder.getQueryString(table) print dbHolder.getRow(table) print "--------------------------------------------------" Index: dbLogin.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/samples/dbBrowser/dbLogin.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** dbLogin.py 4 Sep 2004 11:46:39 -0000 1.11 --- dbLogin.py 17 May 2005 20:33:53 -0000 1.12 *************** *** 18,21 **** --- 18,22 ---- ,'MetaKit': 'metakitBrowse' ,'PySQLite': 'pysqliteBrowse' + ,'PySQLite2': 'pysqlite2Browse' ,'PostgreSQL': 'postgreBrowse' ,'CSV': 'csvBrowse' } *************** *** 42,46 **** self.parent.connection={'databasename':self.components["txtUsername"].text, 'directory':self.components["txtPassword"].text} ! elif self.components.choice.stringSelection == 'PySQLite': self.parent.connection={'databasename':self.components["txtUsername"].text, 'directory':self.components["txtPassword"].text} --- 43,47 ---- 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} *************** *** 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'): self.components.lblUsername.text = 'DB Name' self.components.lblPassword.text = 'DB Directory' --- 90,94 ---- 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' self.components.lblPassword.text = 'DB Directory' Index: readme.txt =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/samples/dbBrowser/readme.txt,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** readme.txt 6 Jul 2003 14:46:43 -0000 1.14 --- readme.txt 17 May 2005 20:33:53 -0000 1.15 *************** *** 1,9 **** Module : dbBrowser Date : 2nd July, 2003 ! Author : Andy Todd <an...@ha...> 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, 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. --- 1,10 ---- Module : dbBrowser Date : 2nd July, 2003 ! Author : Andy Todd <an...@ha...> ! Minor additions: May 17, 2005 Alex Tweedly <al...@tw...> 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. *************** *** 33,37 **** This has only been tested with release candidate 1 of this module. ! Future versions will use different databases. I'm planning to include support for ODBC and possibly csv files. If you would like to add support for another RDBMS please send me an e-mail or post a notice to the mailing list (pyt...@li...). Observations --- 34,43 ---- This has only been tested with release candidate 1 of this module. ! To access PySQLite databases you will need pysqlite installed, either version 1 or 2, get them from: ! http://www.pysqlite.org/ ! ! If you have pysqlite2 installed but don't have any database tables or data, a utility is included with this sample, to create a db from any CSV file. From the scripts directory run "python pysqlite2_from_csv.py". ! ! Future versions will use different databases. I'm planning to include support for ODBC. If you would like to add support for another RDBMS please send me an e-mail or post a notice to the mailing list (pyt...@li...). Observations *************** *** 50,53 **** --- 56,61 ---- Change Notices -------------- + 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. 02.07.2003 - Added PostgreSQL support thanks to Jon Dyte 04.05.2003 - Added dbBrowser2 Index: dbLogin.rsrc.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/samples/dbBrowser/dbLogin.rsrc.py,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** dbLogin.rsrc.py 4 Sep 2004 11:46:39 -0000 1.15 --- dbLogin.rsrc.py 17 May 2005 20:33:53 -0000 1.16 *************** *** 15,19 **** 'name':'choice', 'position':(110, 0), ! 'items':['MySQL', 'Oracle', 'Gadfly', 'MetaKit', 'PySQLite', 'PostgreSQL', 'CSV'], 'stringSelection':'MySQL', }, --- 15,19 ---- 'name':'choice', 'position':(110, 0), ! 'items':['MySQL', 'Oracle', 'Gadfly', 'MetaKit', 'PySQLite', 'PySQLite2', 'PostgreSQL', 'CSV'], 'stringSelection':'MySQL', }, |
From: Alex T. <ale...@us...> - 2005-05-17 20:34:02
|
Update of /cvsroot/pythoncard/PythonCard/samples/dbBrowser/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16079/scripts Added Files: pysqlite2_from_csv.py Log Message: Added support for the new version of pySQLite (pysqlite2) Updated the readme.txt (for this and for last year's addition of CSV file support This includes a utility to convert CSV files to pysqlite2 databases, so is an example of how to use pysqlite2 (since the docs are so meagre). --- NEW FILE: pysqlite2_from_csv.py --- #!/usr/bin/python # Usage: python pysqlite2_sample.py <databaseName> <databaseDirectory> # # Create a SQLite2 database from a CSV file with headers. __author__ = "Alex Tweedly <al...@tw...>" import sys, csv from pysqlite2 import dbapi2 as sqlite # Specify some default values usageString="Usage: python %s <csvfileName> <databaseName> " % sys.argv[0] if __name__=="__main__": if len(sys.argv) > 1: if sys.argv[1] in ("-h","--help") or len(sys.argv) != 3: print usageString sys.exit(0) # There is a database name on the command line csvName=sys.argv[1] dbName=sys.argv[2] db=sqlite.connect(dbName) # We have connected to a database now, lets issue some SQL # There is no error handling here, if anything goes wrong exceptions # will be raised by the MySQLdb package csvReader = csv.reader(file(csvName)) headers = csvReader.next() # clean up headers to ensure they are valid column names # - could do more error checking here - header2 = [ x.replace(' ', '').replace('/', '') for x in headers ] # add a type to each header3 = [ x + " VARCHAR" for x in header2] # and build a single string header4 = ",".join(header3) cursor=db.cursor() stmt="CREATE TABLE sample ( %s ) " % header4 result=cursor.execute(stmt) db.commit() stmt="""CREATE UNIQUE INDEX sample_id ON sample(%s)""" % header2[0] result=cursor.execute(stmt) db.commit() for row in csvReader: stmt=""" INSERT INTO sample ( %s ) VALUES ( %s )""" % (",".join(header2), ",".join(["'" + r + "'" for r in row])) cursor.execute(stmt) db.commit() else: print usageString #sys.exit(0) |
From: Alex T. <ale...@us...> - 2005-05-17 16:36:07
|
Update of /cvsroot/pythoncard/PythonCard In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23413 Modified Files: model.py Log Message: Detect and warn if rsource file is missing. Index: model.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/model.py,v retrieving revision 1.191 retrieving revision 1.192 diff -C2 -d -r1.191 -r1.192 *** model.py 30 Mar 2005 18:07:39 -0000 1.191 --- model.py 17 May 2005 16:35:52 -0000 1.192 *************** *** 172,179 **** --- 172,183 ---- log.debug(filenames) + # AGT 2005-05-17 Detect missing resource file, give some warning; no clean recovery possible. + filename = None for f in filenames: if os.path.exists(f): filename = f break + if not filename: + print "no resource file for", base return filename |
From: Alex T. <ale...@us...> - 2005-05-17 14:25:30
|
Update of /cvsroot/pythoncard/PythonCard/tools/resourceEditor In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27388 Modified Files: resourceEditor.py Log Message: Fix problem of components' size changing unpredictably, by removing old Windows variant code. Index: resourceEditor.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/tools/resourceEditor/resourceEditor.py,v retrieving revision 1.220 retrieving revision 1.221 diff -C2 -d -r1.220 -r1.221 *** resourceEditor.py 13 May 2005 00:16:21 -0000 1.220 --- resourceEditor.py 17 May 2005 14:25:21 -0000 1.221 *************** *** 685,699 **** return ! try: ! # Windows ! xOffset = event.x - self.offset[0] ! yOffset = event.y - self.offset[1] ! except: ! # Mac OS X and Linux/GTK ! #x, y = event.GetPosition() ! globalPosition = wx.GetMousePosition() ! x, y = self.components[self.resizingHandleTarget].ScreenToClient(globalPosition) ! xOffset = x - self.offset[0] ! yOffset = y - self.offset[1] xStartOffset = self.startPosition[0] + e * xOffset --- 685,693 ---- return ! # AGT 2005-05-17 Removed obsolete Windows variant ! globalPosition = wx.GetMousePosition() ! x, y = self.components[self.resizingHandleTarget].ScreenToClient(globalPosition) ! xOffset = x - self.offset[0] ! yOffset = y - self.offset[1] xStartOffset = self.startPosition[0] + e * xOffset |
From: Alex T. <ale...@us...> - 2005-05-13 00:18:08
|
Update of /cvsroot/pythoncard/PythonCard/tools/resourceEditor In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6326 Modified Files: resourceEditor.py Log Message: Add a handler for mouseDoubleClick - and don't use it. Don't know why this is needed - but it prevents the problem that all subsequent events report themselves as coming from the doubleClicked component. Index: resourceEditor.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/tools/resourceEditor/resourceEditor.py,v retrieving revision 1.219 retrieving revision 1.220 diff -C2 -d -r1.219 -r1.220 *** resourceEditor.py 30 Sep 2004 21:16:24 -0000 1.219 --- resourceEditor.py 13 May 2005 00:16:21 -0000 1.220 *************** *** 436,439 **** --- 436,446 ---- #print " self.lastPosition", self.lastPosition + def on_mouseDoubleClick(self, event): + # AGT 2005-05-12 Should be unnecessary - but seems to prevent the problem where a double-click + # was causing subsequent GetEventObjects to "stick" on the button + ##print "dc", event.GetEventObject().GetName() + pass + + def on_mouseDown(self, event): # KEA 2003-03-23 |
Update of /cvsroot/pythoncard/PythonCard/tools/standaloneBuilder/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19409 Modified Files: pic11.jpg pic12.jpg pic23.jpg pic26.jpg pic3.jpg pic9.jpg standaloneBuilder.html Added Files: pic28.jpg Log Message: Screenshots updated to reflect latest changes to UI. Corrected several spelling mistakes in the documentation and added a note about the 'Run...' button. Index: pic3.jpg =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/tools/standaloneBuilder/doc/pic3.jpg,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvs1VJnAF and /tmp/cvsx6ZVEW differ Index: standaloneBuilder.html =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/tools/standaloneBuilder/doc/standaloneBuilder.html,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** standaloneBuilder.html 12 May 2005 08:35:32 -0000 1.3 --- standaloneBuilder.html 12 May 2005 19:36:04 -0000 1.4 *************** *** 3,7 **** <head> <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" /> ! <link rel="stylesheet" type="text/css" href="http://pythoncard.sourceforge.net/PythonCard.css" /> <title>PythonCard standaloneBuilder tool</title> </head> --- 3,7 ---- <head> <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" /> ! <link rel="stylesheet" type="text/css" href="PythonCard.css" /> <title>PythonCard standaloneBuilder tool</title> </head> *************** *** 50,54 **** <p>After filling in any missing information, click the OK button to save your ! preferences for use iin future projects. <h2>Creating a new project</h2> --- 50,54 ---- <p>After filling in any missing information, click the OK button to save your ! preferences for use In future projects. <h2>Creating a new project</h2> *************** *** 97,101 **** containing the items you have specified as making up your project. In this scenario, only those files that you have explicitly listed will be included in the tar file. Also, by ! including your script files explicitly, the usefulness of <i>standaloneBuiler</i> as a general purpose project manager comes into play. You can edit a given script file by simply selecting it in the list and clicking the <i>Edit...</i> button.</p> --- 97,101 ---- containing the items you have specified as making up your project. In this scenario, only those files that you have explicitly listed will be included in the tar file. Also, by ! including your script files explicitly, the usefulness of <i>standaloneBuilder</i> as a general purpose project manager comes into play. You can edit a given script file by simply selecting it in the list and clicking the <i>Edit...</i> button.</p> *************** *** 111,115 **** of the main window can be edited in the same way. Script files will be opened using the program defined as the text editor in preferences. This defaults to the PythonCard code ! editor, but can be changed if required. Files listed uunder the Pixmaps section will be opened using whatever you specify as your default image editor in preferences,</p> --- 111,115 ---- of the main window can be edited in the same way. Script files will be opened using the program defined as the text editor in preferences. This defaults to the PythonCard code ! editor, but can be changed if required. Files listed under the Pixmaps section will be opened using whatever you specify as your default image editor in preferences,</p> *************** *** 166,169 **** --- 166,177 ---- to open a file called <i>readme.txt</i> in the project base folder</p> + <h2>The Run Button</h2> + <p>When clicked, the <i>Run...</i> button executes the main script of your project. It firstly pops + up a small dialog wherein you can specify a number of useful command line options:</p> + <div align="center"><img src="pic28.jpg" /></div> + <p>There must be a reason why this looks suspiciously like the run-time options dialog + from the PythonCard resource editor, but I'm sure I couldn't even begin to guess what + that reason might be... :-)</p> + <h2>The Rebuild button</h2> <p>Clicking this button causes the standalone version of your application to be rebuilt. As *************** *** 171,175 **** The first thing <i>standaloneBuilder</i> does is to remind you about this:</p> <div align="center"><img src="pic17.jpg" /></div> ! <p>The build then proceeds. If all is succesful, the program will tell you where it has stored the installer for the project:</p> <div align="center"><img src="pic18.jpg" /></div> --- 179,183 ---- The first thing <i>standaloneBuilder</i> does is to remind you about this:</p> <div align="center"><img src="pic17.jpg" /></div> ! <p>The build then proceeds. If all is successful, the program will tell you where it has stored the installer for the project:</p> <div align="center"><img src="pic18.jpg" /></div> *************** *** 179,183 **** <p>When the build has completed, the self extracting installer executable can be copied to another Windows machine ad run. The resulting setup wizard looks the same ! as vartually any toher piece of 'professionally' produced software:</p> <div align="center"><img src="pic21.jpg" /></div> <p>The executable itself looks and behaves exactly the same as any other program. This --- 187,191 ---- <p>When the build has completed, the self extracting installer executable can be copied to another Windows machine ad run. The resulting setup wizard looks the same ! as virtually any other piece of 'professionally' produced software:</p> <div align="center"><img src="pic21.jpg" /></div> <p>The executable itself looks and behaves exactly the same as any other program. This *************** *** 190,194 **** and click the Release button. Doing this puts the current release of the project into a <i>frozen</i> state, in which no further changes can be made until you have checked and ! confirmed that the release os okay.</p> <p>The first thing that happens upon clicking the Release button is that a warning dialog --- 198,202 ---- and click the Release button. Doing this puts the current release of the project into a <i>frozen</i> state, in which no further changes can be made until you have checked and ! confirmed that the release is okay.</p> <p>The first thing that happens upon clicking the Release button is that a warning dialog *************** *** 196,200 **** <div align="center"><img src="pic22.jpg" /></div> ! <p>Assuming that you click OK at this point, a number fo things then happen to the project. Firstly, the status gets changed from <i>Open</i> to <i>Frozen</i> and the majority of the controls on the main window get disabled:</p> --- 204,208 ---- <div align="center"><img src="pic22.jpg" /></div> ! <p>Assuming that you click OK at this point, a number of things then happen to the project. Firstly, the status gets changed from <i>Open</i> to <i>Frozen</i> and the majority of the controls on the main window get disabled:</p> *************** *** 210,214 **** click the <i>Release</i> button again. You will be presented with this dialog:</p> <div align="center"><img src="pic24.jpg" /></div> ! <p>Clcik OK to confirm the release. You then have an opportunity to decide what the next version number of your project will be, with the option to override what the program offers as a deafult. In the example shown below I have decided that the next release of the --- 218,222 ---- click the <i>Release</i> button again. You will be presented with this dialog:</p> <div align="center"><img src="pic24.jpg" /></div> ! <p>Click OK to confirm the release. You then have an opportunity to decide what the next version number of your project will be, with the option to override what the program offers as a deafult. In the example shown below I have decided that the next release of the Index: pic12.jpg =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/tools/standaloneBuilder/doc/pic12.jpg,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvsIwLjYL and /tmp/cvsEOsB52 differ Index: pic11.jpg =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/tools/standaloneBuilder/doc/pic11.jpg,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvsRhsPxO and /tmp/cvszPbOG5 differ Index: pic26.jpg =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/tools/standaloneBuilder/doc/pic26.jpg,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvsJpPsMO and /tmp/cvs0pXcX5 differ Index: pic23.jpg =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/tools/standaloneBuilder/doc/pic23.jpg,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvsnj70HR and /tmp/cvs5QbvU8 differ Index: pic9.jpg =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/tools/standaloneBuilder/doc/pic9.jpg,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvsyD0HfU and /tmp/cvswwEZtb differ --- NEW FILE: pic28.jpg --- (This appears to be a binary file; contents omitted.) |
From: Phil E. <l2...@us...> - 2005-05-12 19:34:19
|
Update of /cvsroot/pythoncard/PythonCard/tools/standaloneBuilder In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18897 Modified Files: changelog.txt standaloneBuilder.py Log Message: Now gives a warning message if you try to release a project with the console and/or debug options switched on. Project build number no longer gets updated if you rebuild a frozen project. Pressing cancel in the run options dialog would run the script anyway... :-( Index: changelog.txt =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/tools/standaloneBuilder/changelog.txt,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** changelog.txt 12 May 2005 08:28:09 -0000 1.7 --- changelog.txt 12 May 2005 19:34:04 -0000 1.8 *************** *** 1,8 **** standaloneBuilder version Version 0.1.1 release date TBA -------------------------------------------------------- - Updated documentation to clarify why and when extra scripts might ! need to be added ! - Adding a script now pops up a dialog asking if you want to add the ! matching resource file if one exists - Updated copyright message and removed innacurate list of Pythoncard developers --- 1,14 ---- standaloneBuilder version Version 0.1.1 release date TBA -------------------------------------------------------- + - Now gives a warning message if you try to release a project with + the console and/or debug options switched on + - Project build number no longer gets updated if you rebuild a + frozen project + - Pressing cancel in the run options dialog would run the script + anyway... :-( - Updated documentation to clarify why and when extra scripts might ! need to be added ! - Adding a script now pops up a dialog asking if you want to add the ! matching resource file if one exists - Updated copyright message and removed innacurate list of Pythoncard developers Index: standaloneBuilder.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/tools/standaloneBuilder/standaloneBuilder.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** standaloneBuilder.py 12 May 2005 08:32:50 -0000 1.11 --- standaloneBuilder.py 12 May 2005 19:34:04 -0000 1.12 *************** *** 445,450 **** self.cmdLineArgs['shell'] = result.shell self.cmdLineArgs['otherargs'] = result.otherargs ! ! self.runScript(False) def on_rebuildBtn_mouseClick(self, event): --- 445,449 ---- self.cmdLineArgs['shell'] = result.shell self.cmdLineArgs['otherargs'] = result.otherargs ! self.runScript(False) def on_rebuildBtn_mouseClick(self, event): *************** *** 530,539 **** self.outputWindow.Raise() ! # increment the build number to finish ! build = self.project.getint('Project', 'build') ! build += 1 ! self.project.set('Project', 'build', str(build)) ! self.documentChanged = True ! self.updateStatusBar() def on_releaseBtn_mouseClick(self, event): --- 529,539 ---- self.outputWindow.Raise() ! # if the project is not frozen, increment the build number to finish ! if self.project.get('Project', 'status') == 'open': ! build = self.project.getint('Project', 'build') ! build += 1 ! self.project.set('Project', 'build', str(build)) ! self.documentChanged = True ! self.updateStatusBar() def on_releaseBtn_mouseClick(self, event): *************** *** 541,544 **** --- 541,552 ---- pstatus = self.project.get('Project', 'status') if pstatus == 'open': + # give a warning message if the debug and/or console options + # are switched on in project properties. + if self.project.getboolean('Project', 'console') or self.project.getboolean('Project', 'debug'): + txt = 'Please note that you currently have either the debug and/or the console option(s)' + txt += ' switched on in the properties for this project.\n\nYou might want to switch these off' + txt += ' prior to releasing the final version of your application' + title = 'Project options warning!' + bull = dialog.alertDialog(self, wrap_string(txt, 70), title) # freeze the project ready for release txt = 'This will freeze the current release so that no more changes can ' |