Hi Ariel,

On 3/3/2010 4:12 PM, Ariel Constenla-Haile wrote:
> On Wednesday 03 March 2010, 10:24, Rony G. Flatscher wrote:
>   
>>> maybe
>>>
>>> ContainerWindow.Toolkit
>>> can do the job
>>>       
>> thank you! Tried that already to no avail yesterday; here is what I did:
>>
>>     * create an emnpty swriter document (named: "oDoc",
>>           o get oDoc's XModel -> getCurrentController() -> getFrame()
>>                 + get its getContainerWindow() -> getPosSize(): this
>>                   contains everything, but the enclosing window/frame
>>                   (the top-level window in Windows having the frame and
>>                   the title bar etc.),
>>                 + get the XWindowPeer interface from the container
>>                   window, then its toolkit and from it the work area,
>>           o get xFrame's parent (assuming that then one could get to the
>>             encompassing frame (window), which works, but the position
>>             information (a Dimension object) has all its members set to 0.
>>
>> Tried to research the OOo docs, the DevGuide and search facilities to
>> get further, but have not been successful.
>>
>> Maybe the route I am taking is false, or I do not see the forest for the
>> trees, or the information is not available via UNO.
>> thank you! Unfortunately, this does not help solve the problem.
>>
>> ---
>>
>> The problem rephrased would be: using UNO, how can one get a hold of the
>> e.g. Windows window in which OOo creates its components, such that one
>> can get the exact window position, width and height?
>>     
> let me see if I get you...
> You want to get the window dimensions including the window decorations (that 
> is: the window border and the window title bar).
>   
Yep!

> You are in the right way searching through the container window: *this* is 
> the 
> system window the frame (where the document is loaded) is initialized with.
>
> The problem is that OOo API does not take into account the window manager 
> hints (window decorations, window border and the window title bar).
>
> The closest I could get was working with the 
> com.sun.star.awt.DeviceInfo.TopInset (in Linux [well, on Fedora with KDE 4.4] 
> this gives me an approximate idea of the window title bar height).
> Nevertheless this gives no idea about the window borders.
>
> Play with this awful example:
> http://arielch.fedorapeople.org/devel/ooo/SystemWindow.tar.gz
> As OOo API can't handle to bring the window to the front, you will have to do 
> it manually (read the comments main method).
>   
Thank you *very* much for that interesting example!

> May be the underlying implementation (the vcl WorkWindow/SystemWindow/Window) 
> knows how to get this data, sure Carsten joins the discussion and gives us 
> some light.
>   
Keeping my fingers crossed.

> You could file a RFE to enhance the com.sun.star.awt.XTopWindow (haha now I 
> see 
> someone [fs in dba33a?] added a com.sun.star.awt.XTopWindow2).
>   
But that one seems not to be available (it cannot be interrogated via
reflection).

---

Yesterday, I went after Java itself to find the missing pieces, i.e. the
title bar inset and the width of the window frames, but was not lucky
(looked in the corner of Toolkit, Robot; being a little pressed with
time, I quickly turned back to UNO, hoping at a pure UNO solution).

---rony





---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org
For additional commands, e-mail: dev-h...@api.openoffice.org

Reply via email to