OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

[SOLVED].endExecute() and .dispose() dont seem to work

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API
View previous topic :: View next topic  
Author Message
vladi
General User
General User


Joined: 26 Jun 2012
Posts: 7
Location: Romania

PostPosted: Fri Jul 20, 2012 12:20 am    Post subject: [SOLVED].endExecute() and .dispose() dont seem to work Reply with quote

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
View user's profile Send private message
B Marcelly
Super User
Super User


Joined: 12 May 2004
Posts: 1453
Location: France

PostPosted: Fri Jul 20, 2012 1:57 am    Post subject: Re: .endExecute() and .dispose() dont seem to work Reply with quote

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 / Apache OpenOffice 4.0.1 / LibreOffice 4.1.0
MS-Windows 7 Home SP1
This forum is spammed, use instead Apache OpenOffice forums
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group