comparison lwlib/xlwtabs.c @ 442:abe6d1db359e r21-2-36

Import from CVS: tag r21-2-36
author cvs
date Mon, 13 Aug 2007 11:35:02 +0200
parents 8de8e3f6228a
children 1ccc32a20af4
comparison
equal deleted inserted replaced
441:72a7cfa4a488 442:abe6d1db359e
1 /* Tabs Widget for XEmacs. 1 /* Tabs Widget for XEmacs.
2 Copyright (C) 1999 Edward A. Falk 2 Copyright (C) 1999 Edward A. Falk
3 3
4 This file is part of XEmacs. 4 This file is part of XEmacs.
5 5
6 XEmacs is free software; you can redistribute it and/or modify it 6 XEmacs is free software; you can redistribute it and/or modify it
7 under the terms of the GNU General Public License as published by the 7 under the terms of the GNU General Public License as published by the
8 Free Software Foundation; either version 2, or (at your option) any 8 Free Software Foundation; either version 2, or (at your option) any
9 later version. 9 later version.
10 10
11 XEmacs is distributed in the hope that it will be useful, but WITHOUT 11 XEmacs is distributed in the hope that it will be useful, but WITHOUT
12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 for more details. 14 for more details.
15 15
16 You should have received a copy of the GNU General Public License 16 You should have received a copy of the GNU General Public License
17 along with XEmacs; see the file COPYING. If not, write to 17 along with XEmacs; see the file COPYING. If not, write to
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. */ 19 Boston, MA 02111-1307, USA. */
20 20
21 /* Synched up with: Tabs.c 1.27 */ 21 /* Synched up with: Tabs.c 1.27 */
22 22
23 /* 23 /*
24 * Tabs.c - Index Tabs composite widget 24 * Tabs.c - Index Tabs composite widget
25 * 25 *
26 * Author: Edward A. Falk 26 * Author: Edward A. Falk
27 * falk@falconer.vip.best.com 27 * falk@falconer.vip.best.com
653 653
654 /* If top widget changes, need to change stacking order, redraw tabs. 654 /* If top widget changes, need to change stacking order, redraw tabs.
655 * Window system will handle the redraws. 655 * Window system will handle the redraws.
656 */ 656 */
657 657
658 if( tw->tabs.topWidget != curtw->tabs.topWidget ) 658 if( tw->tabs.topWidget != curtw->tabs.topWidget )
659 { 659 {
660 if( XtIsRealized(tw->tabs.topWidget) ) 660 if( XtIsRealized(tw->tabs.topWidget) )
661 { 661 {
662 Widget w = tw->tabs.topWidget ; 662 Widget w = tw->tabs.topWidget ;
663 TabsConstraints tab = (TabsConstraints) w->core.constraints ; 663 TabsConstraints tab = (TabsConstraints) w->core.constraints ;
755 755
756 756
757 /* 757 /*
758 * Return preferred size. Happily accept anything >= our preferred size. 758 * Return preferred size. Happily accept anything >= our preferred size.
759 * (TODO: is that the right thing to do? Should we always return "almost" 759 * (TODO: is that the right thing to do? Should we always return "almost"
760 * if offerred more than we need?) 760 * if offered more than we need?)
761 */ 761 */
762 762
763 static XtGeometryResult 763 static XtGeometryResult
764 TabsQueryGeometry(Widget w, 764 TabsQueryGeometry(Widget w,
765 XtWidgetGeometry *intended, XtWidgetGeometry *preferred) 765 XtWidgetGeometry *intended, XtWidgetGeometry *preferred)
1383 Position y ; 1383 Position y ;
1384 TabsConstraints tab ; 1384 TabsConstraints tab ;
1385 1385
1386 if( !XtIsRealized((Widget)tw)) 1386 if( !XtIsRealized((Widget)tw))
1387 return ; 1387 return ;
1388 1388
1389 /* draw tabs and frames by row except for the top tab, which 1389 /* draw tabs and frames by row except for the top tab, which
1390 * is drawn last. (This is inefficiently written, but should not 1390 * is drawn last. (This is inefficiently written, but should not
1391 * be too slow as long as there are not a lot of rows.) 1391 * be too slow as long as there are not a lot of rows.)
1392 */ 1392 */
1393 1393
1747 } 1747 }
1748 x += w + SPACING ; 1748 x += w + SPACING ;
1749 if (!query_only) 1749 if (!query_only)
1750 tw->tabs.displayChildren++; 1750 tw->tabs.displayChildren++;
1751 } 1751 }
1752 /* If there was only one row, increse the height by TABDELTA */ 1752 /* If there was only one row, increase the height by TABDELTA */
1753 if( ++row == 1 ) 1753 if( ++row == 1 )
1754 { 1754 {
1755 y = TABDELTA ; 1755 y = TABDELTA ;
1756 if( !query_only ) 1756 if( !query_only )
1757 for(i=num_children, childP=tw->composite.children; 1757 for(i=num_children, childP=tw->composite.children;