A module which implements a "Qt Designer"-like component for creating WSF dialogs in a web browser.object WsfDialog WsfComponent
A WSF component for creating simple WSF components in a web browser. A Dialog is simply a collection of form elements with small code snippets, which are automatically executed when the content of the element has been modified (or the button been pushed). Such a dialog can be dumped as XML and later loaded again. If the "save" button should be functional, you eighter need to derive your own object from this one or overwrite the method name after instanciating this object. Derived from WsfComponent.
var WsfDialog.xmltree;
The configuration of the dialog, in the format described in format_xml_parse(). All changes are done directly in this data structrue. So there is no need of calling any kind of convertation function in order to keep this structure up to date. Simply call format_xml_dump() on this variable to create an XML file for this dialog (usually this is done in an overloaded save() method.
var WsfDialog.values;
The current values of the elements. If there is an input box "foobar", "values.foobar" can be used to read and modify the value of that input box.
var WsfDialog.edit_mode = 0;
When this variable is set to '1', the dialog is currently in edit mode. Usually applications only allow privelidged users to switch to edit mode. The dirty variable (WsfComponent.dirty) must be set when this variable is changed. Usually the method set_edit_mode() is used to set this variable.
var WsfDialog.edit_current = "";
The name of the element which is open in the editor right now. If this is set to "", the screen with the generic dialog options is displayed. Usually this is only set internally by main() when the user changes the current element in the web frontend.
var WsfDialog.edit_show_xml = 0;
The frontend allows displaying the current XML tree so it can e.g. be copy&pasted to a file. This variable is set to '1' when displaying of the XML tree is currently active.
var WsfDialog.show_edit_button = 0;
Set this to '1' if you want this component to add an 'edit' button to the component. With this button, the user can switch to the editor view at any time. This should be used with care since someone with access to the editor may access any SPL code! Only privelidged users show have access to this feature.
method WsfDialog.set_edit_mode(newmode);
Call this function if you want to switch this component to edit mode (parameter = '1') or back to executing the dialog (parameter = '0').
method WsfDialog.get_html();
Overloaded WsfComponent.get_html().
method WsfDialog.save();
This method is called when the user clicks on the "save" button in the dialog editor. It does nothing in the default implementation. So you need to overload it in a derived object to add this functionality.
method WsfDialog.main();
Overloaded WsfComponent.main().
method WsfDialog.reset_values();
Reset the dialog elements to their default values. This can also be used in the code snippets assigned to the dialog elements. To reset the dialog.
method WsfDialog.import_xml(xmldata);
Overwrite xml data. The argument is the XML text. This might also be called by one of the code snippets attached to dialog elements to switch to another dialog. (E.g. when clicking on a "Next" button.)
method WsfDialog.init(xmldata);
The constructor. The parameter is the XML text containing the dialog configuration. If it is undef (or not specified at all), an empty dialog will be created.
Generated by SPLDOC. | http://www.clifford.at/spl/ |