FrameWindow Sizing

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

daves
Home away from home
Home away from home
Posts: 253
Joined: Thu Feb 02, 2006 20:12

FrameWindow Sizing

Postby daves » Mon Sep 24, 2007 14:01

What is the correct way to size a framewindow and size/position its contents to account for the size of the TitleBar and the Frame? If I place a child of the framewindow at Left/Top = CEGUI::UDim(0.0, 0)/CEGUI::UDim(0.0, 0) this will overlap the TitleBar. Also if I set the size of the framewindow to be equal to the total size of all its children I will actually see the framewindow overlap the children. So I need to set the FrameWindow height to be the height of the children plus the height of the titlebar. Is there an easy way to handle these kinds of things?

Can someone please point me to some sample code that will deal with size/placement of the framewindow children, and the size of the framewindow in a fashion that does not have the titlebar interfere with other children of the frame?

Thanks in advance.

Rackle
CEGUI Team (Retired)
Posts: 534
Joined: Mon Jan 16, 2006 11:59
Location: Montréal

Postby Rackle » Mon Sep 24, 2007 17:15

You could query the auto created child TitleBar of a FrameWindow and offset your widgets accordingly. Something like:

Code: Select all

myFrameWindow = createWindow();
myTitlebar = myFrameWindow->getChildItem("TitleBar");
URect titlebarArea= myTitlebar->getArea();
myFirstWidget = createWindow();
myFirstWidget->setPosition( the Y coordinate is based on URect.yBottom or URect.height);


Naturally this won't compile and I'm bound to have used the wrong functions, especially that getChildItem().


Return to “Help”

Who is online

Users browsing this forum: Baidu [Spider] and 4 guests