Re: More mdi fun
Kenneth Wilcox <[email protected]> Thu, 13 Feb 2003 11:38:26 -0700
| Newsgroups | gmane.comp.lang.delphi.kylix |
|---|---|
| Message-ID | <[email protected]> |
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
i: Integer;
frm: TForm2;
ileft, itop: Integer;
iheight, iwidth: Integer;
begin
ileft := 0;
itop := 0;
iheight := (ClientHeight - Panel1.Height -5) div 2;
iwidth := (ClientWidth -5) div 2;
for i := 0 to pred(MDIChildCount) do // or MDIChildCount -1
begin
if MDIChildren[i] is TForm2 then
begin
frm := (MDIChildren[i] as TForm2);
frm.Top := itop;
frm.Width := iwidth; // for spacing
frm.Height := iheight; // for panel
frm.Left := ileft;
ileft := ileft + frm.Width;
if (ileft + frm.Width -5) > ClientWidth then
begin
ileft := 0;
itop := itop + frm.Height;
end;
end;
end;
At 09:11 AM 02/13/03 -0800, you wrote:
>Woops, help if I set it to be readable eh? :)
>
>tbvertical and tbhorizontal aren't in CLX unfortunately
>
>but I can't use them anyways
>
>I only want to tile certain windows, while leaving others minimized.
>
>
>
> >
> >
> >
> >
> > I get a 403 Forbidden on the first two images and a 404 not found error on
> > the last one
> >
> > Have you tried this
> >
> > TileMode := tbVertical; // or tbHorizontal
> > Tile;
> >
> > you can also do Cascade; and ArrangeIcons; (Don't need to set the tileMode
> > on those)
> >
> > Since I can't see the pictures I'm not sure what you are doing but the
> > screen shots of your app look like you do this.
> >
> > Ken
> >
> >
> > At 08:33 AM 02/13/03 -0800, you wrote:
> >
> >
> > >ok ;)
> > >
> > >This should be simple, but it's resisting me
> > >
> > >I have two forms I want to resize and reposition
> > >http://kychat.sourceforge.net/before_tile.png
> > >
> > >
> > >
> > >// this works fine (once you adjust for any button bars etc
> > >childform.height := mainform.clientheight div 2;
> > >childform.width := mainform.clientheight div 2;
> > >
> > >//but this...
> > >childform.left := 1;
> > >childform.top := 1;
> > >
> > >this _should_ move the form to the top left corner no?
> > >
> > >what happens is that it gives me the right height/width, but for some
> > >reason the
> > >controls inside the form are now off center.
> > >http://kychat.sourceforge.net/after_tile.png
> > >
> > >
> > >but when I click on it, things reseat.
> > >http://kychat.sourceforge.net/before_tile_and_click.png
> > >
> > >
> > >yet, the form's position hasn't budged.
> > >
> > >Any clues?
> > >
> > >
> > >
> > >-------------------------------------------------------
> > >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/
> >
> >
> >
> >
> >
> >
> > -------------------------------------------------------
> > 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 the Yahoo! Terms of Service.
> >
> >
> >
> >
> >
>
>
>
>-------------------------------------------------------
>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/
------------------------ 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/