List Info

Thread: Document is loaded in a background window




Document is loaded in a background window
user name
2006-01-19 13:48:22
Am Donnerstag, 19. Januar 2006 13:16 schrieb Martin Thoma:
> I didn't try it, but perhaps this might help:
>
Document.getCurrentController().getFrame().getContainerWindo
w().toFront()

Thanks, this does the trick! There's only one minor peeve
remaining: The 
message box is displayed in front of the old document, not
in front of the 
new document.

PS: Please put your answers below the quoted text you refer
to.  This makes 
reading discussion threads much easier.

-- 
Dipl.-Phys. Felix E. Klee
Email: fklinuxburg.de (work), felix.kleeinka.de (home)
Tel: +49 721 8307937, Fax: +49 721 8307936
Linuxburg, Goethestr. 15A, 76135 Karlsruhe, Germany

------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribeapi.openoffice.org
For additional commands, e-mail: dev-helpapi.openoffice.org

Document is loaded in a background window
user name
2006-01-19 20:31:21
Felix E. Klee wrote:

> Am Donnerstag, 19. Januar 2006 13:16 schrieb Martin
Thoma:
>> I didn't try it, but perhaps this might help:
>>
Document.getCurrentController().getFrame().getContainerWindo
w().toFront()
> 
> Thanks, this does the trick! There's only one minor
peeve remaining: The 
> message box is displayed in front of the old document,
not in front of the 
> new document.

Oops, if I had seen the answer before I could have saved my
mail. 
Anyway, I already explained why the message box is displayed
in front of
the old document.

If the tip from Martin really works your message box should
appear in
front of the new document if you created it *after* putting
the new
window to front.

Best regards,
Mathias

-- 
Mathias Bauer - OpenOffice.org Application Framework Project
Lead
Please reply to the list only, nospamforMBAgmx.de is
a spam sink.

------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribeapi.openoffice.org
For additional commands, e-mail: dev-helpapi.openoffice.org

Document is loaded in a background window
user name
2006-01-20 14:09:14
Am Donnerstag, 19. Januar 2006 21:31 schrieb Mathias Bauer:
> If the tip from Martin really works your message box
should appear in
         ^^^
What tip?  He explained how things are coded.

> front of the new document if you created it *after*
putting the new
> window to front.

No, unless my memory fails badly on me, it doesn't: Even if
I put the new 
window in front before creating the message box, the message
will appear in 
front of the old window.  But if I add a "Wait 1"
before displaying the 
MsgBox, the message box appears in front of the new window!

The solution in a nutshell (the second "toFront"
is a fallback solution for 
the case that the "Wait 1" trick fails):

  Document = Service.loadComponentFromURL(file,
"_blank", 0, noArgs())
 
Document.getCurrentController().getFrame().getContainerWindo
w().toFront()
  Wait 1
  Msgbox "foo"
 
Document.getCurrentController().getFrame().getContainerWindo
w().toFront()

BTW, as window manager KDE 3.something is employed.

-- 
Dipl.-Phys. Felix E. Klee
Email: fklinuxburg.de (work), felix.kleeinka.de (home)
Tel: +49 721 8307937, Fax: +49 721 8307936
Linuxburg, Goethestr. 15A, 76135 Karlsruhe, Germany

------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribeapi.openoffice.org
For additional commands, e-mail: dev-helpapi.openoffice.org

Document is loaded in a background window
user name
2006-01-20 15:36:55
Felix E. Klee wrote:

> Am Donnerstag, 19. Januar 2006 21:31 schrieb Mathias
Bauer:
>> If the tip from Martin really works your message
box should appear in
>          ^^^
> What tip?  He explained how things are coded.

His tip was: "I didn't try it, but perhaps this might
help:
Document.getCurrentController().getFrame().getContainerWindo
w().toFront()"

>> front of the new document if you created it *after*
putting the new
>> window to front.
> 
> No, unless my memory fails badly on me, it doesn't:
Even if I put the new 
> window in front before creating the message box, the
message will appear in 
> front of the old window.  But if I add a "Wait
1" before displaying the 
> MsgBox, the message box appears in front of the new
window!

This is as I said: the WM works asynchronously so it takes
some time
that the window *really* comes to front. The message box is
a clear
indicator: it always takes the OOo window that has the focus
as its
parent. So if it takes the "old" window this one
obviously still has the
focus because the WM until then didn't move the focus to the
new window.

Ciao,
Mathias

-- 
Mathias Bauer - OpenOffice.org Application Framework Project
Lead
Please reply to the list only, nospamforMBAgmx.de is
a spam sink.

------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribeapi.openoffice.org
For additional commands, e-mail: dev-helpapi.openoffice.org

[1-4]

about | contact  Other archives ( Real Estate discussion Medical topics )