B4J Question [ABMaterial] How to pad ABMCheckbox to the right?

Mashiane

Expert
Licensed User
Longtime User
Hi there

I need help in aligning an ABMCheckBox to be in the same position as the previous components in the screen, something like padding it to the right.

Here is my modal sheet, the ABMCheckbox seems to be padded to the left, I need to pad it to the right a little.

AlignCheckbox.png


Here is my Modal Sheet code definition...

B4X:
Private Sub BuildModalSheetmsCalendarEvents() As ABMModalSheet
    Dim msCalendarEvents As ABMModalSheet
    msCalendarEvents.Initialize(page, "msCalendarEvents", True, ABM.MODALSHEET_TYPE_NORMAL, "")
    msCalendarEvents.Size = ABM.MODALSHEET_SIZE_NORMAL
    msCalendarEvents.IsDismissible = False
    msCalendarEvents.IsTextSelectable = True
    msCalendarEvents.Footer.AddRowsM(1, True, 0, 0, "").AddCellsOS(1, 0, 0, 0, 12, 12, 12, "")
    msCalendarEvents.Header.AddRowsM(1, True, 0, 0, "").AddCellsOS(1, 0, 0, 0, 12, 12, 12, "")
    msCalendarEvents.Content.AddRowsM(5, True, 0, 0, "").AddCellsOS(1, 0, 0, 0, 12, 12, 12, "")
    msCalendarEvents.Header.BuildGrid  'IMPORTANT once you loaded the complete grid AND before you start adding components
    msCalendarEvents.Content.BuildGrid 'IMPORTANT once you loaded the complete grid AND before you start adding components
    msCalendarEvents.Footer.BuildGrid  'IMPORTANT once you loaded the complete grid AND before you start adding components
    'Add components to ModalSheet
    Dim txtCalendarEventsTitle As ABMInput
    txtCalendarEventsTitle.Initialize(page, "txtCalendarEventsTitle", ABM.INPUT_TEXT, "Title", False, "")
    msCalendarEvents.Content.Cell(2,1).AddComponent(txtCalendarEventsTitle)
    Dim dpCalendarEventsStartTime As ABMDateTimePicker
    Dim dpCalendarEventsStartTimeDate As Long = DateTime.Now
    dpCalendarEventsStartTime.Initialize(page, "dpCalendarEventsStartTime", ABM.DATETIMEPICKER_TYPE_DATETIME, dpCalendarEventsStartTimeDate, "Start Time", "")
    dpCalendarEventsStartTime.WeekText = "Week"
    dpCalendarEventsStartTime.TodayText = "Today"
    dpCalendarEventsStartTime.ReturnDateFormat = "YYYY-MM-DD"
    dpCalendarEventsStartTime.ReturnTimeFormat = "HH:mm"
    dpCalendarEventsStartTime.Language = "en"
    dpCalendarEventsStartTime.FirstDayOfWeek = ABM.FIRSTDAYOFWEEK_SUNDAY
    dpCalendarEventsStartTime.PickText = "OK"
    dpCalendarEventsStartTime.CancelText = "Back"
    msCalendarEvents.Content.Cell(2,1).AddComponent(dpCalendarEventsStartTime)
    Dim dpCalendarEventsEndTime As ABMDateTimePicker
    Dim dpCalendarEventsEndTimeDate As Long = DateTime.Now
    dpCalendarEventsEndTime.Initialize(page, "dpCalendarEventsEndTime", ABM.DATETIMEPICKER_TYPE_DATETIME, dpCalendarEventsEndTimeDate, "End Time", "")
    dpCalendarEventsEndTime.WeekText = "Week"
    dpCalendarEventsEndTime.TodayText = "Today"
    dpCalendarEventsEndTime.ReturnDateFormat = "YYYY-MM-DD"
    dpCalendarEventsEndTime.ReturnTimeFormat = "HH:mm"
    dpCalendarEventsEndTime.Language = "en"
    dpCalendarEventsEndTime.FirstDayOfWeek = ABM.FIRSTDAYOFWEEK_SUNDAY
    dpCalendarEventsEndTime.PickText = "OK"
    dpCalendarEventsEndTime.CancelText = "Back"
    msCalendarEvents.Content.Cell(2,1).AddComponent(dpCalendarEventsEndTime)
    Dim chkCalendarEventsAllDay As ABMCheckbox
    chkCalendarEventsAllDay.Initialize(page, "chkCalendarEventsAllDay", "All Day", False, "")
    msCalendarEvents.Content.Cell(2,1).AddComponent(chkCalendarEventsAllDay)
    Dim cboCalendarEventsLegendID As ABMCombo
    cboCalendarEventsLegendID.Initialize(page, "cboCalendarEventsLegendID", "Legend", 650, "")
    cboCalendarEventsLegendID.DataBelow = ABM.COMBO_DATA_BELOWINPUT
    cboCalendarEventsLegendID.IsValid = ABM.VALID_TRUE
    msCalendarEvents.Content.Cell(2,1).AddComponent(cboCalendarEventsLegendID)
    Dim lblCalendarEvents As ABMLabel
    lblCalendarEvents.Initialize(page, "lblCalendarEvents", "{NBSP}Add / Edit CalendarEvents", ABM.SIZE_H5, False, "whitefc")
    msCalendarEvents.Header.Cell(1,1).AddComponent(lblCalendarEvents)
    Dim btnApplyCalendarEvents As ABMButton
    btnApplyCalendarEvents.InitializeFlat(page, "btnApplyCalendarEvents", "", "", "Save", "transparent")
    btnApplyCalendarEvents.Size = ABM.BUTTONSIZE_NORMAL
    msCalendarEvents.Footer.Cell(1,1).AddComponent(btnApplyCalendarEvents)
    Dim btnCancelCalendarEvents As ABMButton
    btnCancelCalendarEvents.InitializeFlat(page, "btnCancelCalendarEvents", "", "", "Cancel", "transparent")
    btnCancelCalendarEvents.Size = ABM.BUTTONSIZE_NORMAL
    msCalendarEvents.Footer.Cell(1,1).AddComponent(btnCancelCalendarEvents)
    Return msCalendarEvents
End Sub
 

Mashiane

Expert
Licensed User
Longtime User
CalendaEvent.png

Thanks a lot @mindful,

B4X:
msCalendarEvents.Content.AddRowsM(4, True, 0, 0, "").AddCellsOS(1, 0, 0, 0, 12, 12, 12, "")
    msCalendarEvents.Content.AddRowsM(1, True, 0, 0, "").AddCellsOSMP(1, 0, 0, 0, 12, 12, 12, 0, 0, 10, 0, "")
    msCalendarEvents.Content.AddRowsM(2, True, 0, 0, "").AddCellsOS(1, 0, 0, 0, 12, 12, 12, "")

has done the trick...
 
Upvote 0
Top