]> Pileus Git - ~andy/gtk/blob - gtk/gtkcombo.h
Merges from gtk-1-2
[~andy/gtk] / gtk / gtkcombo.h
1 /* gtkcombo - combo widget for gtk+
2  * Copyright 1997 Paolo Molaro
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Library General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Library General Public License for more details.
13  *
14  * You should have received a copy of the GNU Library General Public
15  * License along with this library; if not, write to the
16  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17  * Boston, MA 02111-1307, USA.
18  */
19
20 /*
21  * Modified by the GTK+ Team and others 1997-1999.  See the AUTHORS
22  * file for a list of people on the GTK+ Team.  See the ChangeLog
23  * files for a list of changes.  These files are distributed with
24  * GTK+ at ftp://ftp.gtk.org/pub/gtk/. 
25  */
26
27 #ifndef __GTK_SMART_COMBO_H__
28 #define __GTK_SMART_COMBO_H__
29
30 #include <gtk/gtkhbox.h>
31 #include <gtk/gtkitem.h>
32
33 #ifdef __cplusplus
34 extern "C" {
35 #endif /* __cplusplus */
36
37 #define GTK_TYPE_COMBO              (gtk_combo_get_type ())
38 #define GTK_COMBO(obj)              (GTK_CHECK_CAST ((obj), GTK_TYPE_COMBO, GtkCombo))
39 #define GTK_COMBO_CLASS(klass)      (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_COMBO, GtkComboClass))
40 #define GTK_IS_COMBO(obj)           (GTK_CHECK_TYPE ((obj), GTK_TYPE_COMBO))
41 #define GTK_IS_COMBO_CLASS(klass)   (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_COMBO))
42 #define GTK_COMBO_GET_CLASS(obj)    (GTK_CHECK_GET_CLASS ((obj), GTK_TYPE_COMBO, GtkComboClass))
43
44
45 typedef struct _GtkCombo        GtkCombo;
46 typedef struct _GtkComboClass   GtkComboClass;
47
48 /* you should access only the entry and list fields directly */
49 struct _GtkCombo {
50         GtkHBox hbox;
51         GtkWidget *entry;
52         GtkWidget *button;
53         GtkWidget *popup;
54         GtkWidget *popwin;
55         GtkWidget *list;
56
57         guint entry_change_id;
58         guint list_change_id;
59
60         guint value_in_list:1;
61         guint ok_if_empty:1;
62         guint case_sensitive:1;
63         guint use_arrows:1;
64         guint use_arrows_always:1;
65
66         guint16 current_button;
67         guint activate_id;
68 };
69
70 struct _GtkComboClass {
71         GtkHBoxClass parent_class;
72 };
73
74 GtkType    gtk_combo_get_type              (void);
75
76 GtkWidget* gtk_combo_new                   (void);
77 /* the text in the entry must be or not be in the list */
78 void       gtk_combo_set_value_in_list     (GtkCombo*    combo, 
79                                             gint         val,
80                                             gint         ok_if_empty);
81 /* set/unset arrows working for changing the value (can be annoying */
82 void       gtk_combo_set_use_arrows        (GtkCombo*    combo, 
83                                             gint         val);
84 /* up/down arrows change value if current value not in list */
85 void       gtk_combo_set_use_arrows_always (GtkCombo*    combo, 
86                                             gint         val);
87 /* perform case-sensitive compares */
88 void       gtk_combo_set_case_sensitive    (GtkCombo*    combo, 
89                                             gint         val);
90 /* call this function on an item if it isn't a label or you
91    want it to have a different value to be displayed in the entry */
92 void       gtk_combo_set_item_string       (GtkCombo*    combo,
93                                             GtkItem*     item,
94                                             const gchar* item_value);
95 /* simple interface */
96 void       gtk_combo_set_popdown_strings   (GtkCombo*    combo, 
97                                             GList        *strings);
98
99 void       gtk_combo_disable_activate      (GtkCombo*    combo);
100
101 #ifdef __cplusplus
102 }
103 #endif /* __cplusplus */
104
105 #endif /* __GTK_SMART_COMBO_H__ */
106
107