B4J Question [BANano] Skeleton several things

angel_

Well-Known Member
Licensed User
Longtime User
Is it possible to reduce the dimensions of the views and the font size for a specific layout?
How can I get the size of SKCombo?
How can I "activate" multiline in SKTextBox or are there better alternatives?

· Minor bugs?
No event from designer for SKCheckbox
When we put .Enabled = False in SKRadio, SKCheckbox, the text does not change color
The SKRadio event from the designer is _Click but it actually works with _Change

· Wishes
Have prefix, suffix and label simultaneously in the SKTextBox
Add GetDefaultLocalStorage2(key, default)
 
Last edited:
Solution
Try this one. Pretty much untested (take a backup!), but this should be added/changed:

1. SKCombo and SKDropDown got a size property
2. SKRadio and SKCheckbox both have the _Change event
3. .Enabled on SKCheckbox and SKRadio should change label color
4. Label also possible if using prefix/suffix

Download v7.40: http://gorgeousapps.com/BANanoSkeleton.b4xlib

Alwaysbusy

alwaysbusy

Expert
Licensed User
Longtime User
1. Is it possible to reduce the dimensions of the views and the font size for a specific layout?

That is just the way the components are designed. You either dive into the CSS of each component and make changes, or a quick and dirty way could be by adding this to Main:
B4X:
#if CSS
    body {
        zoom: 80%;
    }
#End If
NOTE: the user can overrule this by pressing Ctrl +/- as this is a browser functionality.

2. How can I get the size of SKCombo?

What do you mean by that? As you are the one that adds the number of things to the combo, you should keep track of it.

3. How can I "activate" multiline in SKTextBox or are there better alternatives?

An SKTextBox is always single line. The multiline version in HTML is a SKTextArea

4. No event from designer for SKCheckbox

Probably the same issue as with SKRadio but not yet exposed. Try Sub Chk_Change(event As BANanoEvent)

5. When we put .Enabled = False in SKRadio, SKCheckbox, the text does not change color

Not a bug. Guess the original Skeleton CSS lib did not implement this in their CSS.

6. The SKRadio event from the designer is _Click but it actually works with _Change

Will be fixed, together with similar issue in SKCheckBox

7. Have prefix, suffix and label simultaneously in the SKTextBox

As I said, I will check if this is possible

8. Add GetDefaultLocalStorage2(key, default)

The Storage methods are one-on-one wraps of the original JavaScript methods. There is no build-in functionality like that in JavaScript because this is very easy to write yourself with an 'Or':

B4X:
BANano.SetLocalStorage2("test", "hello")
Dim result As String = BANano.GetLocalStorage2("test") Or "default"
Log(result) ' exists so -> hello
Dim result As String = BANano.GetLocalStorage2("test2") Or "default"
Log(result) ' does not exist so -> default

I'll try to find some time this weekend to update the BANanoSkeleton lib with your findings.

Alwaysbusy
 
Upvote 0

angel_

Well-Known Member
Licensed User
Longtime User
2. How can I get the size of SKCombo?

What do you mean by that? As you are the one that adds the number of things to the combo, you should keep track of it.
Sometimes the number of items of the skcombo is variable, the question was asking if there was something like skcombo.size to know the number of elements

8. Add GetDefaultLocalStorage2(key, default)
B4X:
BANano.SetLocalStorage2("test", "hello")
Dim result As String = BANano.GetLocalStorage2("test") Or "default"
Log(result) ' exists so -> hello
Dim result As String = BANano.GetLocalStorage2("test2") Or "default"
Log(result) ' does not exist so -> default
Perfect!!

Thank you very much
 
Upvote 0

alwaysbusy

Expert
Licensed User
Longtime User
Try this one. Pretty much untested (take a backup!), but this should be added/changed:

1. SKCombo and SKDropDown got a size property
2. SKRadio and SKCheckbox both have the _Change event
3. .Enabled on SKCheckbox and SKRadio should change label color
4. Label also possible if using prefix/suffix

Download v7.40: http://gorgeousapps.com/BANanoSkeleton.b4xlib

Alwaysbusy
 
Last edited:
Upvote 0
Solution

angel_

Well-Known Member
Licensed User
Longtime User
1. SKCombo and SKDropDown got a size property
Sorry, I didn't see it

2. SKRadio and SKCheckbox both have the _Change event
It works perfect, (maybe _Click was a bit more logical since it is fired without the need to change)

3. .Enabled on SKCheckbox and SKRadio should change label color
It works perfect

4. Label also possible if using prefix/suffix
From the designer it works fine but from code it is not possible to see. I also see a slightly higher gap than it was before, would it be possible to keep the same gap?

Thank you very much for these important changes.
 

Attachments

  • capture.jpg
    capture.jpg
    7.2 KB · Views: 82
Upvote 0

alwaysbusy

Expert
Licensed User
Longtime User
I also see a slightly higher gap than it was before
Should be fixed. Download from same link as in the post before. (7.40 now)

From the designer it works fine but from code it is not possible to see.
I don't know what you mean. Seems to be working fine from code:

B4X:
Dim sktext As SKTextBox
sktext.Initialize(Me, "sktext", "sktext")
sktext.Label = "MyLabel"
sktext.BeforeText = "Before"
sktext.AfterText = "After"
sktext.PlaceHolder = "Placeholder..."
sktext.FullWidth = True
    
sktext.AddToParent("skcontainer2u")

1662447227921.png


Alwaysbusy
 
Upvote 0

angel_

Well-Known Member
Licensed User
Longtime User
Should be fixed. Download from same link as in the post before. (7.40 now)
Thank you

I don't know what you mean. Seems to be working fine from code:

B4X:
Dim sktext As SKTextBox
sktext.Initialize(Me, "sktext", "sktext")
sktext.Label = "MyLabel"
sktext.BeforeText = "Before"
sktext.AfterText = "After"
sktext.PlaceHolder = "Placeholder..."
sktext.FullWidth = True
    
sktext.AddToParent("skcontainer2u")
If I have added in the designer sktext and then put this in the code, the prefix and suffix are not displayed
B4X:
sktext.Label = "MyLabel"
sktext.BeforeText = "Before"
sktext.AfterText = "After"
sktext.PlaceHolder = "Placeholder..."
sktext.FullWidth = True
 
Upvote 0

alwaysbusy

Expert
Licensed User
Longtime User
That is correct and the expected behavior. It is either code or abstract designer. If you want to change one from the abstract designer in code, you will need to put 'something' in these fields in the abstract designer because the layout has to be prepared (with all kind of html tag wrappers)
 
Upvote 0
Top