Re: [udk-dev] Addon with modal dialog

2006-10-23 Thread Stephan Bergmann

Andreas,

I guess dev@api.openoffice.org is a better mailing list for this 
question.  Please try and repost there.


-Stephan

Andreas Saeger wrote:
I use the Addons.xcu provided at 
http://wiki.services.openoffice.org/wiki/UNO_component_packaging without 
 node oor:name=Images

and replaced the python-class with my own one:

import uno
import unohelper
import string
from com.sun.star.task import XJobExecutor

class Wavelet( unohelper.Base, XJobExecutor ):
cnt = 0
def __init__( self, ctx ):
Wavelet.cnt +=1
self.ctx = ctx
def __del__(self):
Wavelet.cnt -=1
def trigger( self, args ):
Dlg = 
self.ctx.ServiceManager.createInstance(com.sun.star.awt.UnoControlDialog)
M = 
self.ctx.ServiceManager.createInstance(com.sun.star.awt.UnoControlDialogModel) 



M.Title = args.__repr__() +' '+  str(Wavelet.cnt) +''
Dlg.setModel(M)
Dlg.setVisible(True)
Dlg.execute()

g_ImplementationHelper = unohelper.ImplementationHelper()
g_ImplementationHelper.addImplementation(
Wavelet,
name.vojta.openoffice.Wavelet,
(com.sun.star.task.Job,),)

It executes a most simple awt-dialog, showing a reference-counter and 
the content of the trigger's second param args in the title.
(could not imagine which args are passed. It's the param execute of 
the control's URL service:name.vojta.openoffice.Wavelet?execute)
After installation with package manager of OOo2.0.2(Linux) I can open a 
series of new writer docs, call the modal dialog from unnamed1, 
another instance from unnamed2,... After closing one dialog I can 
access the respective document-view again. Everything works as expected, 
BUT:
All instances of the dialogs are stacked. I can access the last opened 
dialog only.
Another python-addon oooblogger behaves likewise. Calc's C++ solver 
is non-modal and I guess it uses awt.TopWindow rather than 
UnoControlDialog.
I translated some working basic-code to python because I wanted an 
object orientated implementation. It includes dialog-classes for 
selection and navigation across different types of spreadsheet-cells. 
Because my dialogs start with some user-selection and perform selection 
and scolling within the current controller they should be modal in 
respect to the current controller, but they should allow parallel 
inspection of two views as well. So they should not be modal in respect 
to each other.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [udk-dev] Addon with modal dialog

2006-10-23 Thread Laurent Godard

Hi


M.Title = args.__repr__() +' '+  str(Wavelet.cnt) +''
Dlg.setModel(M)
Dlg.setVisible(True)
Dlg.execute()



try commenting the Dlg.execute()

Laurent

--
Laurent Godard [EMAIL PROTECTED] - Ingénierie OpenOffice.org - 
http://www.indesko.com
Nuxeo Enterprise Content Management  http://www.nuxeo.com - 
http://www.nuxeo.org

Livre Programmation OpenOffice.org, Eyrolles 2004-2006

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[udk-dev] Addon with modal dialog

2006-10-22 Thread Andreas Saeger
I use the Addons.xcu provided at 
http://wiki.services.openoffice.org/wiki/UNO_component_packaging without 
 node oor:name=Images

and replaced the python-class with my own one:

import uno
import unohelper
import string
from com.sun.star.task import XJobExecutor

class Wavelet( unohelper.Base, XJobExecutor ):
cnt = 0
def __init__( self, ctx ):
Wavelet.cnt +=1
self.ctx = ctx
def __del__(self):
Wavelet.cnt -=1
def trigger( self, args ):
Dlg = 
self.ctx.ServiceManager.createInstance(com.sun.star.awt.UnoControlDialog)
M = 
self.ctx.ServiceManager.createInstance(com.sun.star.awt.UnoControlDialogModel)


M.Title = args.__repr__() +' '+  str(Wavelet.cnt) +''
Dlg.setModel(M)
Dlg.setVisible(True)
Dlg.execute()

g_ImplementationHelper = unohelper.ImplementationHelper()
g_ImplementationHelper.addImplementation(
Wavelet,
name.vojta.openoffice.Wavelet,
(com.sun.star.task.Job,),)

It executes a most simple awt-dialog, showing a reference-counter and 
the content of the trigger's second param args in the title.
(could not imagine which args are passed. It's the param execute of 
the control's URL service:name.vojta.openoffice.Wavelet?execute)
After installation with package manager of OOo2.0.2(Linux) I can open a 
series of new writer docs, call the modal dialog from unnamed1, 
another instance from unnamed2,... After closing one dialog I can 
access the respective document-view again. Everything works as expected, 
BUT:
All instances of the dialogs are stacked. I can access the last opened 
dialog only.
Another python-addon oooblogger behaves likewise. Calc's C++ solver 
is non-modal and I guess it uses awt.TopWindow rather than UnoControlDialog.
I translated some working basic-code to python because I wanted an 
object orientated implementation. It includes dialog-classes for 
selection and navigation across different types of spreadsheet-cells. 
Because my dialogs start with some user-selection and perform selection 
and scolling within the current controller they should be modal in 
respect to the current controller, but they should allow parallel 
inspection of two views as well. So they should not be modal in respect 
to each other.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]