1 /** 2 Numerical input text field. 3 4 Copyright: 5 Copyright (c) 2007-2018 Juan Linietsky, Ariel Manzur. 6 Copyright (c) 2014-2018 Godot Engine contributors (cf. AUTHORS.md) 7 Copyright (c) 2017-2018 Godot-D contributors 8 9 License: $(LINK2 https://opensource.org/licenses/MIT, MIT License) 10 11 12 */ 13 module godot.spinbox; 14 import std.meta : AliasSeq, staticIndexOf; 15 import std.traits : Unqual; 16 import godot.d.meta; 17 import godot.core; 18 import godot.c; 19 import godot.d.bind; 20 import godot.d.reference; 21 import godot.object; 22 import godot.classdb; 23 import godot.range; 24 import godot.inputevent; 25 import godot.lineedit; 26 import godot.control; 27 import godot.canvasitem; 28 import godot.node; 29 /** 30 Numerical input text field. 31 32 SpinBox is a numerical input text field. It allows entering integers and floats. 33 */ 34 @GodotBaseClass struct SpinBox 35 { 36 enum string _GODOT_internal_name = "SpinBox"; 37 public: 38 @nogc nothrow: 39 union { godot_object _godot_object; Range _GODOT_base; } 40 alias _GODOT_base this; 41 alias BaseClasses = AliasSeq!(typeof(_GODOT_base), typeof(_GODOT_base).BaseClasses); 42 package(godot) __gshared bool _classBindingInitialized = false; 43 package(godot) static struct _classBinding 44 { 45 __gshared: 46 @GodotName("_gui_input") GodotMethod!(void, InputEvent) _guiInput; 47 @GodotName("_text_entered") GodotMethod!(void, String) _textEntered; 48 @GodotName("set_align") GodotMethod!(void, long) setAlign; 49 @GodotName("get_align") GodotMethod!(LineEdit.Align) getAlign; 50 @GodotName("set_suffix") GodotMethod!(void, String) setSuffix; 51 @GodotName("get_suffix") GodotMethod!(String) getSuffix; 52 @GodotName("set_prefix") GodotMethod!(void, String) setPrefix; 53 @GodotName("get_prefix") GodotMethod!(String) getPrefix; 54 @GodotName("set_editable") GodotMethod!(void, bool) setEditable; 55 @GodotName("is_editable") GodotMethod!(bool) isEditable; 56 @GodotName("_line_edit_focus_exit") GodotMethod!(void) _lineEditFocusExit; 57 @GodotName("get_line_edit") GodotMethod!(LineEdit) getLineEdit; 58 @GodotName("_line_edit_input") GodotMethod!(void, InputEvent) _lineEditInput; 59 @GodotName("_range_click_timeout") GodotMethod!(void) _rangeClickTimeout; 60 } 61 bool opEquals(in SpinBox other) const { return _godot_object.ptr is other._godot_object.ptr; } 62 SpinBox opAssign(T : typeof(null))(T n) { _godot_object.ptr = null; } 63 bool opEquals(typeof(null) n) const { return _godot_object.ptr is null; } 64 mixin baseCasts; 65 static SpinBox _new() 66 { 67 static godot_class_constructor constructor; 68 if(constructor is null) constructor = _godot_api.godot_get_class_constructor("SpinBox"); 69 if(constructor is null) return typeof(this).init; 70 return cast(SpinBox)(constructor()); 71 } 72 @disable new(size_t s); 73 /** 74 75 */ 76 void _guiInput(InputEvent arg0) 77 { 78 Array _GODOT_args = Array.empty_array; 79 _GODOT_args.append(arg0); 80 String _GODOT_method_name = String("_gui_input"); 81 this.callv(_GODOT_method_name, _GODOT_args); 82 } 83 /** 84 85 */ 86 void _textEntered(StringArg0)(in StringArg0 arg0) 87 { 88 Array _GODOT_args = Array.empty_array; 89 _GODOT_args.append(arg0); 90 String _GODOT_method_name = String("_text_entered"); 91 this.callv(_GODOT_method_name, _GODOT_args); 92 } 93 /** 94 95 */ 96 void setAlign(in long _align) 97 { 98 checkClassBinding!(typeof(this))(); 99 ptrcall!(void)(_classBinding.setAlign, _godot_object, _align); 100 } 101 /** 102 103 */ 104 LineEdit.Align getAlign() const 105 { 106 checkClassBinding!(typeof(this))(); 107 return ptrcall!(LineEdit.Align)(_classBinding.getAlign, _godot_object); 108 } 109 /** 110 111 */ 112 void setSuffix(StringArg0)(in StringArg0 suffix) 113 { 114 checkClassBinding!(typeof(this))(); 115 ptrcall!(void)(_classBinding.setSuffix, _godot_object, suffix); 116 } 117 /** 118 119 */ 120 String getSuffix() const 121 { 122 checkClassBinding!(typeof(this))(); 123 return ptrcall!(String)(_classBinding.getSuffix, _godot_object); 124 } 125 /** 126 127 */ 128 void setPrefix(StringArg0)(in StringArg0 prefix) 129 { 130 checkClassBinding!(typeof(this))(); 131 ptrcall!(void)(_classBinding.setPrefix, _godot_object, prefix); 132 } 133 /** 134 135 */ 136 String getPrefix() const 137 { 138 checkClassBinding!(typeof(this))(); 139 return ptrcall!(String)(_classBinding.getPrefix, _godot_object); 140 } 141 /** 142 143 */ 144 void setEditable(in bool editable) 145 { 146 checkClassBinding!(typeof(this))(); 147 ptrcall!(void)(_classBinding.setEditable, _godot_object, editable); 148 } 149 /** 150 151 */ 152 bool isEditable() const 153 { 154 checkClassBinding!(typeof(this))(); 155 return ptrcall!(bool)(_classBinding.isEditable, _godot_object); 156 } 157 /** 158 159 */ 160 void _lineEditFocusExit() 161 { 162 Array _GODOT_args = Array.empty_array; 163 String _GODOT_method_name = String("_line_edit_focus_exit"); 164 this.callv(_GODOT_method_name, _GODOT_args); 165 } 166 /** 167 168 */ 169 LineEdit getLineEdit() 170 { 171 checkClassBinding!(typeof(this))(); 172 return ptrcall!(LineEdit)(_classBinding.getLineEdit, _godot_object); 173 } 174 /** 175 176 */ 177 void _lineEditInput(InputEvent arg0) 178 { 179 Array _GODOT_args = Array.empty_array; 180 _GODOT_args.append(arg0); 181 String _GODOT_method_name = String("_line_edit_input"); 182 this.callv(_GODOT_method_name, _GODOT_args); 183 } 184 /** 185 186 */ 187 void _rangeClickTimeout() 188 { 189 Array _GODOT_args = Array.empty_array; 190 String _GODOT_method_name = String("_range_click_timeout"); 191 this.callv(_GODOT_method_name, _GODOT_args); 192 } 193 /** 194 195 */ 196 @property LineEdit.Align _align() 197 { 198 return getAlign(); 199 } 200 /// ditto 201 @property void _align(long v) 202 { 203 setAlign(v); 204 } 205 /** 206 207 */ 208 @property bool editable() 209 { 210 return isEditable(); 211 } 212 /// ditto 213 @property void editable(bool v) 214 { 215 setEditable(v); 216 } 217 /** 218 219 */ 220 @property String prefix() 221 { 222 return getPrefix(); 223 } 224 /// ditto 225 @property void prefix(String v) 226 { 227 setPrefix(v); 228 } 229 /** 230 231 */ 232 @property String suffix() 233 { 234 return getSuffix(); 235 } 236 /// ditto 237 @property void suffix(String v) 238 { 239 setSuffix(v); 240 } 241 }