| View previous topic :: View next topic |
| Author |
Message |
vladi General User

Joined: 26 Jun 2012 Posts: 7 Location: Romania
|
Posted: Fri Jul 20, 2012 12:20 am Post subject: [SOLVED].endExecute() and .dispose() dont seem to work |
|
|
Hello,
Third time i come in search for greater knowledge. I have these dialogs and after i use them they dont seem to close after i pressed a button inside them altough i use the dispose and endExecute commands. The code that i use for showing the dialog is this one:
| Code: |
sub HelpMenu
DialogLibraries.loadLibrary("Standard")
oDialog = CreateUnoDialog(DialogLibraries.Standard.Help1)
oDialog.Execute()
oDialog.endExecute()
end sub |
from what i understood from other posts and guides the oDialog.endExecute() function should close my dialog box after i used it.
My dialog box contains multiple buttons that call in several subs. I want to know what is the command for closing the dialog box after i press one of the buttons inside it.
Thanks in advance
Last edited by vladi on Sun Jul 22, 2012 11:55 pm; edited 1 time in total |
|
| Back to top |
|
 |
B Marcelly Super User

Joined: 12 May 2004 Posts: 1414 Location: France
|
Posted: Fri Jul 20, 2012 1:57 am Post subject: Re: .endExecute() and .dispose() dont seem to work |
|
|
Hi,
| vladi wrote: | | Code: |
oDialog.Execute()
oDialog.endExecute() |
from what i understood from other posts and guides the oDialog.endExecute() function should close my dialog box after i used it. |
Not this way.
oDialog.Execute() opens the dialog and your routine HelpMenu is "freezed".
To close the dialog you may :
- click the X on the window dialog
- click an OK or Cancel Button of your dialog
- or within a separate routine called by a control event, run the instruction oDialog.endExecute() before end sub.
When the dialog is closed, OpenOffice will run the instructions after oDialog.Execute().
The code should be like:
| Code: | Private oDialog As Object
sub HelpMenu
DialogLibraries.loadLibrary("Standard")
oDialog = CreateUnoDialog(DialogLibraries.Standard.Help1)
oDialog.Execute()
oDialog.dispose
end sub
sub myEventRoutine(evt As Object)
' ..... do some job here...
oDialog.endExecute()
end sub |
_________________ Bernard
OpenOffice.org 1.1.5 fr / OpenOffice.org 3.4.1 en-US + langpacks, MS-Windows XP Home SP3
This forum is unusable, use instead Apache OpenOffice forums |
|
| Back to top |
|
 |
|