Name: TDDateTimePicker
Lib.: b4xlib
Version: 2.01
Update!
Feature Overview:
This is a Custom View you may use with the Designer or by code.
To install:
Custom Properties Designer:
Custom Properties by Code:
Find attached:
TDDateTimePicker.b4xlib - use this in yourB4X Suite
TDDateTimePicker.bas - use this to have look into the code.
Project.ZIP - Example B4A Project
Lib.: b4xlib
Version: 2.01
Update!
- Access to all Custom Properties by code
Feature Overview:
- Timepicker, modifiable by DateTime.TimeFormat Value
- Datepicker, modifiable by DateTime.DateFormat Value
- Individual Colors
- Localizable Text strings for Title, Labels and Buttons
- Graphical Calendar
- self generated JSON File for Layout
- Return Value as formated string
This is a Custom View you may use with the Designer or by code.
To install:
- Copy TDDateTime.b4xlib to your additional lib folder.
- In your Project activate these libraries: B4XPreferencesDialog, TDDateTimePicker.
- In the Designer drag the view from the views/custom views Menu on to the right page.
- Notice the Dimension of the view is only a placeholder, 40dip is right enough.
- Set the Custom Properties.
Custom Properties Designer:
Custom Properties by Code:
Property Name | Description | Property Name | Description |
BackgroundColor | Dialog Background color (Int) | TitleBarColor | Background of the Title bar (Int) |
BorderColor | Dialog Border color (Int) | TitleTextColor | Title Text Color (Int) |
BodyTextColor | Dialog label text color (Int) | InfoDateDLG | Date Dialog SubTitle (string) |
BorderCornerRadius | Dialog Border Radius (Int) | btOk | Text string OK Button (string) |
BorderWidth | Dialog Border width (Int) | btCancel | Text string Cancel Button (string) |
TitleTimeDLG | TimeDialog title (string) | lblTimeDLG | Time DIalog field labels as a formated string (see Example) |
TitleDateDLG | DateDialog title (string) |
Set Properties by Code:
Public Sub setProperties
' | = Alt-124'
TDDateTimePicker1.mprops.put("lblTimeDLG","Hour:|Minute:|Second:")
TDDateTimePicker1.mprops.put("TitelTimeDLG","Set a Time")
TDDateTimePicker1.mprops.put("BorderColor",0xFF047CB9)
' .....
End SUb
B4XPage Object initialized by Designer:
Sub Class_Globals
Private Root As B4XView
Private xui As XUI
Private TDDateTimePicker1 As TDDateTimePicker
End Sub
B4XPage Call the Dialog:
Private Sub Button1_Click
DateTime.TimeFormat="HH:mm:ss"
TDDateTimePicker1.showTimepicker
End Sub
Private Sub Button2_Click
DateTime.DateFormat="dd.MM.yyyy"
TDDateTimePicker1.showDateDialog
End Sub
Event to capture Dialog Result:
private Sub TDDateTimePicker1_DialogResult(Result As String)
xui.MsgboxAsync(Result,"Result:")
End Sub
Find attached:
TDDateTimePicker.b4xlib - use this in yourB4X Suite
TDDateTimePicker.bas - use this to have look into the code.
Project.ZIP - Example B4A Project
Attachments
Last edited: