How to put 'unknown' in a dategadget?

Just starting out? Need help? Post your questions and find answers here.
MrCor
User
User
Posts: 22
Joined: Tue Dec 01, 2015 8:31 pm

How to put 'unknown' in a dategadget?

Post by MrCor »

Hi guys and dolls,

I want to use the dategadget. Initial I want to put 'Unknown' in there - no problem so far.
But when I want to select a real date and so use the gadget what it is there for, it will not allow me to do that.
Suggestions or is it just the way it is?

Thanks in advance.

MrCor
normeus
Enthusiast
Enthusiast
Posts: 472
Joined: Fri Apr 20, 2012 8:09 pm
Contact:

Re: How to put 'unknown' in a dategadget?

Post by normeus »

From help file
are you doing this?

Code: Select all

  DateGadget(0, 10, 10, 210, 25, "unknown")
then you have to change the MASK to a MASK that displays the date, at the location where you handle the events for DateGadget:

Code: Select all

             Select EventType()
              Case #PB_EventType_Change:SetGadgetText(0,"Date: %mm/%dd/%yyyy Time: %hh:%ii")
            EndSelect
If you post some code, you will get a lot more help.

Norm.
google Translate;Makes my jokes fall flat- Fait mes blagues tombent à plat- Machte meine Witze verpuffen- Eh cumpari ci vo sunari
BarryG
Addict
Addict
Posts: 4178
Joined: Thu Apr 18, 2019 8:17 am

Re: How to put 'unknown' in a dategadget?

Post by BarryG »

MrCor wrote: Tue Dec 05, 2023 3:38 pmI want to put 'Unknown' in there - no problem so far.
Yes, there is: you can't put custom text or generic messages in a DateGadget; you can just set a text mask for the date in it, as normeus said.

DateGadgets do not operate like TextGadgets, and in your example the string "Unknown" is the mask you set, so later trying to set a date in there won't work, because the mask of "Unknown" doesn't support any date information.
Post Reply