gtkcombo.inc 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. // included by gtk2.pas
  2. {$IFDEF read_forward_definitions}
  3. {$ENDIF read_forward_definitions}
  4. //------------------------------------------------------------------------------
  5. {$IFDEF read_interface_types}
  6. { you should access only the entry and list fields directly }
  7. PGtkCombo = ^TGtkCombo;
  8. TGtkCombo = record
  9. hbox : TGtkHBox;
  10. entry : PGtkWidget;
  11. button : PGtkWidget;
  12. popup : PGtkWidget;
  13. popwin : PGtkWidget;
  14. list : PGtkWidget;
  15. entry_change_id : guint;
  16. list_change_id : guint;
  17. flag0 : word;
  18. current_button : guint16;
  19. activate_id : guint;
  20. end;
  21. { Padding for future expansion }
  22. PGtkComboClass = ^TGtkComboClass;
  23. TGtkComboClass = record
  24. parent_class : TGtkHBoxClass;
  25. _gtk_reserved1 : procedure ; cdecl;
  26. _gtk_reserved2 : procedure ; cdecl;
  27. _gtk_reserved3 : procedure ; cdecl;
  28. _gtk_reserved4 : procedure ; cdecl;
  29. end;
  30. {$ENDIF read_interface_types}
  31. //------------------------------------------------------------------------------
  32. {$IFDEF read_interface_rest}
  33. const
  34. bm_TGtkCombo_value_in_list = $1;
  35. bp_TGtkCombo_value_in_list = 0;
  36. bm_TGtkCombo_ok_if_empty = $2;
  37. bp_TGtkCombo_ok_if_empty = 1;
  38. bm_TGtkCombo_case_sensitive = $4;
  39. bp_TGtkCombo_case_sensitive = 2;
  40. bm_TGtkCombo_use_arrows = $8;
  41. bp_TGtkCombo_use_arrows = 3;
  42. bm_TGtkCombo_use_arrows_always = $10;
  43. bp_TGtkCombo_use_arrows_always = 4;
  44. function GTK_TYPE_COMBO : GType;
  45. function GTK_COMBO(obj: pointer) : PGtkCombo;
  46. function GTK_COMBO_CLASS(klass: pointer) : PGtkComboClass;
  47. function GTK_IS_COMBO(obj: pointer) : boolean;
  48. function GTK_IS_COMBO_CLASS(klass: pointer) : boolean;
  49. function GTK_COMBO_GET_CLASS(obj: pointer) : PGtkComboClass;
  50. function value_in_list(var a : TGtkCombo) : guint;
  51. procedure set_value_in_list(var a : TGtkCombo; __value_in_list : guint);
  52. function ok_if_empty(var a : TGtkCombo) : guint;
  53. procedure set_ok_if_empty(var a : TGtkCombo; __ok_if_empty : guint);
  54. function case_sensitive(var a : TGtkCombo) : guint;
  55. procedure set_case_sensitive(var a : TGtkCombo; __case_sensitive : guint);
  56. function use_arrows(var a : TGtkCombo) : guint;
  57. procedure set_use_arrows(var a : TGtkCombo; __use_arrows : guint);
  58. function use_arrows_always(var a : TGtkCombo) : guint;
  59. procedure set_use_arrows_always(var a : TGtkCombo; __use_arrows_always : guint);
  60. function gtk_combo_get_type:TGtkType; cdecl; external gtklib;
  61. function gtk_combo_new:PGtkWidget; cdecl; external gtklib;
  62. { the text in the entry must be or not be in the list }
  63. procedure gtk_combo_set_value_in_list(combo:PGtkCombo; val:gboolean; ok_if_empty:gboolean); cdecl; external gtklib;
  64. { set/unset arrows working for changing the value (can be annoying) }
  65. procedure gtk_combo_set_use_arrows(combo:PGtkCombo; val:gboolean); cdecl; external gtklib;
  66. { up/down arrows change value if current value not in list }
  67. procedure gtk_combo_set_use_arrows_always(combo:PGtkCombo; val:gboolean); cdecl; external gtklib;
  68. { perform case-sensitive compares }
  69. procedure gtk_combo_set_case_sensitive(combo:PGtkCombo; val:gboolean); cdecl; external gtklib;
  70. { call this function on an item if it isn't a label or you
  71. want it to have a different value to be displayed in the entry }
  72. procedure gtk_combo_set_item_string(combo:PGtkCombo; item:PGtkItem; item_value:Pgchar); cdecl; external gtklib;
  73. { simple interface }
  74. procedure gtk_combo_set_popdown_strings(combo:PGtkCombo; strings:PGList); cdecl; external gtklib;
  75. procedure gtk_combo_disable_activate(combo:PGtkCombo); cdecl; external gtklib;
  76. {$ENDIF read_interface_rest}
  77. //------------------------------------------------------------------------------
  78. {$IFDEF read_implementation}
  79. function GTK_TYPE_COMBO : GType;
  80. begin
  81. GTK_TYPE_COMBO:=gtk_combo_get_type;
  82. end;
  83. function GTK_COMBO(obj: pointer) : PGtkCombo;
  84. begin
  85. GTK_COMBO:=PGtkCombo(GTK_CHECK_CAST(obj,GTK_TYPE_COMBO));
  86. end;
  87. function GTK_COMBO_CLASS(klass: pointer) : PGtkComboClass;
  88. begin
  89. GTK_COMBO_CLASS:=PGtkComboClass(GTK_CHECK_CLASS_CAST(klass,GTK_TYPE_COMBO));
  90. end;
  91. function GTK_IS_COMBO(obj: pointer) : boolean;
  92. begin
  93. GTK_IS_COMBO:=GTK_CHECK_TYPE(obj,GTK_TYPE_COMBO);
  94. end;
  95. function GTK_IS_COMBO_CLASS(klass: pointer) : boolean;
  96. begin
  97. GTK_IS_COMBO_CLASS:=GTK_CHECK_CLASS_TYPE(klass,GTK_TYPE_COMBO);
  98. end;
  99. function GTK_COMBO_GET_CLASS(obj: pointer) : PGtkComboClass;
  100. begin
  101. GTK_COMBO_GET_CLASS:=PGtkComboClass(GTK_CHECK_GET_CLASS(obj,GTK_TYPE_COMBO));
  102. end;
  103. function value_in_list(var a : TGtkCombo) : guint;
  104. begin
  105. value_in_list:=(a.flag0 and bm_TGtkCombo_value_in_list) shr bp_TGtkCombo_value_in_list;
  106. end;
  107. procedure set_value_in_list(var a : TGtkCombo; __value_in_list : guint);
  108. begin
  109. a.flag0:=a.flag0 or ((__value_in_list shl bp_TGtkCombo_value_in_list) and bm_TGtkCombo_value_in_list);
  110. end;
  111. function ok_if_empty(var a : TGtkCombo) : guint;
  112. begin
  113. ok_if_empty:=(a.flag0 and bm_TGtkCombo_ok_if_empty) shr bp_TGtkCombo_ok_if_empty;
  114. end;
  115. procedure set_ok_if_empty(var a : TGtkCombo; __ok_if_empty : guint);
  116. begin
  117. a.flag0:=a.flag0 or ((__ok_if_empty shl bp_TGtkCombo_ok_if_empty) and bm_TGtkCombo_ok_if_empty);
  118. end;
  119. function case_sensitive(var a : TGtkCombo) : guint;
  120. begin
  121. case_sensitive:=(a.flag0 and bm_TGtkCombo_case_sensitive) shr bp_TGtkCombo_case_sensitive;
  122. end;
  123. procedure set_case_sensitive(var a : TGtkCombo; __case_sensitive : guint);
  124. begin
  125. a.flag0:=a.flag0 or ((__case_sensitive shl bp_TGtkCombo_case_sensitive) and bm_TGtkCombo_case_sensitive);
  126. end;
  127. function use_arrows(var a : TGtkCombo) : guint;
  128. begin
  129. use_arrows:=(a.flag0 and bm_TGtkCombo_use_arrows) shr bp_TGtkCombo_use_arrows;
  130. end;
  131. procedure set_use_arrows(var a : TGtkCombo; __use_arrows : guint);
  132. begin
  133. a.flag0:=a.flag0 or ((__use_arrows shl bp_TGtkCombo_use_arrows) and bm_TGtkCombo_use_arrows);
  134. end;
  135. function use_arrows_always(var a : TGtkCombo) : guint;
  136. begin
  137. use_arrows_always:=(a.flag0 and bm_TGtkCombo_use_arrows_always) shr bp_TGtkCombo_use_arrows_always;
  138. end;
  139. procedure set_use_arrows_always(var a : TGtkCombo; __use_arrows_always : guint);
  140. begin
  141. a.flag0:=a.flag0 or ((__use_arrows_always shl bp_TGtkCombo_use_arrows_always) and bm_TGtkCombo_use_arrows_always);
  142. end;
  143. {$ENDIF read_implementation}
  144. // included by gtk2.pas