Press on the image to return to the main documentation page.
BetterDialogs
Written by Fr\u00e9d\u00e9ric Leneuf-Magaud
List of types:
BD_CustomDlgParams
BD_InputBoxParams
BetterDialogs
BD_CustomDlgParams
Events:
None
Members:
Background
As
Object
BodyHeight
As
Int
BodyWidth
As
Int
CancelButton
As
Object
DialogBody
As
Object
DialogGravity
As
Int
Duration
As
Int
Initialize
MarginHeight
As
Int
NegativeButton
As
Object
OpenKeyboard
As
Boolean
PositiveButton
As
Object
Title
As
Object
TitleHeight
As
Int
TitleWidth
As
Int
Members description:
Background
As
Object
Gets or sets the dialog background. It can be a color or a drawable. Pass Null (default) if you want to keep the default background.
BodyHeight
As
Int
Gets or sets the height of the dialog body.
BodyWidth
As
Int
Gets or sets the width of the dialog body.
CancelButton
As
Object
Gets or sets the "cancel" button to display. It can be a button or a string (the HTML tags in the string are interpreted). Pass Null (default) or "" if you don't want to show the button.
DialogBody
As
Object
Gets or sets the dialog body. It can be any view.
DialogGravity
As
Int
Duration
As
Int
Gets or sets the duration of the dialog, in seconds. Pass 0 (default) if you don't want to set a duration (the dialog will be dismissed only by an user action).
Initialize
MarginHeight
As
Int
Gets or sets the height of the margin added above the dialog body. Should be set only when the gravity is set to TOP. Default = 0.
NegativeButton
As
Object
Gets or sets the "negative" button to display. It can be a button or a string (the HTML tags in the string are interpreted). Pass Null (default) or "" if you don't want to show the button.
OpenKeyboard
As
Boolean
If True, open the virtual keyboard when the dialog is shown. Relevant only when the dialog contains an editable view. Default = False.
PositiveButton
As
Object
Gets or sets the "positive" button to display. It can be a button or a string (the HTML tags in the string are interpreted). Pass Null (default) or "" if you don't want to show the button.
Title
As
Object
Gets or sets the dialog title. It can be a view (a label, a panel, ...) or a string (the HTML tags in the string are interpreted).
TitleHeight
As
Int
Gets or sets the height of the title. Relevant only when the title is a view.
TitleWidth
As
Int
Gets or sets the width of the title. Relevant only when the title is a view.
BD_InputBoxParams
Events:
None
Members:
Answer
As
String
[read
only]
CompactAnswer
As
String
[read
only]
CursorPosition
As
Int
Default
As
String
Format
As
String
Gravity
As
Int
Hint
As
String
HintColor
As
Int
Initialize
INPUT_TYPE_DECIMAL_NUMBERS
As
Int
INPUT_TYPE_NUMBERS
As
Int
INPUT_TYPE_NUMBERS_WITH_SIGN
As
Int
INPUT_TYPE_PHONE
As
Int
INPUT_TYPE_TEXT
As
Int
INPUT_TYPE_TEXT_WITH_CAPS
As
Int
InputTextSize
As
Int
InputType
As
Int
Multiline
As
Boolean
PasswordMode
As
Boolean
Question
As
String
QuestionTextSize
As
Int
SpaceBetween
As
Int
ValidationCallback
As
String
[write
only]
WithSuggestions
As
Boolean
Members description:
Answer
As
String
[read
only]
Returns the user input.
CompactAnswer
As
String
[read
only]
Returns a copy of the user input without the leading and trailing spaces, and without the placeholders if Format is not empty.
CursorPosition
As
Int
Gets or sets the cursor position in the input field.
It is set by default to the length of the default text.
Default
As
String
Gets or sets the initial text of the input field.
Format
As
String
Gets or sets the input mask.
Mask characters:
# = Digit
L = Letter
A = Alphanumeric
H = Hexadecimal
? = Any character
Examples:
- Date & time = "##/##/#### ##:##"
- Phone number = "(###) ###-####"
- IP address = "###.###.###.###"
- MAC address = "HH:HH:HH:HH:HH:HH"
- Parental lock password = "AAAA"
Gravity
As
Int
Hint
As
String
Gets or sets the text that will appear when the input field is empty.
HintColor
As
Int
Initialize
INPUT_TYPE_DECIMAL_NUMBERS
As
Int
INPUT_TYPE_NUMBERS
As
Int
INPUT_TYPE_NUMBERS_WITH_SIGN
As
Int
INPUT_TYPE_PHONE
As
Int
INPUT_TYPE_TEXT
As
Int
INPUT_TYPE_TEXT_WITH_CAPS
As
Int
InputTextSize
As
Int
Gets or sets the text size of the input field.
InputType
As
Int
Gets or sets the input type flag. This flag is used to determine the settings of the virtual keyboard.
The value is one of the INPUT_TYPE constants.
Multiline
As
Boolean
Gets or sets whether the input field should be in multiline mode.
Default = single line mode.
PasswordMode
As
Boolean
Gets or sets whether the input field should be in password mode and hide the actual characters.
Default = False
Question
As
String
Gets or sets the text above the input field. HTML tags are interpreted.
QuestionTextSize
As
Int
Gets or sets the text size of the question.
SpaceBetween
As
Int
Gets or sets the height of the gap between the question and the input field.
ValidationCallback
As
String
[write
only]
Sets the function to call when the dialog is exited with the "positive" button.
The callback function will return "" if the input is valid or an error message if the input is invalid.
Example:
IP
.
ValidationCallback
(
"Input_Validation"
)
WithSuggestions
As
Boolean
Sets whether the virtual keyboard displays any dictionary-based candidates.
This setting is ignored if Format is not empty or InputType is set to Numbers or Phone.
Default = False
BetterDialogs
This is an 'Activity Object', it cannot be declared under Sub Process_Globals.
Events:
Validation(Answer As String, CompactAnswer As String) As String
BackKeyPressed As Boolean
Closing(DlgResponse As Int) As Boolean
Members:
CanceledOnTouchOutside
As
Boolean
CloseDialog
(
Response
As
Int
)
CustomDialog
(
DlgParams
As
BD_CustomDlgParams
,
EvtPrefix
As
String
)
As
Int
InputBox
(
Title
As
String
,
Params
As
BD_InputBoxParams
,
Positive
As
String
,
Cancel
As
String
,
Negative
As
String
,
Icon
As
Object
)
As
Int
MsgBox
(
Title
As
String
,
Message
As
String
,
Positive
As
String
,
Cancel
As
String
,
Negative
As
String
,
Icon
As
Object
)
As
Int
Members description:
CanceledOnTouchOutside
As
Boolean
CloseDialog
(
Response
As
Int
)
Closes the current dialog.
Response: One of the DialogResponse constants.
CustomDialog
(
DlgParams
As
BD_CustomDlgParams
,
EvtPrefix
As
String
)
As
Int
Shows a modal custom dialog.
Returns one of the DialogResponse values.
DlgParams: A set of parameters defining the position and the contents of the dialog.
EvtPrefix: The prefix for the BackKeyPressed and Closing events.
InputBox
(
Title
As
String
,
Params
As
BD_InputBoxParams
,
Positive
As
String
,
Cancel
As
String
,
Negative
As
String
,
Icon
As
Object
)
As
Int
Shows a modal input box.
Returns one of the DialogResponse values.
Title: The dialog title. HTML tags (<B>, <I>, <U>, <BR>, <Sup>, <Sub>, <Font Color=...>, <TT>, <H1> to <H6>, etc.) are interpreted.
Params: A set of parameters defining the behaviour and the appearance of the dialog.
Positive: The text to display for the "positive" button. Pass "" if you don't want to show the button.
Cancel: The text to display for the "cancel" button. Pass "" if you don't want to show the button.
Negative: The text to display for the "negative" button. Pass "" if you don't want to show the button.
Icon: An image (bitmap or drawable) that will be drawn near the title. Pass Null if you don't want to show an icon.
MsgBox
(
Title
As
String
,
Message
As
String
,
Positive
As
String
,
Cancel
As
String
,
Negative
As
String
,
Icon
As
Object
)
As
Int
Shows a modal message box.
Returns one of the DialogResponse values.
Title: The dialog title. HTML tags (<B>, <I>, <U>, <BR>, <Sup>, <Sub>, <Font Color=...>, <TT>, <H1> to <H6>, etc.) are interpreted.
Message: The dialog message. HTML tags are interpreted.
Positive: The text to display for the "positive" button. Pass "" if you don't want to show the button.
Cancel: The text to display for the "cancel" button. Pass "" if you don't want to show the button.
Negative: The text to display for the "negative" button. Pass "" if you don't want to show the button.
Icon: An image (bitmap or drawable) that will be drawn near the title. Pass Null if you don't want to show an icon.
Top