B4J Library [ABMaterial] Creating ABMModalSheets at runtime

Ola

Well, I'm rather exited... been wanting to do this eversince I started learning ABM. At times you just need a simple modal without the heavy load of actually building in in code. Let it rather be created at runtime and you can get/set content to it.


1. Click a button
2. Build and modal form and show it
3. Click on modal save & return a map of the contents
4. Click on modal cancel & hide the modal

2018-08-26
1. Build and show the modal form skeleton.

Reproduction

1. Define your form in Class_Globals

B4X:
Dim mymdl As MashForm

2.Add a button to your page in ConnectPage to build & show the modal sheet

B4X:
'create a test button for the modal sheet
    Dim btnMdl As ABMButton
    btnMdl.InitializeRaised(page,"btnMdl","","","Runtime Modal","")
    page.Cell(2,1).AddComponent(btnMdl)

3. Call the button click method to build the modal and show it.

The purpose of the form controls is for them to be built and placed in the right spots. This is the same methodology that the ABMGenerator follows so this will come handy esp for me. I reference data in other tables so without having to open another page, i can just add new records to a reference list and get the data on my form, wala!

B4X:
'create a run time modal sheet
Sub btnMdl_Clicked(Target As String)
    mymdl.Initialize(page,theme,"simplelogin",ABM.MODALSHEET_SIZE_NORMAL,False,"id","users","FORM COMPONENTS")
    mymdl.IsTextSelectable = False
    mymdl.IsDismissible = False
    mymdl.ForceLeft = True
    mymdl.CenterHeading = True
    mymdl.WhiteHeading = True
    'mymdl.AddTextBox("emailaddress","Email Address","",2,1,0,0,0,12,12,12,True)
    'mymdl.AddTextBox("password","Password","",2,1,0,0,0,12,12,12,True)
    mymdl.AddCheckBox("chk","ABMCheckBox","1",3,1,0,0,0,12,12,12,False)
    mymdl.AddComboBox("cbo","ABMComboBox","",4,1,0,0,0,12,12,12,False)
    mymdl.AddDatePick("dp","ABMDatePick","",5,1,0,0,0,12,12,12,True)
    mymdl.AddDateScroll("ds","ABMDateScroll","",6,1,0,0,0,12,12,12,False)
    mymdl.AddDateTimePick("dtp","ABMDateTimePick","",7,1,0,0,0,12,12,12,False)
    mymdl.AddDateTimeScroll("dts","ABMDateTimeScroll","",8,1,0,0,0,12,12,12,True)
    mymdl.AddDouble("dbl","ABMDouble","0",9,1,0,0,0,12,12,12,True)
    mymdl.AddInteger("int","ABMInt","0",10,1,0,0,0,12,12,12,True)
    mymdl.AddSwitch("swt","ABMSwitch","0",11,1,0,0,0,12,12,12,True)
    mymdl.AddTextArea("txta","ABMTextArea","",12,1,0,0,0,12,12,12,False)
    mymdl.AddTextBox("txt","ABMTextBox","",13,1,0,0,0,12,12,12,True)
    mymdl.AddTimePick("tp","ABMTimePick","",14,1,0,0,0,12,12,12,True)
    mymdl.AddTimeScroll("ts","ABMTimeScroll","",15,1,0,0,0,0,12,12,True)
    mymdl.showmodal
End Sub

  • ForceLeft will ensure that your cancel button is forced to the left
  • CenterHeading will apply a theme to the heading to center the heading
  • WhiteHeading will apply a theme to the heading to make it have a white forecolor
  • We are adding form controls and we will place them at particular RCs indicating their offsets and sizes using OS,OM,OL,SS,SM,SL (Offset Small,Offset Medium,Offset Large,Size Small, Size Medium,Size Large) methodology. This is just the grid specifications. For more details see the ABMGridBuilder.
4. Trap the Save / Cancel event of the modal

The cancel & save events are controls that will link to the modal form. You need to specify these in your page. Our modal sheet name is 'simplelogin' so the save and cancel button names will be simpleloginsave and simplelogincancel respectively. For now let's just show a msgbox for each.

B4X:
Sub simpleloginsave_Clicked(Target As String)
    page.Msgbox("","Modal sheet save clicked!","Modal Sheet Save","OK",False,"","")
End Sub

Sub simplelogincancel_Clicked(Target As String)
    page.Msgbox("","Modal sheet cancel clicked!","Modal Sheet Cancel","OK",False,"","")
End Sub

Watch this space!!!

Update:

On save, we want to return the contents of the modal sheet as a record.. this is achieved by calling .GetFormData. To set the content you will have to add a method to run an inverse of that function eg. SetFormData

B4X:
Sub simpleloginsave_Clicked(Target As String)
    Dim record As Map = mymdl.GetFormData
    Log(record)
End Sub

Sub simplelogincancel_Clicked(Target As String)
    mymdl.hide
End Sub

This was to find out of this could be done and whether the contents of the form can be read. As it is a custom class, you can extend it to meet your needs.

Enjoy..
 

Attachments

  • MashForm.bas
    48.5 KB · Views: 501
Last edited:

Mashiane

Expert
Licensed User
Longtime User
Phew... the next challenge is building the grid to hold the contents that are being added.



1. Each element added to the form is stored in a map using the field name. This will create uniqueness. An ABM.GEN_NONE item is added as soon as the class is initialized. This will store the key of the record being added.
2. To add rows to the modal sheet, I am using .Content.AddRowsM to also specify the margins. By default the bottom margin is set to 20 as it normally is done.
3. All cell adding methods are a variant of AddCellsOSMPV, i.e. O - offsets, S - size, M - margin, P - padding and V - visibility, so I am using that method.
4. The row number cannot be less than zero
5. The offsets, sizes should also be between 12 and 1 and not more or less.

Now the trick is ensuring that all the controls that are being added are added to a proper grid. This mega sub below ensures that the grid is build property by reading each added control. There can be 12 cells / columns in a row, so I am adding each cell adding method to take care of these 12 cells.

Each method to AddText, AddCombo etc, is a variant of this master call as depicted below.

B4X:
private Sub AddComponent(fieldName As String, Label As String, TypeOf As String, sDefaultValue As String,iRow As Int, iCell As Int,iOffsetSmall As Int, iOffsetMedium As Int, iOffsetLarge As Int, _
    iSizeSmall As Int, iSizeMedium As Int, iSizeLarge As Int,bEnabled As Boolean,bUseInUpdates As Boolean,bIsVisible As Boolean, Visibility As String, sHeaderTheme As String, sCellTheme As String, _
    bCanSearch As Boolean,bCanSort As Boolean,bRequired As Boolean,iHeaderHeight As Int, iHeaderWidth As Int)
    If iRow < 1 Then
        LogError($"MashForm: ${fieldName} row cannot be less than 1."$)
        Return
    End If
    If iCell > 13 Or iCell < 1 Then
        LogError($"MashForm: ${fieldName} cell cannot be more than 13 or less than 1."$)
        Return
    End If
    If iOffsetSmall > 13 Or iOffsetSmall < 0 Then
        LogError($"MashForm: ${fieldName} offset small cannot be more than 13 or less than 1."$)
        Return
    End If
    If iOffsetMedium > 13 Or iOffsetMedium < 0 Then
        LogError($"MashForm: ${fieldName} offset medium cannot be more than 13 or less than 1."$)
        Return
    End If
    If iOffsetLarge > 13 Or iOffsetLarge < 0 Then
        LogError($"MashForm: ${fieldName} offset large cannot be more than 13 or less than 1."$)
        Return
    End If
    If iSizeSmall > 13 Or iSizeSmall < 0 Then
        LogError($"MashForm: ${fieldName} size small cannot be more than 13 or less than 1."$)
        Return
    End If
    If iSizeMedium > 13 Or iSizeMedium < 0 Then
        LogError($"MashForm: ${fieldName} size medium cannot be more than 13 or less than 1."$)
        Return
    End If
    If iSizeLarge > 13 Or iSizeLarge < 0 Then
        LogError($"MashForm: ${fieldName} size large cannot be more than 13 or less than 1."$)
        Return
    End If
 
    Dim acomp As EachComponent
    acomp.Initialize
    acomp.CanSearch = bCanSearch
    acomp.CanSort = bCanSort
    acomp.Cell = iCell
    acomp.CellTheme = sCellTheme
    acomp.HeaderTheme = sHeaderTheme
    acomp.Defaultvalue = sDefaultValue
    acomp.Enabled = bEnabled
    acomp.FieldName = fieldName
    acomp.HeaderHeight = iHeaderHeight
    acomp.HeaderTheme  = sHeaderTheme
    acomp.HeaderWidth = iHeaderWidth
    acomp.IsVisible = bIsVisible
    acomp.Label = Label
    acomp.OffsetLarge = iOffsetLarge
    acomp.OffsetMedium = iOffsetMedium
    acomp.OffsetSmall = iOffsetSmall
    acomp.Row = iRow
    acomp.SizeLarge = iSizeLarge
    acomp.SizeMedium = iSizeMedium
    acomp.SizeSmall = iSizeSmall
    acomp.UseInUpdates = bUseInUpdates
    acomp.required = bRequired
    acomp.Visibility = Visibility
    acomp.MarginTop = 0
    acomp.MarginBottom = 0
    acomp.MarginLeft = 0
    acomp.MarginRight = 0
    acomp.PaddingLeft = 0
    acomp.PaddingRight = 0
    acomp.PaddingTop = 0
    acomp.PaddingBottom = 0
    components.Put(fieldName,acomp)
    'to determine the number of rows to add
    If iRow > TotalRows Then
        TotalRows = iRow
    End If
End Sub

Adding controls. We are using the ABM.GEN enumeration for this..

B4X:
Sub AddTextBox(fieldName As String, Label As String, sDefaultValue As String,iRow As Int, iCell As Int,iOffsetSmall As Int, iOffsetMedium As Int, iOffsetLarge As Int, iSizeSmall As Int, iSizeMedium As Int, iSizeLarge As Int,bRequired As Boolean)
    AddComponent(fieldName,Label,ABM.GEN_TEXT,sDefaultValue,iRow,iCell,iOffsetSmall,iOffsetMedium,iOffsetLarge,iSizeSmall,iSizeMedium,iSizeLarge,True,True,True,ABM.VISIBILITY_ALL,"","",True,True,bRequired,48,0)
End Sub

Sub AddComboBox(fieldName As String, Label As String, sDefaultValue As String,iRow As Int, iCell As Int,iOffsetSmall As Int, iOffsetMedium As Int, iOffsetLarge As Int, iSizeSmall As Int, iSizeMedium As Int, iSizeLarge As Int,bRequired As Boolean)
    AddComponent(fieldName,Label,ABM.GEN_COMBOSQL,sDefaultValue,iRow,iCell,iOffsetSmall,iOffsetMedium,iOffsetLarge,iSizeSmall,iSizeMedium,iSizeLarge,True,True,True,ABM.VISIBILITY_ALL,"","",True,True,bRequired,48,0)
End Sub

Sub AddCheckBox(fieldName As String, Label As String, sDefaultValue As String,iRow As Int, iCell As Int,iOffsetSmall As Int, iOffsetMedium As Int, iOffsetLarge As Int, iSizeSmall As Int, iSizeMedium As Int, iSizeLarge As Int,bRequired As Boolean)
    AddComponent(fieldName,Label,ABM.GEN_CHECKBOX,sDefaultValue,iRow,iCell,iOffsetSmall,iOffsetMedium,iOffsetLarge,iSizeSmall,iSizeMedium,iSizeLarge,True,True,True,ABM.VISIBILITY_ALL,"","",True,True,bRequired,48,0)
End Sub

Sub AddTextArea(fieldName As String, Label As String, sDefaultValue As String,iRow As Int, iCell As Int,iOffsetSmall As Int, iOffsetMedium As Int, iOffsetLarge As Int, iSizeSmall As Int, iSizeMedium As Int, iSizeLarge As Int,bRequired As Boolean)
    AddComponent(fieldName,Label,ABM.GEN_TEXTAREA,sDefaultValue,iRow,iCell,iOffsetSmall,iOffsetMedium,iOffsetLarge,iSizeSmall,iSizeMedium,iSizeLarge,True,True,True,ABM.VISIBILITY_ALL,"","",True,True,bRequired,48,0)
End Sub


Sub AddSwitch(fieldName As String, Label As String, sDefaultValue As String,iRow As Int, iCell As Int,iOffsetSmall As Int, iOffsetMedium As Int, iOffsetLarge As Int, iSizeSmall As Int, iSizeMedium As Int, iSizeLarge As Int,bRequired As Boolean)
    AddComponent(fieldName,Label,ABM.GEN_SWITCH,sDefaultValue,iRow,iCell,iOffsetSmall,iOffsetMedium,iOffsetLarge,iSizeSmall,iSizeMedium,iSizeLarge,True,True,True,ABM.VISIBILITY_ALL,"","",True,True,bRequired,48,0)
End Sub

Sub AddDateScroll(fieldName As String, Label As String, sDefaultValue As String,iRow As Int, iCell As Int,iOffsetSmall As Int, iOffsetMedium As Int, iOffsetLarge As Int, iSizeSmall As Int, iSizeMedium As Int, iSizeLarge As Int,bRequired As Boolean)
    AddComponent(fieldName,Label,ABM.GEN_DATE_SCROLL,sDefaultValue,iRow,iCell,iOffsetSmall,iOffsetMedium,iOffsetLarge,iSizeSmall,iSizeMedium,iSizeLarge,True,True,True,ABM.VISIBILITY_ALL,"","",True,True,bRequired,48,0)
End Sub

Sub AddTimeScroll(fieldName As String, Label As String, sDefaultValue As String,iRow As Int, iCell As Int,iOffsetSmall As Int, iOffsetMedium As Int, iOffsetLarge As Int, iSizeSmall As Int, iSizeMedium As Int, iSizeLarge As Int,bRequired As Boolean)
    AddComponent(fieldName,Label,ABM.GEN_TIME_SCROLL,sDefaultValue,iRow,iCell,iOffsetSmall,iOffsetMedium,iOffsetLarge,iSizeSmall,iSizeMedium,iSizeLarge,True,True,True,ABM.VISIBILITY_ALL,"","",True,True,bRequired,48,0)
End Sub

Sub AddDateTimeScroll(fieldName As String, Label As String, sDefaultValue As String,iRow As Int, iCell As Int,iOffsetSmall As Int, iOffsetMedium As Int, iOffsetLarge As Int, iSizeSmall As Int, iSizeMedium As Int, iSizeLarge As Int,bRequired As Boolean)
    AddComponent(fieldName,Label,ABM.GEN_DATETIME_SCROLL,sDefaultValue,iRow,iCell,iOffsetSmall,iOffsetMedium,iOffsetLarge,iSizeSmall,iSizeMedium,iSizeLarge,True,True,True,ABM.VISIBILITY_ALL,"","",True,True,bRequired,48,0)
End Sub

Sub AddDatePick(fieldName As String, Label As String, sDefaultValue As String,iRow As Int, iCell As Int,iOffsetSmall As Int, iOffsetMedium As Int, iOffsetLarge As Int, iSizeSmall As Int, iSizeMedium As Int, iSizeLarge As Int,bRequired As Boolean)
    AddComponent(fieldName,Label,ABM.GEN_DATE_PICK,sDefaultValue,iRow,iCell,iOffsetSmall,iOffsetMedium,iOffsetLarge,iSizeSmall,iSizeMedium,iSizeLarge,True,True,True,ABM.VISIBILITY_ALL,"","",True,True,bRequired,48,0)
End Sub


Sub AddTimePick(fieldName As String, Label As String, sDefaultValue As String,iRow As Int, iCell As Int,iOffsetSmall As Int, iOffsetMedium As Int, iOffsetLarge As Int, iSizeSmall As Int, iSizeMedium As Int, iSizeLarge As Int,bRequired As Boolean)
    AddComponent(fieldName,Label,ABM.GEN_TIME_PICK,sDefaultValue,iRow,iCell,iOffsetSmall,iOffsetMedium,iOffsetLarge,iSizeSmall,iSizeMedium,iSizeLarge,True,True,True,ABM.VISIBILITY_ALL,"","",True,True,bRequired,48,0)
End Sub

Sub AddDateTimePick(fieldName As String, Label As String, sDefaultValue As String,iRow As Int, iCell As Int,iOffsetSmall As Int, iOffsetMedium As Int, iOffsetLarge As Int, iSizeSmall As Int, iSizeMedium As Int, iSizeLarge As Int,bRequired As Boolean)
    AddComponent(fieldName,Label,ABM.GEN_DATETIME_PICK,sDefaultValue,iRow,iCell,iOffsetSmall,iOffsetMedium,iOffsetLarge,iSizeSmall,iSizeMedium,iSizeLarge,True,True,True,ABM.VISIBILITY_ALL,"","",True,True,bRequired,48,0)
End Sub

Sub AddInteger(fieldName As String, Label As String, sDefaultValue As String,iRow As Int, iCell As Int,iOffsetSmall As Int, iOffsetMedium As Int, iOffsetLarge As Int, iSizeSmall As Int, iSizeMedium As Int, iSizeLarge As Int,bRequired As Boolean)
    AddComponent(fieldName,Label,ABM.GEN_INTEGER,sDefaultValue,iRow,iCell,iOffsetSmall,iOffsetMedium,iOffsetLarge,iSizeSmall,iSizeMedium,iSizeLarge,True,True,True,ABM.VISIBILITY_ALL,"","",True,True,bRequired,48,0)
End Sub

Sub AddDouble(fieldName As String, Label As String, sDefaultValue As String,iRow As Int, iCell As Int,iOffsetSmall As Int, iOffsetMedium As Int, iOffsetLarge As Int, iSizeSmall As Int, iSizeMedium As Int, iSizeLarge As Int,bRequired As Boolean)
    AddComponent(fieldName,Label,ABM.GEN_DOUBLE,sDefaultValue,iRow,iCell,iOffsetSmall,iOffsetMedium,iOffsetLarge,iSizeSmall,iSizeMedium,iSizeLarge,True,True,True,ABM.VISIBILITY_ALL,"","",True,True,bRequired,48,0)
End Sub

When building the grid, we loop through each component and add it to the grid... this is done with... (see attached flow here)

B4X:
private Sub BuildContentGrid(mdl As ABMModalSheet)
    ' lets define these as class variables as we will access them a multiple times
    sortitM.Initialize
    sortItL.Initialize 
    'lets first sort the sequencing of controls
    Dim compTot As Int = components.Size - 1
    Dim compCnt As Int
    For compCnt = 0 To compTot
        Dim comp As EachComponent = components.GetValueAt(compCnt)
        'get row
        Dim sRow As String = comp.Row 
        'get cell
        Dim sCell As String = comp.cell
        'padd stuff
        sRow = PadRight(sRow,2,"0")
        sCell = PadRight(sCell,2,"0")
        'define a key
        Dim rcKey As String = $"${sRow}.${sCell}"$
        sortitM.Put(rcKey,comp)
        sortItL.Add(rcKey)
    Next
    ' sort the rcs
    sortItL.Sort(True)
    'find out if we have a missing rc
    Dim missingRC As List
    missingRC.Initialize 
    For compCnt = 1 To TotalRows
        Dim sRow As String = compCnt
        sRow = PadRight(sRow,2,"0")
        Dim sCell As String = PadRight("1",2,"0")
        Dim rcKey As String = $"${sRow}.${sCell}"$
        If sortItL.IndexOf(rcKey) = -1 Then
            missingRC.Add(rcKey)
        End If
    Next
    If missingRC.Size -1 >= 0 Then
        For Each rc As String In missingRC
            LogError("MashForm: "& rc & ": no content is defined for " & ModalSheetName)
        Next
        'nothing will be drawn if there is a missing element
        Return
    End If
    'add the grid definition
    'link related columns to the rows use the sorted list
    'if we have records falling in the same row, sequence them
    Dim finalRows As Map
    finalRows.Initialize
    For Each rc As String In sortItL
        Dim sRow As String = MvField(rc,1,".")
        If finalRows.ContainsKey(sRow) Then
            Dim finalCells As List = finalRows.Get(sRow)
        Else
            Dim finalCells As List = NewList(finalCells)
        End If
        finalCells.Add(rc)
        finalRows.Put(sRow,finalCells)
    Next
    'build the grid
    Dim finalCell(11) As String
    Dim ec(11) As EachComponent 
    Dim colCnt As Int   
    For Each finalRow As String In finalRows.Keys
        'add the row
        Dim finalCells As List = finalRows.Get(finalRow)
        'how many controls do we have per row, add appropriate cells
        Dim finalCellsSize As Int = finalCells.Size - 1
        For colCnt = 0 To finalCellsSize
            finalCell(colCnt) = finalCells.Get(colCnt)
            ec(colCnt) = sortitM.Get(finalCell(colCnt))
        Next
        Select Case finalCellsSize
        Case 0
            '1 column
            mdl.Content.AddRowsM(1,True,0,20,"") _
            .AddCellsOSMPV(1,ec(0).OffsetSmall,ec(0).OffsetMedium,ec(0).OffsetLarge,ec(0).SizeSmall,ec(0).SizeMedium,ec(0).SizeLarge,ec(0).margintop,ec(0).MarginBottom,ec(0).paddingleft,ec(0).paddingright,ec(0).Visibility, "")
        Case 1
            '2 columns
            mdl.Content.AddRowsM(1,True,0,20,"") _
            .AddCellsOSMPV(1,ec(0).OffsetSmall,ec(0).OffsetMedium,ec(0).OffsetLarge,ec(0).SizeSmall,ec(0).SizeMedium,ec(0).SizeLarge,ec(0).margintop,ec(0).MarginBottom,ec(0).paddingleft,ec(0).paddingright,ec(0).Visibility, "") _
            .AddCellsOSMPV(1,ec(1).OffsetSmall,ec(1).OffsetMedium,ec(1).OffsetLarge,ec(1).SizeSmall,ec(1).SizeMedium,ec(1).SizeLarge,ec(1).margintop,ec(1).MarginBottom,ec(1).paddingleft,ec(1).paddingright,ec(1).Visibility, "")
        Case 2
            '3 columns
            mdl.Content.AddRowsM(1,True,0,20,"") _
            .AddCellsOSMPV(1,ec(0).OffsetSmall,ec(0).OffsetMedium,ec(0).OffsetLarge,ec(0).SizeSmall,ec(0).SizeMedium,ec(0).SizeLarge,ec(0).margintop,ec(0).MarginBottom,ec(0).paddingleft,ec(0).paddingright,ec(0).Visibility, "") _
            .AddCellsOSMPV(1,ec(1).OffsetSmall,ec(1).OffsetMedium,ec(1).OffsetLarge,ec(1).SizeSmall,ec(1).SizeMedium,ec(1).SizeLarge,ec(1).margintop,ec(1).MarginBottom,ec(1).paddingleft,ec(1).paddingright,ec(1).Visibility, "") _
            .AddCellsOSMPV(1,ec(2).OffsetSmall,ec(2).OffsetMedium,ec(2).OffsetLarge,ec(2).SizeSmall,ec(2).SizeMedium,ec(2).SizeLarge,ec(2).margintop,ec(2).MarginBottom,ec(2).paddingleft,ec(2).paddingright,ec(2).Visibility, "")
        Case 3
            '4 columns   
            mdl.Content.AddRowsM(1,True,0,20,"") _
            .AddCellsOSMPV(1,ec(0).OffsetSmall,ec(0).OffsetMedium,ec(0).OffsetLarge,ec(0).SizeSmall,ec(0).SizeMedium,ec(0).SizeLarge,ec(0).margintop,ec(0).MarginBottom,ec(0).paddingleft,ec(0).paddingright,ec(0).Visibility, "") _
            .AddCellsOSMPV(1,ec(1).OffsetSmall,ec(1).OffsetMedium,ec(1).OffsetLarge,ec(1).SizeSmall,ec(1).SizeMedium,ec(1).SizeLarge,ec(1).margintop,ec(1).MarginBottom,ec(1).paddingleft,ec(1).paddingright,ec(1).Visibility, "") _
            .AddCellsOSMPV(1,ec(2).OffsetSmall,ec(2).OffsetMedium,ec(2).OffsetLarge,ec(2).SizeSmall,ec(2).SizeMedium,ec(2).SizeLarge,ec(2).margintop,ec(2).MarginBottom,ec(2).paddingleft,ec(2).paddingright,ec(2).Visibility, "") _
            .AddCellsOSMPV(1,ec(3).OffsetSmall,ec(3).OffsetMedium,ec(3).OffsetLarge,ec(3).SizeSmall,ec(3).SizeMedium,ec(3).SizeLarge,ec(3).margintop,ec(3).MarginBottom,ec(3).paddingleft,ec(3).paddingright,ec(3).Visibility, "")
        Case 4
            '5 columns
            mdl.Content.AddRowsM(1,True,0,20,"") _
            .AddCellsOSMPV(1,ec(0).OffsetSmall,ec(0).OffsetMedium,ec(0).OffsetLarge,ec(0).SizeSmall,ec(0).SizeMedium,ec(0).SizeLarge,ec(0).margintop,ec(0).MarginBottom,ec(0).paddingleft,ec(0).paddingright,ec(0).Visibility, "") _
            .AddCellsOSMPV(1,ec(1).OffsetSmall,ec(1).OffsetMedium,ec(1).OffsetLarge,ec(1).SizeSmall,ec(1).SizeMedium,ec(1).SizeLarge,ec(1).margintop,ec(1).MarginBottom,ec(1).paddingleft,ec(1).paddingright,ec(1).Visibility, "") _
            .AddCellsOSMPV(1,ec(2).OffsetSmall,ec(2).OffsetMedium,ec(2).OffsetLarge,ec(2).SizeSmall,ec(2).SizeMedium,ec(2).SizeLarge,ec(2).margintop,ec(2).MarginBottom,ec(2).paddingleft,ec(2).paddingright,ec(2).Visibility, "") _
            .AddCellsOSMPV(1,ec(3).OffsetSmall,ec(3).OffsetMedium,ec(3).OffsetLarge,ec(3).SizeSmall,ec(3).SizeMedium,ec(3).SizeLarge,ec(3).margintop,ec(3).MarginBottom,ec(3).paddingleft,ec(3).paddingright,ec(3).Visibility, "") _
            .AddCellsOSMPV(1,ec(4).OffsetSmall,ec(4).OffsetMedium,ec(4).OffsetLarge,ec(4).SizeSmall,ec(4).SizeMedium,ec(4).SizeLarge,ec(4).margintop,ec(4).MarginBottom,ec(4).paddingleft,ec(4).paddingright,ec(4).Visibility, "")
        Case 5
            '6 columns   
            mdl.Content.AddRowsM(1,True,0,20,"") _
            .AddCellsOSMPV(1,ec(0).OffsetSmall,ec(0).OffsetMedium,ec(0).OffsetLarge,ec(0).SizeSmall,ec(0).SizeMedium,ec(0).SizeLarge,ec(0).margintop,ec(0).MarginBottom,ec(0).paddingleft,ec(0).paddingright,ec(0).Visibility, "") _
            .AddCellsOSMPV(1,ec(1).OffsetSmall,ec(1).OffsetMedium,ec(1).OffsetLarge,ec(1).SizeSmall,ec(1).SizeMedium,ec(1).SizeLarge,ec(1).margintop,ec(1).MarginBottom,ec(1).paddingleft,ec(1).paddingright,ec(1).Visibility, "") _
            .AddCellsOSMPV(1,ec(2).OffsetSmall,ec(2).OffsetMedium,ec(2).OffsetLarge,ec(2).SizeSmall,ec(2).SizeMedium,ec(2).SizeLarge,ec(2).margintop,ec(2).MarginBottom,ec(2).paddingleft,ec(2).paddingright,ec(2).Visibility, "") _
            .AddCellsOSMPV(1,ec(3).OffsetSmall,ec(3).OffsetMedium,ec(3).OffsetLarge,ec(3).SizeSmall,ec(3).SizeMedium,ec(3).SizeLarge,ec(3).margintop,ec(3).MarginBottom,ec(3).paddingleft,ec(3).paddingright,ec(3).Visibility, "") _
            .AddCellsOSMPV(1,ec(4).OffsetSmall,ec(4).OffsetMedium,ec(4).OffsetLarge,ec(4).SizeSmall,ec(4).SizeMedium,ec(4).SizeLarge,ec(4).margintop,ec(4).MarginBottom,ec(4).paddingleft,ec(4).paddingright,ec(4).Visibility, "") _
            .AddCellsOSMPV(1,ec(5).OffsetSmall,ec(5).OffsetMedium,ec(5).OffsetLarge,ec(5).SizeSmall,ec(5).SizeMedium,ec(5).SizeLarge,ec(5).margintop,ec(5).MarginBottom,ec(5).paddingleft,ec(5).paddingright,ec(5).Visibility, "")
        Case 6
            '7 columns
            mdl.Content.AddRowsM(1,True,0,20,"") _
            .AddCellsOSMPV(1,ec(0).OffsetSmall,ec(0).OffsetMedium,ec(0).OffsetLarge,ec(0).SizeSmall,ec(0).SizeMedium,ec(0).SizeLarge,ec(0).margintop,ec(0).MarginBottom,ec(0).paddingleft,ec(0).paddingright,ec(0).Visibility, "") _
            .AddCellsOSMPV(1,ec(1).OffsetSmall,ec(1).OffsetMedium,ec(1).OffsetLarge,ec(1).SizeSmall,ec(1).SizeMedium,ec(1).SizeLarge,ec(1).margintop,ec(1).MarginBottom,ec(1).paddingleft,ec(1).paddingright,ec(1).Visibility, "") _
            .AddCellsOSMPV(1,ec(2).OffsetSmall,ec(2).OffsetMedium,ec(2).OffsetLarge,ec(2).SizeSmall,ec(2).SizeMedium,ec(2).SizeLarge,ec(2).margintop,ec(2).MarginBottom,ec(2).paddingleft,ec(2).paddingright,ec(2).Visibility, "") _
            .AddCellsOSMPV(1,ec(3).OffsetSmall,ec(3).OffsetMedium,ec(3).OffsetLarge,ec(3).SizeSmall,ec(3).SizeMedium,ec(3).SizeLarge,ec(3).margintop,ec(3).MarginBottom,ec(3).paddingleft,ec(3).paddingright,ec(3).Visibility, "") _
            .AddCellsOSMPV(1,ec(4).OffsetSmall,ec(4).OffsetMedium,ec(4).OffsetLarge,ec(4).SizeSmall,ec(4).SizeMedium,ec(4).SizeLarge,ec(4).margintop,ec(4).MarginBottom,ec(4).paddingleft,ec(4).paddingright,ec(4).Visibility, "") _
            .AddCellsOSMPV(1,ec(5).OffsetSmall,ec(5).OffsetMedium,ec(5).OffsetLarge,ec(5).SizeSmall,ec(5).SizeMedium,ec(5).SizeLarge,ec(5).margintop,ec(5).MarginBottom,ec(5).paddingleft,ec(5).paddingright,ec(5).Visibility, "") _
            .AddCellsOSMPV(1,ec(6).OffsetSmall,ec(6).OffsetMedium,ec(6).OffsetLarge,ec(6).SizeSmall,ec(6).SizeMedium,ec(6).SizeLarge,ec(6).margintop,ec(6).MarginBottom,ec(6).paddingleft,ec(6).paddingright,ec(6).Visibility, "")
        Case 7
            '8 columns
            mdl.Content.AddRowsM(1,True,0,20,"") _
            .AddCellsOSMPV(1,ec(0).OffsetSmall,ec(0).OffsetMedium,ec(0).OffsetLarge,ec(0).SizeSmall,ec(0).SizeMedium,ec(0).SizeLarge,ec(0).margintop,ec(0).MarginBottom,ec(0).paddingleft,ec(0).paddingright,ec(0).Visibility, "") _
            .AddCellsOSMPV(1,ec(1).OffsetSmall,ec(1).OffsetMedium,ec(1).OffsetLarge,ec(1).SizeSmall,ec(1).SizeMedium,ec(1).SizeLarge,ec(1).margintop,ec(1).MarginBottom,ec(1).paddingleft,ec(1).paddingright,ec(1).Visibility, "") _
            .AddCellsOSMPV(1,ec(2).OffsetSmall,ec(2).OffsetMedium,ec(2).OffsetLarge,ec(2).SizeSmall,ec(2).SizeMedium,ec(2).SizeLarge,ec(2).margintop,ec(2).MarginBottom,ec(2).paddingleft,ec(2).paddingright,ec(2).Visibility, "") _
            .AddCellsOSMPV(1,ec(3).OffsetSmall,ec(3).OffsetMedium,ec(3).OffsetLarge,ec(3).SizeSmall,ec(3).SizeMedium,ec(3).SizeLarge,ec(3).margintop,ec(3).MarginBottom,ec(3).paddingleft,ec(3).paddingright,ec(3).Visibility, "") _
            .AddCellsOSMPV(1,ec(4).OffsetSmall,ec(4).OffsetMedium,ec(4).OffsetLarge,ec(4).SizeSmall,ec(4).SizeMedium,ec(4).SizeLarge,ec(4).margintop,ec(4).MarginBottom,ec(4).paddingleft,ec(4).paddingright,ec(4).Visibility, "") _
            .AddCellsOSMPV(1,ec(5).OffsetSmall,ec(5).OffsetMedium,ec(5).OffsetLarge,ec(5).SizeSmall,ec(5).SizeMedium,ec(5).SizeLarge,ec(5).margintop,ec(5).MarginBottom,ec(5).paddingleft,ec(5).paddingright,ec(5).Visibility, "") _
            .AddCellsOSMPV(1,ec(6).OffsetSmall,ec(6).OffsetMedium,ec(6).OffsetLarge,ec(6).SizeSmall,ec(6).SizeMedium,ec(6).SizeLarge,ec(6).margintop,ec(6).MarginBottom,ec(6).paddingleft,ec(6).paddingright,ec(6).Visibility, "") _
            .AddCellsOSMPV(1,ec(7).OffsetSmall,ec(7).OffsetMedium,ec(7).OffsetLarge,ec(7).SizeSmall,ec(7).SizeMedium,ec(7).SizeLarge,ec(7).margintop,ec(7).MarginBottom,ec(7).paddingleft,ec(7).paddingright,ec(7).Visibility, "")
        Case 8
            '9 columns
            mdl.Content.AddRowsM(1,True,0,20,"") _
            .AddCellsOSMPV(1,ec(0).OffsetSmall,ec(0).OffsetMedium,ec(0).OffsetLarge,ec(0).SizeSmall,ec(0).SizeMedium,ec(0).SizeLarge,ec(0).margintop,ec(0).MarginBottom,ec(0).paddingleft,ec(0).paddingright,ec(0).Visibility, "") _
            .AddCellsOSMPV(1,ec(1).OffsetSmall,ec(1).OffsetMedium,ec(1).OffsetLarge,ec(1).SizeSmall,ec(1).SizeMedium,ec(1).SizeLarge,ec(1).margintop,ec(1).MarginBottom,ec(1).paddingleft,ec(1).paddingright,ec(1).Visibility, "") _
            .AddCellsOSMPV(1,ec(2).OffsetSmall,ec(2).OffsetMedium,ec(2).OffsetLarge,ec(2).SizeSmall,ec(2).SizeMedium,ec(2).SizeLarge,ec(2).margintop,ec(2).MarginBottom,ec(2).paddingleft,ec(2).paddingright,ec(2).Visibility, "") _
            .AddCellsOSMPV(1,ec(3).OffsetSmall,ec(3).OffsetMedium,ec(3).OffsetLarge,ec(3).SizeSmall,ec(3).SizeMedium,ec(3).SizeLarge,ec(3).margintop,ec(3).MarginBottom,ec(3).paddingleft,ec(3).paddingright,ec(3).Visibility, "") _
            .AddCellsOSMPV(1,ec(4).OffsetSmall,ec(4).OffsetMedium,ec(4).OffsetLarge,ec(4).SizeSmall,ec(4).SizeMedium,ec(4).SizeLarge,ec(4).margintop,ec(4).MarginBottom,ec(4).paddingleft,ec(4).paddingright,ec(4).Visibility, "") _
            .AddCellsOSMPV(1,ec(5).OffsetSmall,ec(5).OffsetMedium,ec(5).OffsetLarge,ec(5).SizeSmall,ec(5).SizeMedium,ec(5).SizeLarge,ec(5).margintop,ec(5).MarginBottom,ec(5).paddingleft,ec(5).paddingright,ec(5).Visibility, "") _
            .AddCellsOSMPV(1,ec(6).OffsetSmall,ec(6).OffsetMedium,ec(6).OffsetLarge,ec(6).SizeSmall,ec(6).SizeMedium,ec(6).SizeLarge,ec(6).margintop,ec(6).MarginBottom,ec(6).paddingleft,ec(6).paddingright,ec(6).Visibility, "") _
            .AddCellsOSMPV(1,ec(7).OffsetSmall,ec(7).OffsetMedium,ec(7).OffsetLarge,ec(7).SizeSmall,ec(7).SizeMedium,ec(7).SizeLarge,ec(7).margintop,ec(7).MarginBottom,ec(7).paddingleft,ec(7).paddingright,ec(7).Visibility, "") _
            .AddCellsOSMPV(1,ec(8).OffsetSmall,ec(8).OffsetMedium,ec(8).OffsetLarge,ec(8).SizeSmall,ec(8).SizeMedium,ec(8).SizeLarge,ec(8).margintop,ec(8).MarginBottom,ec(8).paddingleft,ec(8).paddingright,ec(8).Visibility, "")
        Case 9
            '10 columns
            mdl.Content.AddRowsM(1,True,0,20,"") _
            .AddCellsOSMPV(1,ec(0).OffsetSmall,ec(0).OffsetMedium,ec(0).OffsetLarge,ec(0).SizeSmall,ec(0).SizeMedium,ec(0).SizeLarge,ec(0).margintop,ec(0).MarginBottom,ec(0).paddingleft,ec(0).paddingright,ec(0).Visibility, "") _
            .AddCellsOSMPV(1,ec(1).OffsetSmall,ec(1).OffsetMedium,ec(1).OffsetLarge,ec(1).SizeSmall,ec(1).SizeMedium,ec(1).SizeLarge,ec(1).margintop,ec(1).MarginBottom,ec(1).paddingleft,ec(1).paddingright,ec(1).Visibility, "") _
            .AddCellsOSMPV(1,ec(2).OffsetSmall,ec(2).OffsetMedium,ec(2).OffsetLarge,ec(2).SizeSmall,ec(2).SizeMedium,ec(2).SizeLarge,ec(2).margintop,ec(2).MarginBottom,ec(2).paddingleft,ec(2).paddingright,ec(2).Visibility, "") _
            .AddCellsOSMPV(1,ec(3).OffsetSmall,ec(3).OffsetMedium,ec(3).OffsetLarge,ec(3).SizeSmall,ec(3).SizeMedium,ec(3).SizeLarge,ec(3).margintop,ec(3).MarginBottom,ec(3).paddingleft,ec(3).paddingright,ec(3).Visibility, "") _
            .AddCellsOSMPV(1,ec(4).OffsetSmall,ec(4).OffsetMedium,ec(4).OffsetLarge,ec(4).SizeSmall,ec(4).SizeMedium,ec(4).SizeLarge,ec(4).margintop,ec(4).MarginBottom,ec(4).paddingleft,ec(4).paddingright,ec(4).Visibility, "") _
            .AddCellsOSMPV(1,ec(5).OffsetSmall,ec(5).OffsetMedium,ec(5).OffsetLarge,ec(5).SizeSmall,ec(5).SizeMedium,ec(5).SizeLarge,ec(5).margintop,ec(5).MarginBottom,ec(5).paddingleft,ec(5).paddingright,ec(5).Visibility, "") _
            .AddCellsOSMPV(1,ec(6).OffsetSmall,ec(6).OffsetMedium,ec(6).OffsetLarge,ec(6).SizeSmall,ec(6).SizeMedium,ec(6).SizeLarge,ec(6).margintop,ec(6).MarginBottom,ec(6).paddingleft,ec(6).paddingright,ec(6).Visibility, "") _
            .AddCellsOSMPV(1,ec(7).OffsetSmall,ec(7).OffsetMedium,ec(7).OffsetLarge,ec(7).SizeSmall,ec(7).SizeMedium,ec(7).SizeLarge,ec(7).margintop,ec(7).MarginBottom,ec(7).paddingleft,ec(7).paddingright,ec(7).Visibility, "") _
            .AddCellsOSMPV(1,ec(8).OffsetSmall,ec(8).OffsetMedium,ec(8).OffsetLarge,ec(8).SizeSmall,ec(8).SizeMedium,ec(8).SizeLarge,ec(8).margintop,ec(8).MarginBottom,ec(8).paddingleft,ec(8).paddingright,ec(8).Visibility, "") _
            .AddCellsOSMPV(1,ec(9).OffsetSmall,ec(9).OffsetMedium,ec(9).OffsetLarge,ec(9).SizeSmall,ec(9).SizeMedium,ec(9).SizeLarge,ec(9).margintop,ec(9).MarginBottom,ec(9).paddingleft,ec(9).paddingright,ec(9).Visibility, "")
        Case 10
            '11 columns
            mdl.Content.AddRowsM(1,True,0,20,"") _
            .AddCellsOSMPV(1,ec(0).OffsetSmall,ec(0).OffsetMedium,ec(0).OffsetLarge,ec(0).SizeSmall,ec(0).SizeMedium,ec(0).SizeLarge,ec(0).margintop,ec(0).MarginBottom,ec(0).paddingleft,ec(0).paddingright,ec(0).Visibility, "") _
            .AddCellsOSMPV(1,ec(1).OffsetSmall,ec(1).OffsetMedium,ec(1).OffsetLarge,ec(1).SizeSmall,ec(1).SizeMedium,ec(1).SizeLarge,ec(1).margintop,ec(1).MarginBottom,ec(1).paddingleft,ec(1).paddingright,ec(1).Visibility, "") _
            .AddCellsOSMPV(1,ec(2).OffsetSmall,ec(2).OffsetMedium,ec(2).OffsetLarge,ec(2).SizeSmall,ec(2).SizeMedium,ec(2).SizeLarge,ec(2).margintop,ec(2).MarginBottom,ec(2).paddingleft,ec(2).paddingright,ec(2).Visibility, "") _
            .AddCellsOSMPV(1,ec(3).OffsetSmall,ec(3).OffsetMedium,ec(3).OffsetLarge,ec(3).SizeSmall,ec(3).SizeMedium,ec(3).SizeLarge,ec(3).margintop,ec(3).MarginBottom,ec(3).paddingleft,ec(3).paddingright,ec(3).Visibility, "") _
            .AddCellsOSMPV(1,ec(4).OffsetSmall,ec(4).OffsetMedium,ec(4).OffsetLarge,ec(4).SizeSmall,ec(4).SizeMedium,ec(4).SizeLarge,ec(4).margintop,ec(4).MarginBottom,ec(4).paddingleft,ec(4).paddingright,ec(4).Visibility, "") _
            .AddCellsOSMPV(1,ec(5).OffsetSmall,ec(5).OffsetMedium,ec(5).OffsetLarge,ec(5).SizeSmall,ec(5).SizeMedium,ec(5).SizeLarge,ec(5).margintop,ec(5).MarginBottom,ec(5).paddingleft,ec(5).paddingright,ec(5).Visibility, "") _
            .AddCellsOSMPV(1,ec(6).OffsetSmall,ec(6).OffsetMedium,ec(6).OffsetLarge,ec(6).SizeSmall,ec(6).SizeMedium,ec(6).SizeLarge,ec(6).margintop,ec(6).MarginBottom,ec(6).paddingleft,ec(6).paddingright,ec(6).Visibility, "") _
            .AddCellsOSMPV(1,ec(7).OffsetSmall,ec(7).OffsetMedium,ec(7).OffsetLarge,ec(7).SizeSmall,ec(7).SizeMedium,ec(7).SizeLarge,ec(7).margintop,ec(7).MarginBottom,ec(7).paddingleft,ec(7).paddingright,ec(7).Visibility, "") _
            .AddCellsOSMPV(1,ec(8).OffsetSmall,ec(8).OffsetMedium,ec(8).OffsetLarge,ec(8).SizeSmall,ec(8).SizeMedium,ec(8).SizeLarge,ec(8).margintop,ec(8).MarginBottom,ec(8).paddingleft,ec(8).paddingright,ec(8).Visibility, "") _
            .AddCellsOSMPV(1,ec(9).OffsetSmall,ec(9).OffsetMedium,ec(9).OffsetLarge,ec(9).SizeSmall,ec(9).SizeMedium,ec(9).SizeLarge,ec(9).margintop,ec(9).MarginBottom,ec(9).paddingleft,ec(9).paddingright,ec(9).Visibility, "") _
            .AddCellsOSMPV(1,ec(10).OffsetSmall,ec(10).OffsetMedium,ec(10).OffsetLarge,ec(10).SizeSmall,ec(10).SizeMedium,ec(10).SizeLarge,ec(10).margintop,ec(10).MarginBottom,ec(10).paddingleft,ec(10).paddingright,ec(10).Visibility, "")
        Case 11
            '12 columns
            mdl.Content.AddRowsM(1,True,0,20,"") _
            .AddCellsOSMPV(1,ec(0).OffsetSmall,ec(0).OffsetMedium,ec(0).OffsetLarge,ec(0).SizeSmall,ec(0).SizeMedium,ec(0).SizeLarge,ec(0).margintop,ec(0).MarginBottom,ec(0).paddingleft,ec(0).paddingright,ec(0).Visibility, "") _
            .AddCellsOSMPV(1,ec(1).OffsetSmall,ec(1).OffsetMedium,ec(1).OffsetLarge,ec(1).SizeSmall,ec(1).SizeMedium,ec(1).SizeLarge,ec(1).margintop,ec(1).MarginBottom,ec(1).paddingleft,ec(1).paddingright,ec(1).Visibility, "") _
            .AddCellsOSMPV(1,ec(2).OffsetSmall,ec(2).OffsetMedium,ec(2).OffsetLarge,ec(2).SizeSmall,ec(2).SizeMedium,ec(2).SizeLarge,ec(2).margintop,ec(2).MarginBottom,ec(2).paddingleft,ec(2).paddingright,ec(2).Visibility, "") _
            .AddCellsOSMPV(1,ec(3).OffsetSmall,ec(3).OffsetMedium,ec(3).OffsetLarge,ec(3).SizeSmall,ec(3).SizeMedium,ec(3).SizeLarge,ec(3).margintop,ec(3).MarginBottom,ec(3).paddingleft,ec(3).paddingright,ec(3).Visibility, "") _
            .AddCellsOSMPV(1,ec(4).OffsetSmall,ec(4).OffsetMedium,ec(4).OffsetLarge,ec(4).SizeSmall,ec(4).SizeMedium,ec(4).SizeLarge,ec(4).margintop,ec(4).MarginBottom,ec(4).paddingleft,ec(4).paddingright,ec(4).Visibility, "") _
            .AddCellsOSMPV(1,ec(5).OffsetSmall,ec(5).OffsetMedium,ec(5).OffsetLarge,ec(5).SizeSmall,ec(5).SizeMedium,ec(5).SizeLarge,ec(5).margintop,ec(5).MarginBottom,ec(5).paddingleft,ec(5).paddingright,ec(5).Visibility, "") _
            .AddCellsOSMPV(1,ec(6).OffsetSmall,ec(6).OffsetMedium,ec(6).OffsetLarge,ec(6).SizeSmall,ec(6).SizeMedium,ec(6).SizeLarge,ec(6).margintop,ec(6).MarginBottom,ec(6).paddingleft,ec(6).paddingright,ec(6).Visibility, "") _
            .AddCellsOSMPV(1,ec(7).OffsetSmall,ec(7).OffsetMedium,ec(7).OffsetLarge,ec(7).SizeSmall,ec(7).SizeMedium,ec(7).SizeLarge,ec(7).margintop,ec(7).MarginBottom,ec(7).paddingleft,ec(7).paddingright,ec(7).Visibility, "") _
            .AddCellsOSMPV(1,ec(8).OffsetSmall,ec(8).OffsetMedium,ec(8).OffsetLarge,ec(8).SizeSmall,ec(8).SizeMedium,ec(8).SizeLarge,ec(8).margintop,ec(8).MarginBottom,ec(8).paddingleft,ec(8).paddingright,ec(8).Visibility, "") _
            .AddCellsOSMPV(1,ec(9).OffsetSmall,ec(9).OffsetMedium,ec(9).OffsetLarge,ec(9).SizeSmall,ec(9).SizeMedium,ec(9).SizeLarge,ec(9).margintop,ec(9).MarginBottom,ec(9).paddingleft,ec(9).paddingright,ec(9).Visibility, "") _
            .AddCellsOSMPV(1,ec(10).OffsetSmall,ec(10).OffsetMedium,ec(10).OffsetLarge,ec(10).SizeSmall,ec(10).SizeMedium,ec(10).SizeLarge,ec(10).margintop,ec(10).MarginBottom,ec(10).paddingleft,ec(10).paddingright,ec(10).Visibility, "") _
            .AddCellsOSMPV(1,ec(11).OffsetSmall,ec(11).OffsetMedium,ec(11).OffsetLarge,ec(11).SizeSmall,ec(11).SizeMedium,ec(11).SizeLarge,ec(11).margintop,ec(11).MarginBottom,ec(11).paddingleft,ec(11).paddingright,ec(11).Visibility, "")
        End Select
    Next
End Sub

Watch this space!!!
 
Last edited:

Mashiane

Expert
Licensed User
Longtime User
Yes!!!


B4X:
'create a run time modal sheet
Sub btnMdl_Clicked(Target As String)
    mymdl.Initialize(page,theme,"simplelogin",ABM.MODALSHEET_SIZE_FULL,ABM.MODALSHEET_TYPE_NORMAL,False,"id","users","FORM COMPONENTS")
    mymdl.IsTextSelectable = False
    mymdl.IsDismissible = False
    mymdl.ForceLeft = True
    mymdl.CenterHeading = True
    mymdl.WhiteHeading = True
    mymdl.AddTextBox("emailaddress","Email Address","",2,1,0,0,0,12,6,6,True)
    mymdl.AddTextBox("password","Password","",2,2,0,0,0,12,6,6,True)
    mymdl.AddCheckBox("chk","ABMCheckBox","1",3,1,0,0,0,12,4,4,False)
    mymdl.AddComboBox("cbo","ABMComboBox","",3,2,0,0,0,12,4,4,False)
    mymdl.AddDatePick("dp","ABMDatePick","",3,3,0,0,0,12,4,4,True)
    mymdl.AddDateScroll("ds","ABMDateScroll","",4,1,0,0,0,12,12,12,False)
    mymdl.AddDateTimePick("dtp","ABMDateTimePick","",5,1,0,0,0,12,12,12,False)
    mymdl.AddDateTimeScroll("dts","ABMDateTimeScroll","",6,1,0,0,0,12,12,12,True)
    mymdl.AddDouble("dbl","ABMDouble","0",7,1,0,0,0,12,3,3,True)
    mymdl.AddInteger("int","ABMInt","0",7,2,0,0,0,12,3,3,True)
    mymdl.AddSwitch("swt","ABMSwitch","0",7,3,0,0,0,12,3,3,True)
    mymdl.AddTextArea("txta","ABMTextArea","",7,4,0,0,0,12,3,3,False)
    mymdl.AddTextBox("txt","ABMTextBox","",8,1,0,0,0,12,2,2,True)
    mymdl.AddTimePick("tp","ABMTimePick","",8,2,0,0,0,12,2,2,True)
    mymdl.AddTimeScroll("ts","ABMTimeScroll","",8,3,0,0,0,12,8,8,True)
    mymdl.showmodal
End Sub

Lets look at the code

B4X:
mymdl.AddTextBox("emailaddress","Email Address","",2,1,0,0,0,12,6,6,True)
    mymdl.AddTextBox("password","Password","",2,2,0,0,0,12,6,6,True)

This adds two text boxes. One should sit on either half of row 2 (2.1 and 2.2), each should span 6 columns each.

B4X:
mymdl.AddCheckBox("chk","ABMCheckBox","1",3,1,0,0,0,12,4,4,False)
    mymdl.AddComboBox("cbo","ABMComboBox","",3,2,0,0,0,12,4,4,False)
    mymdl.AddDatePick("dp","ABMDatePick","",3,3,0,0,0,12,4,4,True)

The next row add stuff at row 3. For medium and large devices, the span of the columns should be 4 each. Each control will sit on a 1/3 of the row (3.1, 3.2 and 3.3). Remember each row should always be 12 columns each, so 4+4+4=12.

B4X:
mymdl.AddDateScroll("ds","ABMDateScroll","",4,1,0,0,0,12,12,12,False)
    mymdl.AddDateTimePick("dtp","ABMDateTimePick","",5,1,0,0,0,12,12,12,False)
    mymdl.AddDateTimeScroll("dts","ABMDateTimeScroll","",6,1,0,0,0,12,12,12,True)

Add the above controls to take the whole row each per control.

B4X:
mymdl.AddDouble("dbl","ABMDouble","0",7,1,0,0,0,12,3,3,True)
    mymdl.AddInteger("int","ABMInt","0",7,2,0,0,0,12,3,3,True)
    mymdl.AddSwitch("swt","ABMSwitch","0",7,3,0,0,0,12,3,3,True)
    mymdl.AddTextArea("txta","ABMTextArea","",7,4,0,0,0,12,3,3,False)

Add each control to take 1/4 of the row. Each control should span 3 columns each. 3+3+3+3=12

B4X:
mymdl.AddTextBox("txt","ABMTextBox","",8,1,0,0,0,12,2,2,True)
    mymdl.AddTimePick("tp","ABMTimePick","",8,2,0,0,0,12,2,2,True)
    mymdl.AddTimeScroll("ts","ABMTimeScroll","",8,3,0,0,0,12,8,8,True)

Add two controls to span 2 columns and 1 control to span 8 columns. Each sitting on 1/3 of the row.

Enjoy.

MashForm attached on first post!!
 
Last edited:
Cookies are required to use this site. You must accept them to continue using the site. Learn more…