]> Pileus Git - ~andy/gtk/blob - gtk/gtkcombo.h
Updated Bulgarian translation by Alexander Shopov <ash@contact.bg>
[~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 Lesser 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  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser 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-2000.  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_DISABLE_DEPRECATED
28
29 #ifndef __GTK_SMART_COMBO_H__
30 #define __GTK_SMART_COMBO_H__
31
32 #include <gtk/gtkhbox.h>
33 #include <gtk/gtkitem.h>
34
35 #ifdef __cplusplus
36 extern "C" {
37 #endif /* __cplusplus */
38
39 #define GTK_TYPE_COMBO              (gtk_combo_get_type ())
40 #define GTK_COMBO(obj)              (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_COMBO, GtkCombo))
41 #define GTK_COMBO_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_COMBO, GtkComboClass))
42 #define GTK_IS_COMBO(obj)           (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_COMBO))
43 #define GTK_IS_COMBO_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_COMBO))
44 #define GTK_COMBO_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_COMBO, GtkComboClass))
45
46
47 typedef struct _GtkCombo        GtkCombo;
48 typedef struct _GtkComboClass   GtkComboClass;
49
50 /* you should access only the entry and list fields directly */
51 struct _GtkCombo {
52         GtkHBox hbox;
53   
54         /*< public >*/
55         GtkWidget *entry;
56         
57         /*< private >*/
58         GtkWidget *button;
59         GtkWidget *popup;
60         GtkWidget *popwin;
61         
62         /*< public >*/
63         GtkWidget *list;
64
65         /*< private >*/
66         guint entry_change_id;
67         guint list_change_id;   /* unused */
68
69         guint value_in_list:1;
70         guint ok_if_empty:1;
71         guint case_sensitive:1;
72         guint use_arrows:1;
73         guint use_arrows_always:1;
74
75         guint16 current_button;
76         guint activate_id;
77 };
78
79 struct _GtkComboClass {
80         GtkHBoxClass parent_class;
81
82         /* Padding for future expansion */
83         void (*_gtk_reserved1) (void);
84         void (*_gtk_reserved2) (void);
85         void (*_gtk_reserved3) (void);
86         void (*_gtk_reserved4) (void);
87 };
88
89 GType      gtk_combo_get_type              (void) G_GNUC_CONST;
90
91 GtkWidget* gtk_combo_new                   (void);
92 /* the text in the entry must be or not be in the list */
93 void       gtk_combo_set_value_in_list     (GtkCombo*    combo, 
94                                             gboolean     val,
95                                             gboolean     ok_if_empty);
96 /* set/unset arrows working for changing the value (can be annoying) */
97 void       gtk_combo_set_use_arrows        (GtkCombo*    combo, 
98                                             gboolean     val);
99 /* up/down arrows change value if current value not in list */
100 void       gtk_combo_set_use_arrows_always (GtkCombo*    combo, 
101                                             gboolean     val);
102 /* perform case-sensitive compares */
103 void       gtk_combo_set_case_sensitive    (GtkCombo*    combo, 
104                                             gboolean     val);
105 /* call this function on an item if it isn't a label or you
106    want it to have a different value to be displayed in the entry */
107 void       gtk_combo_set_item_string       (GtkCombo*    combo,
108                                             GtkItem*     item,
109                                             const gchar* item_value);
110 /* simple interface */
111 void       gtk_combo_set_popdown_strings   (GtkCombo*    combo, 
112                                             GList        *strings);
113
114 void       gtk_combo_disable_activate      (GtkCombo*    combo);
115
116 #ifdef __cplusplus
117 }
118 #endif /* __cplusplus */
119
120 #endif /* __GTK_SMART_COMBO_H__ */
121
122 #endif /* GTK_DISABLE_DEPRECATED */