iOS Code Snippet CheckBoxes / RadioButtons - **Warning** this code may smell

I have a large B4A bal that has about 40 checkboxes and 10 radiobuttons that I am thinking of converting to B4i
Now B4i doesn't have checkboxes (has switches) and doesn't have radiobuttons.

When copying the fields from designer in B4A to B4i All my checkboxes are made into switches and all my radiobuttons are lost.

So I looked at the program Bal2Bil (https://www.b4x.com/android/forum/threads/tool-bal2bil-b4a-layouts-converter.50197/#content) and changed it to make checkboxes & RadioButtons into ImageViews (attaching modified code)

Then I wrote these 2 classes CheckBox & RadioButtons and that I am including in the test example.

This is just a look and feel. (example is made for iPad - Landscape)

I'm not sure how much this code smells. But it does work

1650640393817.png
 

Attachments

  • Bal2Bil.zip
    6.1 KB · Views: 256
  • Project.zip
    21 KB · Views: 286

Robert Valentino

Well-Known Member
Licensed User
Longtime User
True but there isn't a way to convert from bal to bil and take a togglebutton and make a
B4XRadioButton. I guess my biggest problem (well I have a lot) is my Variable names.

B4X:
    Private     sUserPreferences_PlayerInfo_Options_Panel                                         As Panel
    Private         sUserPreferences_PlayerInfo_Message                                         As Label   
    Private         sUserPreferences_PlayerInfo_PlayerStats                                     As B4XView
    Private         sUserPreferences_PlayerInfo_PlayerStats_Tag                                 As Label

    Private     sUserPreferences_Print_Options_Panel                                             As Panel
    Private            sUserPreferences_Print_Message                                                As Label
    Private         sUserPreferences_Print_Options_SubPanel1                                     As Panel   
    Private             sUserPreferences_Print_MoreBrackets                                     As B4XView
    Private             sUserPreferences_Print_MoreBrackets_Tag                                 As Label
    Private             sUserPreferences_Print_Standings_OnePage                                 As B4XView
    Private             sUserPreferences_Print_Standings_OnePage_Tag                             As Label   
    Private             sUserPreferences_Print_Standings_OnePage_Detail                         As B4XView
    Private             sUserPreferences_Print_Standings_OnePage_Detail_Tag                     As Label
    Private         sUserPreferences_Print_Options_SubPanel2                                     As Panel
    Private             sUserPreferences_Print_Combine                                             As B4XView
    Private             sUserPreferences_Print_Combine_Tag                                         As Label
    Private             sUserPreferences_Print_DontAsk                                             As B4XView
    Private             sUserPreferences_Print_DontAsk_Tag                                         As Label   
    Private             sUserPreferences_Print_Force2Up                                         As B4XView
    Private             sUserPreferences_Print_Force2Up_Tag                                     As Label

To delete and retype these names in designer is soooo much work (I never use small variable names) and designer has not way to just rename a field type (say ImageView to CustomView).

Also things like switch are fixed size (no real way of changing how they look)
 
Top