/packages/gtk2/src/gtk+/gtk/gtkspinbutton.inc

https://github.com/slibre/freepascal · Pascal · 273 lines · 208 code · 45 blank · 20 comment · 0 complexity · e2be1946cc197b93dc318376be3c1f9c MD5 · raw file

  1. // included by gtk2.pas
  2. {$IFDEF read_forward_definitions}
  3. {$ENDIF read_forward_definitions}
  4. //------------------------------------------------------------------------------
  5. {$IFDEF read_interface_types}
  6. PGtkSpinButtonUpdatePolicy = ^TGtkSpinButtonUpdatePolicy;
  7. TGtkSpinButtonUpdatePolicy = (
  8. GTK_UPDATE_ALWAYS,
  9. GTK_UPDATE_IF_VALID
  10. );
  11. PGtkSpinType = ^TGtkSpinType;
  12. TGtkSpinType = (
  13. GTK_SPIN_STEP_FORWARD,
  14. GTK_SPIN_STEP_BACKWARD,
  15. GTK_SPIN_PAGE_FORWARD,
  16. GTK_SPIN_PAGE_BACKWARD,
  17. GTK_SPIN_HOME,
  18. GTK_SPIN_END,
  19. GTK_SPIN_USER_DEFINED
  20. );
  21. { valid: GTK_ARROW_UP=0, GTK_ARROW_DOWN=1 or 2=NONE/BOTH }
  22. PGtkSpinButton = ^TGtkSpinButton;
  23. TGtkSpinButton = record
  24. entry : TGtkEntry;
  25. adjustment : PGtkAdjustment;
  26. panel : PGdkWindow;
  27. timer : guint32;
  28. climb_rate : gdouble;
  29. timer_step : gdouble;
  30. update_policy : TGtkSpinButtonUpdatePolicy;
  31. flag0 : longint;
  32. end;
  33. { Action signals for keybindings, do not connect to these }
  34. { Padding for future expansion }
  35. PGtkSpinButtonClass = ^TGtkSpinButtonClass;
  36. TGtkSpinButtonClass = record
  37. parent_class : TGtkEntryClass;
  38. input : function (spin_button:PGtkSpinButton; new_value:Pgdouble):gint; cdecl;
  39. output : function (spin_button:PGtkSpinButton):gint; cdecl;
  40. value_changed : procedure (spin_button:PGtkSpinButton); cdecl;
  41. change_value : procedure (spin_button:PGtkSpinButton; scroll:TGtkScrollType); cdecl;
  42. _gtk_reserved1 : procedure ; cdecl;
  43. _gtk_reserved2 : procedure ; cdecl;
  44. _gtk_reserved3 : procedure ; cdecl;
  45. _gtk_reserved4 : procedure ; cdecl;
  46. end;
  47. {$ENDIF read_interface_types}
  48. //------------------------------------------------------------------------------
  49. {$IFDEF read_interface_rest}
  50. const
  51. GTK_INPUT_ERROR = -(1);
  52. bm_TGtkSpinButton_in_child = $3;
  53. bp_TGtkSpinButton_in_child = 0;
  54. bm_TGtkSpinButton_click_child = $C;
  55. bp_TGtkSpinButton_click_child = 2;
  56. bm_TGtkSpinButton_button = $30;
  57. bp_TGtkSpinButton_button = 4;
  58. bm_TGtkSpinButton_need_timer = $40;
  59. bp_TGtkSpinButton_need_timer = 6;
  60. bm_TGtkSpinButton_timer_calls = $380;
  61. bp_TGtkSpinButton_timer_calls = 7;
  62. bm_TGtkSpinButton_digits = $FFC00;
  63. bp_TGtkSpinButton_digits = 10;
  64. bm_TGtkSpinButton_numeric = $100000;
  65. bp_TGtkSpinButton_numeric = 20;
  66. bm_TGtkSpinButton_wrap = $200000;
  67. bp_TGtkSpinButton_wrap = 21;
  68. bm_TGtkSpinButton_snap_to_ticks = $400000;
  69. bp_TGtkSpinButton_snap_to_ticks = 22;
  70. function GTK_TYPE_SPIN_BUTTON : GType;
  71. function GTK_SPIN_BUTTON(obj: pointer) : PGtkSpinButton;
  72. function GTK_SPIN_BUTTON_CLASS(klass: pointer) : PGtkSpinButtonClass;
  73. function GTK_IS_SPIN_BUTTON(obj: pointer) : boolean;
  74. function GTK_IS_SPIN_BUTTON_CLASS(klass: pointer) : boolean;
  75. function GTK_SPIN_BUTTON_GET_CLASS(obj: pointer) : PGtkSpinButtonClass;
  76. function in_child(var a : TGtkSpinButton) : guint; overload;
  77. procedure set_in_child(var a : TGtkSpinButton; __in_child : guint); overload;
  78. function click_child(var a : TGtkSpinButton) : guint; overload;
  79. procedure set_click_child(var a : TGtkSpinButton; __click_child : guint); overload;
  80. function button(var a : TGtkSpinButton) : guint; overload;
  81. procedure set_button(var a : TGtkSpinButton; __button : guint); overload;
  82. function need_timer(var a : TGtkSpinButton) : guint; overload;
  83. procedure set_need_timer(var a : TGtkSpinButton; __need_timer : guint); overload;
  84. function timer_calls(var a : TGtkSpinButton) : guint;
  85. procedure set_timer_calls(var a : TGtkSpinButton; __timer_calls : guint);
  86. function digits(var a : TGtkSpinButton) : guint;
  87. procedure set_digits(var a : TGtkSpinButton; __digits : guint);
  88. function numeric(var a : TGtkSpinButton) : guint;
  89. procedure set_numeric(var a : TGtkSpinButton; __numeric : guint);
  90. function wrap(var a : TGtkSpinButton) : guint; overload;
  91. procedure set_wrap(var a : TGtkSpinButton; __wrap : guint); overload;
  92. function snap_to_ticks(var a : TGtkSpinButton) : guint;
  93. procedure set_snap_to_ticks(var a : TGtkSpinButton; __snap_to_ticks : guint);
  94. function gtk_spin_button_get_type:TGtkType; cdecl; external gtklib;
  95. procedure gtk_spin_button_configure(spin_button:PGtkSpinButton; adjustment:PGtkAdjustment; climb_rate:gdouble; digits:guint); cdecl; external gtklib;
  96. function gtk_spin_button_new(adjustment:PGtkAdjustment; climb_rate:gdouble; digits:guint):PGtkWidget; cdecl; external gtklib;
  97. function gtk_spin_button_new_with_range(min:gdouble; max:gdouble; step:gdouble):PGtkWidget; cdecl; external gtklib;
  98. procedure gtk_spin_button_set_adjustment(spin_button:PGtkSpinButton; adjustment:PGtkAdjustment); cdecl; external gtklib;
  99. function gtk_spin_button_get_adjustment(spin_button:PGtkSpinButton):PGtkAdjustment; cdecl; external gtklib;
  100. procedure gtk_spin_button_set_digits(spin_button:PGtkSpinButton; digits:guint); cdecl; external gtklib;
  101. function gtk_spin_button_get_digits(spin_button:PGtkSpinButton):guint; cdecl; external gtklib;
  102. procedure gtk_spin_button_set_increments(spin_button:PGtkSpinButton; step:gdouble; page:gdouble); cdecl; external gtklib;
  103. procedure gtk_spin_button_get_increments(spin_button:PGtkSpinButton; step:Pgdouble; page:Pgdouble); cdecl; external gtklib;
  104. procedure gtk_spin_button_set_range(spin_button:PGtkSpinButton; min:gdouble; max:gdouble); cdecl; external gtklib;
  105. procedure gtk_spin_button_get_range(spin_button:PGtkSpinButton; min:Pgdouble; max:Pgdouble); cdecl; external gtklib;
  106. function gtk_spin_button_get_value(spin_button:PGtkSpinButton):gdouble; cdecl; external gtklib;
  107. function gtk_spin_button_get_value_as_int(spin_button:PGtkSpinButton):gint; cdecl; external gtklib;
  108. procedure gtk_spin_button_set_value(spin_button:PGtkSpinButton; value:gdouble); cdecl; external gtklib;
  109. procedure gtk_spin_button_set_update_policy(spin_button:PGtkSpinButton; policy:TGtkSpinButtonUpdatePolicy); cdecl; external gtklib;
  110. function gtk_spin_button_get_update_policy(spin_button:PGtkSpinButton):TGtkSpinButtonUpdatePolicy; cdecl; external gtklib;
  111. procedure gtk_spin_button_set_numeric(spin_button:PGtkSpinButton; numeric:gboolean); cdecl; external gtklib;
  112. function gtk_spin_button_get_numeric(spin_button:PGtkSpinButton):gboolean; cdecl; external gtklib;
  113. procedure gtk_spin_button_spin(spin_button:PGtkSpinButton; direction:TGtkSpinType; increment:gdouble); cdecl; external gtklib;
  114. procedure gtk_spin_button_set_wrap(spin_button:PGtkSpinButton; wrap:gboolean); cdecl; external gtklib;
  115. function gtk_spin_button_get_wrap(spin_button:PGtkSpinButton):gboolean; cdecl; external gtklib;
  116. procedure gtk_spin_button_set_snap_to_ticks(spin_button:PGtkSpinButton; snap_to_ticks:gboolean); cdecl; external gtklib;
  117. function gtk_spin_button_get_snap_to_ticks(spin_button:PGtkSpinButton):gboolean; cdecl; external gtklib;
  118. procedure gtk_spin_button_update(spin_button:PGtkSpinButton); cdecl; external gtklib;
  119. {$ifndef GTK_DISABLE_DEPRECATED}
  120. function gtk_spin_button_get_value_as_float(spin_button:PGtkSpinButton):gdouble;
  121. {$endif}
  122. {$ENDIF read_interface_rest}
  123. //------------------------------------------------------------------------------
  124. {$IFDEF read_implementation}
  125. function GTK_TYPE_SPIN_BUTTON : GType;
  126. begin
  127. GTK_TYPE_SPIN_BUTTON:=gtk_spin_button_get_type;
  128. end;
  129. function GTK_SPIN_BUTTON(obj: pointer) : PGtkSpinButton;
  130. begin
  131. GTK_SPIN_BUTTON:=PGtkSpinButton(GTK_CHECK_CAST(obj,GTK_TYPE_SPIN_BUTTON));
  132. end;
  133. function GTK_SPIN_BUTTON_CLASS(klass: pointer) : PGtkSpinButtonClass;
  134. begin
  135. GTK_SPIN_BUTTON_CLASS:=PGtkSpinButtonClass(GTK_CHECK_CLASS_CAST(klass,GTK_TYPE_SPIN_BUTTON));
  136. end;
  137. function GTK_IS_SPIN_BUTTON(obj: pointer) : boolean;
  138. begin
  139. GTK_IS_SPIN_BUTTON:=GTK_CHECK_TYPE(obj,GTK_TYPE_SPIN_BUTTON);
  140. end;
  141. function GTK_IS_SPIN_BUTTON_CLASS(klass: pointer) : boolean;
  142. begin
  143. GTK_IS_SPIN_BUTTON_CLASS:=GTK_CHECK_CLASS_TYPE(klass,GTK_TYPE_SPIN_BUTTON);
  144. end;
  145. function GTK_SPIN_BUTTON_GET_CLASS(obj: pointer) : PGtkSpinButtonClass;
  146. begin
  147. GTK_SPIN_BUTTON_GET_CLASS:=PGtkSpinButtonClass(GTK_CHECK_GET_CLASS(obj,GTK_TYPE_SPIN_BUTTON));
  148. end;
  149. function in_child(var a : TGtkSpinButton) : guint;
  150. begin
  151. in_child:=(a.flag0 and bm_TGtkSpinButton_in_child) shr bp_TGtkSpinButton_in_child;
  152. end;
  153. procedure set_in_child(var a : TGtkSpinButton; __in_child : guint);
  154. begin
  155. a.flag0:=a.flag0 or ((__in_child shl bp_TGtkSpinButton_in_child) and bm_TGtkSpinButton_in_child);
  156. end;
  157. function click_child(var a : TGtkSpinButton) : guint;
  158. begin
  159. click_child:=(a.flag0 and bm_TGtkSpinButton_click_child) shr bp_TGtkSpinButton_click_child;
  160. end;
  161. procedure set_click_child(var a : TGtkSpinButton; __click_child : guint);
  162. begin
  163. a.flag0:=a.flag0 or ((__click_child shl bp_TGtkSpinButton_click_child) and bm_TGtkSpinButton_click_child);
  164. end;
  165. function button(var a : TGtkSpinButton) : guint;
  166. begin
  167. button:=(a.flag0 and bm_TGtkSpinButton_button) shr bp_TGtkSpinButton_button;
  168. end;
  169. procedure set_button(var a : TGtkSpinButton; __button : guint);
  170. begin
  171. a.flag0:=a.flag0 or ((__button shl bp_TGtkSpinButton_button) and bm_TGtkSpinButton_button);
  172. end;
  173. function need_timer(var a : TGtkSpinButton) : guint;
  174. begin
  175. need_timer:=(a.flag0 and bm_TGtkSpinButton_need_timer) shr bp_TGtkSpinButton_need_timer;
  176. end;
  177. procedure set_need_timer(var a : TGtkSpinButton; __need_timer : guint);
  178. begin
  179. a.flag0:=a.flag0 or ((__need_timer shl bp_TGtkSpinButton_need_timer) and bm_TGtkSpinButton_need_timer);
  180. end;
  181. function timer_calls(var a : TGtkSpinButton) : guint;
  182. begin
  183. timer_calls:=(a.flag0 and bm_TGtkSpinButton_timer_calls) shr bp_TGtkSpinButton_timer_calls;
  184. end;
  185. procedure set_timer_calls(var a : TGtkSpinButton; __timer_calls : guint);
  186. begin
  187. a.flag0:=a.flag0 or ((__timer_calls shl bp_TGtkSpinButton_timer_calls) and bm_TGtkSpinButton_timer_calls);
  188. end;
  189. function digits(var a : TGtkSpinButton) : guint;
  190. begin
  191. digits:=(a.flag0 and bm_TGtkSpinButton_digits) shr bp_TGtkSpinButton_digits;
  192. end;
  193. procedure set_digits(var a : TGtkSpinButton; __digits : guint);
  194. begin
  195. a.flag0:=a.flag0 or ((__digits shl bp_TGtkSpinButton_digits) and bm_TGtkSpinButton_digits);
  196. end;
  197. function numeric(var a : TGtkSpinButton) : guint;
  198. begin
  199. numeric:=(a.flag0 and bm_TGtkSpinButton_numeric) shr bp_TGtkSpinButton_numeric;
  200. end;
  201. procedure set_numeric(var a : TGtkSpinButton; __numeric : guint);
  202. begin
  203. a.flag0:=a.flag0 or ((__numeric shl bp_TGtkSpinButton_numeric) and bm_TGtkSpinButton_numeric);
  204. end;
  205. function wrap(var a : TGtkSpinButton) : guint;
  206. begin
  207. wrap:=(a.flag0 and bm_TGtkSpinButton_wrap) shr bp_TGtkSpinButton_wrap;
  208. end;
  209. procedure set_wrap(var a : TGtkSpinButton; __wrap : guint);
  210. begin
  211. a.flag0:=a.flag0 or ((__wrap shl bp_TGtkSpinButton_wrap) and bm_TGtkSpinButton_wrap);
  212. end;
  213. function snap_to_ticks(var a : TGtkSpinButton) : guint;
  214. begin
  215. snap_to_ticks:=(a.flag0 and bm_TGtkSpinButton_snap_to_ticks) shr bp_TGtkSpinButton_snap_to_ticks;
  216. end;
  217. procedure set_snap_to_ticks(var a : TGtkSpinButton; __snap_to_ticks : guint);
  218. begin
  219. a.flag0:=a.flag0 or ((__snap_to_ticks shl bp_TGtkSpinButton_snap_to_ticks) and bm_TGtkSpinButton_snap_to_ticks);
  220. end;
  221. {$ifndef GTK_DISABLE_DEPRECATED}
  222. function gtk_spin_button_get_value_as_float(spin_button:PGtkSpinButton):gdouble;
  223. begin
  224. gtk_spin_button_get_value_as_float:=gtk_spin_button_get_value(spin_button);
  225. end;
  226. {$endif}
  227. {$ENDIF read_implementation}
  228. // included by gtk2.pas