Date: Sat, 13 Oct 2001 14:16:05 -0400 From: The Anarcat <anarcat@anarcat.dyndns.org> To: Alexander Langer <alex@big.endian.de> Cc: Libh <freebsd-libh@FreeBSD.ORG> Subject: Re: doc/hui Message-ID: <20011013141605.E739@shall.anarcat.dyndns.org> In-Reply-To: <20011013194100.A77141@fump.kawo2.rwth-aachen.de> References: <20011013130619.C739@shall.anarcat.dyndns.org> <20011013194100.A77141@fump.kawo2.rwth-aachen.de>
next in thread | previous in thread | raw e-mail | index | archive | help
--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<ContainerWidget*>( (Hui::Widget*) parent());
>=20
> GroupWidget *gp =3D
> dynamic_cast<GroupWidget*>( (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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20011013141605.E739>
