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