Difference between revisions of "Documentation/DevGuide/Basic/Showing a Dialog"
m |
|||
Line 31: | Line 31: | ||
End Sub | End Sub | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | The dialog control is created by calling the runtime function <code>CreateUnoDialog()</code> which takes an object as parameter that supports the <idl>com.sun.star.io.XInputStreamProvider</idl> interface. This object provides an input stream that represents an XML description of the dialog. The section [[Documentation/DevGuide/Basic/Advanced Library Organization|Advanced Library Organization]] explains the accessing to the object inside the library hierarchy. The dialog control is shown by calling the <code>execute()</code> method of the <idl>com.sun.star.awt.XDialog</idl> interface. It can be closed by calling <code>endExecute()</code>, or by offering a | + | The dialog control is created by calling the runtime function <code>CreateUnoDialog()</code> which takes an object as parameter that supports the <idl>com.sun.star.io.XInputStreamProvider</idl> interface. This object provides an input stream that represents an XML description of the dialog. The section [[Documentation/DevGuide/Basic/Advanced Library Organization|Advanced Library Organization]] explains the accessing to the object inside the library hierarchy. The dialog control is shown by calling the <code>execute()</code> method of the <idl>com.sun.star.awt.XDialog</idl> interface. It can be closed by calling <code>endExecute()</code>, or by offering a {{button|Cancel}} or {{button|OK}} button on the dialog. For additional information, see [[Documentation/DevGuide/Basic/Programming Dialogs and Dialog Controls|Programming Dialogs and Dialog Controls]]. |
{{PDL1}} | {{PDL1}} | ||
[[Category:Documentation/Developer's Guide/Basic and Dialogs]] | [[Category:Documentation/Developer's Guide/Basic and Dialogs]] |
Latest revision as of 13:01, 18 January 2024
After a dialog has been designed using the dialog editor, a developer wants to show the dialog from within the program code. The necessary steps are shown in the following example:
Sub ShowDialog() Dim oLibContainer As Object, oLib As Object Dim oInputStreamProvider As Object Dim oDialog As Object Const sLibName = "Library1" Const sDialogName = "Dialog1" REM library container oLibContainer = DialogLibraries REM load the library oLibContainer.loadLibrary( sLibName ) REM get library oLib = oLibContainer.getByName( sLibName ) REM get input stream provider oInputStreamProvider = oLib.getByName( sDialogName ) REM create dialog control oDialog = CreateUnoDialog( oInputStreamProvider ) REM show the dialog oDialog.execute() End Sub
The dialog control is created by calling the runtime function CreateUnoDialog()
which takes an object as parameter that supports the com.sun.star.io.XInputStreamProvider interface. This object provides an input stream that represents an XML description of the dialog. The section Advanced Library Organization explains the accessing to the object inside the library hierarchy. The dialog control is shown by calling the execute()
method of the com.sun.star.awt.XDialog interface. It can be closed by calling endExecute()
, or by offering a Cancel or OK button on the dialog. For additional information, see Programming Dialogs and Dialog Controls.
Content on this page is licensed under the Public Documentation License (PDL). |