B4J Library [B4X] [B4XLib] [XUI] SD_xMultiSpinner

NOTE: You can use this library for personal and commercial use. Include it in your projects.. Attention, even if it is a B4XLib library, it is not allowed to decompress it, modify it, change its name or redistribute it without the permission of the author

SD_xMultiSpinner

Author:
Star-Dust
Version: 0.05
  • xMultiSpinner
    • Events:
      • ItemClick (Position As Int, CheckValue As Boolean)
    • Fields:
      • ItemHeight As Int
      • ItemWidth As Int
      • mBase As B4XView
      • Tag As Object
    • Functions:
      • Add (Text As String, ReturnValue As Object, Check As Boolean)
        Add Item
      • Add2 (Text As String, ReturnValue As Object, Check As Boolean, Enabled As Boolean)
      • AddAll (L As List)
        Add List of Item, Return Value is a Text
      • Clear
      • CloseDropDown
      • DesignerCreateView (Base As Object, Lbl As Label, Props As Map)
        Base type must be Object
      • GetBase As B4XView
      • GetChecked (Position As Int) As Boolean
      • GetReturnValue (Position As Int) As Object
      • GetText (Position As Int) As String
      • Initialize (Callback As Object, EventName As String)
      • isDroprDownOpen As Boolean
      • OpenDropDown
      • RemoveIndex (Position As Int)
      • SelectedIndexToArray As Int()
      • SelectedReturnValueToArray As Object()
      • SelectedReturnValueToText As String
      • SelectedTextToArray As String()
      • SelectedToText As String
      • SetChecked (Position As Int, Check As Boolean)
      • SetEnabled (Position As Int, Check As Boolean)
      • Size As Int
    • Properties:
      • Hint As String
      • HintFont As B4XFont
      • TextFont As B4XFont

Video 1.gif
Video 2.gif
 

Attachments

  • j_sample.zip
    2.4 KB · Views: 374
  • SD_xMultiSpinner.b4xlib
    4.8 KB · Views: 259
Last edited:

Star-Dust

Expert
Licensed User
Longtime User
If you mean the method to remove the Check, there is SetChecked
 

Star-Dust

Expert
Licensed User
Longtime User
No. I mean If an Item is checked by default and can not be unchecked you need to disable the whole item.
I will evaluate your request
 

Star-Dust

Expert
Licensed User
Longtime User
Update 0.02
  • Added methods to retrieve the selected list: SelectedIndexToArray, SelectedReturnValueToArray, SelectedTextToArray, SelectedToText
  • Added B4J example
 

Mashiane

Expert
Licensed User
Longtime User
Awesome.

If possible on the chips, one could perhaps have a x on the chips to remove it from the selected list. Is the SelectedToText bringing out a delimited string? For example, one would want to just pass that to a SQL clause like in (?)

Please also check what happens to the dropdown when you leave it open and navigate to another page. Perhaps adding a "close" method could help, that one can fire when back.
 

Star-Dust

Expert
Licensed User
Longtime User
Awesome.

If possible on the chips, one could perhaps have a x on the chips to remove it from the selected list. Is the SelectedToText bringing out a delimited string? For example, one would want to just pass that to a SQL clause like in (?)

Please also check what happens to the dropdown when you leave it open and navigate to another page. Perhaps adding a "close" method could help, that one can fire when back.
SelectedToText produces a string with all the items delimited by commas (eg "Item1, Item2, Item4")

Please also check what happens to the dropdown when you leave it open and navigate to another page. Perhaps adding a "close" method could help, that one can fire when back.
Try method CloseDropDown


Awesome.

If possible on the chips, one could perhaps have a x on the chips to remove it from the selected list.
For the proposed changes I will consider them for the next update
 
Last edited:

Star-Dust

Expert
Licensed User
Longtime User
Update 0.03
  1. Added SelectedReturnValueToText
  2. Added: Enable for each item and can be selected with SetEnabled or with the new Add2 method

In the next update SelectedToText and SelectedReturnValueToText will include a parameter to allow each selected entry inserted, in the resulting string, to be enclosed by a single quote (') or double quote (") if desired to use it as a parameter in SQL
 
Last edited:

Star-Dust

Expert
Licensed User
Longtime User
Update 0.04
  1. Added the ability to set the opening automatically, or always at the bottom or always at the top
  2. Fix bug
 
Top