1 /* Tabs Widget for XEmacs.
2 Copyright (C) 1999 Edward A. Falk
4 This file is part of XEmacs.
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
8 Free Software Foundation; either version 2, or (at your option) any
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
13 FITNESS FOR A PARTICULAR PURPOSE. See 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
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. */
22 * This widget manages one or more child widgets, exactly one of which is
23 * visible. Above the child widgets is a graphic that looks like index
24 * tabs from file folders. Each tab corresponds to one of the child widgets.
25 * By clicking on a tab, the user can bring the corresponding widget to
26 * the top of the stack.
33 #include <X11/Constraint.h>
36 /***********************************************************************
38 * Tabs Widget (subclass of CompositeClass)
40 ***********************************************************************/
44 Name Class RepType Default Value
45 ---- ----- ------- -------------
46 font Font XFontStruct* XtDefaultFont
47 internalWidth Width Dimension 4 *1
48 internalHeight Height Dimension 2 *1
49 topWidget TopWidget Widget *2
50 highlightWidget HighlightWidget Widget 4
51 callback Callback XtCallbackList NULL *3
52 popdownCallback Callback XtCallbackList NULL *4
53 selectInsensitive SelectInsensitive Boolean True *5
54 beNiceToColormap BeNiceToColormap Boolean False *6
55 topShadowContrast TopShadowContrast int 20
56 bottomShadowContrast BottomShadowContrast int 40
57 insensitiveContrast InsensitiveContrast int 33 *7
59 background Background Pixel XtDefaultBackground
60 border BorderColor Pixel XtDefaultForeground
61 borderWidth BorderWidth Dimension 1
62 destroyCallback Callback Pointer NULL
63 hSpace HSpace Dimension 4
64 height Height Dimension 0
65 mappedWhenManaged MappedWhenManaged Boolean True
66 orientation Orientation XtOrientation vertical
67 vSpace VSpace Dimension 4
68 width Width Dimension 0
74 1 internalWidth, internalHeight specify the margins around the text
76 2 topWidget identifies the widget which is currently visible.
77 3 callbacks are called whenever the user selects a tab. Call_data is
79 4 popdownCallbacks are called whenever the user selects a tab. Call_data is
80 the old (no longer visible) top widget. Note that popdownCallbacks
81 are called before callbacks.
82 5 SelectInsensitive determines whether or not insensitive children may
84 6 BeNiceToColormap causes the Tabs widget to use fewer colors.
85 7 InsensitiveContrast sets the contrast used for labels of insensitive widgets.
89 /* Constraint parameters:
90 Name Class RepType Default Value
91 ---- ----- ------- -------------
92 tabLabel Label String widget name
93 tabLeftBitmap LeftBitmap Pixmap None
94 tabForeground Foreground Pixel XtDefaultForeground
95 resizable Resizable Boolean False
101 #define XtNtabLabel "tabLabel"
102 #define XtNtabForeground "tabForeground"
105 #ifndef XtNtabLeftBitmap
106 #define XtNtabLeftBitmap "tabLeftBitmap"
109 #ifndef XtCLeftBitmap
110 #define XtCLeftBitmap "LeftBitmap"
114 #define XtCResizable "Resizable"
117 #ifndef XtNselectInsensitive
118 #define XtNselectInsensitive "selectInsensitive"
119 #define XtCSelectInsensitive "SelectInsensitive"
123 #define XtNnlabels "nlabels"
124 #define XtCNLabels "NLabels"
127 #define XtNlabels "labels"
128 #define XtCLabels "Labels"
132 #define XtNtopWidget "topWidget"
133 #define XtCTopWidget "TopWidget"
136 #ifndef XtNhighlightWidget
137 #define XtNhighlightWidget "highlightWidget"
138 #define XtCHighlightWidget "HighlightWidget"
142 #define XtNhSpace "hSpace"
143 #define XtCHSpace "HSpace"
144 #define XtNvSpace "vSpace"
145 #define XtCVSpace "VSpace"
149 #define XtNresizable "resizable"
152 #ifndef XtNinsensitiveContrast
153 #define XtNinsensitiveContrast "insensitiveContrast"
154 #define XtCInsensitiveContrast "InsensitiveContrast"
157 #ifndef XtNshadowWidth
158 #define XtNshadowWidth "shadowWidth"
159 #define XtCShadowWidth "ShadowWidth"
160 #define XtNtopShadowPixel "topShadowPixel"
161 #define XtCTopShadowPixel "TopShadowPixel"
162 #define XtNbottomShadowPixel "bottomShadowPixel"
163 #define XtCBottomShadowPixel "BottomShadowPixel"
164 #define XtNtopShadowContrast "topShadowContrast"
165 #define XtCTopShadowContrast "TopShadowContrast"
166 #define XtNbottomShadowContrast "bottomShadowContrast"
167 #define XtCBottomShadowContrast "BottomShadowContrast"
170 #ifndef XtNtopShadowPixmap
171 #define XtNtopShadowPixmap "topShadowPixmap"
172 #define XtCTopShadowPixmap "TopShadowPixmap"
173 #define XtNbottomShadowPixmap "bottomShadowPixmap"
174 #define XtCBottomShadowPixmap "BottomShadowPixmap"
177 #ifndef XtNbeNiceToColormap
178 #define XtNbeNiceToColormap "beNiceToColormap"
179 #define XtCBeNiceToColormap "BeNiceToColormap"
180 #define XtNbeNiceToColourmap "beNiceToColormap"
181 #define XtCBeNiceToColourmap "BeNiceToColormap"
184 /* Class record constants */
186 extern WidgetClass tabsWidgetClass;
188 typedef struct _TabsClassRec *TabsWidgetClass;
189 typedef struct _TabsRec *TabsWidget;
195 #if NeedFunctionPrototypes
203 #if NeedFunctionPrototypes