This is a fully customizable popup dialog which supports Image, Video, Custom View, Simple text, Long Scrollable text and many more.
iPopupDialog
Author: @Biswajit
Version: 1.0
Dependency: iUI8
Features:
iPopupDialog
Author: @Biswajit
Version: 1.0
Dependency: iUI8
Features:
- Image Alert
- Video Alert (remote video) with video pause play functionality
- Simple text Alert (Supports very long text)
- Customizable
- Background Color
- Corner Radius
- Button Font
- Button Text Color
- Button Color
- Blurry Overlay Style
- Title Text Label
- Body Text Label
- Supports both orientations
- Copy xml file to library folder
- Copy .a and .h file to B4IBuilder Libs folder
- Copy the attached popupvideo.bil file to your project files folder (if you want to use video option)
- Initialize iPopupDialog with title, body, and button list
- Set all properties like image, video button color, back color etc
- Call Show function with Style Constant to show the dialog
- Wait for the Result event
- 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
- CLOSE_WITHOUT_RESULT As String
- STYLE_DARK As Int
- STYLE_EXTRALIGHT 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.
- ButtonBackgroundColor
- Events: