From owner-freebsd-libh Sat Oct 13 11:16: 3 2001 Delivered-To: freebsd-libh@freebsd.org Received: from tomts7-srv.bellnexxia.net (tomts7.bellnexxia.net [209.226.175.40]) by hub.freebsd.org (Postfix) with ESMTP id 1CA0137B409 for ; Sat, 13 Oct 2001 11:15:57 -0700 (PDT) Received: from khan.anarcat.dyndns.org ([65.94.128.156]) by tomts7-srv.bellnexxia.net (InterMail vM.4.01.03.16 201-229-121-116-20010115) with ESMTP id <20011013181556.BEVQ2701.tomts7-srv.bellnexxia.net@khan.anarcat.dyndns.org>; Sat, 13 Oct 2001 14:15:56 -0400 Received: from shall.anarcat.dyndns.org (shall.anarcat.dyndns.org [192.168.0.1]) by khan.anarcat.dyndns.org (Postfix) with ESMTP id D0F8D1AC5; Sat, 13 Oct 2001 14:15:49 -0400 (EDT) Received: by shall.anarcat.dyndns.org (Postfix, from userid 1000) id 00BEB20B50; Sat, 13 Oct 2001 14:16:05 -0400 (EDT) Date: Sat, 13 Oct 2001 14:16:05 -0400 From: The Anarcat To: Alexander Langer Cc: Libh Subject: Re: doc/hui Message-ID: <20011013141605.E739@shall.anarcat.dyndns.org> Mail-Followup-To: The Anarcat , Alexander Langer , Libh References: <20011013130619.C739@shall.anarcat.dyndns.org> <20011013194100.A77141@fump.kawo2.rwth-aachen.de> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="gDGSpKKIBgtShtf+" Content-Disposition: inline In-Reply-To: <20011013194100.A77141@fump.kawo2.rwth-aachen.de> User-Agent: Mutt/1.3.22.1i Sender: owner-freebsd-libh@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG --gDGSpKKIBgtShtf+ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat Oct 13, 2001 at 07:41:00PM +0200, Alexander Langer wrote: > Thus spake The Anarcat (anarcat@anarcat.dyndns.org): >=20 > > Now the problem is that this file mentions "boxes". There are no boxes > > in the example (hello world). It is quite confusing. :) >=20 > Yes, boxes have been removed by me about one year ago. Have they been replaced by "containers"? > > hit "eval". :) I have been able to make the box little, only now. But > > it's ackward. And the call is: > > $cmd_cont resize "3 -1" > > Now I don't know, but this is odd. If I make this "1 -1", for example > > the Y dimension shrinks. Not x!!! Why? And what does the -1 *do* > > exactly? And what are the units for these dimensions??? >=20 > -1 has a special meaning if you don't you free placement (=3D=3D arrangin= g) > of widgets. you=3D=3Duse? :) > Arranging means, it raises the sub-widgets to max. possible size, > giving all sub-widgets the same width/height (depending on > if it is arranging horizontally or vertically). Ok. How is that selected? > Now, if you for example want a fixed size of 2 for one widget, > but the others shall be arranged automatically (you can > still use "free" arranging and do everything manually...), > use -1. Now wait a minute... There are 2 "arrangement" here. "free" and "arranging", right? You said: "free placement (=3D=3D arranging) of widgets" and "Arranging means it raises the sub-widgets to max. possible size" but also: "use "free" arranging and do everything manually". "Free arranging", is that "manual" or "automatic"? > So, if you want a fixed height of 2 for example, use > resize "-1 2" =20 > (resize "width height"). But the fun thing is that this will make: "fixed width of 2", and "height max". > If you are using "free" arrangement (I believe you do), not so sure about that. I do not have to resize the widgets I place and they fill up the space unless I tell them so. > using -1 should have NO effect: >=20 > void > HuiQt::Widget::resize(const QSize& to, int is_arranging =3D 0) > { > if (to.width() =3D=3D -1 && to.height() =3D=3D -1) > return; [nitpick mode=3Don] This should be: if (to.width() <=3D -1 && to.height() <=3D -1) return; to make it clearer that this accepts arbitrary negative values. > if (to.width() >=3D 0 && to.height() >=3D 0) { > /* real resize */ > if (qwidget()) > qwidget()->resize(to); > setsize(to); > return; > } > if ((to.width() >=3D 0 || to.height() >=3D 0) && !is_arranging) { > ContainerWidget *cp =3D > dynamic_cast( (Hui::Widget*) parent()); >=20 > GroupWidget *gp =3D > dynamic_cast( (Hui::Widget*) parent()); >=20 > mFixedSize =3D (to.width() < 0) ? to.height() : to.width(= ); interesting.. is this where the "switch" would take place (ie y modifies x and so on)? > /* arrange parent again since we changed the fixed size */ > if (cp !=3D NULL) > cp->arrange(); > if (gp !=3D NULL) > gp->arrange(); > } >=20 > } // HuiQt::Widget::resize Looks fine. > So I don't know what's happening there, it should just do nothing. I think I'm not using "free arranging". > (Note that widgets still have a default size, probably given > by Qt. So if this is the only resize statement you are using > on this widget, it is probably using Qt's default size for > that widget, which is the reason why it shrinks X and not Y :) Again, I do not thing so. Modifying the first param changes y: set cmd_cont [$cons_w container "container"] $cmd_cont resize "3 -1" # the container is now of a given vertical size $cmd_cont resize "5 -1" # the container is now of a bigger vertical size :) > Alex A. --gDGSpKKIBgtShtf+ Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (FreeBSD) Comment: For info see http://www.gnupg.org iEYEARECAAYFAjvIhOQACgkQttcWHAnWiGclhgCfQrKswEBiEl8TKYO5cVVBKTl3 3PEAn0hqs0bgP+IapsLbmJHWyrpTsKg1 =ey2X -----END PGP SIGNATURE----- --gDGSpKKIBgtShtf+-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-libh" in the body of the message