Author: reinhard Date: 2011-06-18 04:17:53 -0500 (Sat, 18 Jun 2011) New Revision: 10322
Modified: trunk/gnue-designer/ trunk/gnue-designer/src/base/Incubator.py trunk/gnue-designer/src/base/document.py trunk/gnue-designer/src/forms/LayoutEditor/LayoutEditor.py trunk/gnue-designer/src/forms/document.py trunk/gnue-designer/src/ui/wx/Instance.py Log: Complete simple form wizard without fatal error. However, labels and entries do not appear. Property changes on: trunk/gnue-designer ___________________________________________________________________ Name: bzr:revision-info - timestamp: 2011-05-19 11:16:36.624000072 -0700 committer: whizman properties: branch-nick: designer + timestamp: 2011-05-27 16:02:56.151999950 -0700 committer: whizman properties: branch-nick: designer Name: bzr:file-ids - src/app/designer.py 8389@3a364389-8fce-0310-8f11-cc363fde16c7:trunk%2Fgnue-designer:src%2Fapp%2Fdesigner.py + src/base/Incubator.py 1368@3a364389-8fce-0310-8f11-cc363fde16c7:trunk%2Fgnue-designer:src%2Fbase%2FIncubator.py src/base/document.py 8929@3a364389-8fce-0310-8f11-cc363fde16c7:trunk%2Fgnue-designer:src%2Fbase%2Fdocument.py src/forms/LayoutEditor/LayoutEditor.py 2348@3a364389-8fce-0310-8f11-cc363fde16c7:trunk%2Fgnue-designer:src%2Fforms%2FLayoutEditor%2FLayoutEditor.py src/forms/document.py 8389@3a364389-8fce-0310-8f11-cc363fde16c7:trunk%2Fgnue-designer:src%2Fforms%2Fdocument.py src/ui/wx/Instance.py 8335@3a364389-8fce-0310-8f11-cc363fde16c7:trunk%2Fgnue-designer:src%2Fui%2Fwx%2FInstance.py Name: bzr:revision-id:v4 - 937 reinhard.muel...@bytewise.at-20100426083744-iq5ahvdxf38ltx6r 938 whizman_software_solutions_www.whizman.com-20110131201023-bmx4kgkf4erlim85 939 whizman_software_solutions_www.whizman.com-20110226005239-cn6eioyybe5p62rh 940 whizman-20110504201148-w669gtbff176vhop 941 whizman-20110505231025-243w4sfxhzqcbzt2 942 whizman-20110509181949-gnbxobve89qk8pr5 943 whizman-20110509204654-xx9cb9tiuszib409 944 whizman-20110519181636-ighctsn5h1uftknz + 937 reinhard.muel...@bytewise.at-20100426083744-iq5ahvdxf38ltx6r 938 whizman_software_solutions_www.whizman.com-20110131201023-bmx4kgkf4erlim85 939 whizman_software_solutions_www.whizman.com-20110226005239-cn6eioyybe5p62rh 940 whizman-20110504201148-w669gtbff176vhop 941 whizman-20110505231025-243w4sfxhzqcbzt2 942 whizman-20110509181949-gnbxobve89qk8pr5 943 whizman-20110509204654-xx9cb9tiuszib409 944 whizman-20110519181636-ighctsn5h1uftknz 945 whizman-20110527230256-kqjr2eb33a29zy9o Name: bzr:text-parents - src/app/designer.py whizman_software_solutions_www.whizman.com-20110131201023-bmx4kgkf4erlim85 + src/base/Incubator.py svn-v3-single1-dHJ1bmsvZ251ZS1kZXNpZ25lcg..:3a364389-8fce-0310-8f11-cc363fde16c7:trunk%2Fgnue-designer:9955 src/base/document.py whizman_software_solutions_www.whizman.com-20110131201023-bmx4kgkf4erlim85 src/forms/LayoutEditor/LayoutEditor.py whizman-20110505231025-243w4sfxhzqcbzt2 src/forms/document.py whizman-20110504201148-w669gtbff176vhop src/ui/wx/Instance.py svn-v3-single1-dHJ1bmsvZ251ZS1kZXNpZ25lcg..:3a364389-8fce-0310-8f11-cc363fde16c7:trunk%2Fgnue-designer:9955 Modified: trunk/gnue-designer/src/base/Incubator.py =================================================================== --- trunk/gnue-designer/src/base/Incubator.py 2011-06-18 09:17:50 UTC (rev 10321) +++ trunk/gnue-designer/src/base/Incubator.py 2011-06-18 09:17:53 UTC (rev 10322) @@ -92,7 +92,10 @@ o.name = name self.document.nameMappings[o.name] = o o._buildObject() - o.dispatch_designer_event('ObjectCreated') + # AttributeError: "'GFDataSource' object has no attribute 'dispatch_designer_event'" + # chicken-and-egg circular-precondition with BaseDocument.__object_created_event + # o.dispatch_designer_event('ObjectCreated') + self.document.onAddedObject(o) if select: o.dispatch_designer_event('ObjectSelected') return o Modified: trunk/gnue-designer/src/base/document.py =================================================================== --- trunk/gnue-designer/src/base/document.py 2011-06-18 09:17:50 UTC (rev 10321) +++ trunk/gnue-designer/src/base/document.py 2011-06-18 09:17:53 UTC (rev 10322) @@ -35,6 +35,7 @@ import os import time import dircache +# TODO: *new* is deprecated in python-2.6, obsoleted in py-3.0 import new # ----------------------------------------------------------------- @@ -330,7 +331,15 @@ self.objectLists[tag] = list return list + # --------------------------------------------------------------- + # On-add-object method needs be called before attr dispatch_designer_event + # --------------------------------------------------------------- + def onAddedObject(self, object): + # See __object_created_event, BaseIncubator.createObject + self.__inventory(object) + self.makeDirty() + # ================================================================ # Private functions # ================================================================ @@ -411,7 +420,7 @@ self.__loadFromBuffer(buffer) self.makeDirty() else: - self.__createEmptyInstance(style) + self.__createEmptyDocument(style) else: if not os.access (location, os.R_OK): @@ -424,7 +433,7 @@ # TODO: Is this right? sys.exit() self.hide() - self.__createEmptyInstance(style) + self.__createEmptyDocument(style) self._path = location self.makeDirty() @@ -609,7 +618,7 @@ self.rootObject = self.loadBuffer(fileHandle) - def __createEmptyInstance(self, style): + def __createEmptyDocument(self, style): self.rootObject = self.loadEmpty(style) self.makeClean() self._isNew = True Modified: trunk/gnue-designer/src/forms/LayoutEditor/LayoutEditor.py =================================================================== --- trunk/gnue-designer/src/forms/LayoutEditor/LayoutEditor.py 2011-06-18 09:17:50 UTC (rev 10321) +++ trunk/gnue-designer/src/forms/LayoutEditor/LayoutEditor.py 2011-06-18 09:17:53 UTC (rev 10322) @@ -65,7 +65,7 @@ self.app = self.document.app - self.page = object + self.page = self.object = object self.block = None self.lastBlock = None self.blockMap = {} @@ -84,7 +84,7 @@ try: self.uidriver = uidriver = self.document.__uidriver except AttributeError: - self.document.__uidriver = self.uidriver = uidriver = UIwxpython.GFUserInterface(self.document, 0) + self.document.__uidriver = self.uidriver = uidriver = UIwxpython.GFUserInterface(self.document, 0, disableSplash=True) # Create a list of all UI widgets @@ -361,7 +361,7 @@ self.drawPage(page) def calcGridSpacing(self): - UIwxpython.initFont(self.panel) + #UIwxpython.initFont(self.panel) maxWidth, maxHeight, maxDescent, maxLeading = [0,0,0,0] @@ -418,7 +418,7 @@ order(255,self.panelColor.Green()+16)[0], order(255,self.panelColor.Blue()+16)[0]) - page.__pointSize = UIwxpython.getPointSize() + page.__pointSize = self.__getPointSize() self.calcGridSpacing() page.walk(self.__drawItem) @@ -708,10 +708,10 @@ def zoomIn(self, event): - size = UIwxpython.getPointSize() + size = self.__getPointSize() if size < 72: size = size + 1 # int(size * 1.05 + .5) - UIwxpython.setPointSize(size) + self.__setPointSize(size) self.calcGridSpacing() self.refreshPage(self.page) self.setFeedback(u_('Adjusting base point size to %spt') % size) @@ -720,9 +720,9 @@ def zoomOut(self, event): - size = UIwxpython.getPointSize() + size = self.__getPointSize() if size > 6: - size = size - 1 # int(size * -1.05) + size = size - 1 # int(size * 0.95) UIwxpython.setPointSize(size) self.calcGridSpacing() self.refreshPage(self.page) @@ -811,7 +811,16 @@ .PopupMenu(self.page._popupMenu, pt) event.Skip() + def __getPointSize(self): + if not hasattr(self, '__pointSize'): + self.__pointSize = wx.NORMAL_FONT.GetPointSize() + return self.__pointSize + def __setPointSize(self, newSize): + self.__pointSize = newSize + return newSize + + class TransparentPanel: def __init__(self, layoutEditor, parent): self.parent = parent Modified: trunk/gnue-designer/src/forms/document.py =================================================================== --- trunk/gnue-designer/src/forms/document.py 2011-06-18 09:17:50 UTC (rev 10321) +++ trunk/gnue-designer/src/forms/document.py 2011-06-18 09:17:53 UTC (rev 10322) @@ -147,8 +147,8 @@ def createEditors(self): # Associate our LayoutEditor with GFPage objects - self.registerEditor(LayoutEditor, 'GFPage') - self.registerEditor(PagePainter, 'GFPage') + #self.registerEditor(LayoutEditor, 'GFPage') # svn-8210/bzr-848 + self.registerEditor(PagePainter, 'GFPage') # one or the other;svn-8290 def createTools(self): @@ -300,9 +300,8 @@ return {'form': baseForm, 'logic': baseForm._logic, 'layout': baseForm._layout, - # AttributeError: "'FormDocument' object has no attribute 'visualEditor'" - 'page': None, # self.visualEditor.page, - 'block': None, # self.visualEditor.block, + 'page': self.GFPage.object, # see ui/wx/Instance.createEditor, forms/PagePainter.init + 'block': None, # saw None tracing 0.5.4 anyway 'object': self._currentObject} Modified: trunk/gnue-designer/src/ui/wx/Instance.py =================================================================== --- trunk/gnue-designer/src/ui/wx/Instance.py 2011-06-18 09:17:50 UTC (rev 10321) +++ trunk/gnue-designer/src/ui/wx/Instance.py 2011-06-18 09:17:53 UTC (rev 10322) @@ -169,6 +169,11 @@ self._editorIcons.Add(icon) object._editorComponent = tool + # Not sure how close this comes to the intentions of bzr-847/svn-8208, + # but it makes the GFPage object available to buildWizardCurrentDict + # [whizman 2011-05-05] + #self.document.visualEditor = tool # more like 0.5 + self.document.__dict__[object._type] = tool ## NotebookCtrl: ##page = self.editNotebook.AddPage(tool, tool._caption, False, iconIndex) _______________________________________________ commit-gnue mailing list commit-gnue@gnu.org https://lists.gnu.org/mailman/listinfo/commit-gnue