From ebd49cefb3e07b1d4139320ba54a900ccc8ece22 Mon Sep 17 00:00:00 2001 From: Bronley Date: Fri, 9 Jul 2021 06:21:24 -0400 Subject: [PATCH] Finished with initial flow --- components/JFButton.brs | 21 +++++++++++++++++ components/JFButton.xml | 7 ++++++ components/config/SetServerScreen.brs | 21 ++++++++--------- components/config/SetServerScreen.xml | 25 ++++++++++---------- source/Main.brs | 10 ++++---- source/ShowScenes.brs | 22 ++++-------------- source/utils/misc.brs | 33 ++++++++++++++++++++++++--- 7 files changed, 89 insertions(+), 50 deletions(-) create mode 100644 components/JFButton.brs create mode 100644 components/JFButton.xml diff --git a/components/JFButton.brs b/components/JFButton.brs new file mode 100644 index 00000000..98de4ed6 --- /dev/null +++ b/components/JFButton.brs @@ -0,0 +1,21 @@ +sub init() + m.top.observeFieldScoped("text", "onTextChanged") + m.top.iconUri = "" + m.top.focusedIconUri = "" + m.top.showFocusFootprint = true + m.top.minWidth = 0 +end sub + +sub onTextChanged() + addSpaceAfter = true + minChars = m.top.minChars + if minChars = invalid then minChars = 50 + while m.top.text.Len() < minChars + if addSpaceAfter then + m.top.text = m.top.text + Chr(160) + else + m.top.text = Chr(160) + m.top.text + end if + addSpaceAfter = addSpaceAfter = false + end while +end sub diff --git a/components/JFButton.xml b/components/JFButton.xml new file mode 100644 index 00000000..a4bf7db8 --- /dev/null +++ b/components/JFButton.xml @@ -0,0 +1,7 @@ + + + + + +