Android Programming Press on the image to return to the main documentation page.

Dialogs

Written by Andrew Graham

This library contains several modal, that is blocking, dialogs by which the user
can enter data. Presently they are an InputDialog for text, a TimeDialog for times,
a DateDialog for dates, both a ColorDialog and a ColorPickerDialog for colors, a
NumberDialog for numbers,a FileDialog for folders and file names and a CustomDialog.

Android does not provide modal dialogs but a special mechanism to permit this exists
in Basic4android. The Android Activity lifetime system makes this support complicated
because Activities can be created and destroyed at will by the OS. To avoid stack
runaway on the GUI thread when an Activity is destroyed the stack must be unwound to
the lowest level. The Basic4android modal mechanism does this by closing any modal
dialog being shown and exiting the Sub that called the dialog, and any Sub that called
that Sub and so on, in order to return the main thread to the message loop. This means
that the application does not necessarily receive a return value from the dialog and has
its expected flow of execution interrupted. This will probably most often happen if the
device is rotated while a modal dialog is displayed so the Activity is destroyed and rebuilt
with a new layout.

Because this may happen unexpectedly applications, depending upon their logical structure,
may need code in the Pause and Resume Subs to deal with the fact that modal dialog closure
may not always be detected. Setting a process global when a modal dialog is shown and
clearing it when it returns with some checking code in the Resume Sub is one way of dealing
with this possibility.

The above discussion also applies the Basic4android modal dialogs InputList, InputMultiList,
Msgbox and Msgbox2.

List of types:

ColorDialog
ColorDialogHSV
ColorPickerDialog
CustomDialog
CustomDialog2
CustomLayoutDialog
DateDialog
FileDialog
InputDialog
NumberDialog
TimeDialog

ColorDialog

This modal dialog allows the user to define a colour by its Red, Green and Blue components.
This is an 'Activity Object', it cannot be declared under Sub Process_Globals.

Events:

Result (Result As Int)

Members:


  ARGB (alpha As Int) As Int

  Blue As Int

  Green As Int

  Red As Int

  Response As Int [read only]

  RGB As Int

  Show (title As String, Positive As String, Cancel As String, Negative As String, icon As android.graphics.Bitmap) As Int

  ShowAsync (title As String, Positive As String, Cancel As String, Negative As String, icon As android.graphics.Bitmap, Cancelable As Boolean) As Object

  Version As Double [read only]

Members description:

ARGB (alpha As Int) As Int
Returns an integer value representing the color built from the three components and with the specified alpha value.
Alpha - A value between 0 to 255 where 0 is fully transparent and 255 is fully opaque.
Blue As Int
Sets the value of the blue component of the dialog when is intially shown.
Returns the value of the blue component of the dialog when it was closed.
Green As Int
Sets the value of the green component of the dialog when is intially shown.
Returns the value of the green component of the dialog when it was closed.
Red As Int
Sets the value of the red component of the dialog when is intially shown.
Returns the value of the red component of the dialog when it was closed.
Response As Int [read only]
Returns the response code that the dialog returned when it last closed.
RGB As Int
Sets the value of the red, green and blue components of the dialog when is intially shown.
Returns the color of the red, green and blue components of the dialog when it was closed.
Alpha of the provided color is ignored on set and implicitly set to 255 (opaque) on get.
Show (title As String, Positive As String, Cancel As String, Negative As String, icon As android.graphics.Bitmap) As Int
Shows a modal color dialog with the specified title.
Title - The dialog title.
Positive - The text to show for the "positive" button. Pass "" if you don't want to show the button.
Cancel - The text to show for the "cancel" button. Pass "" if you don't want to show the button.
Negative - The text to show for the "negative" button. Pass "" if you don't want to show the button.
Icon - A bitmap that will be drawn near the title. Pass Null if you don't want to show an icon.
Returns one of the DialogResponse values.
ShowAsync (title As String, Positive As String, Cancel As String, Negative As String, icon As android.graphics.Bitmap, Cancelable As Boolean) As Object
Shows a non-modal color dialog. The Dialog_Result event will be raised.
Example:
Dim cd As ColorDialog
Dim sf As Object = cd.ShowAsync("Choose Color", "Yes", "Cancel", "No", Null, False)
Wait For (sf) Dialog_Result(Result As Int)
If Result = DialogResponse.POSITIVE Then
  Activity.Color = cd.RGB
End If
Version As Double [read only]
Returns the version of the library.

ColorDialogHSV

This modal dialog allows the user to define a colour by its Hue, Saturation and Value components.
This is an 'Activity Object', it cannot be declared under Sub Process_Globals.

Events:

Result (Result As Int)

Members:


  ARGB (alpha As Int) As Int

  Hue As Float

  Response As Int [read only]

  RGB As Int

  Saturation As Float

  Show (title As String, Positive As String, Cancel As String, Negative As String, icon As android.graphics.Bitmap) As Int

  ShowAsync (title As String, Positive As String, Cancel As String, Negative As String, icon As android.graphics.Bitmap, Cancelable As Boolean) As Object

  Value As Float

  Version As Double [read only]

Members description:

ARGB (alpha As Int) As Int
Returns an integer value representing the color built from the three components and with the specified alpha value.
Alpha - A value between 0 to 255 where 0 is fully transparent and 255 is fully opaque.
Hue As Float
Sets the value of the hue component of the dialog when is intially shown.
Returns the value of the hue component of the dialog when it was closed.
The range of valid numbers for hue is 0.0 to 360.0.
Response As Int [read only]
Returns the response code that the dialog returned when it last closed.
RGB As Int
Sets the value of the red, green and blue components of the dialog when is intially shown.
Returns the color of the red, green and blue components of the dialog when it was closed.
Alpha of the provided color is ignored on set and implicitly set to 255 (opaque) on get.
Saturation As Float
Sets the value of the saturation component of the dialog when is intially shown.
Returns the value of the saturation component of the dialog when it was closed.
The range of valid numbers for saturation is 0.0 to 1.0.
Show (title As String, Positive As String, Cancel As String, Negative As String, icon As android.graphics.Bitmap) As Int
Shows a modal color dialog with the specified title.
Title - The dialog title.
Positive - The text to show for the "positive" button. Pass "" if you don't want to show the button.
Cancel - The text to show for the "cancel" button. Pass "" if you don't want to show the button.
Negative - The text to show for the "negative" button. Pass "" if you don't want to show the button.
Icon - A bitmap that will be drawn near the title. Pass Null if you don't want to show an icon.
Returns one of the DialogResponse values.
ShowAsync (title As String, Positive As String, Cancel As String, Negative As String, icon As android.graphics.Bitmap, Cancelable As Boolean) As Object
Shows a non-modal color dialog. The Dialog_Result event will be raised.
Example:
Dim hsv As ColorDialogHSV
Dim sf As Object = hsv.ShowAsync("Choose Color", "Yes", "Cancel", "No", Null, False)
Wait For (sf) Dialog_Result(Result As Int)
If Result = DialogResponse.POSITIVE Then
  Activity.Color = hsv.RGB
End If
Value As Float
Sets the value of the value component of the dialog when is intially shown.
Returns the value of the value component of the dialog when it was closed.
The range of valid numbers for value is 0.0 to 1.0.
Version As Double [read only]
Returns the version of the library.

ColorPickerDialog

This modal dialog allows the user to select a colour from a palette of colours.
The color may be from a standard palette in the dialog or a custom programmed palette.
This is an 'Activity Object', it cannot be declared under Sub Process_Globals.

Events:

Result (Result As Int)

Members:


  ARGB (alpha As Int) As Int

  GetPaletteAt (index As Int) As Int

  Palette() As Int

  ResetPalette

  Response As Int [read only]

  RGB As Int

  SetPaletteAt (index As Int, color As Int)

  Show (title As String, Positive As String, Cancel As String, Negative As String, icon As android.graphics.Bitmap) As Int

  ShowAsync (title As String, Positive As String, Cancel As String, Negative As String, icon As android.graphics.Bitmap, Cancelable As Boolean) As Object

  Version As Double [read only]

Members description:

ARGB (alpha As Int) As Int
Returns an integer value representing the color built from the chosen color and with the specified alpha value.
Alpha - A value between 0 to 255 where 0 is fully transparent and 255 is fully opaque.
GetPaletteAt (index As Int) As Int
Gets the value of the color at the specified index in the current palette.
Palette() As Int
Copies the colours in the array provided to the palette of colors in the dialog.
The provided array should contain 15 colors.
Returns an integer array that is a copy of the present palette.
ResetPalette
Reset the palette of colors to the standard palette of the dialog.
Response As Int [read only]
Returns the response code that the dialog returned when it last closed.
RGB As Int
Sets the value of the chosen color of the dialog when is intially shown.
Returns the value of the chosen color of the dialog when it was closed.
SetPaletteAt (index As Int, color As Int)
Sets the value of the color at the specified index in the current palette.
This allows replacing just one or two colors without defining an entire palette.
Show (title As String, Positive As String, Cancel As String, Negative As String, icon As android.graphics.Bitmap) As Int
Shows a modal color picker dialog with the specified title.
Title - The dialog title.
Positive - The text to show for the "positive" button. Pass "" if you don't want to show the button.
Cancel - The text to show for the "cancel" button. Pass "" if you don't want to show the button.
Negative - The text to show for the "negative" button. Pass "" if you don't want to show the button.
Icon - A bitmap that will be drawn near the title. Pass Null if you don't want to show an icon.
Returns one of the DialogResponse values.
ShowAsync (title As String, Positive As String, Cancel As String, Negative As String, icon As android.graphics.Bitmap, Cancelable As Boolean) As Object
Shows a non-modal color dialog. The Dialog_Result event will be raised.
Example:
Dim cp As ColorPickerDialog
Dim sf As Object = cp.ShowAsync("Choose Color", "Yes", "Cancel", "No", Null, False)
Wait For (sf) Dialog_Result(Result As Int)
If Result = DialogResponse.POSITIVE Then
  Activity.Color = cp.RGB
End If
Version As Double [read only]
Returns the version of the library.

CustomDialog

This modal dialog displays a custom set of controls laid out on a Basic4android Panel.
The Panel is displayed at an abolute position and size within the dialog.
It is recommended to use CustomLayoutDialog instead.
This is an 'Activity Object', it cannot be declared under Sub Process_Globals.

Events:

None

Members:


  AddView (view As android.view.View, left As Int, top As Int, width As Int, height As Int)

  Response As Int [read only]

  Show (Title As String, Positive As String, Cancel As String, Negative As String, icon As android.graphics.Bitmap) As Int

  Version As Double [read only]

Members description:

AddView (view As android.view.View, left As Int, top As Int, width As Int, height As Int)
Adds the custom layout view, most probably a Panel, to the custom dialog.
Although named AddView to match Basic4androd syntax only one view can be added.
Adding a view replaces any existing view previously added to the dialog.
Response As Int [read only]
Returns the response code that the dialog returned when it last closed.
Show (Title As String, Positive As String, Cancel As String, Negative As String, icon As android.graphics.Bitmap) As Int
Shows a modal custom dialog with the specified title.
Title - The dialog title.
Positive - The text to show for the "positive" button. Pass "" if you don't want to show the button.
Cancel - The text to show for the "cancel" button. Pass "" if you don't want to show the button.
Negative - The text to show for the "negative" button. Pass "" if you don't want to show the button.
Icon - A bitmap that will be drawn near the title. Pass Null if you don't want to show an icon.
Returns one of the DialogResponse values.
Version As Double [read only]
Returns the version of the library.

CustomDialog2

This modal dialog displays a custom set of controls laid out on a Basic4android Panel.
The Panel will be automatically centred in the displayed dialog.
It is recommended to use CustomLayoutDialog instead.
This is an 'Activity Object', it cannot be declared under Sub Process_Globals.

Events:

None

Members:


  AddView (view As android.view.View, width As Int, height As Int)

  Response As Int [read only]

  Show (Title As String, Positive As String, Cancel As String, Negative As String, icon As android.graphics.Bitmap) As Int

  Version As Double [read only]

Members description:

AddView (view As android.view.View, width As Int, height As Int)
Adds the custom layout view, most probably a Panel, to the custom dialog.
Although named AddView to match Basic4androd syntax only one view can be added.
Adding a view replaces any existing view previously added to the dialog.
Response As Int [read only]
Returns the response code that the dialog returned when it last closed.
Show (Title As String, Positive As String, Cancel As String, Negative As String, icon As android.graphics.Bitmap) As Int
Shows a modal custom dialog with the specified title.
Title - The dialog title.
Positive - The text to show for the "positive" button. Pass "" if you don't want to show the button.
Cancel - The text to show for the "cancel" button. Pass "" if you don't want to show the button.
Negative - The text to show for the "negative" button. Pass "" if you don't want to show the button.
Icon - A bitmap that will be drawn near the title. Pass Null if you don't want to show an icon.
Returns one of the DialogResponse values.
Version As Double [read only]
Returns the version of the library.

CustomLayoutDialog

A customizable dialog. Note that it is supported by Android 4+ (API 14+).
This is an 'Activity Object', it cannot be declared under Sub Process_Globals.

Events:

Ready (DialogPanel As Panel)
Result (Result As Int)

Members:


  CloseDialog (Result As Int)

  GetButton (ButtonType As Int) As ButtonWrapper

  SetSize (Width As Int, Height As Int)

  ShowAsync (Title As String, Positive As String, Cancel As String, Negative As String, icon As android.graphics.Bitmap, Cancelable As Boolean) As Object

Members description:

CloseDialog (Result As Int)
Closes the dialog and raises the Dialog_Result event.
Example:
DetailsDialog.CloseDialog(DialogResponse.POSITIVE)
GetButton (ButtonType As Int) As ButtonWrapper
Returns one of the dialogs buttons. Returns an uninitialized object if there is no such button.
ButtonType - One of the DialogResponse values.
SetSize (Width As Int, Height As Int)
Sets the dialog size. If not called then the default size will be used.
Must be set immediately after the ShowAsync call (before the Ready event).
The actualy size of the panel will be smaller, especially the height dimension.
ShowAsync (Title As String, Positive As String, Cancel As String, Negative As String, icon As android.graphics.Bitmap, Cancelable As Boolean) As Object
Prepares the dialog. The Ready event will be raised.
Example:
Dim cd As CustomLayoutDialog
Dim sf As Object = cd.ShowAsync("Title", "Yes", "Cancel", "No", Null, False)
Wait For (sf) Dialog_Ready (DialogPanel As Panel)
DialogPanel.LoadLayout("DialogLayout")
Wait For (sf) Dialog_Result (Result As Int)
If Result = DialogResponse.POSITIVE Then
  Log("Yes!")
End If

DateDialog

This modal dialog allows the collection of user entered data in the form of a date.
This is an 'Activity Object', it cannot be declared under Sub Process_Globals.

Events:

Result (Result As Int)

Members:


  DateTicks As Long

  DayOfMonth As Int

  Month As Int

  Response As Int [read only]

  SetDate (dayofmonth As Int, month As Int, year As Int)

  Show (Message As String, Title As String, Positive As String, Cancel As String, Negative As String, icon As android.graphics.Bitmap) As Int

  ShowAsync (Message As String, Title As String, Positive As String, Cancel As String, Negative As String, icon As android.graphics.Bitmap, Cancelable As Boolean) As Object

  ShowCalendar As Boolean

  Version As Double [read only]

  Year As Int

Members description:

DateTicks As Long
Sets the date value of the dialog when is intially shown.
Returns the date value in ticks of the dialog when it is closed.
DayOfMonth As Int
Sets the day of month value of the dialog when is intially shown.
Returns the day of month value of the dialog when it is closed.
Month As Int
Sets the month value of the dialog when is intially shown.
Returns the month value of the dialog when it is closed.
Response As Int [read only]
Returns the response code that the dialog returned when it last closed.
SetDate (dayofmonth As Int, month As Int, year As Int)
Sets the date values of the dialog when is intially shown.
Show (Message As String, Title As String, Positive As String, Cancel As String, Negative As String, icon As android.graphics.Bitmap) As Int
Shows a modal date input dialog with the specified message and title.
Message - The dialog message.
Title - The dialog title.
Positive - The text to show for the "positive" button. Pass "" if you don't want to show the button.
Cancel - The text to show for the "cancel" button. Pass "" if you don't want to show the button.
Negative - The text to show for the "negative" button. Pass "" if you don't want to show the button.
Icon - A bitmap that will be drawn near the title. Pass Null if you don't want to show an icon.
Returns one of the DialogResponse values.
ShowAsync (Message As String, Title As String, Positive As String, Cancel As String, Negative As String, icon As android.graphics.Bitmap, Cancelable As Boolean) As Object
Shows a non-modal date dialog. The Dialog_Result event will be raised.
Example:
Dim dd As DateDialog
dd.DateTicks = DateTime.Now
Dim sf As Object = dd.ShowAsync("", "Select day", "Yes", "", "Cancel", Null, False)
Wait For (sf) Dialog_Result(Result As Int)
If Result = DialogResponse.POSITIVE Then
  Log(DateTime.Date(dd.DateTicks))
End If
ShowCalendar As Boolean
Gets or sets whether the calendar will be appear. Note that the calendar always appears in the material theme.
Version As Double [read only]
Returns the version of the library.
Year As Int
Sets the year value of the dialog when is intially shown.
Returns the year value of the dialog when it is closed.

FileDialog

This modal dialog allows the user to choose a folder and choose or enter a filename.
This is an 'Activity Object', it cannot be declared under Sub Process_Globals.

Events:

Result (Result As Int)

Members:


  ChosenName As String

  FastScroll As Boolean

  FileFilter As String

  FilePath As String

  Response As Int [read only]

  ScrollingBackgroundColor As Int

  Show (Title As CharSequence, Positive As String, Cancel As String, Negative As String, icon As android.graphics.Bitmap) As Int

  ShowAsync (Title As CharSequence, Positive As String, Cancel As String, Negative As String, icon As android.graphics.Bitmap, Cancelable As Boolean) As Object

  ShowOnlyFolders As Boolean

  TextColor As Int

  Version As Double [read only]

Members description:

ChosenName As String
Sets the filename initially shown to the user.
Returns the filename entered or chosen by the user.
FastScroll As Boolean
Gets or sets whether the fast scroll thumb is displayed by the dialog.
FileFilter As String
Gets or sets the filter values of the dialog.
The filter can be a single value ".txt"
The filter can also be a comma separated list of values ".jpg,.png".
Note that spaces in filter values are significant and are not ignored.
If a filename contains the text of a filter value the file will be displayed.
A value of an empty string, the default, will show all files.
FilePath As String
Sets the file path of the dialog when it is intially shown.
Returns the file path of the dialog when it is closed.
Note that setting the file path also sets ChosenName to an empty string.
Response As Int [read only]
Returns the response code that the dialog returned when it last closed.
ScrollingBackgroundColor As Int
Gets or sets the background color that will be used while scrolling the list.
This is an optimization done to make the scrolling smoother.
Set to Colors.Transparent if the background behind the list is not solid color.
The default whatever is the default for the particular device
Show (Title As CharSequence, Positive As String, Cancel As String, Negative As String, icon As android.graphics.Bitmap) As Int
Shows a modal file dialog with the specified title.
Title - The dialog title.
Positive - The text to show for the "positive" button. Pass "" if you don't want to show the button.
Cancel - The text to show for the "cancel" button. Pass "" if you don't want to show the button.
Negative - The text to show for the "negative" button. Pass "" if you don't want to show the button.
Icon - A bitmap that will be drawn near the title. Pass Null if you don't want to show an icon.
Returns one of the DialogResponse values.
ShowAsync (Title As CharSequence, Positive As String, Cancel As String, Negative As String, icon As android.graphics.Bitmap, Cancelable As Boolean) As Object
Shows an async file dialog. Dialog_Result event will be raised.
Example:
Dim fd As FileDialog
fd.FilePath = File.DirRootExternal
Dim sf As Object = fd.ShowAsync("Select file", "Yes", "Cancel", "No", Null, False)
Wait For (sf) Dialog_Result(Result As Int)
If Result = DialogResponse.POSITIVE Then
  Log("File path: " & fd.FilePath)
  Log("File name: " & fd.ChosenName)
End If
ShowOnlyFolders As Boolean
Gets or sets whether to show only folders and not files in the dialog.
TextColor As Int
Version As Double [read only]
Returns the version of the library.

InputDialog

This modal dialog allows the collection of user entered data in the form of text.
The default is free text but the input can be restricted to numeric characters only
or to signed numbers including a decimal point.
This is an 'Activity Object', it cannot be declared under Sub Process_Globals.

Events:

Result (Result As Int)

Members:


  Hint As String

  HintColor As Int

  Input As String

  INPUT_TYPE_DECIMAL_NUMBERS As Int

  INPUT_TYPE_NONE As Int

  INPUT_TYPE_NUMBERS As Int

  INPUT_TYPE_PHONE As Int

  INPUT_TYPE_TEXT As Int

  InputType As Int

  PasswordMode As Boolean

  Response As Int [read only]

  Show (message As String, title As String, Positive As String, Cancel As String, Negative As String, icon As android.graphics.Bitmap) As Int

  ShowAsync (Message As String, Title As String, Positive As String, Cancel As String, Negative As String, icon As android.graphics.Bitmap, Cancelable As Boolean) As Object

  Version As Double [read only]

Members description:

Hint As String
Gets or sets the text that will appear when the dialog is empty.
HintColor As Int
Gets or sets the hint text color.
Input As String
Sets the initial text when the dialog is shown and returns the text entered by the user.
INPUT_TYPE_DECIMAL_NUMBERS As Int
INPUT_TYPE_NONE As Int
INPUT_TYPE_NUMBERS As Int
INPUT_TYPE_PHONE As Int
INPUT_TYPE_TEXT As Int
InputType As Int
Sets or returns the input type accepted by the input box.Possible values are:
ThisDialogName.INPUT_TYPE_NUMBERS for integer numbers.
ThisDialogName.INPUT_TYPE_DECIMAL_NUMBER for signed decimal numbers.
ThisDialogName.INPUT_TYPE_TEXT for free text.
ThisDialogName.INPUT_TYPE_PHONE for telephone numbers.
PasswordMode As Boolean
Sets or returns whether this dialog hides the actual characters entered by the user.
Response As Int [read only]
Returns the response code that the dialog returned when it last closed.
Show (message As String, title As String, Positive As String, Cancel As String, Negative As String, icon As android.graphics.Bitmap) As Int
Shows a modal text input dialog with the specified message and title.
Message - The dialog message.
Title - The dialog title.
Positive - The text to show for the "positive" button. Pass "" if you don't want to show the button.
Cancel - The text to show for the "cancel" button. Pass "" if you don't want to show the button.
Negative - The text to show for the "negative" button. Pass "" if you don't want to show the button.
Icon - A bitmap that will be drawn near the title. Pass Null if you don't want to show an icon.
Returns one of the DialogResponse values.
ShowAsync (Message As String, Title As String, Positive As String, Cancel As String, Negative As String, icon As android.graphics.Bitmap, Cancelable As Boolean) As Object
Shows a non-modal input dialog. The Dialog_Result event will be raised.
Example:
Dim id As InputDialog
Dim sf As Object = id.ShowAsync("", "Enter your name", "Ok", "", "Cancel", Null, False)
Wait For (sf) Dialog_Result(Result As Int)
If Result = DialogResponse.POSITIVE Then
  Log(id.Input)
End If
Version As Double [read only]
Returns the version of the library.

NumberDialog

This configurable modal dialog allows the user to enter a number.
The dialog is configurable to show any number of digits between a minimum of one and a maximum of eight.
The display of a decimal point is optional and the character displayed as the decimal indicator is configurable.
Note that the number accepted and returned by the dialog is an integer value and so may need scaling appropriately.
This is an 'Activity Object', it cannot be declared under Sub Process_Globals.

Events:

Result (Result As Int)

Members:


  Decimal As Int

  DecimalChar As Char

  Digits As Int

  Number As Int

  Response As Int [read only]

  Show (title As String, Positive As String, Cancel As String, Negative As String, icon As android.graphics.Bitmap) As Int

  ShowAsync (Title As String, Positive As String, Cancel As String, Negative As String, icon As android.graphics.Bitmap, Cancelable As Boolean) As Object

  ShowSign As Boolean

  Version As Double [read only]

Members description:

Decimal As Int
Gets or sets the position of a displayed decimal point in the dialog.
Zero displays no decimals, one indicates a single decimal, and so on.
DecimalChar As Char
Gets or sets the displayed decimal character in the dialog.
The default is ".".
Digits As Int
Gets or sets the number of digits displayed in the dialog when it is open.
One is the minimum, nine is the maximum. The default is five.
If ShowSign is True then the leftmost digit will display a "+" or "-".
Number As Int
Sets the number initially displayed in the dialog when it is shown.
If the number is negative and ShowSign is False then the absolute value is displayed
Gets the number entered by the user after the dialog is closed.
If ShowSign is True the sign of the number corresponds to the sign entered by the user.
Response As Int [read only]
Returns the response code that the dialog returned when it last closed.
Show (title As String, Positive As String, Cancel As String, Negative As String, icon As android.graphics.Bitmap) As Int
Shows a modal number picker dialog with the specified title.
Title - The dialog title.
Positive - The text to show for the "positive" button. Pass "" if you don't want to show the button.
Cancel - The text to show for the "cancel" button. Pass "" if you don't want to show the button.
Negative - The text to show for the "negative" button. Pass "" if you don't want to show the button.
Icon - A bitmap that will be drawn near the title. Pass Null if you don't want to show an icon.
Returns one of the DialogResponse values.
ShowAsync (Title As String, Positive As String, Cancel As String, Negative As String, icon As android.graphics.Bitmap, Cancelable As Boolean) As Object
Shows a non-modal number dialog. The Dialog_Result event will be raised.
Example:
Dim nd As NumberDialog
nd.Digits = 4
Dim sf As Object = nd.ShowAsync("Select number", "Yes", "", "Cancel", Null, False)
Wait For (sf) Dialog_Result(Result As Int)
If Result = DialogResponse.POSITIVE Then
  Log(nd.Number)
End If
ShowSign As Boolean
Gets or sets whether the displayed number includes a sign character.
The default is False, no absolute value of the input number is displayed.
Version As Double [read only]
Returns the version of the library.

TimeDialog

This modal dialog allows the collection of user entered data in the form of a time.
The time may be entered in 12 or 24 hour format as determined by the programmer.
This is an 'Activity Object', it cannot be declared under Sub Process_Globals.

Events:

Result (Result As Int)

Members:


  Hour As Int

  Is24Hours As Boolean

  Minute As Int

  Response As Int [read only]

  SetTime (hour As Int, minutes As Int, hours24 As Boolean)

  Show (Message As String, Title As String, Positive As String, Cancel As String, Negative As String, icon As android.graphics.Bitmap) As Int

  ShowAsync (Message As String, Title As String, Positive As String, Cancel As String, Negative As String, icon As android.graphics.Bitmap, Cancelable As Boolean) As Object

  TimeTicks As Long

  Version As Double [read only]

Members description:

Hour As Int
Sets the hour value of the dialog when is intially shown.
Returns the hour value of the dialog when it is closed.
Is24Hours As Boolean
Sets or returns whether the dialog shows the time in 24 hour format.
Minute As Int
Sets the minute value of the dialog when is intially shown.
Returns the minute value of the dialog when it is closed.
Response As Int [read only]
Returns the response code that the dialog returned when it last closed.
SetTime (hour As Int, minutes As Int, hours24 As Boolean)
Sets the time values of the dialog when is intially shown.
Show (Message As String, Title As String, Positive As String, Cancel As String, Negative As String, icon As android.graphics.Bitmap) As Int
Shows a modal time input dialog with the specified message and title.
Message - The dialog message.
Title - The dialog title.
Positive - The text to show for the "positive" button. Pass "" if you don't want to show the button.
Cancel - The text to show for the "cancel" button. Pass "" if you don't want to show the button.
Negative - The text to show for the "negative" button. Pass "" if you don't want to show the button.
Icon - A bitmap that will be drawn near the title. Pass Null if you don't want to show an icon.
Returns one of the DialogResponse values.
ShowAsync (Message As String, Title As String, Positive As String, Cancel As String, Negative As String, icon As android.graphics.Bitmap, Cancelable As Boolean) As Object
Shows a non-modal time dialog. The Dialog_Result event will be raised.
Note that this dialog does not show properly in landscape orientation.
Example:
Dim td As TimeDialog
td.TimeTicks = DateTime.Now
Dim sf As Object = td.ShowAsync("", "Select time", "Yes", "", "Cancel", Null, False)
Wait For (sf) Dialog_Result(Result As Int)
If Result = DialogResponse.POSITIVE Then
  Log(DateTime.Time(td.TimeTicks))
End If
TimeTicks As Long
Sets the time value of the dialog when is intially shown.
Returns the time value in ticks of the dialog when it is closed.
Version As Double [read only]
Returns the version of the library.
Top