Shoutbox

[Help] Resizing Windows - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Thread: [Help] Resizing Windows (/showthread.php?tid=62137)

[Help] Resizing Windows by rob_botch on 06-30-2006 at 02:58 PM

I have been recommended to allow the window of my script to be resized. How would I go about doing this? I presume that there is a tag in the xml file.


Any help would be much appreciated.


RE: [Help] Resizing Windows by RaceProUK on 06-30-2006 at 04:01 PM

The schema doesn't seem to allow resizeable windows...

Edit: After more careful examination, yes it does :$


RE: [Help] Resizing Windows by Eljay on 06-30-2006 at 04:28 PM

code:
<Position Width="200" Height="370">       
    <Resizeable Allowed="BothSides">
        <MinWidth>200</MinWidth>
        <MinHeight>370</MinHeight>
    </Resizeable>
</Position>

as a sub element of <Window>
RE: [Help] Resizing Windows by rob_botch on 06-30-2006 at 05:55 PM

Thank you for your help. One more question, though, if I may. How would I get the controls in the window to resize or move with the main window?

Thank you again,


RE: [Help] Resizing Windows by ramik on 06-30-2006 at 06:26 PM

yep, nice question rob_botch.... i want to be able to resize the window i made... waiting for an answer.

there should be (in future relase if not now) some events for window OnEventWindowIdResize(oldsize, new size)
and a way to resize elements in scripts, it will be great.


RE: [Help] Resizing Windows by Eljay on 06-30-2006 at 08:12 PM

example of auto resizing element:

code:
<Element xsi:type="LineElement" Id="BottomLine">
    <Position Top="313" Left="1" Width="188" Height="0">
        <Anchor Horizontal="LeftRightFixed" />
    </Position>
    <Color>
        <GlobalColor>label</GlobalColor>
    </Color>
</Element>

options for Anchor:
Horizontal
-LeftFixed
-RightFixed
-LeftRightFixed
Vertical
-TopFixed
-BottomFixed
-TopBottomFixed
RE: [Help] Resizing Windows by rob_botch on 07-01-2006 at 07:30 AM

Thank you for your help. This code works perfectly for me for horizontal stretching, but the vertical element does not apear to work. Is the syntax the same? As in:

code:
<Anchor Vertical="TopBottomFixed" />

Thank you,


Edit: Sorted now, Thanks!
RE: [Help] Resizing Windows by Eljay on 07-01-2006 at 07:55 AM

yes thats the right syntax, ive tested it here and it works fine

example:
you have a window with width 100 and height 200, and an element that is 20 dlg units away from all sides

code:
<Window Id="TestWnd" Version="1">
    <WindowTmpl />
    <Position Height="200" Width="100">
        <Resizeable Allowed="BothSides">
            <MinWidth>100</MinWidth>
            <MinHeight>200</MinHeight>
        </Resizeable>
    </Position>
    <Elements>
        <Element xsi:type="FigureElement" Id="Background">
            <Position Top="20" Left="20" Width="60" Height="160">
                <Anchor Horizontal="LeftRightFixed" Vertical="TopBottomFixed" />
            </Position>
            <Figure><Rectangle /></Figure>
            <Fill><PlainColor><BaseColor/></PlainColor></Fill>
       </Element>
    </Elements>
</Window>


when this window is resized it will always be 20 dlg units away from all sides.
RE: [Help] Resizing Windows by rob_botch on 07-01-2006 at 07:57 AM

Thank you, yes it works for me too, now. I was being stupid and putting the Horizontal and Vertical components in separate tags! :P


Thank you for your help.


RE: [Help] Resizing Windows by ramik on 07-01-2006 at 11:54 AM

There is a bug in the resize algorithm:
if I set to resize only in vertical, it doesn't work unless I put minWidth too...


RE: [Help] Resizing Windows by RaceProUK on 07-01-2006 at 01:35 PM

It's not a bug: both Min* elements are required children of Position.