Mar 21, 2013 Replies: 244 This is an old version. Latest version is included in XUI Views: https://www.b4x.com/android/forum/threads/100836/#content AnotherDatePicker is an inline date picker: The advantage of this class over the built-in dialog (DateDialog from the Dialogs library) is that you can easily customize it as needed. Most of the layout is created with the visual designer and designer script. ADP.GetDate returns the selected date. The months names and days names are based on the device locale. In order to use this class in your code you should add AnotherDatePicker class, reference DateUtils library and add DatePicker layout file to the Files tab. Starting from v2.0, ADP should be added as a custom view from the designer: v2.0 - Better support for visual designer and more configurable options (including first day of week). v1.11 - Fixes an issue with SetDate that is called before the view is ready. v1.10 - Adds a Closed event. See the attached example. Attachments AnotherDatePicker.zip AnotherDatePicker.zip 13.2 KB · Views: 4,479 Last edited: Feb 18, 2019 Click to expand...
This is an old version. Latest version is included in XUI Views: https://www.b4x.com/android/forum/threads/100836/#content AnotherDatePicker is an inline date picker: The advantage of this class over the built-in dialog (DateDialog from the Dialogs library) is that you can easily customize it as needed. Most of the layout is created with the visual designer and designer script. ADP.GetDate returns the selected date. The months names and days names are based on the device locale. In order to use this class in your code you should add AnotherDatePicker class, reference DateUtils library and add DatePicker layout file to the Files tab. Starting from v2.0, ADP should be added as a custom view from the designer: v2.0 - Better support for visual designer and more configurable options (including first day of week). v1.11 - Fixes an issue with SetDate that is called before the view is ready. v1.10 - Adds a Closed event. See the attached example.
Erel B4X founder Staff member Licensed User Longtime User Feb 4, 2016 #181 Are you opening it in Activity_Create?
Pilar-JLSineriz Active Member Licensed User Longtime User Feb 4, 2016 #183 If I execute in debug mode, the control works, the problem appears when I work in release mode. The strange thing is that I the strange thing is that I have the same instructions in other forms and works well
If I execute in debug mode, the control works, the problem appears when I work in release mode. The strange thing is that I the strange thing is that I have the same instructions in other forms and works well
Erel B4X founder Staff member Licensed User Longtime User Feb 4, 2016 #184 The control is not ready yet. Internally it uses CallSubDelayed to call the sub that loads the layout (you can see it in the code). You can do the same thing in your code. Use CallSubDelayed to call a sub at the end of Activity_Create. The picker will be ready in that sub.
The control is not ready yet. Internally it uses CallSubDelayed to call the sub that loads the layout (you can see it in the code). You can do the same thing in your code. Use CallSubDelayed to call a sub at the end of Activity_Create. The picker will be ready in that sub.
Pilar-JLSineriz Active Member Licensed User Longtime User Feb 5, 2016 #185 Thanks Erel!!. I attach my code. I add the red line in activity_create. The anothedatepicker name is "ADP", it's the format OK??? Sub Activity_Create(FirstTime As Boolean) 'Do not forget to load the layout file created with the visual designer. For example: Activity.LoadLayout("DatosGenerales") Activity.Title=Main.strEstG DateTime.DateFormat="dd/MM/yyyy" CallSubDelayed(ADP,"AddToActivity") ADP.SetDate(DateTime.now, True) If FirstTime Then GPS_Tablet.Initialize("GPS_Tablet") End If blnGuardar=True FillDatosGenerales ' End Sub
Thanks Erel!!. I attach my code. I add the red line in activity_create. The anothedatepicker name is "ADP", it's the format OK??? Sub Activity_Create(FirstTime As Boolean) 'Do not forget to load the layout file created with the visual designer. For example: Activity.LoadLayout("DatosGenerales") Activity.Title=Main.strEstG DateTime.DateFormat="dd/MM/yyyy" CallSubDelayed(ADP,"AddToActivity") ADP.SetDate(DateTime.now, True) If FirstTime Then GPS_Tablet.Initialize("GPS_Tablet") End If blnGuardar=True FillDatosGenerales ' End Sub
Pilar-JLSineriz Active Member Licensed User Longtime User Feb 5, 2016 #186 Hi again I check the line and logically does not work. I check that "AddToActivity" is a sub included in "anotherdatepicker" control. I dont´know as I can call to datepicker with callsubdelayed. Thanks
Hi again I check the line and logically does not work. I check that "AddToActivity" is a sub included in "anotherdatepicker" control. I dont´know as I can call to datepicker with callsubdelayed. Thanks
DonManfred Expert Licensed User Longtime User Feb 5, 2016 #187 I think you misinterpreted erels answer. Add the Datepicker in Activity_create and call a sub with callsubdelayed which then will set the date you want to have in the datepicker... In the delayed sub you place the Code: ADP.SetDate(DateTime.now, True) But maybe it´s just me which misinterpreted the answer!?
I think you misinterpreted erels answer. Add the Datepicker in Activity_create and call a sub with callsubdelayed which then will set the date you want to have in the datepicker... In the delayed sub you place the Code: ADP.SetDate(DateTime.now, True) But maybe it´s just me which misinterpreted the answer!?
Pilar-JLSineriz Active Member Licensed User Longtime User Feb 6, 2016 #188 J je je.... yes yes I put in all my forms (activity_create) that use anotherdatepicker, the rutine "ADP.SetDate(DateTime.now, True)" (you can observe my code line in the last mail) but in any occasions the control stop to work and I have an error, "the panel should be inicialized", and the programm is stopped. We don´t understand where the mistake is. Thanks Manfred
J je je.... yes yes I put in all my forms (activity_create) that use anotherdatepicker, the rutine "ADP.SetDate(DateTime.now, True)" (you can observe my code line in the last mail) but in any occasions the control stop to work and I have an error, "the panel should be inicialized", and the programm is stopped. We don´t understand where the mistake is. Thanks Manfred
Erel B4X founder Staff member Licensed User Longtime User Feb 7, 2016 #189 Example: Code: Sub Globals Dim ADP As AnotherDatePicker End Sub Sub Activity_Create(FirstTime As Boolean) Activity.LoadLayout("1") CallSubDelayed(Me, "ShowADP") End Sub Sub ShowADP ADP.Show End Sub
Example: Code: Sub Globals Dim ADP As AnotherDatePicker End Sub Sub Activity_Create(FirstTime As Boolean) Activity.LoadLayout("1") CallSubDelayed(Me, "ShowADP") End Sub Sub ShowADP ADP.Show End Sub
Pilar-JLSineriz Active Member Licensed User Longtime User Feb 7, 2016 #190 Thanks Erel!!! I'll try now!
LucaMs Expert Licensed User Longtime User Feb 7, 2016 #191 I suspect it will work . (and it is a very useful hint, not for ADP only... to be write in some important place!)
I suspect it will work . (and it is a very useful hint, not for ADP only... to be write in some important place!)
Erel B4X founder Staff member Licensed User Longtime User Feb 10, 2016 #193 V2.00 is now available. It is implemented as a custom view with more options and also fixes the issue with ADP not ready at startup.
V2.00 is now available. It is implemented as a custom view with more options and also fixes the issue with ADP not ready at startup.
Pilar-JLSineriz Active Member Licensed User Longtime User Feb 12, 2016 #194 Thanks Erel, i'll try now.. I've finished the APK and I don´t know if it´'s a good idea to modify the control now
Thanks Erel, i'll try now.. I've finished the APK and I don´t know if it´'s a good idea to modify the control now
LucaMs Expert Licensed User Longtime User Feb 12, 2016 #195 Pilar-JLSineriz said: Thanks Erel, i'll try now.. I've finished the APK and I don´t know if it´'s a good idea to modify the control now Click to expand... For this time I am sure: if your app does not have bugs related to this view... no, it's not a good idea
Pilar-JLSineriz said: Thanks Erel, i'll try now.. I've finished the APK and I don´t know if it´'s a good idea to modify the control now Click to expand... For this time I am sure: if your app does not have bugs related to this view... no, it's not a good idea
Humberto Active Member Licensed User Longtime User Feb 14, 2016 #196 I´m trying the sample in post #1 and I´m geting the error in attach Some one can help ? My b4a version is 5.50 Thnaks Attachments error.png 70.6 KB · Views: 596
I´m trying the sample in post #1 and I´m geting the error in attach Some one can help ? My b4a version is 5.50 Thnaks
DonManfred Expert Licensed User Longtime User Feb 15, 2016 #197 Humberto said: My b4a version is 5.50 Click to expand... The new designer-properties comes with version 5.8 (beta as yet)
Humberto said: My b4a version is 5.50 Click to expand... The new designer-properties comes with version 5.8 (beta as yet)
Pilar-JLSineriz Active Member Licensed User Longtime User Feb 15, 2016 #198 LucaMs said: For this time I am sure: if your app does not have bugs related to this view... no, it's not a good idea Click to expand... I agree with you!
LucaMs said: For this time I am sure: if your app does not have bugs related to this view... no, it's not a good idea Click to expand... I agree with you!
Humberto Active Member Licensed User Longtime User Feb 16, 2016 #199 Thanks Manfred I use to wait the release version. Thanks
A Andy S. Member Licensed User Longtime User Feb 25, 2016 #200 Hi Erel, Is this class in the public domain? Thanks, Andy