summaryrefslogtreecommitdiff
path: root/include/Item.h
blob: 0827ea916e884c41f818a653bbe38762e4e9436e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
/*
# Item.h: public header file for an ``item widget''.
#
# Copyright (C) 1992, 2011 Free Software Foundation, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
*/


/*
# A composite widget consisting of a label and a (string) value.  Both 
# subwidgets are created by the Item itself, and geometry requests from them are
# ignored.
*/


#ifndef ITEM_WIDGET_H
#define ITEM_WIDGET_H

#include "xt-common.h"

#include <kpathsea/types.h>


/* Resources (in addition to those in Core and Composite):

Name		Class		RepType		Default Value
----		-----		-------		-------------
callback	Callback	Callback	NULL
  These routines are called when the accept_value action (see below) is
  performed.  The call_data passed is the contents of the `value'
  resource.

label		Label		String		name of widget
  A constant string displayed before the editable text.  The characters
  in this string are copied by the Item widget.

length		Length		Dimension	1
  The longest `value' allowed, in characters.

translations	Translations	TranslationTable NULL
  The event bindings associated with this widget.  The Item
  provides an action `AcceptValue', which calls the routines in the
  `callback' resource.  `AcceptValue' does not take any parameters.

  By default, no events are bound to `AcceptValue'.  Default bindings
  (perhaps to RET and CTRL-M) should be put in the app-defaults file.

value		Value		String		empty string
  The editable text.  The longest value allowed is the value of `length'.
*/

/* Convenience procedures.  */
extern string ItemGetLabelString (Widget);
extern string ItemGetValueString (Widget);
extern Widget ItemGetValueWidget (Widget);



/* The class variable, for arguments to XtCreateWidget et al.  */
extern WidgetClass itemWidgetClass;

/* The class and instance record types.  */
typedef struct _ItemClassRec *ItemWidgetClass;
typedef struct _ItemRec *ItemWidget;

#endif /* not ITEM_WIDGET_H */