2021-02-27 19:02:30 +00:00
|
|
|
package net.shadowfacts.cacao.view.textfield
|
|
|
|
|
|
|
|
/**
|
2021-02-28 17:19:09 +00:00
|
|
|
* A simple, no-frills text field. This text field accepts any value.
|
|
|
|
*
|
2021-02-27 19:02:30 +00:00
|
|
|
* @author shadowfacts
|
2021-02-28 17:19:09 +00:00
|
|
|
* @param initialText The initial value of this text field.
|
|
|
|
* @param handler A function that is invoked when the value of the text field changes.
|
2021-02-27 19:02:30 +00:00
|
|
|
*/
|
2021-02-28 17:19:09 +00:00
|
|
|
class TextField(
|
|
|
|
initialText: String,
|
|
|
|
handler: ((TextField) -> Unit)? = null
|
|
|
|
): AbstractTextField<TextField>(initialText) {
|
|
|
|
init {
|
2021-02-27 19:02:30 +00:00
|
|
|
this.handler = handler
|
|
|
|
}
|
|
|
|
|
|
|
|
override fun validate(proposedText: String): Boolean {
|
|
|
|
return true
|
|
|
|
}
|
|
|
|
}
|