SeaMonkey:Toolkit Transition:PrefwindowPanes:HowTo: Difference between revisions

no edit summary
No edit summary
Line 18: Line 18:
* ''Edit → (Legacy Prefwindow...)'' opens the old XPFE ''pref.xul''.
* ''Edit → (Legacy Prefwindow...)'' opens the old XPFE ''pref.xul''.


==== 1. Tree items ====
====Tree items====
Edit [http://mxr.mozilla.org/seamonkey/source/suite/common/pref/preferences.xul /suite/common/pref/preferences.xul] (or the respective overlay, if eg. you're migrating a MailNews panel) and set the following attributes on the respective <treeitem>:
Edit [http://mxr.mozilla.org/seamonkey/source/suite/common/pref/preferences.xul /suite/common/pref/preferences.xul] (or the respective overlay, if eg. you're migrating a MailNews panel) and set the following attributes on the respective <treeitem>:


Line 36: Line 36:
To minimize confusion about which panels are migrated and which not, comment out unmigrated treeitems in the new dialog and replace the label in the legacy dialog with "(migrated)". ''This is not done yet in the new dialog!''
To minimize confusion about which panels are migrated and which not, comment out unmigrated treeitems in the new dialog and replace the label in the legacy dialog with "(migrated)". ''This is not done yet in the new dialog!''


==== 2. Panels ====
====Panels====
Old panels were actually "real" documents, loaded into a browser window. New panels are <prefpane> elements, overlayed over the main window. To avoid the global namespace clashes of <script>s mentioned above, SeaMonkey's prefwindow brings along some additional internal handling.
Old panels were actually "real" documents, loaded into a browser window. New panels are <prefpane> elements, overlayed over the main window. To avoid the global namespace clashes of <script>s mentioned above, SeaMonkey's prefwindow brings along some additional internal handling.


Line 106: Line 106:
All reading/writing of preferences is handled by the backend, there is usally no need to instantiate preference interface/service!
All reading/writing of preferences is handled by the backend, there is usally no need to instantiate preference interface/service!


====Call Order for Initialization Code====
====Order of Initialization Code====
* On opening the preferences dialog, the prefwindow binding gets attached to the <prefwindow> element. The toolkit base binding's constructor is executed and dispatches 'paneload' events to any static <prefpane>s.
* On opening the preferences dialog, the prefwindow binding gets attached to the <prefwindow> element. The toolkit base binding's constructor is executed and dispatches 'paneload' events to any static <prefpane>s.
* On changing the panel selection, either by code or tree selection, a 'paneload' event is only dispatched to the new <prefpane> if it hasn't been initialized yet.
* On changing the panel selection, either by code or tree selection, a 'paneload' event is only dispatched to the new <prefpane> if it hasn't been initialized yet.
* These 'paneload' events are processed in the following order:
* These 'paneload' events are processed in the following order:
** SM's derived <prefpane> 'paneload' handler is called, evaluating the <prefpane>'s 'script' attribute. If defined, the <prefpane>'s Startup() function is called, so that <preference> elements can be created dynamically.<br><i style="color:red">Mind that <preference>s are '''not''' initialized yet!</i>
** SeaMonkey's derived <prefpane> 'paneload' handler is called, evaluating the <prefpane>'s 'script' attribute. If defined, the <prefpane>'s Startup() function is called, so that <preference> elements can be created dynamically.<br><i style="color:red">Mind that <preference>s are '''not''' initialized yet!</i>
** Toolkit's <prefpane> 'paneload' handler is called and initializes the <preference> elements, evaluating any 'onsyncfrompreference' handler attributes on elements tied to a <preference>.
** Toolkit's <prefpane> 'paneload' handler is called and initializes the <preference> elements, evaluating any 'onsyncfrompreference' handler attributes on elements tied to a <preference>.
** SM's <prefwindow> 'paneload' handler is called, synchronizing <tree> and <prefpane<.
** SeaMonkey's <prefwindow> 'paneload' handler is called, synchronizing <tree> and <prefpane<.
** Finally, any <prefpane> 'onpaneload' handler attribute is evaluated.
** Finally, any <prefpane> 'onpaneload' handler attribute is evaluated.




<div style="font-size:smaller; direction: rtl;">''Page maintained by [mailto:mnyromyr@tprac.de Karsten Düsterloh]''</div>
<div style="font-size:smaller; direction: rtl;">''Page maintained by [mailto:mnyromyr@tprac.de Karsten Düsterloh]''</div>
235

edits