From: Alex T. <ale...@us...> - 2004-10-09 18:31:22
|
Update of /cvsroot/pythoncard/PythonCard/tools/oneEditor In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28112/tools/oneEditor Modified Files: tabcodeEditor.py Log Message: Protect against setResource|File being called before openFile is completed. Index: tabcodeEditor.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/tools/oneEditor/tabcodeEditor.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** tabcodeEditor.py 5 Oct 2004 17:32:54 -0000 1.5 --- tabcodeEditor.py 9 Oct 2004 18:31:08 -0000 1.6 *************** *** 570,592 **** self.components.popComponentNames.items = [] self.components.popComponentEvents.items = [] ! if not self.currentPage: return ! try: ! self.resourceFilename = getResourceFilename(self.currentPage.documentPath) ! self.rsrc = resource.ResourceFile(self.resourceFilename).getResource() ! self.rsrcComponents = {} ! if hasattr(self.rsrc, 'application'): ! components = self.rsrc.application.backgrounds[0].components ! else: ! # CustomDialog ! components = self.rsrc.components ! for c in components: ! self.rsrcComponents[c.name] = c.type ! items = self.rsrcComponents.keys() ! items.sort() ! self.components.popComponentNames.items = items ! except: ! pass def fillEventNames(self, componentName): r = registry.Registry.getInstance() componentType = self.rsrcComponents[componentName] --- 570,601 ---- self.components.popComponentNames.items = [] self.components.popComponentEvents.items = [] ! if self.currentPageNumber >= 0: ! self.currentPage = self.pages[self.currentPageNumber] ! if self.currentPage: ! try: ! self.resourceFilename = getResourceFilename(self.currentPage.documentPath) ! self.rsrc = resource.ResourceFile(self.resourceFilename).getResource() ! self.rsrcComponents = {} ! if hasattr(self.rsrc, 'application'): ! components = self.rsrc.application.backgrounds[0].components ! else: ! # CustomDialog ! components = self.rsrc.components ! for c in components: ! self.rsrcComponents[c.name] = c.type ! items = self.rsrcComponents.keys() ! items.sort() ! self.components.popComponentNames.items = items ! self.components.popComponentNames.visible = True ! self.components.popComponentEvents.visible = False ! return ! except: ! pass ! # no page, or no components on page ! self.components.popComponentNames.visible = False ! self.components.popComponentEvents.visible = False def fillEventNames(self, componentName): + self.components.popComponentEvents.visible = True r = registry.Registry.getInstance() componentType = self.rsrcComponents[componentName] *************** *** 603,608 **** eventNames.append(' ' + e) # should we try and save and restore the current selection? ! if self.components.popComponentEvents.items != eventNames: ! self.components.popComponentEvents.items = eventNames def on_popComponentNames_select(self, event): --- 612,621 ---- eventNames.append(' ' + e) # should we try and save and restore the current selection? ! # AGT 2004-10-09 Changing between two components of same type ! # should reset the even selection ! ## if self.components.popComponentEvents.items != eventNames: ! ## self.components.popComponentEvents.items = eventNames ! self.components.popComponentEvents.items = eventNames ! def on_popComponentNames_select(self, event): |