Re: [framework-dev] MacOsX & LayoutManager & macro

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: [framework-dev] MacOsX & LayoutManager & macro

Carsten Driesner-3
On 13.09.2010 17:01, Laurent Godard wrote:

 >Hi all
 >
 >i have a macro running and i want to deactivate OOo while it is running,
 >so that the user can't activate any menu nor click inside the sheet
 >
 >under windows & linux, it works using
 >thisComponent.CurrentController.Frame.ContainerWindow.Enable = False
 >
 >But under macosX, the main menus (File, Edit, ...) are still active
 >
 >I tried adding
 >oLayout = ThisComponent.CurrentController.getFrame.LayoutManager
 >oLayout.HideElement("private:resource/menubar/menubar/")
 >and it works under linux and  windows, the main menus disappear
 >
 >But no success under MacOsX i think due to menus detached of the OOo
 >document window
 >
 >is there any trick to lock OOo main menu under macOsX ?
 >(the best would be cross-plateform compatible ;) )

Hi Laurent,

I am not very familiar with the MacOS implementation of VCL. Contrary to
the other platforms VCL uses a system-menu on Mac (normally a self-drawn
menu is used). May be this is the root cause of the difficulties you
currently see. Unfortunately Philipp, who knows VCL and the Mac
specialties much better, is in vacation. I don't know any way to
circumvent this "special" implementation detail. May be Philipp can help
you when he is back from vacation.

Regards,
Carsten

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [framework-dev] MacOsX & LayoutManager & macro

Laurent Godard-4
Hi Carsten

>>i have a macro running and i want to deactivate OOo while it is running,
>>so that the user can't activate any menu nor click inside the sheet
>>

I tried an alternate way using OOoBasic dialogs

the .execute() method is usualy modal so the entire OOo is deactivated

But, as I want to update a progress bar in the dialog, i use a
com.sun.star.awt.AsyncCallback and a com.sun.star.awt.XCallback inside a
WindowListener

public function onWindowListener_windowShown(evt)

This works pretty well under windows and linux
and is safer in case my macro crashes (no potential lock as in my
previous mail)

Unfortunatelly, testing under MacOsX leads to the previous problem
The dialog and progress bar, works
the sheet is deactivated, ok
but the OOo top level menus remain active, not ok

(btw, same probleme on legacy OOoDialog.execute() without any callback
trick -  a simple OOoDialog is not modal)

I think it  is a problem in OOo's MacOsX implementation as OOoBasic
Dialog are not modal regarding those menus

Is there any trick i could use or something i'm doing wrong ?
Should I open an issue ?

Thanks in advance

Laurent



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]