B4i Library iComboBox - Easy way to put combo in your B4i apps

abarnett

Member
Licensed User
Alberto, Great combobox.

What is the best way to move the box once it is created. I rearrange the views based on the orientation of the device.

Thanks
Andrew
 

Derek Johnson

Active Member
Licensed User
Hello Derek,

Can you try this beta version? Now with Return event, I mean, when you type and pulse ENTER, works like choose a list item.


Alberto Iglesias
Alberto

I still have the issue in testing your updated library but I have a couple of further observations.

If you rotate a device there seems to be no way to correctly reposition/resize the combo box. There is also no way to remove the object from a page (except by showing it on another page).

There is no IsInitialized property.
Perhaps the Initialize method should remove previous instances of the object.

Finally what is the mechanism for removing the nagware messages from production apps? I can't see how this would work for hosted versions of the Library.

Thanks for creating this, it looks very promising.

Derek
 

abarnett

Member
Licensed User
Hi Alberto, i'm still getting an error with the move command, also is there a way to prepopulate the edit box within the combo

Thanks
 

Derek Johnson

Active Member
Licensed User
abarnett,

I've created this workaround for myself to deal with the issue of not being able to move the combo box when the device is rotated.

B4X:
Sub Process_Globals
    'These global variables will be declared once when the application starts.
    'Public variables can be accessed from all modules.
    Public App As Application
    Public NavControl As NavigationController
    Private Page1,Page2, Page3, HiddenPage As Page
    Dim Combo1 As iComboBox
    Dim Combo1_IsInitialised =False As Boolean
    Dim ComboNotNeeded as  Boolean
    Dim gCombo1AreaSelected As String 'Tracks item that is selected
End Sub

Private Sub Application_Start (Nav As NavigationController)
.....
HiddenPage.Initialize("Hidden")
...
End Sub
B4X:
'Call this when you want to re-display the combo box after a rotation for instance
Sub ShowCombo(MyPage As Page)

    If Combo1_IsInitialised Then 'remove evidence of it from the current page
        'Since we can't get rid of it - show it on another unused page
       'These will accumulate when the device is rotated!
        Combo1.Show(HiddenPage)
    End If
    If ComboNotNeeded Then
        Return
    End If
 
    'Now re-draw the combo box
    Combo1_IsInitialised=True
    gCombo1AreaSelected=""
    Combo1.DebugMode = False
   'Get positioning and size of combo-box from other elements on the same page (These will have been moved/re-sized by the rotation event)
    Combo1.Initialize("Combo1","Select Area",txtCardNumber.left, lblSpinner.top,Min(txtCardNumber.width,300), txtCardNumber.Height, 60%y, False, File.DirAssets & "/arrow.png" )
    Combo1.SectionTitleEnable=True
    Combo1.ColorHeadSection(240,240,240,180,180,180)
 
'(Re) Initialise combo contents from a list
    Dim AreaList() As String, i As Int
    AreaList=Regex.Split(",",gAreaCSVList)
    Dim Items As List
    Items.Initialize
  
    For i=0 To AreaList.Length-1
        Dim tempIcon1 As typeIcon , FileName  As String
        tempIcon1.IconLabel  = AreaList(i)
'Icon based on first letter of AreaList item
        FileName = AreaList(i).SubString2(0,1) & ".png"
        tempIcon1.ImagePath = File.Combine(File.DirAssets,FileName.ToLowerCase)
        Items.Add(tempIcon1)
    Next

    Combo1.AddSection("Select Area",Items)
    Combo1.Show(MyPage)


End Sub

Sub Combo1_onSelected(itemName As String)
    gCombo1AreaSelected=itemName
End Sub
It would be nice to hear back from Alberto with a better solution though! :)
 
Last edited:

abarnett

Member
Licensed User
Alberto, is there any way to change the selected text colour in the combo box, it seems to be gray not black. Actually black default would be better.

Thanks
Andrew
 

JonPM

Well-Known Member
Licensed User
I keep getting Class not found error with v1.03:

B4X:
Copying updated assets files (3)
Error occurred on line: 0 (Main)
Class not found: B4IComboBox
Stack Trace: (
  CoreFoundation       <redacted> + 154
  libobjc.A.dylib      objc_exception_throw + 38
  CoreFoundation       <redacted> + 0
  iComboBox            -[B4IShell createObject:] + 206
  iComboBox            -[B4IShell raiseEventImpl:method:args::] + 1832
  iComboBox            -[B4IShellBI raiseEvent:event:params:] + 1332
  iComboBox            -[B4IStaticModule initializeModule] + 530
  iComboBox            -[b4i_main initializeStaticModules] + 88
  iComboBox            -[B4IShellBI raiseEvent:event:params:] + 230
  iComboBox            __33-[B4I raiseUIEvent:event:params:]_block_invoke + 74
libdispatch.dylib    <redacted> + 10
libdispatch.dylib    <redacted> + 22
libdispatch.dylib    <redacted> + 254
CoreFoundation       <redacted> + 8
CoreFoundation       <redacted> + 1300
CoreFoundation       CFRunLoopRunSpecific + 522
CoreFoundation       CFRunLoopRunInMode + 106
GraphicsServices     GSEventRunModal + 138
UIKit                UIApplicationMain + 1136
iComboBox            main + 108
libdyld.dylib        <redacted> + 2
)
Application_Start
Application_Active
I have verified that I have copied the .a and .h to my local MAC server Libs folder, and the XML to the B4i folder. It shows up under Libraries and I have it selected.
 

Ross Woodward

Member
Licensed User
Thanks Alberto,

Thank you also for adding the feature as requested!
Recommend this icombox, mainly because for the filter option!
 

stanmiller

Active Member
Licensed User
Fellow iComboBox users, what is the procedure for obtaining a license key to iComboBox? I have donated and received a link from PayPal to the old library, version 1.03. I would like to use version 1.04.

I sent a note to Alberto requesting a license key and he replied with a link to the 1.04 library. I updated to that library but I'm still prompted that the library is not registered. I am using the hosted building service.

Thank you...
 
Top