398
|
1 /* Tabs Widget for XEmacs.
|
|
2 Copyright (C) 1999 Edward A. Falk
|
|
3
|
|
4 This file is part of XEmacs.
|
|
5
|
|
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
|
|
9 later version.
|
|
10
|
|
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
|
|
14 for more details.
|
|
15
|
|
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. */
|
|
20
|
|
21 /*
|
|
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.
|
|
27 */
|
|
28
|
|
29
|
|
30 #ifndef _Tabs_h
|
|
31 #define _Tabs_h
|
|
32
|
|
33 #include <X11/Constraint.h>
|
|
34
|
|
35
|
|
36 /***********************************************************************
|
|
37 *
|
|
38 * Tabs Widget (subclass of CompositeClass)
|
|
39 *
|
|
40 ***********************************************************************/
|
|
41
|
|
42 /* Parameters:
|
|
43
|
|
44 Name Class RepType Default Value
|
|
45 ---- ----- ------- -------------
|
|
46 font Font XFontStruct* XtDefaultFont
|
3685
|
47 fcFontName FcFontName String NULL *0
|
|
48 xftFont XftFont String Helvetica-12 *8
|
3397
|
49 internalWidth Width Dimension 4 *1
|
|
50 internalHeight Height Dimension 2 *1
|
|
51 topWidget TopWidget Widget *2
|
|
52 callback Callback XtCallbackList NULL *3
|
|
53 popdownCallback Callback XtCallbackList NULL *4
|
|
54 selectInsensitive SelectInsensitive Boolean True *5
|
|
55 beNiceToColormap BeNiceToColormap Boolean False *6
|
398
|
56 topShadowContrast TopShadowContrast int 20
|
|
57 bottomShadowContrast BottomShadowContrast int 40
|
3397
|
58 insensitiveContrast InsensitiveContrast int 33 *7
|
398
|
59
|
|
60 background Background Pixel XtDefaultBackground
|
|
61 border BorderColor Pixel XtDefaultForeground
|
|
62 borderWidth BorderWidth Dimension 1
|
|
63 destroyCallback Callback Pointer NULL
|
|
64 hSpace HSpace Dimension 4
|
|
65 height Height Dimension 0
|
|
66 mappedWhenManaged MappedWhenManaged Boolean True
|
|
67 orientation Orientation XtOrientation vertical
|
|
68 vSpace VSpace Dimension 4
|
|
69 width Width Dimension 0
|
|
70 x Position Position 0
|
|
71 y Position Position 0
|
|
72
|
|
73 Notes:
|
|
74
|
3397
|
75 0 this is a joke, it will be changed.
|
398
|
76 1 internalWidth, internalHeight specify the margins around the text
|
|
77 in the tabs.
|
|
78 2 topWidget identifies the widget which is currently visible.
|
|
79 3 callbacks are called whenever the user selects a tab. Call_data is
|
|
80 the new top widget.
|
|
81 4 popdownCallbacks are called whenever the user selects a tab. Call_data is
|
|
82 the old (no longer visible) top widget. Note that popdownCallbacks
|
|
83 are called before callbacks.
|
|
84 5 SelectInsensitive determines whether or not insensitive children may
|
|
85 be selected anyway.
|
|
86 6 BeNiceToColormap causes the Tabs widget to use fewer colors.
|
|
87 7 InsensitiveContrast sets the contrast used for labels of insensitive widgets.
|
3397
|
88 8 fcFontName and xftFont are separate resources because there is not yet
|
|
89 registered representation and converter for XftFonts.
|
398
|
90 */
|
|
91
|
|
92 /* Constraint parameters:
|
|
93 Name Class RepType Default Value
|
|
94 ---- ----- ------- -------------
|
|
95 tabLabel Label String widget name
|
|
96 tabLeftBitmap LeftBitmap Pixmap None
|
|
97 tabForeground Foreground Pixel XtDefaultForeground
|
|
98 resizable Resizable Boolean False
|
|
99 */
|
|
100
|
|
101 /* New fields */
|
|
102
|
|
103 #ifndef XtNtabLabel
|
|
104 #define XtNtabLabel "tabLabel"
|
|
105 #define XtNtabForeground "tabForeground"
|
|
106 #endif
|
|
107
|
|
108 #ifndef XtNtabLeftBitmap
|
|
109 #define XtNtabLeftBitmap "tabLeftBitmap"
|
|
110 #endif
|
|
111
|
|
112 #ifndef XtCLeftBitmap
|
|
113 #define XtCLeftBitmap "LeftBitmap"
|
|
114 #endif
|
|
115
|
|
116 #ifndef XtCResizable
|
|
117 #define XtCResizable "Resizable"
|
|
118 #endif
|
|
119
|
|
120 #ifndef XtNselectInsensitive
|
|
121 #define XtNselectInsensitive "selectInsensitive"
|
|
122 #define XtCSelectInsensitive "SelectInsensitive"
|
|
123 #endif
|
|
124
|
|
125 #ifndef XtNnlabels
|
|
126 #define XtNnlabels "nlabels"
|
|
127 #define XtCNLabels "NLabels"
|
|
128 #endif
|
|
129 #ifndef XtNlabels
|
|
130 #define XtNlabels "labels"
|
|
131 #define XtCLabels "Labels"
|
|
132 #endif
|
|
133
|
|
134 #ifndef XtNtopWidget
|
|
135 #define XtNtopWidget "topWidget"
|
|
136 #define XtCTopWidget "TopWidget"
|
|
137 #endif
|
|
138
|
|
139 #ifndef XtNhSpace
|
|
140 #define XtNhSpace "hSpace"
|
|
141 #define XtCHSpace "HSpace"
|
|
142 #define XtNvSpace "vSpace"
|
|
143 #define XtCVSpace "VSpace"
|
|
144 #endif
|
|
145
|
|
146 #ifndef XtNresizable
|
|
147 #define XtNresizable "resizable"
|
|
148 #endif
|
|
149
|
|
150 #ifndef XtNinsensitiveContrast
|
|
151 #define XtNinsensitiveContrast "insensitiveContrast"
|
|
152 #define XtCInsensitiveContrast "InsensitiveContrast"
|
|
153 #endif
|
|
154
|
|
155 #ifndef XtNshadowWidth
|
|
156 #define XtNshadowWidth "shadowWidth"
|
|
157 #define XtCShadowWidth "ShadowWidth"
|
|
158 #define XtNtopShadowPixel "topShadowPixel"
|
|
159 #define XtCTopShadowPixel "TopShadowPixel"
|
|
160 #define XtNbottomShadowPixel "bottomShadowPixel"
|
|
161 #define XtCBottomShadowPixel "BottomShadowPixel"
|
|
162 #define XtNtopShadowContrast "topShadowContrast"
|
|
163 #define XtCTopShadowContrast "TopShadowContrast"
|
|
164 #define XtNbottomShadowContrast "bottomShadowContrast"
|
|
165 #define XtCBottomShadowContrast "BottomShadowContrast"
|
|
166 #endif
|
|
167
|
|
168 #ifndef XtNtopShadowPixmap
|
|
169 #define XtNtopShadowPixmap "topShadowPixmap"
|
|
170 #define XtCTopShadowPixmap "TopShadowPixmap"
|
|
171 #define XtNbottomShadowPixmap "bottomShadowPixmap"
|
|
172 #define XtCBottomShadowPixmap "BottomShadowPixmap"
|
|
173 #endif
|
|
174
|
|
175 #ifndef XtNbeNiceToColormap
|
|
176 #define XtNbeNiceToColormap "beNiceToColormap"
|
|
177 #define XtCBeNiceToColormap "BeNiceToColormap"
|
|
178 #define XtNbeNiceToColourmap "beNiceToColormap"
|
|
179 #define XtCBeNiceToColourmap "BeNiceToColormap"
|
|
180 #endif
|
|
181
|
|
182 /* Class record constants */
|
|
183
|
|
184 extern WidgetClass tabsWidgetClass;
|
|
185
|
|
186 typedef struct _TabsClassRec *TabsWidgetClass;
|
|
187 typedef struct _TabsRec *TabsWidget;
|
|
188
|
|
189 _XFUNCPROTOBEGIN
|
|
190
|
|
191 extern void
|
|
192 XawTabsSetTop(
|
|
193 #if NeedFunctionPrototypes
|
|
194 Widget w,
|
|
195 Bool callCallbacks
|
|
196 #endif
|
|
197 ) ;
|
|
198
|
|
199 extern void
|
|
200 XawTabsSetHighlight(
|
|
201 #if NeedFunctionPrototypes
|
|
202 Widget tabs,
|
|
203 Widget w
|
|
204 #endif
|
|
205 ) ;
|
|
206
|
|
207 _XFUNCPROTOEND
|
|
208
|
|
209 #endif /* _Tabs_h */
|