Re: More mdi fun

"Brian" <[email protected]> Thu, 13 Feb 2003 10:55:24 -0800 (PST)
Newsgroups gmane.comp.lang.delphi.kylix
Message-ID <[email protected]>
after some digging, it appears that left is always reverting back to 2 and
top is reverting to 23. in the child windows that is

Very weird.


>
>
>
>
> OK, I think what you need to do is something like this
>
> childform - I'm assuming this is a variable you use to create all your
> forms? Since this is only one var it may not be pointing to the right
> child
> form
>
> You might want to try something like this - it works with Delphi cause
> that's what I have at work (I wish it was Kylix).
>
> Note: This only works with 4 forms, if you have more than that you have to
> change the divisor (2).
> (eg. if you have 9 forms change it to 3)
>
> var
> &nbsp;&nbsp; i: Integer;
> &nbsp;&nbsp; frm: TForm2;
> &nbsp;&nbsp; ileft, itop: Integer;
> &nbsp;&nbsp; iheight, iwidth: Integer;
> begin
> &nbsp;&nbsp; ileft := 0;
> &nbsp;&nbsp; itop := 0;
> &nbsp;&nbsp; iheight := (ClientHeight - Panel1.Height -5) div 2;
> &nbsp;&nbsp; iwidth := (ClientWidth -5) div 2;
> &nbsp;&nbsp; for i := 0 to pred(MDIChildCount) do // or MDIChildCount -1
> &nbsp;&nbsp; begin
> &nbsp;&nbsp;&nbsp;&nbsp; if MDIChildren[i] is TForm2 then
> &nbsp;&nbsp;&nbsp;&nbsp; begin
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; frm := (MDIChildren[i] as TForm2);
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; frm.Top := itop;
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; frm.Width := iwidth; // for spacing
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; frm.Height := iheight; // for panel
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; frm.Left := ileft;
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ileft := ileft + frm.Width;
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (ileft + frm.Width -5) &gt;
> ClientWidth then
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ileft := 0;
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; itop := itop +
> frm.Height;
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;
> &nbsp;&nbsp;&nbsp;&nbsp; end;
> &nbsp;&nbsp; end;
>
> At 09:11 AM 02/13/03 -0800, you wrote:
> &gt;Woops, help if I set it to be readable eh? :)
> &gt;
> &gt;tbvertical and tbhorizontal aren't in CLX unfortunately
> &gt;
> &gt;but I can't use them anyways
> &gt;
> &gt;I only want to tile certain windows, while leaving others minimized.
> &gt;
> &gt;
> &gt;
> &gt; &gt;
> &gt; &gt;
> &gt; &gt;
> &gt; &gt;
> &gt; &gt; I get a 403 Forbidden on the first two images and a 404 not
> found error on
> &gt; &gt; the last one
> &gt; &gt;
> &gt; &gt; Have you tried this
> &gt; &gt;
> &gt; &gt; &amp;nbsp;&amp;nbsp; TileMode := tbVertical; // or tbHorizontal
> &gt; &gt; &amp;nbsp;&amp;nbsp; Tile;
> &gt; &gt;
> &gt; &gt; you can also do Cascade; and ArrangeIcons; (Don't need to set
> the tileMode
> &gt; &gt; on those)
> &gt; &gt;
> &gt; &gt; Since I can't see the pictures I'm not sure what you are doing
> but the
> &gt; &gt; screen shots of your app look like you do this.
> &gt; &gt;
> &gt; &gt; Ken
> &gt; &gt;
> &gt; &gt;
> &gt; &gt; At 08:33 AM 02/13/03 -0800, you wrote:
> &gt; &gt;
> &gt; &gt;
> &gt; &gt; &amp;gt;ok ;)
> &gt; &gt; &amp;gt;
> &gt; &gt; &amp;gt;This should be simple, but it's resisting me
> &gt; &gt; &amp;gt;
> &gt; &gt; &amp;gt;I have two forms I want to resize and reposition
> &gt; &gt; &amp;gt;http://kychat.sourceforge.net/before_tile.png
> &gt; &gt; &amp;gt;
> &gt; &gt; &amp;gt;
> &gt; &gt; &amp;gt;
> &gt; &gt; &amp;gt;// this works fine (once you adjust for any button bars
> etc
> &gt; &gt; &amp;gt;childform.height := mainform.clientheight div 2;
> &gt; &gt; &amp;gt;childform.width := mainform.clientheight div 2;
> &gt; &gt; &amp;gt;
> &gt; &gt; &amp;gt;//but this...
> &gt; &gt; &amp;gt;childform.left := 1;
> &gt; &gt; &amp;gt;childform.top := 1;
> &gt; &gt; &amp;gt;
> &gt; &gt; &amp;gt;this _should_ move the form to the top left corner no?
> &gt; &gt; &amp;gt;
> &gt; &gt; &amp;gt;what happens is that it gives me the right height/width,
> but for some
> &gt; &gt; &amp;gt;reason the
> &gt; &gt; &amp;gt;controls inside the form are now off center.
> &gt; &gt; &amp;gt;http://kychat.sourceforge.net/after_tile.png
> &gt; &gt; &amp;gt;
> &gt; &gt; &amp;gt;
> &gt; &gt; &amp;gt;but when I click on it, things reseat.
> &gt; &gt; &amp;gt;http://kychat.sourceforge.net/before_tile_and_click.png
> &gt; &gt; &amp;gt;
> &gt; &gt; &amp;gt;
> &gt; &gt; &amp;gt;yet, the form's position hasn't budged.
> &gt; &gt; &amp;gt;
> &gt; &gt; &amp;gt;Any clues?
> &gt; &gt; &amp;gt;
> &gt; &gt; &amp;gt;
> &gt; &gt; &amp;gt;
> &gt; &gt; &amp;gt;-------------------------------------------------------
> &gt; &gt; &amp;gt;Forum / mailing list for Borland Kylix programmers
> &gt; &gt; &amp;gt;Our web page:&amp;nbsp;
> http://groups.yahoo.com/group/kylixgroup
> &gt; &gt; &amp;gt;To join the forum: [email protected]
> &gt; &gt; &amp;gt;To unsubscribe:&amp;nbsp;
> [email protected]
> &gt; &gt; &amp;gt;To post your
> messages:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
> &gt; &gt; [email protected]
> &gt; &gt; &amp;gt;To contact the moderator:&amp;nbsp;
> [email protected]
> &gt; &gt; &amp;gt;-------------------------------------------------------
> &gt; &gt; &amp;gt;
> &gt; &gt; &amp;gt;Your use of Yahoo! Groups is subject to
> &gt; &gt; http://docs.yahoo.com/info/terms/
> &gt; &gt;
> &gt; &gt;
> &gt; &gt;
> &gt; &gt;
> &gt; &gt;
> &gt; &gt;
> &gt; &gt; -------------------------------------------------------
> &gt; &gt; Forum / mailing list for Borland Kylix programmers
> &gt; &gt; Our web page:&amp;nbsp; http://groups.yahoo.com/group/kylixgroup
> &gt; &gt; To join the forum: [email protected]
> &gt; &gt; To unsubscribe:&amp;nbsp; [email protected]
> &gt; &gt; To post your
> messages:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
> &gt; &gt; [email protected]
> &gt; &gt; To contact the moderator:&amp;nbsp; [email protected]
> &gt; &gt; -------------------------------------------------------
> &gt; &gt;
> &gt; &gt;
> &gt; &gt;
> &gt; &gt; Your use of Yahoo! Groups is subject to the Yahoo! Terms of
> Service.
> &gt; &gt;
> &gt; &gt;
> &gt; &gt;
> &gt; &gt;
> &gt; &gt;
> &gt;
> &gt;
> &gt;
> &gt;-------------------------------------------------------
> &gt;Forum / mailing list for Borland Kylix programmers
> &gt;Our web page:&nbsp; http://groups.yahoo.com/group/kylixgroup
> &gt;To join the forum: [email protected]
> &gt;To unsubscribe:&nbsp; [email protected]
> &gt;To post your messages:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
> [email protected]
> &gt;To contact the moderator:&nbsp; [email protected]
> &gt;-------------------------------------------------------
> &gt;
> &gt;Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
>
>
>
>
>
>
> -------------------------------------------------------
> Forum / mailing list for Borland Kylix programmers
> Our web page:&nbsp; http://groups.yahoo.com/group/kylixgroup
> To join the forum: [email protected]
> To unsubscribe:&nbsp; [email protected]
> To post your messages:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
> [email protected]
> To contact the moderator:&nbsp; [email protected]
> -------------------------------------------------------
>
>
>
> Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
>
>
>
>
>


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Get 128 Bit SSL Encryption!
http://us.click.yahoo.com/FpY02D/vN2EAA/xGHJAA/i7folB/TM
---------------------------------------------------------------------~->

-------------------------------------------------------
Forum / mailing list for Borland Kylix programmers
Our web page:  http://groups.yahoo.com/group/kylixgroup
To join the forum: [email protected]
To unsubscribe:  [email protected]
To post your messages:       [email protected]
To contact the moderator:  [email protected]
------------------------------------------------------- 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/