B4J Library [B4X] [XUI] AnotherDatePicker

Status
Not open for further replies.

Claudio Oliveira

Active Member
Licensed User
Longtime User
@Erel
CloseAllDialogs sub always returns True, so Back key can't be handled correctly.

Replacing lines 291 and 292:
B4X:
adp.Hide
res = True

With this code:
B4X:
If adp.IsVisible Then
    adp.Hide
    res = True
End If

solved the issue.
 

Claudio Oliveira

Active Member
Licensed User
Longtime User

To accomplish this, there ain't no need to add an Enabled custom designer property.
Just use the common Enabled property and handle it inside the class, like this:

B4X:
Public Sub getEnabled As Boolean
    Return mBase.Enabled
End Sub
Public Sub setEnabled(enabled As Boolean)
    mBase.Enabled=enabled
    btnOpen.Enabled = enabled
    dateField.Enabled = enabled
End Sub

Of course you should also set Enabled property of DateField and btnOpen accordingly in the DesignerCreateView sub
B4X:
dateField.Enabled=mBase.Enabled

btnOpen.Enabled=mBase.Enabled

And that's all there's to it.
 

Claudio Oliveira

Active Member
Licensed User
Longtime User
Hi @Erel
The 1.03 class file name has a space (or a not visible special character) in its name.
It is being saved locally as "AnotherDatePicker .bas", which causes a unknown type error.
Please take a look at it.
Thanks
 

Claudio Oliveira

Active Member
Licensed User
Longtime User
It is not so, it works. I would try creating a new layout.
Sorry, @LucaMs, but it is so indeed.
Creating a new layout is a "workaround" not a solution. This would lead to recreating all relevant layouts and editing all relevant variable types in every existing working projects. That's not reasonable.
Truth is: the file name is wrong and should be fixed.
Ok. It's not big deal. Just dowload the file, rename it locally and that's it. But I don't think that's how things should be dealt with...
 

Star-Dust

Expert
Licensed User
Longtime User
Hi @Erel
The 1.03 class file name has a space (or a not visible special character) in its name.
It is being saved locally as "AnotherDatePicker .bas", which causes a unknown type error.
Please take a look at it.
Thanks
I tried the Version for B4A and B4J I do not have this character that tells me error.

Which are you trying? What error do you report?
 

Claudio Oliveira

Active Member
Licensed User
Longtime User
I tried the Version for B4A and B4J I do not have this character that tells me error.
Which are you trying? What error do you report?

Hi @Star-Dust
Look, I have a working project which uses AnotherDatePicker class version 1.02
Today I've downloaded version 1.03 and I just couldn't compile my working project afterwards, because B4A says "AnotherDatePicker" is not a known type. This is the main error, which leads to a number of other syntax errors and stuff...
Well, after a while I realized that the class name was not "AnotherDatePicker", but "AnotherDatePicker " instead.
I removed the class from my project; renamed the .bas file from "AnotherDatePicker .bas" to "AnotherDatePicker.bas"; added it again and everything got ok and I was able to compile and run my project.
This is simple and straightforward.
Please note that I didn't and still don't mean to start an argument about this, but just point out that the file name for class version 1.03 attached in post #1 was wrong, and this could lead others to the same errors I've come across.
As I said before, this is not a big deal. Renaming the file is all it takes to make everything allright. My intention was only to let Erel know about this tiny mistake and save other people a couple of minutes of debugging.
Nevertheless, all this happened about 11:30 AM (02:30 PM GMT) today. Now it's 19:07 PM (22:07 PM GMT) and it's not happening anymore.
I'm not able to explain this.
That said, I consider this argument closed and rather leave it to Erel's comments, shall he consider it worthy...

'gonna have some icy cold beer now.

Have you all an awsome weekend!
 

Star-Dust

Expert
Licensed User
Longtime User
Maybe Erel had noticed the error and he corrected or there was a failure in the download and he saved the file with none wrong, it happens when there is a drop in voltage with the pc fixed to me it happened.
 

Star-Dust

Expert
Licensed User
Longtime User
Then it will be the second hypothesis, because I did not give this error
 

Claudio Oliveira

Active Member
Licensed User
Longtime User
Yes, @Star-Dust, that could be the case indeed. Transmission error... Windows mess... bad disk... A lot of things could have caused this. We'll never know.
So let's forget about this and move on.
 

LucaMs

Expert
Licensed User
Longtime User
I added a "feature" and an event.

I needed to highlight a certain number of dates; so I added some routines, the color properties of the dates to highlight and slightly modified the DrawDays routine for this purpose.

Without much imagination I named these dates "special dates". It can be useful, for example, to highlight appointments.

I have also added an event that triggers when you select a different month or year.

I have marked the lines added with "LM" (I hope all lines).

I do not know what Erel wants to do with the attached version, whether to make it official or not; in the meantime, I attach it
 

Attachments

  • ADP LM.zip
    7.7 KB · Views: 479
Last edited:

Vicente Barba

Member
Licensed User
Hello everyone,

I am using AnotherDatePicker v1.03 in a project and for internationalization I would like to be able to change the date format and be able to choose between for example:
y - m - d
m / d / y
d / m / y

Does anyone know a good way to get it?
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…