Difference between revisions of "Documentation/DevGuide/Basic/Showing a Dialog"
OOoWikiBot (Talk | contribs) m (Robot: Changing Category:Documentation/Developers Guide/Basic and Dialogs) |
OOoWikiBot (Talk | contribs) m (FINAL VERSION FOR L10N) |
||
Line 6: | Line 6: | ||
|NextPage=Documentation/DevGuide/Basic/Getting the Dialog Model | |NextPage=Documentation/DevGuide/Basic/Getting the Dialog Model | ||
}} | }} | ||
− | {{DISPLAYTITLE:Showing a Dialog }} | + | {{Documentation/DevGuideLanguages|Documentation/DevGuide/Basic/{{SUBPAGENAME}}}} |
+ | {{DISPLAYTITLE:Showing a Dialog }} | ||
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: | 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: | ||
<!--[SOURCE:BasicAndDialogs/ToolkitControls]--> | <!--[SOURCE:BasicAndDialogs/ToolkitControls]--> |
Revision as of 12:34, 15 May 2009
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). |