From owner-freebsd-libh Sat Sep 23 5: 0:37 2000 Delivered-To: freebsd-libh@freebsd.org Received: from usw4.freebsd.org (usw4.freebsd.org [209.180.6.228]) by hub.freebsd.org (Postfix) with ESMTP id C6C9B37B422 for ; Sat, 23 Sep 2000 05:00:34 -0700 (PDT) Received: (from alex@localhost) by usw4.freebsd.org (8.9.3/8.9.3) id HAA26225 for libh@FreeBSD.org; Sat, 23 Sep 2000 07:00:34 -0500 (CDT) (envelope-from alex) Message-Id: <200009231200.HAA26225@usw4.freebsd.org> From: Alexander Langer Date: Sat, 23 Sep 2000 07:00:34 -0500 (CDT) To: libh@FreeBSD.org Subject: cvs commit: libh/lib/hui Hui.cd.cc Hui.hh HuiQt.cc HuiQt.hh Sender: owner-freebsd-libh@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG alex 2000/09/23 07:00:34 CDT Modified files: lib/hui Hui.cd.cc Hui.hh HuiQt.cc HuiQt.hh Log: The second commit to libhui, that gives the first set of functionality to the new ContainerWidget: Moving it and its childs - childs relative to the parent. * Fix constructor for Hui::Position: If called with args, also save these values. I probably broke this when fixing the original version of libh. * ContainerWidget can now create a button and be the parent of that button. * ContainerWidget / GroupWidget are both derived from Hui::Widget. This way we can use Pointer to point to both and cast this pointer to a Container/GroupWidget to do further things. See below. * Every widget (including ContainerWidgets) saves its parent now. It is a pointer to Hui::Widget. Introduce functions to set/get the parent. * If a widget is moved, it checks, if the parent is a Containerwidget (using casts). If so, it moves relative to the parent's position. If not, behave as before (qwidget()->move()). * Widget's now save their position in a seperate variable and do not call translate(qwidget()->position()) to get their position. * ContainerWidget::move() moves all childs again to their old position. (child->move(child->position()). Since Widget::move does this relative to the parent, the child's position is adjusted correctly. * Introduce ContainerWidget::translate() to do some Hui::Position and Qt QPoint translations (as HuiQt::Widget can do, too). * Introduce ContainerWidget::qwidget(), which simply points to the parent's qwidget. Needed for translate(). * Introduce ContainerWidget::real_position(), which gets the REAL position (i.e. on the QWidget) of the Widget. Usually, this would be archived by a call to qwidget()->position(), but since ContainerWidget doesn't have a widget, we must do it this way. While writing this, I wonder if I can't do it in another way (using the QPoint position() function which exists anyways). I'll probably change this. But since this is widget-internal, it doesn't matter. Revision Changes Path 1.7 +23 -1 libh/lib/hui/Hui.cd.cc 1.6 +37 -33 libh/lib/hui/Hui.hh 1.7 +94 -27 libh/lib/hui/HuiQt.cc 1.7 +95 -48 libh/lib/hui/HuiQt.hh To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-libh" in the body of the message