*solved* getting window metrics

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

Curtaoa
Just popping in
Just popping in
Posts: 3
Joined: Wed Aug 31, 2011 14:59

*solved* getting window metrics

Postby Curtaoa » Sun Sep 11, 2011 14:37

using

Code: Select all

11/09/2011 00:32:46 (Std)    ---- Version 0.7.5 (Build: Aug 23 2011 Debug Microsoft Windows MSVC++ 8.0 32 bit) ----
11/09/2011 00:32:46 (Std)    ---- Renderer module is: CEGUI::OgreRenderer - Official OGRE based 2nd generation renderer module. ----
11/09/2011 00:32:46 (Std)    ---- XML Parser module is: CEGUI::ExpatParser - Official expat based parser module for CEGUI ----
11/09/2011 00:32:46 (Std)    ---- Image Codec module is: OgreImageCodec - Integrated ImageCodec using the Ogre engine. ----
11/09/2011 00:32:46 (Std)    ---- Scripting module is: None ----


I am trying to get the screen metrics for the renderable part of a FrameWindow, so I created a dummy window (as a StaticImage) within it. At run-time I grab that window and get its position (left scale = 0, top scale = 0) and then recursively figure out its screen coordinates.

Works fine I can drag it around and re-size and everything, except the window claims to be at 0,0 when in fact it is below the title bar. Which is a problem because the parent window claims to have an origin at the upper-left of the title bar (thus "0,0" draws on top of the title bar). I get it, the title bar is not part of the "working" area of the window, but I have not figured out how I am supposed to compute how tall the title bar is, in pixels, to offset the draw area. I tried the look/feel but it only defines corners since the actual height is determined by the font of the label.

So I grabbed the font, and get a height on that, which is a start, but it wasn't the correct offset (and I didn't expect it to be, I would need the framing overhead as well).

So bottom line, what is the proper way to determine the screen position of the renderable area of a frame window? Specifically the top-most visible pixel. Any help would be appreciated

-Curt
Last edited by Curtaoa on Mon Sep 12, 2011 18:02, edited 1 time in total.

User avatar
Kulik
CEGUI Team
Posts: 1382
Joined: Mon Jul 26, 2010 18:47
Location: Czech Republic
Contact:

Re: getting window metrics

Postby Kulik » Sun Sep 11, 2011 15:49

see Window::getOuterRect and InnerRect.


Return to “Help”

Who is online

Users browsing this forum: No registered users and 10 guests