B4i Library iPopupDialog - A fully customizable popup dialog

This is a fully customizable popup dialog which supports Image, Video, Custom View, Simple text, Long Scrollable text and many more.

video alert.gifcustom view alert.gifmulti button alert.gifimage alert.gifsimple alert with long text.gif

Version: 1.0
Dependency: iUI8

  1. Image Alert
  2. Video Alert (remote video) with video pause play functionality
  3. Simple text Alert (Supports very long text)
  4. Customizable
    1. Background Color
    2. Corner Radius
    3. Button Font
    4. Button Text Color
    5. Button Color
    6. Blurry Overlay Style
    7. Title Text Label
    8. Body Text Label
  5. Supports both orientations
  1. Copy xml file to library folder
  2. Copy .a and .h file to B4IBuilder Libs folder
  3. Copy the attached popupvideo.bil file to your project files folder (if you want to use video option)
  4. Initialize iPopupDialog with title, body, and button list
  5. Set all properties like image, video button color, back color etc
  6. Call Show function with Style Constant to show the dialog
  7. Wait for the Result event
  8. Result event will return the button text or CLOSE_WITHOUT_RESULT constant (See below documentation for details.
  • iPopupDialog
    • Events:
      • Eventname_Result (button As String)
    • Fields:
      • BodyLabel As Label
      • STYLE_DARK As Int
      • STYLE_LIGHT As Int
      • STYLE_REGULAR As Int
      • TitleLabel As Label
    • Functions:
      • Class_Globals As String
      • ClosePopup As String
        Close the popup without result.
        This will return CLOSE_WITHOUT_RESULT constant in popup result event
      • Initialize (Eventname As String, Callback As Object, Title As String, Body As String, Buttons As List, Cancelable As Boolean) As iPopupDialog
        Initialize the popup everytime you need a new one
        Eventname: Sub name that will handle the popup result event [ Eventname_Result(button as string) ]
        Callback: Set the module in which you want to catch the result event
        Title: Title of the popup. Leave blank if you dont want.
        Body: Body text of the popup. Leave blank if you dont want.
        Buttons: List of button name. You will get this name in result sub
        Cancelable: Set if it is cancelable by clicking outside of the popup
      • IsInitialized As BOOL
        Tests whether the object has been initialized.
      • PopupWidth As Int
        Get the popup width (useful for custom popup)
      • Resize As String
        Call it from Page_Resize event if your application support both orientation
      • Show (style As Int) As String
        Style must be any of the style constant
        You should set all properties you need before calling this
      • UpdatePostion (NewHeight As Float) As String
        Update the popup position relative to keyboard (only requrired if popup contains input field).
        Call it from Page_KeyboardStateChanged event
    • Properties:
      • ButtonBackgroundColor
        Set button color
        Default: Transparent Black
      • ButtonFont
        Set button text font.
        Default font size is 14
      • ButtonTextColor
        Set button text color
        Default: Black
      • CustomView
        Set the custom view.
        Setting custom view will hide Body text, Image and Video properties.
      • PopupBackgroundColor
        Set the popup background color. Default: white
      • PopupCornerRadius
        Set the popup corner radius.
        Default: 5
        Max: 15
      • PopupImage
        Set popup image.
        If you set popup image then popup video will not work.
      • PopupVideo
        Set popup video url.
        If you want to load video from non secure url (http) then make sure that ATS is disable.


  • popupvideo.bil.zip
    1.6 KB · Views: 24
  • iPopupDialog_example.zip
    99.9 KB · Views: 37
  • iPopupDialog library.zip
    179.3 KB · Views: 41