[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
GNUe Designer form elements display on multiple pages
From: |
Randall Whitman |
Subject: |
GNUe Designer form elements display on multiple pages |
Date: |
Fri, 07 Oct 2011 12:12:23 -0700 |
In current Designer-bzr, with a multiple-page form, an added form element
is displayed on every page, rather than on only its one page. This is
particularly at issue with the FormBuilder wizard, as the form elements
for every page, pile up on the first page.
Partial workaround: Save-As, close, Open-File - after adding form elements.
Not having a resolution at this time, I'll post my current tech notes ...
PagePainter.__objectCreated is multiply registered callback,
bound to different objects.
When an object is created (AddElement) on page-2 (object is descendant of
pg2-GFPage), PagePainter.__objectCreated is called twice, adding the
object's widget to the canvases for both page-1 and page-2, because
the event listener list registered for ObjectSelected events contains
PagePainter.__objectCreated method bound to both of page-1-PagePainter &
page-2-PagePainter, rather than only page-2.
When page2.__objectSelected (PagePainter.__objectSelected bound to page 2)
is registered as a listener of ObjectSelected (PagePainter.init),
nothing removes page1.__objectSelected as a listener, so both are
registered, and upon the event both are called.
Note: PagePainter.register_listeners is an alias of
FormDocument.register_listeners, per EventAware.__init__ .
Compare/contrast with Designer-0.5.4:
D-0.5: one LayoutEditor per form/document/Instance (not per Page),
so LayoutEditor.onCreateObject is registered once for 'ObjectCreated';
in LayoutEditor.onCreateObject, the current page is looked up
by [g]object ancestry/parentage.
D-bzr: a PagePainter per page, so 2 PagePainter objects for the form/doc,
and in the callback list for 'ObjectCreated', PagePainter.__objectCreated
is registered twice (bound to each PagePainter) - in the per document/form
registry (EventController inherited by Document not by PagePainter);
in PagePainter.inventory, the current page on which to add the widget,
is the PagePainter instance itself - but the method is called for all
pages (PagePainter-s).
Randall
- GNUe Designer form elements display on multiple pages,
Randall Whitman <=