From: Kevin A. <ka...@us...> - 2004-10-17 16:39:22
|
Update of /cvsroot/pythoncard/PythonCard/tools/oneEditor In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4080 Modified Files: tabcodeEditor.py Log Message: fixed setResourceFile Index: tabcodeEditor.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/tools/oneEditor/tabcodeEditor.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** tabcodeEditor.py 11 Oct 2004 01:53:25 -0000 1.9 --- tabcodeEditor.py 17 Oct 2004 16:39:13 -0000 1.10 *************** *** 556,562 **** win = model.childWindow(self.components.notebook, codePage.CodePage) self.components.notebook.AddPage(win, "new ...", True) ! self.pages.append( win ) wx.CallAfter(win.newFile) ! self.currentPageNumber = len(self.pages)-1 wx.CallAfter(self.setResourceFile) size = self.pages[-1].size --- 556,562 ---- win = model.childWindow(self.components.notebook, codePage.CodePage) self.components.notebook.AddPage(win, "new ...", True) ! self.pages.append(win) wx.CallAfter(win.newFile) ! self.currentPageNumber = len(self.pages) - 1 wx.CallAfter(self.setResourceFile) size = self.pages[-1].size *************** *** 570,578 **** if (not self.currentPage or self.currentPage.documentPath or ! self.currentDocument.GetModify() ): win = model.childWindow(self.components.notebook, codePage.CodePage) self.components.notebook.AddPage(win, "opening ...", True) ! self.pages.append( win ) self.currentPageNumber = len(self.pages)-1 size = self.pages[-1].size --- 570,578 ---- if (not self.currentPage or self.currentPage.documentPath or ! self.currentDocument.GetModify()): win = model.childWindow(self.components.notebook, codePage.CodePage) self.components.notebook.AddPage(win, "opening ...", True) ! self.pages.append(win) self.currentPageNumber = len(self.pages)-1 size = self.pages[-1].size *************** *** 591,614 **** 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 --- 591,616 ---- if self.currentPageNumber >= 0: self.currentPage = self.pages[self.currentPageNumber] ! self.currentDocument = self.currentPage.components.document ! # KEA self.currentPage is always True, so why the if? ! #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 |