1 /* Tabs Widget for SXEmacs.
2 Copyright (C) 1999 Edward A. Falk
4 This file is part of SXEmacs.
6 SXEmacs 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 3 of the License, or (at your
9 option) any later version.
11 SXEmacs is distributed in the hope that it will be
12 useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>. */
20 * This widget manages one or more child widgets, exactly one of which is
21 * visible. Above the child widgets is a graphic that looks like index
22 * tabs from file folders. Each tab corresponds to one of the child widgets.
23 * By clicking on a tab, the user can bring the corresponding widget to
24 * the top of the stack.
30 #include <X11/Constraint.h>
32 /***********************************************************************
34 * Tabs Widget (subclass of CompositeClass)
36 ***********************************************************************/
40 Name Class RepType Default Value
41 ---- ----- ------- -------------
42 font Font XFontStruct* XtDefaultFont
43 internalWidth Width Dimension 4 *1
44 internalHeight Height Dimension 2 *1
45 topWidget TopWidget Widget *2
46 highlightWidget HighlightWidget Widget 4
47 callback Callback XtCallbackList NULL *3
48 popdownCallback Callback XtCallbackList NULL *4
49 selectInsensitive SelectInsensitive Boolean True *5
50 beNiceToColormap BeNiceToColormap Boolean False *6
51 topShadowContrast TopShadowContrast int 20
52 bottomShadowContrast BottomShadowContrast int 40
53 insensitiveContrast InsensitiveContrast int 33 *7
55 background Background Pixel XtDefaultBackground
56 border BorderColor Pixel XtDefaultForeground
57 borderWidth BorderWidth Dimension 1
58 destroyCallback Callback Pointer NULL
59 hSpace HSpace Dimension 4
60 height Height Dimension 0
61 mappedWhenManaged MappedWhenManaged Boolean True
62 orientation Orientation XtOrientation vertical
63 vSpace VSpace Dimension 4
64 width Width Dimension 0
70 1 internalWidth, internalHeight specify the margins around the text
72 2 topWidget identifies the widget which is currently visible.
73 3 callbacks are called whenever the user selects a tab. Call_data is
75 4 popdownCallbacks are called whenever the user selects a tab. Call_data is
76 the old (no longer visible) top widget. Note that popdownCallbacks
77 are called before callbacks.
78 5 SelectInsensitive determines whether or not insensitive children may
80 6 BeNiceToColormap causes the Tabs widget to use fewer colors.
81 7 InsensitiveContrast sets the contrast used for labels of insensitive widgets.
85 /* Constraint parameters:
86 Name Class RepType Default Value
87 ---- ----- ------- -------------
88 tabLabel Label String widget name
89 tabLeftBitmap LeftBitmap Pixmap None
90 tabForeground Foreground Pixel XtDefaultForeground
91 resizable Resizable Boolean False
97 #define XtNtabLabel "tabLabel"
98 #define XtNtabForeground "tabForeground"
101 #ifndef XtNtabLeftBitmap
102 #define XtNtabLeftBitmap "tabLeftBitmap"
105 #ifndef XtCLeftBitmap
106 #define XtCLeftBitmap "LeftBitmap"
110 #define XtCResizable "Resizable"
113 #ifndef XtNselectInsensitive
114 #define XtNselectInsensitive "selectInsensitive"
115 #define XtCSelectInsensitive "SelectInsensitive"
119 #define XtNnlabels "nlabels"
120 #define XtCNLabels "NLabels"
123 #define XtNlabels "labels"
124 #define XtCLabels "Labels"
128 #define XtNtopWidget "topWidget"
129 #define XtCTopWidget "TopWidget"
132 #ifndef XtNhighlightWidget
133 #define XtNhighlightWidget "highlightWidget"
134 #define XtCHighlightWidget "HighlightWidget"
138 #define XtNhSpace "hSpace"
139 #define XtCHSpace "HSpace"
140 #define XtNvSpace "vSpace"
141 #define XtCVSpace "VSpace"
145 #define XtNresizable "resizable"
148 #ifndef XtNinsensitiveContrast
149 #define XtNinsensitiveContrast "insensitiveContrast"
150 #define XtCInsensitiveContrast "InsensitiveContrast"
153 #ifndef XtNshadowWidth
154 #define XtNshadowWidth "shadowWidth"
155 #define XtCShadowWidth "ShadowWidth"
156 #define XtNtopShadowPixel "topShadowPixel"
157 #define XtCTopShadowPixel "TopShadowPixel"
158 #define XtNbottomShadowPixel "bottomShadowPixel"
159 #define XtCBottomShadowPixel "BottomShadowPixel"
160 #define XtNtopShadowContrast "topShadowContrast"
161 #define XtCTopShadowContrast "TopShadowContrast"
162 #define XtNbottomShadowContrast "bottomShadowContrast"
163 #define XtCBottomShadowContrast "BottomShadowContrast"
166 #ifndef XtNtopShadowPixmap
167 #define XtNtopShadowPixmap "topShadowPixmap"
168 #define XtCTopShadowPixmap "TopShadowPixmap"
169 #define XtNbottomShadowPixmap "bottomShadowPixmap"
170 #define XtCBottomShadowPixmap "BottomShadowPixmap"
173 #ifndef XtNbeNiceToColormap
174 #define XtNbeNiceToColormap "beNiceToColormap"
175 #define XtCBeNiceToColormap "BeNiceToColormap"
176 #define XtNbeNiceToColourmap "beNiceToColormap"
177 #define XtCBeNiceToColourmap "BeNiceToColormap"
180 /* Class record constants */
182 extern WidgetClass tabsWidgetClass;
184 typedef struct _TabsClassRec *TabsWidgetClass;
185 typedef struct _TabsRec *TabsWidget;
187 _XFUNCPROTOBEGIN extern void XawTabsSetTop(
188 #if NeedFunctionPrototypes
189 Widget w, Bool callCallbacks
193 extern void XawTabsSetHighlight(
194 #if NeedFunctionPrototypes
195 Widget tabs, Widget w