comparison android/DWindows.kt @ 2481:94f0d61d6953

Android: Initial commit of signal handlers, connecting buttons to the new system.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Mon, 26 Apr 2021 11:01:58 +0000
parents 878d36588aaa
children 4888503c3e3e
comparison
equal deleted inserted replaced
2480:878d36588aaa 2481:94f0d61d6953
127 127
128 fun buttonNew(text: String, cid: Int): Button 128 fun buttonNew(text: String, cid: Int): Button
129 { 129 {
130 val button = Button(this) 130 val button = Button(this)
131 button.text = text 131 button.text = text
132 button.setOnClickListener { eventHandler(button, button, 8, "", "", 0, 0, 0, 0) }
132 return button 133 return button
133 } 134 }
134 135
135 fun entryfieldNew(text: String, cid: Int, password: Int): EditText 136 fun entryfieldNew(text: String, cid: Int, password: Int): EditText
136 { 137 {
144 145
145 fun radioButtonNew(text: String, cid: Int): RadioButton 146 fun radioButtonNew(text: String, cid: Int): RadioButton
146 { 147 {
147 val radiobutton = RadioButton(this) 148 val radiobutton = RadioButton(this)
148 radiobutton.text = text 149 radiobutton.text = text
150 radiobutton.setOnClickListener { eventHandler(radiobutton, radiobutton, 8, "", "", 0, 0, 0, 0) }
149 return radiobutton 151 return radiobutton
150 } 152 }
151 153
152 fun checkboxNew(text: String, cid: Int): CheckBox 154 fun checkboxNew(text: String, cid: Int): CheckBox
153 { 155 {
166 /* 168 /*
167 * Native methods that are implemented by the 'dwindows' native library, 169 * Native methods that are implemented by the 'dwindows' native library,
168 * which is packaged with this application. 170 * which is packaged with this application.
169 */ 171 */
170 external fun dwindowsInit(dataDir: String): String 172 external fun dwindowsInit(dataDir: String): String
173 external fun eventHandler(obj1: Any, obj2: Any, message: Int, str1: String, str2: String, int1: Int, int2: Int, int3: Int, int4: Int): Int
171 174
172 companion object 175 companion object
173 { 176 {
174 // Used to load the 'dwindows' library on application startup. 177 // Used to load the 'dwindows' library on application startup.
175 init 178 init