Wish [B4X] More consistency in B4X controls.

MrKim

Well-Known Member
Licensed User
Longtime User
See this post
I lose a LOT of time trying to figure out how to get the various components working across multiple platforms. The link is a good example of the sort of thing I am always running into. It would be REALLY nice if at least the context help that pops up would let you know which platforms a given function is available on. Think about how much time this cost me. Add is a command for a combo box. I had to come search for the Add command three different times and the final time I find out the command doesn't even exist. When I first did the list I used SetItems which is common to all. What I needed to do is add one item if the user chooses custom. But SetItems was there and is easier for just one item so I used it. Now I have to go back and rewrite the code to use SetItems.
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
1. 100% of the public methods in XUI Views are cross platform.
2. As I don't like to limit developers, most of the internal fields are also exposed. Once you access an internal field, not everything is cross platform.
3. The XUI Views example fills a B4XComboBox and it obviously does it with the only relevant public method, which is SetItems.
It should be clear that the main feature of a cross platform combobox doesn't require such code:
B4X:
        #IF B4A
PortNumCmbo.cmbBox.Add(MP.DCUTs.smgr.Get("PortNum"))
#ELSE IF B4J
PortNumCmbo.cmbBox.Items.Add(MP.DCUTs.smgr.Get("PortNum"))
#Else
PortNumCmbo.????
        #End If
If you start writing such code then stop and look again in the available methods. This is of course not the correct way to do it.
 

MrKim

Well-Known Member
Licensed User
Longtime User
1. 100% of the public methods in XUI Views are cross platform.
Ahh, now I think I understand! So in my example only what is available with PortNumCmbo.XXX is guaranteed to be cross platform?
I have seen so much use of B4XXXX.mBase.XXX I didn't realize that once you get beyond the original DOT you were in uncharted territory.
Thanks for making that clear.
 
Top