Login button creates a login window
This commit is contained in:
parent
697a71f2d2
commit
bb2ab0348b
2 changed files with 29 additions and 1 deletions
27
src/main/kotlin/org/bm00/DataAccessor/windows/LoginWindow.kt
Normal file
27
src/main/kotlin/org/bm00/DataAccessor/windows/LoginWindow.kt
Normal file
|
@ -0,0 +1,27 @@
|
|||
package org.bm00.DataAccessor.windows
|
||||
|
||||
import jexer.TAction
|
||||
import jexer.TApplication
|
||||
import jexer.TWindow
|
||||
import jexer.layout.StretchLayoutManager
|
||||
|
||||
class LoginWindow private constructor(parent: TApplication, flags: Int) :
|
||||
TWindow(parent, "Login", 0, 0, 46, 10, flags) {
|
||||
constructor(parent: TApplication) : this(parent, CENTERED)
|
||||
|
||||
init {
|
||||
setLayoutManager(
|
||||
StretchLayoutManager(
|
||||
width - 2,
|
||||
height - 2
|
||||
)
|
||||
)
|
||||
|
||||
addButton("Exit...", CENTERED + 28, CENTERED,
|
||||
object : TAction() {
|
||||
override fun DO() {
|
||||
System.exit(0)
|
||||
}
|
||||
}
|
||||
)
|
||||
}}
|
|
@ -4,6 +4,7 @@ import jexer.TAction
|
|||
import jexer.TApplication
|
||||
import jexer.TWindow
|
||||
import jexer.layout.StretchLayoutManager
|
||||
import org.bm00.DataAccessor.main
|
||||
|
||||
class WelcomeWindow private constructor(parent: TApplication, flags: Int) :
|
||||
TWindow(parent, "O.S.D.A.", 0, 0, 46, 10, flags) {
|
||||
|
@ -38,7 +39,7 @@ class WelcomeWindow private constructor(parent: TApplication, flags: Int) :
|
|||
addButton("Login", CENTERED, CENTERED,
|
||||
object : TAction() {
|
||||
override fun DO() {
|
||||
TODO("Create the login prompt")
|
||||
LoginWindow(parent)
|
||||
}
|
||||
}
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue