How floating panel files work
Custom floating panels can be moved, resized, and tabbed together the same way as the floating panels that are built in to Adobe Dreamweaver. Custom floating panels differ from built-in floating panels in the following ways:
- Custom floating panels display in the default gray. Setting the
BGCOLORattribute in theBODYtag has no effect. - All custom floating panels either appear always in front of the Document window or float behind it when inactive, depending on the setting for All Other Floaters in the Panels preferences.
Floating panel files also differ somewhat from other extensions. Unlike other extension files, Adobe Dreamweaver does not load floating panel files into memory at startup unless the floating panels were visible when Adobe Dreamweaver last shut down. If the floating panels were not visible when Adobe Dreamweaver shut down, the files that define them are loaded only when referenced from one of the following functions: dreamweaver.getFloaterVisibility(), dreamweaver.setFloaterVisibility(), or dreamweaver.toggleFloater(). For more information on these functions, see the Adobe Dreamweaver API Reference.
When one of the files inside the Configuration folder calls the dw.getFloaterVisibility(floaterName), dw.setFloaterVisibility(floaterName), or dw.toggleFloater(floaterName) functions, the following events occur:
- If
floaterNameis not one of the reserved floating panel names, Adobe Dreamweaver searches the Configuration/Floaters folder for a file calledfloaterName.htm. (For a complete list of reserved floating panel names, see thedreamweaver.getFloaterVisibility()function in the Adobe Dreamweaver API Reference. IffloaterName.htm is not found, Adobe Dreamweaver searches forfloaterName.html. If no file is found, nothing happens. - If the floating panel file is being loaded for the first time, the
initialPosition()function is called, if it is defined, to determine the floating panel's default position on the screen, and theinitialTabs()function is called, if it is defined, to determine the floating panel's default tab grouping. - The
selectionChanged()anddocumentEdited()functions are called on the assumption that changes probably occurred while the floating panel was hidden. - When the floating panel is visible, the following actions occur:
- When the selection changes, the
selectionChanged()function is called, if it is defined. - When the user makes changes to the document, the
documentEdited()function is called, if it is defined. - Event handlers that are attached to the fields in the floating panel interface execute as the user encounters them. (For example, a button with an
onClickevent handler that executesdw.getDocumentDOM().body.innerHTML=''removes everything between the opening and closingBODYtags in the document when it is clicked.)Floating panels support two special events on the
bodytag:onShow()andonHide().
- When the selection changes, the
- When the user quits Adobe Dreamweaver, the current visibility, position, and tab grouping of the floating panel are saved. The next time Adobe Dreamweaver starts up, it loads the floating panel files for any floating panels that were visible at the last shutdown and displays the floating panels in their last position and tab grouping.