I'm happy to announce the publication of my new B4XView library.
This library adds to the XUi Views the native views of the three platforms (Android / IOS / Desktop) so that they can be managed by Design, using them as XUI views without having to change its type in the Globals Sub.
With this Library the views have the same properties and identical events, and you can also access the original view and more properties, method and animation not included natively.
This will allow you to reuse the code written for a platform on the others without any changes.
Also I'm adding custom views and animations not included natively.

Included this view
videoa-gif.71130
Other views not included in this list (such as XCustomListView or XComboBox, B4XComboBox, LoadingIndicator, CicularProgressBar, RadarProgressView, GaugeView, RulerPicker, RoundSlider, CaptchaView, etc.. ) will not be included in the future because they already exist. Many sources have been made available just search the forum.
NOTICE. Unfortunately in the IOS version it occupies more than 500Kb, so I compressed with RAR and then with ZIP. to decompress it, you must use WinRar

SD_XUIView

Author:
Star-Dust
Version: 0.16
  • B4XButton
    • Events:
      • DoubleOrLongClick
      • OneClick
      • Touch (Action As Int, Coordinate() As Tp_Coordinate)
    • Fields:
      • Action_Click As Int
      • Action_DoubleClick As Int
      • Action_Down As Int
      • Action_Drag As Int
      • Action_LongClick As Int
      • Action_LoseTouch As Int
      • Action_Up As Int
      • MinMoveAccept As Int
      • Tag As Object
    • Functions:
      • AddToParent (PanelToAdd As B4XView, Left As Int, Top As Int, Width As Int, Height As Int) As String
      • B4XObject As B4XView
      • BringToFront As String
      • Class_Globals As String
      • DesignerCreateView (Base As Object, Lbl As Label, Props As Map) As String
        Base type must be Object
      • GetAllViewsRecursive As List
      • GetBase As Panel
      • GetView (Index As Int) As B4XView
      • Initialize (Callback As Object, EventName As String) As String
      • IsInitialized As Boolean
        Verifica se l'oggetto sia stato inizializzato.
      • NativeObject As Button
      • RemoveAllViews As String
      • RemoveViewFromParent As String
      • RequestFocus As String
      • ReSetEvent (Callback As Object, EventName As String) As String
      • Rotate (AngleX As Float, AngleY As Float, AngleZ As Float) As String
      • SendToBack As String
      • Snapshot As B4XView
    • Properties:
      • Color As Int
      • Enable As Boolean
      • Font
      • Height As Int
      • Left As Int
      • Top As Int
      • Visible As Boolean
      • Width As Int
  • B4XCalendarPicker
    • Events:
      • Click
    • Fields:
      • Color As Int
      • Square As Boolean
      • Tag As Object
      • TextColor As Int
      • TextSize As Int
      • Title As String
    • Functions:
      • BringToFront As String
      • Class_Globals As String
      • DesignerCreateView (Base As Object, Lbl As Label, Props As Map) As String
        Base type must be Object
      • GetAllViewsRecursive As List
      • GetBase As Panel
      • GetView (Index As Int) As B4XView
      • Initialize (CallBack As Object, EventName As String) As String
      • IsInitialized As Boolean
        Verifica se l'oggetto sia stato inizializzato.
      • RemoveViewFromParent As String
      • RequestFocus As String
      • ReSetEvent (Callback As Object, EventName As String) As String
      • Rotate (AngleX As Float, AngleY As Float, AngleZ As Float) As String
      • SendToBack As String
      • Snapshot As B4XView
    • Properties:
      • Date As Long
      • Enable As Boolean
      • Height As Int
      • Left As Int
      • Top As Int
      • Visible As Boolean
      • Width As Int
  • B4XCheckBox
    • Events:
      • Click
    • Fields:
      • Action_Click As Int
      • Action_DoubleClick As Int
      • Action_Down As Int
      • Action_Drag As Int
      • Action_LongClick As Int
      • Action_LoseTouch As Int
      • Action_Up As Int
      • MinMoveAccept As Int
    • Functions:
      • AddToParent (PanelToAdd As B4XView, Left As Int, Top As Int, Width As Int, Height As Int) As String
      • BringToFront As String
      • Class_Globals As String
      • DesignerCreateView (Base As Object, Lbl As Label, Props As Map) As String
        Base type must be Object
      • GetAllViewsRecursive As List
      • GetBase As Panel
      • GetView (Index As Int) As B4XView
      • Initialize (Callback As Object, EventName As String) As String
      • IsInitialized As Boolean
        Verifica se l'oggetto sia stato inizializzato.
      • RemoveAllViews As String
      • RemoveViewFromParent As String
      • RequestFocus As String
      • ReSetEvent (Callback As Object, EventName As String) As String
      • Rotate (AngleX As Float, AngleY As Float, AngleZ As Float) As String
      • SendToBack As String
      • Snapshot As B4XView
    • Properties:
      • Check As Boolean
      • Color As Int
      • Enable As Boolean
      • Font
      • Height As Int
      • Left As Int
      • Top As Int
      • Visible As Boolean
      • Width As Int
  • B4XEditText
    • Events:
      • DoubleOrLongClick
      • EnterPressed
      • FocusChanged
      • OneClick
      • TextChanged (Old As String, New As String)
    • Fields:
      • Action_Click As Int
      • Action_DoubleClick As Int
      • Action_Down As Int
      • Action_Drag As Int
      • Action_LongClick As Int
      • Action_LoseTouch As Int
      • Action_Up As Int
      • Tag As Object
    • Functions:
      • AddToParent (PanelToAdd As B4XView, Left As Int, Top As Int, Width As Int, Height As Int) As String
      • B4XObject As B4XView
      • BringToFront As String
      • Class_Globals As String
      • DesignerCreateView (Base As Object, Lbl As Label, Props As Map) As String
        Base type must be Object
      • GetAllViewsRecursive As List
      • GetBase As Panel
      • GetView (Index As Int) As B4XView
      • Initialize (Callback As Object, EventName As String) As String
      • IsInitialized As Boolean
        Verifica se l'oggetto sia stato inizializzato.
      • NativeObjct As EditText
      • RemoveAllViews As String
      • RemoveViewFromParent As String
      • RequestFocus As String
      • ReSetEvent (Callback As Object, EventName As String) As String
      • Rotate (AngleX As Float, AngleY As Float, AngleZ As Float) As String
      • SendToBack As String
      • setSelection (StartIndex As Int, EndIndex As Int) As String
      • Snapshot As B4XView
    • Properties:
      • Color As Int
      • CursorVisible
      • Ellipsize As String
      • Enable As Boolean
      • Font
      • ForceDoneButton
      • Height As Int
      • Left As Int
      • SelectionEnd As Int [read only]
      • SelectionStart As Int [read only]
      • TextIsEditable
      • TextIsSelectable
      • Top As Int
      • Typeface
      • Visible As Boolean
      • Width As Int
  • B4XLabel
    • Events:
      • DoubleOrLongClick
      • OneClick
      • Touch (Action As Int, Coordinate() As Tp_Coordinate)
    • Fields:
      • Action_Click As Int
      • Action_DoubleClick As Int
      • Action_Down As Int
      • Action_Drag As Int
      • Action_LongClick As Int
      • Action_LoseTouch As Int
      • Action_Up As Int
      • MinMoveAccept As Int
      • Tag As Object
    • Functions:
      • AddToParent (PanelToAdd As B4XView, Left As Int, Top As Int, Width As Int, Height As Int) As String
      • B4XObject As B4XView
      • BringToFront As String
      • Class_Globals As String
      • DesignerCreateView (Base As Object, Lbl As Label, Props As Map) As String
        Base type must be Object
      • GetAllViewsRecursive As List
      • GetBase As Panel
      • GetView (Index As Int) As B4XView
      • Initialize (Callback As Object, EventName As String) As String
      • IsInitialized As Boolean
        Verifica se l'oggetto sia stato inizializzato.
      • NativeObject As Label
      • RemoveViewFromParent As String
      • RequestFocus As String
      • ReSetEvent (Callback As Object, EventName As String) As String
      • Rotate (AngleX As Float, AngleY As Float, AngleZ As Float) As String
      • SendToBack As String
      • Snapshot As B4XView
    • Properties:
      • Color As Int
      • Enable As Boolean
      • Font
      • Height As Int
      • Left As Int
      • TextAppear
      • TextFind
      • TextRoll
      • TextScroll
      • Top As Int
      • Visible As Boolean
      • Width As Int
  • B4XPanel
    • Events:
      • DoubleOrLongClick
      • Moved
      • OneClick
      • Resized
      • Touch (Action As Int, Coordinate() As Tp_Coordinate)
    • Fields:
      • Action_Click As Int
      • Action_DoubleClick As Int
      • Action_Down As Int
      • Action_Drag As Int
      • Action_LongClick As Int
      • Action_LoseTouch As Int
      • Action_Up As Int
      • AllSurfaceMove As Boolean
      • MinMoveAccept As Int
      • Movible As Boolean
      • Resizable As Boolean
      • Tag As Object
    • Functions:
      • AddToParent (PanelToAdd As B4XView, Left As Int, Top As Int, Width As Int, Height As Int) As String
      • AddView (View As B4XView, Left As Int, Top As Int, Width As Int, Height As Int) As String
      • B4XObject As B4XView
      • BringToFront As String
      • Class_Globals As String
      • DesignerCreateView (Base As Object, Lbl As Label, Props As Map) As String
        Base type must be Object
      • EmbedView (View As B4XView) As String
      • GetAllViewsRecursive As List
      • GetBase As Panel
      • GetView (Index As Int) As B4XView
      • Initialize (Callback As Object, EventName As String) As String
      • IsInitialized As Boolean
        Verifica se l'oggetto sia stato inizializzato.
      • NativeObject As Panel
      • RemoveAllViews As String
      • RemoveViewFromParent As String
      • RequestFocus As String
      • ReSetEvent (Callback As Object, EventName As String) As String
      • Rotate (AngleX As Float, AngleY As Float, AngleZ As Float) As String
      • SendToBack As String
      • Snapshot As B4XView
    • Properties:
      • Enable As Boolean
      • Height As Int
      • Left As Int
      • Top As Int
      • Visible As Boolean
      • Width As Int
  • B4XProgressBar
    • Fields:
      • Tag As Object
    • Functions:
      • AddToParent (PanelToAdd As B4XView, Left As Int, Top As Int, Width As Int, Height As Int) As String
      • BringToFront As String
      • Class_Globals As String
      • DesignerCreateView (Base As Object, Lbl As Label, Props As Map) As String
        Base type must be Object
      • GetBase As Panel
      • GetView (Index As Int) As B4XView
      • Initialize (Callback As Object, EventName As String) As String
      • IsInitialized As Boolean
        Verifica se l'oggetto sia stato inizializzato.
      • RemoveViewFromParent As String
      • RequestFocus As String
      • ReSetEvent (Callback As Object, EventName As String) As String
      • Rotate (AngleX As Float, AngleY As Float, AngleZ As Float) As String
      • SendToBack As String
      • Snapshot As B4XView
    • Properties:
      • BackgroundColor
      • BarColor
      • Enable As Boolean
      • Height As Int
      • Left As Int
      • Top As Int
      • Value As Float
      • Visible As Boolean
      • Width As Int
  • B4XSeek_Bar
    • Events:
      • ChangeValue (Value As Float)
    • Fields:
      • Tag As Object
    • Functions:
      • AddToParent (PanelToAdd As B4XView, Left As Int, Top As Int, Width As Int, Height As Int) As String
      • BringToFront As String
      • Class_Globals As String
      • DesignerCreateView (Base As Object, Lbl As Label, Props As Map) As String
        Base type must be Object
      • GetBase As Panel
      • GetView (Index As Int) As B4XView
      • Initialize (Callback As Object, EventName As String) As String
      • IsInitialized As Boolean
        Verifica se l'oggetto sia stato inizializzato.
      • RemoveViewFromParent As String
      • RequestFocus As String
      • ReSetEvent (Callback As Object, EventName As String) As String
      • Rotate (AngleX As Float, AngleY As Float, AngleZ As Float) As String
      • SendToBack As String
      • Snapshot As B4XView
    • Properties:
      • Enable As Boolean
      • Height As Int
      • Left As Int
      • Top As Int
      • Value As Float
      • Visible As Boolean
      • Width As Int
  • Tp_Coordinate
    • Fields:
      • IsInitialized As Boolean
        Verifica se l'oggetto sia stato inizializzato.
      • x As Int
      • y As Int
    • Functions:
      • Initialize
        Inizializza i campi al loro valore predefinito.
  • xRadioButton
    • Events:
      • Click
    • Fields:
      • Action_Click As Int
      • Action_DoubleClick As Int
      • Action_Down As Int
      • Action_Drag As Int
      • Action_LongClick As Int
      • Action_LoseTouch As Int
      • Action_Up As Int
      • MinMoveAccept As Int
      • Tag As Object
    • Functions:
      • AddToParent (PanelToAdd As B4XView, Left As Int, Top As Int, Width As Int, Height As Int) As String
      • BringToFront As String
      • Class_Globals As String
      • DesignerCreateView (Base As Object, Lbl As Label, Props As Map) As String
        Base type must be Object
      • GetAllViewsRecursive As List
      • GetBase As Panel
      • GetView (Index As Int) As B4XView
      • Initialize (Callback As Object, EventName As String) As String
      • IsInitialized As Boolean
        Verifica se l'oggetto sia stato inizializzato.
      • RemoveAllViews As String
      • RemoveViewFromParent As String
      • RequestFocus As String
      • ReSetEvent (Callback As Object, EventName As String) As String
      • Rotate (AngleX As Float, AngleY As Float, AngleZ As Float) As String
      • SendToBack As String
      • Snapshot As B4XView
    • Properties:
      • Check As Boolean
      • Color As Int
      • Enable As Boolean
      • Font
      • Height As Int
      • Left As Int
      • Top As Int
      • Visible As Boolean
      • Width As Int

_________________________________________________________________________

For ios download here
 

Attachments

  • SD_XUIView 0.16.zip
    72 KB · Views: 203
  • jSD_XUIView 0.16.zip
    68.9 KB · Views: 172
Last edited:

Star-Dust

Expert
Licensed User
Longtime User
Update rel 0.06 - Fix Bugs
 

Star-Dust

Expert
Licensed User
Longtime User
Update rel 0.07
Added in CalendarPiker the possibility to set from Calendar the calendar starting from today's date (DateTime.Now)
 

Jack Cole

Well-Known Member
Licensed User
Longtime User
It is good to add cross platform controls that do not exist as native controls.
It is a mistake to wrap existing native views. It only makes things more complicated.

It all depends on what your goals are. A top goal of mine is to minimize code differences across platforms. I *think* one of your primary goals is to remain true to the underlying native system (correct me if I'm wrong). I was personally pleased to find this library and that SD had wrapped the native panels and labels. I personally find it to be a weakness of b4x that some methods and UI types are different between b4a, b4i, and especially b4j. Like with b4j, you have Panes instead of Panels. In b4i, you have RemoveViewFromParent as a view method as opposed to RemoveView in b4a. I'm not sure I understand the philosophy behind those choices. I'm sure you have a reason, because you are a masterful developer. I just love the idea of consistency across platforms and efficiency in the development process.

I would like it if you could add a method to your XUI Views similar to SD's AddToParent method, which would allow programmatic view creation.

The B4XPanel and Labels makes me consider porting some apps to b4j. It is nice to have a consistent set of methods and types across platforms. It is also nice to be able to programmatically add views (not as a primary UI method, but there are times when it is needed).
 

Jack Cole

Well-Known Member
Licensed User
Longtime User
I get an error trying to use this library in b4i while using Erel's XUI Views library.

In file included from /Users/jackcole/Desktop/b4ibuilder/UploadedProjects/<user id>/B4iProject/b4i_wordmemory2.m:113:
/Users/jackcole/Desktop/b4ibuilder/UploadedProjects/<user id>/B4iProject/b4i_b4xseekbar.h:166:1: error: duplicate interface definition for class 'b4i_b4xseekbar'
@interface b4i_b4xseekbar : B4IClass
^
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
I personally find it to be a weakness of b4x that some methods and UI types are different between b4a, b4i, and especially b4j. Like with b4j, you have Panes instead of Panels. In b4i, you have RemoveViewFromParent as a view method as opposed to RemoveView in b4a. I'm not sure I understand the philosophy behind those choices. I'm sure you have a reason, because you are a masterful developer. I just love the idea of consistency across platforms and efficiency in the development process.
All the inconsistencies you described are solved with XUI library. You need to learn how to work with B4XView. You don't need any other wrapper.
I will write it again as it keeps confusing developers:
All the inconsistencies you described are solved with XUI library. You need to learn how to work with B4XView.
More information here: https://www.b4x.com/android/forum/threads/b4x-xui-cross-platform-native-ui-library.84359/#content

BTW, it is trivial to work with B4XView and you don't lose anything as you can switch back and forth between the native type and B4XView. In fact it is simpler to work with B4XViews and B4XView includes methods that are not available in the native types.
 
Last edited:

LucaMs

Expert
Licensed User
Longtime User

(there)
2. Use B4XViews whenever possible and whenever it makes sense. You can change the types of views added with the designer to B4XView:
B4X:
Sub Globals
Private clv1 As CustomListView
Private clv2 As CustomListView
Private Label1 As B4XView '<--- manually change to B4XView
Private CheckBox1 As B4XView
End Sub

Remove that comment: "<--- manually...

(O.T., I know, but I don't think I should open a new thread just for this suggestion 😊)
 

angel_

Well-Known Member
Licensed User
Longtime User
When I load this library with XUI Views and try to compile it appears these errors

B4X:
...
/Users/administrator/Documents/UploadedProjects/<user id>/B4iProject/b4i_b4xseekbar.h:31:1: error: duplicate interface definition for class 'b4i_b4xseekbar'
@interface b4i_b4xseekbar : B4IClass
^
In file included from /Users/administrator/Documents/UploadedProjects/<user id>/B4iProject/b4i_b4xsignaturetemplate.m:2:
In file included from /Users/administrator/Documents/UploadedProjects/<user id>/B4iProject/b4i_b4xsignaturetemplate.h:2:
/Users/administrator/Documents/Libs/iSD_XUIView.h:873:12: note: previous definition is here
@interface b4i_b4xseekbar : B4IClass
           ^
In file included from /Users/administrator/Documents/UploadedProjects/<user id>/B4iProject/b4i_b4xsignaturetemplate.m:18:
/Users/administrator/Documents/UploadedProjects/<user id>/B4iProject/b4i_b4xseekbar.h:59:32: error: property has a previous declaration
@property (nonatomic)NSString* _meventname;
                               ^
In file included from /Users/administrator/Documents/UploadedProjects/<user id>/B4iProject/b4i_b4xsignaturetemplate.m:2:
In file included from /Users/administrator/Documents/UploadedProjects/<user id>/B4iProject/b4i_b4xsignaturetemplate.h:2:
/Users/administrator/Documents/Libs/iSD_XUIView.h:890:32: note: property declared here
@property (nonatomic)NSString* _meventname;
                               ^
In file included from /Users/administrator/Documents/UploadedProjects/<user id>/B4iProject/b4i_b4xsignaturetemplate.m:18:
/Users/administrator/Documents/UploadedProjects/<user id>/B4iProject/b4i_b4xseekbar.h:60:32: error: property has a previous declaration
@property (nonatomic)NSObject* _mcallback;
                               ^
In file included from /Users/administrator/Documents/UploadedProjects/<user id>/B4iProject/b4i_b4xsignaturetemplate.m:2:
In file included from /Users/administrator/Documents/UploadedProjects/<user id>/B4iProject/b4i_b4xsignaturetemplate.h:2:
/Users/administrator/Documents/Libs/iSD_XUIView.h:891:32: note: property declared here
@property (nonatomic)NSObject* _mcallback;
                               ^
In file included from /Users/administrator/Documents/UploadedProjects/<user id>/B4iProject/b4i_b4xsignaturetemplate.m:18:
/Users/administrator/Documents/UploadedProjects/<user id>/B4iProject/b4i_b4xseekbar.h:61:38: error: property has a previous declaration
@property (nonatomic)B4XViewWrapper* _mbase;
                                     ^
In file included from /Users/administrator/Documents/UploadedProjects/<user id>/B4iProject/b4i_b4xsignaturetemplate.m:2:
In file included from /Users/administrator/Documents/UploadedProjects/<user id>/B4iProject/b4i_b4xsignaturetemplate.h:2:
/Users/administrator/Documents/Libs/iSD_XUIView.h:892:38: note: property declared here
@property (nonatomic)B4XViewWrapper* _mbase;
                                     ^
In file included from /Users/administrator/Documents/UploadedProjects/<user id>/B4iProject/b4i_b4xsignaturetemplate.m:18:
/Users/administrator/Documents/UploadedProjects/<user id>/B4iProject/b4i_b4xseekbar.h:62:30: error: property has a previous declaration
@property (nonatomic)B4IXUI* _xui;
                             ^
In file included from /Users/administrator/Documents/UploadedProjects/<user id>/B4iProject/b4i_b4xsignaturetemplate.m:2:
In file included from /Users/administrator/Documents/UploadedProjects/<user id>/B4iProject/b4i_b4xsignaturetemplate.h:2:
/Users/administrator/Documents/Libs/iSD_XUIView.h:893:30: note: property declared here
@property (nonatomic)B4IXUI* _xui;
                             ^
In file included from /Users/administrator/Documents/UploadedProjects/<user id>/B4iProject/b4i_b4xsignaturetemplate.m:18:
/Users/administrator/Documents/UploadedProjects/<user id>/B4iProject/b4i_b4xseekbar.h:73:27: error: property has a previous declaration
@property (nonatomic)BOOL _vertical;
                          ^
In file included from /Users/administrator/Documents/UploadedProjects/<user id>/B4iProject/b4i_b4xsignaturetemplate.m:2:
In file included from /Users/administrator/Documents/UploadedProjects/<user id>/B4iProject/b4i_b4xsignaturetemplate.h:2:
/Users/administrator/Documents/Libs/iSD_XUIView.h:898:27: note: property declared here
@property (nonatomic)BOOL _vertical;
                          ^
6 errors generated.
...
 

Star-Dust

Expert
Licensed User
Longtime User
New Update 0.08 - FIX BUG

Now it won't conflict with XUI View, I changed the name of the B4XSeekBar object with B4XSeek_Bar.

Note: B4XSeek_Bar is not wrapping a corresponding in XUI Views
 

Star-Dust

Expert
Licensed User
Longtime User
Is it posible enable/disable B4XRadioButton by code?
B4XRadiobutton1.Enabled=False
or
B4XRadiobutton1.GetBase.Enabled=False
 

angel_

Well-Known Member
Licensed User
Longtime User
It doesn't seem to work
 

Attachments

  • test.zip
    9.4 KB · Views: 405

angel_

Well-Known Member
Licensed User
Longtime User
Is it possible to change the color by disabling? like this or something similar:
B4X:
    If CheckBox1.Checked Then
        B4XRadioButton1.Enable = True
        B4XRadioButton1.TextColor = Colors.Black
    Else
        B4XRadioButton1.Enable = False
        B4XRadioButton1.TextColor = Colors.LightGray
    End If
 

Star-Dust

Expert
Licensed User
Longtime User
Is it possible to change the color by disabling? like this or something similar:
B4X:
    If CheckBox1.Checked Then
        B4XRadioButton1.Enable = True
        B4XRadioButton1.TextColor = Colors.Black
    Else
        B4XRadioButton1.Enable = False
        B4XRadioButton1.TextColor = Colors.LightGray
    End If
I will see in the next update.
 
Top