You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

119 line
4.1 KiB

  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. * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
  21. * file for a list of people on the GTK+ Team. See the ChangeLog
  22. * files for a list of changes. These files are distributed with
  23. * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
  24. */
  25. #ifndef GTK_DISABLE_DEPRECATED
  26. #ifndef __GTK_SMART_COMBO_H__
  27. #define __GTK_SMART_COMBO_H__
  28. #include <gtk/gtk.h>
  29. G_BEGIN_DECLS
  30. #define GTK_TYPE_COMBO (gtk_combo_get_type ())
  31. #define GTK_COMBO(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_COMBO, GtkCombo))
  32. #define GTK_COMBO_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_COMBO, GtkComboClass))
  33. #define GTK_IS_COMBO(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_COMBO))
  34. #define GTK_IS_COMBO_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_COMBO))
  35. #define GTK_COMBO_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_COMBO, GtkComboClass))
  36. typedef struct _GtkCombo GtkCombo;
  37. typedef struct _GtkComboClass GtkComboClass;
  38. /* you should access only the entry and list fields directly */
  39. struct _GtkCombo {
  40. GtkHBox hbox;
  41. /*< public >*/
  42. GtkWidget *entry;
  43. /*< private >*/
  44. GtkWidget *button;
  45. GtkWidget *popup;
  46. GtkWidget *popwin;
  47. /*< public >*/
  48. GtkWidget *list;
  49. /*< private >*/
  50. guint entry_change_id;
  51. guint list_change_id; /* unused */
  52. guint value_in_list:1;
  53. guint ok_if_empty:1;
  54. guint case_sensitive:1;
  55. guint use_arrows:1;
  56. guint use_arrows_always:1;
  57. guint16 current_button;
  58. guint activate_id;
  59. };
  60. struct _GtkComboClass {
  61. GtkHBoxClass parent_class;
  62. /* Padding for future expansion */
  63. void (*_gtk_reserved1) (void);
  64. void (*_gtk_reserved2) (void);
  65. void (*_gtk_reserved3) (void);
  66. void (*_gtk_reserved4) (void);
  67. };
  68. GType gtk_combo_get_type (void) G_GNUC_CONST;
  69. GtkWidget* gtk_combo_new (void);
  70. /* the text in the entry must be or not be in the list */
  71. void gtk_combo_set_value_in_list (GtkCombo* combo,
  72. gboolean val,
  73. gboolean ok_if_empty);
  74. /* set/unset arrows working for changing the value (can be annoying) */
  75. void gtk_combo_set_use_arrows (GtkCombo* combo,
  76. gboolean val);
  77. /* up/down arrows change value if current value not in list */
  78. void gtk_combo_set_use_arrows_always (GtkCombo* combo,
  79. gboolean val);
  80. /* perform case-sensitive compares */
  81. void gtk_combo_set_case_sensitive (GtkCombo* combo,
  82. gboolean val);
  83. /* call this function on an item if it isn't a label or you
  84. want it to have a different value to be displayed in the entry */
  85. void gtk_combo_set_item_string (GtkCombo* combo,
  86. GtkItem* item,
  87. const gchar* item_value);
  88. /* simple interface */
  89. void gtk_combo_set_popdown_strings (GtkCombo* combo,
  90. GList *strings);
  91. void gtk_combo_disable_activate (GtkCombo* combo);
  92. G_END_DECLS
  93. #endif /* __GTK_SMART_COMBO_H__ */
  94. #endif /* GTK_DISABLE_DEPRECATED */