No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.
 
 
 
 
 
 

143 líneas
6.1 KiB

  1. /* gtkcombobox.h
  2. * Copyright (C) 2002, 2003 Kristian Rietveld <kris@gtk.org>
  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. #if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
  20. #error "Only <gtk/gtk.h> can be included directly."
  21. #endif
  22. #ifndef __GTK_COMBO_BOX_H__
  23. #define __GTK_COMBO_BOX_H__
  24. #include <gtk/gtkbin.h>
  25. #include <gtk/gtktreemodel.h>
  26. #include <gtk/gtktreeview.h>
  27. G_BEGIN_DECLS
  28. #define GTK_TYPE_COMBO_BOX (gtk_combo_box_get_type ())
  29. #define GTK_COMBO_BOX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_COMBO_BOX, GtkComboBox))
  30. #define GTK_COMBO_BOX_CLASS(vtable) (G_TYPE_CHECK_CLASS_CAST ((vtable), GTK_TYPE_COMBO_BOX, GtkComboBoxClass))
  31. #define GTK_IS_COMBO_BOX(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_COMBO_BOX))
  32. #define GTK_IS_COMBO_BOX_CLASS(vtable) (G_TYPE_CHECK_CLASS_TYPE ((vtable), GTK_TYPE_COMBO_BOX))
  33. #define GTK_COMBO_BOX_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), GTK_TYPE_COMBO_BOX, GtkComboBoxClass))
  34. typedef struct _GtkComboBox GtkComboBox;
  35. typedef struct _GtkComboBoxClass GtkComboBoxClass;
  36. typedef struct _GtkComboBoxPrivate GtkComboBoxPrivate;
  37. struct _GtkComboBox
  38. {
  39. GtkBin parent_instance;
  40. /*< private >*/
  41. GtkComboBoxPrivate *GSEAL (priv);
  42. };
  43. struct _GtkComboBoxClass
  44. {
  45. GtkBinClass parent_class;
  46. /* signals */
  47. void (* changed) (GtkComboBox *combo_box);
  48. /* vfuncs */
  49. gchar * (* get_active_text) (GtkComboBox *combo_box);
  50. /* Padding for future expansion */
  51. void (*_gtk_reserved0) (void);
  52. void (*_gtk_reserved1) (void);
  53. void (*_gtk_reserved2) (void);
  54. };
  55. /* construction */
  56. GType gtk_combo_box_get_type (void) G_GNUC_CONST;
  57. GtkWidget *gtk_combo_box_new (void);
  58. GtkWidget *gtk_combo_box_new_with_model (GtkTreeModel *model);
  59. /* grids */
  60. gint gtk_combo_box_get_wrap_width (GtkComboBox *combo_box);
  61. void gtk_combo_box_set_wrap_width (GtkComboBox *combo_box,
  62. gint width);
  63. gint gtk_combo_box_get_row_span_column (GtkComboBox *combo_box);
  64. void gtk_combo_box_set_row_span_column (GtkComboBox *combo_box,
  65. gint row_span);
  66. gint gtk_combo_box_get_column_span_column (GtkComboBox *combo_box);
  67. void gtk_combo_box_set_column_span_column (GtkComboBox *combo_box,
  68. gint column_span);
  69. gboolean gtk_combo_box_get_add_tearoffs (GtkComboBox *combo_box);
  70. void gtk_combo_box_set_add_tearoffs (GtkComboBox *combo_box,
  71. gboolean add_tearoffs);
  72. G_CONST_RETURN gchar *gtk_combo_box_get_title (GtkComboBox *combo_box);
  73. void gtk_combo_box_set_title (GtkComboBox *combo_box,
  74. const gchar *title);
  75. gboolean gtk_combo_box_get_focus_on_click (GtkComboBox *combo);
  76. void gtk_combo_box_set_focus_on_click (GtkComboBox *combo,
  77. gboolean focus_on_click);
  78. /* get/set active item */
  79. gint gtk_combo_box_get_active (GtkComboBox *combo_box);
  80. void gtk_combo_box_set_active (GtkComboBox *combo_box,
  81. gint index_);
  82. gboolean gtk_combo_box_get_active_iter (GtkComboBox *combo_box,
  83. GtkTreeIter *iter);
  84. void gtk_combo_box_set_active_iter (GtkComboBox *combo_box,
  85. GtkTreeIter *iter);
  86. /* getters and setters */
  87. void gtk_combo_box_set_model (GtkComboBox *combo_box,
  88. GtkTreeModel *model);
  89. GtkTreeModel *gtk_combo_box_get_model (GtkComboBox *combo_box);
  90. GtkTreeViewRowSeparatorFunc gtk_combo_box_get_row_separator_func (GtkComboBox *combo_box);
  91. void gtk_combo_box_set_row_separator_func (GtkComboBox *combo_box,
  92. GtkTreeViewRowSeparatorFunc func,
  93. gpointer data,
  94. GDestroyNotify destroy);
  95. void gtk_combo_box_set_button_sensitivity (GtkComboBox *combo_box,
  96. GtkSensitivityType sensitivity);
  97. GtkSensitivityType gtk_combo_box_get_button_sensitivity (GtkComboBox *combo_box);
  98. /* convenience -- text */
  99. GtkWidget *gtk_combo_box_new_text (void);
  100. void gtk_combo_box_append_text (GtkComboBox *combo_box,
  101. const gchar *text);
  102. void gtk_combo_box_insert_text (GtkComboBox *combo_box,
  103. gint position,
  104. const gchar *text);
  105. void gtk_combo_box_prepend_text (GtkComboBox *combo_box,
  106. const gchar *text);
  107. void gtk_combo_box_remove_text (GtkComboBox *combo_box,
  108. gint position);
  109. gchar *gtk_combo_box_get_active_text (GtkComboBox *combo_box);
  110. /* programmatic control */
  111. void gtk_combo_box_popup (GtkComboBox *combo_box);
  112. void gtk_combo_box_popdown (GtkComboBox *combo_box);
  113. AtkObject* gtk_combo_box_get_popup_accessible (GtkComboBox *combo_box);
  114. G_END_DECLS
  115. #endif /* __GTK_COMBO_BOX_H__ */