View Single Post
Old 09-18-2008, 03:45 PM   #5
Stoplaughin
A Tundra Mammoth
 
Join Date: Mar 2004
Posts: 60
Interface Author - Click to view interfaces
Default

Quote:
Originally Posted by Savok
I noticed that the pet winodw only resizes horizintally but I didn't see the layout command in there at all. Can you give an example of code?

The pet window is hard coded to only size horizontally. You can emulate the same thing, except the borders that do not size cannot be used to move the window. So you would need a title bar to move it. If you do not want the top of the window to be sizable, you can replace the top border with a title bar that looks like a border.

The basic idea is to create a sizable Screen with a draw template that has borders with zero width and height on the sides you do not want to user to be able to size. You then make a child Screen and anchor it so it fills the parent window. On the child Screen you give it borders on the sides the parent doesn't. Place all your window components inside the child window. In order to move the window the parent window will need a title bar. The title bar is placed underneath the top border. You can specify no top border and make your title bar look like a border, or you can take that into account when drawing your images. One thing you have to remember about sizing windows is that their size comes from the ini file not the size in the XML file. If someone loads your window and the unsizable dimension was different than what your window was made for, they either have to edit their ini file or uncheck "Keep Your Layout" when reloading the UI.

You can find an example at http://www.eqinterface.com/download....php?s=&id=5665. It allows you to size horizontally and vertically, but if you only wanted it to size horizontally you would replace MUI2_WDT_NoTop with:
Code:
<WindowDrawTemplate item="MUI2_WDT_NoTop"> <Background></Background> <Titlebar> <Left>MUI2_A_WndNull</Left> <Middle>MUI2_A_WndHor</Middle> <Right>MUI2_A_WndNull</Right> <OverlapLeft>0</OverlapLeft> <OverlapTop>0</OverlapTop> <OverlapRight>0</OverlapRight> <OverlapBottom>0</OverlapBottom> </Titlebar> <Border> <Top>MUI2_A_WndNull</Top> <Bottom>MUI2_A_WndNull</Bottom> <!-- now only sizable horizontally --> <Left>MUI2_A_WndVer</Left> <Right>MUI2_A_WndVer</Right> <TopLeft>MUI2_A_WndNull</TopLeft> <TopRight>MUI2_A_WndNull</TopRight> <BottomLeft>MUI2_A_WndNull</BottomLeft> <BottomRight>MUI2_A_WndNull</BottomRight> <RightTop>MUI2_A_WndNull</RightTop> <RightBottom>MUI2_A_WndNull</RightBottom> <LeftTop>MUI2_A_WndNull</LeftTop> <LeftBottom>MUI2_A_WndNull</LeftBottom> <OverlapLeft>0</OverlapLeft> <OverlapTop>0</OverlapTop> <OverlapRight>0</OverlapRight> <OverlapBottom>0</OverlapBottom> </Border> </WindowDrawTemplate>
Stoplaughin is offline   Reply With Quote