Saturday, June 3, 2017

DTPickerX Revisited

Talking to one subscribers via FB Messenger last night made me aware that he is not aware of all of its feature so I decided to create this now to itemize its important features.

Return Values

Others may not be aware but it does not simply return a date or datetime value.  It returns a lot of other values as follows:

  • Value = depending on nLevel property, it can either return a date value or a datetime value
  • nYear = returns the numeric year of the selected date
  • nMonth = returns the numeric month of the selected date
  • nDay = returns the numeric day of the selected date
  • _BOM = always returns the beginning of month of the selected date
  • _EOM = always returns the end of month of the selected date
  • _DateTime = regardless of nLevel, always returns the datetine value of the selected date
  • SQLValue (new) = always return the date on YMD string format.  Useful for other backends such as MSSQL, MySQL, MariaDB or any other backend that requires the same format

Language Localization

Todate, dtPickerX supports seven (7) languages per request of subscribers as follows:

0=Indonesian, 1=English, 2=Italian, 3=Spanish, 4=Turkish, 5=Romanian, 6=German




nLevel property 

This allows the class to morph based on your need as follows:

1 = month year picker only.  Notice that it shows also only the month and the year on the class itself.  This is useful such as in reporting where you want to go quick to a specific month and year (regardless of the day).  Then you can use _BOM and _EOM to get two dates for the whole month.






 2 = with calendar.  Well this is the standard need of a datepicker.  What makes this class unique among other date pickers is faster navigation as months are already shown above.










3 = full with time.  Take a look at the class as it again adjusts its appearance to include the time portion.  Also below the year spinner, two new spinner appears, i.e, hour and minutes.










Any selection done to any objects on the popup form is reflected outright on the class itself.  Also disregarding the nLevel property of the class, you can always get all the return values as mentioned above.

HotKeys for Faster Navigation.  Some users may still not be aware of this but hotkeys has long been implemented as well on the class per request of one subscriber.  The guides can be seen by hovering your mouse pointer into that innocent icon below the calendar face.  I was trying to capture it but since it s based on ToolTip, then it is hard to do that.



Currently, HotKeys guide supports 3 languages (German, Spanish and English) pending requests from other subscribers and submission of the corresponding localized words as well for those.  This is tied up with Language property

HotKeys in English are:

+,=,Up Arrow = Next day
-,Down Arrow = Previous day
T,t = Today
M,m = First day of month, then back 1 month
H,h = Last day of month, then to end of next month
Y,y = First day of year, then back one year
R/r = Last day of year, then to end of next year
Spacebar = Pops dropdown calendar

To easily remember these hotkeys especially on the month and year navigation, we used the first and last letters of the world MontH as well as YeaR to move backwards and onwards.  These hotkeys work even if the dropdown portion is not shown.

ControlSource

As with other native objects, you can also bind this class to a field via its ControlSource property

Visual Appearance

You can now also change FontName, FontSize, Enabled, ReadOnly and BackColor of the class



DTPickerX on Grid

Now, for this one to work properly on your end, you have to ensure that you have SP2 or above for VFP as there are needed adjustments and bug fixes there especially on Control Classes.  You can get it here  http://msdn.microsoft.com/VFOXPRO.


IdleTime

I added this as well so you guys can control the time before the popup calendar automatically hides itself when it gets idle.

Well there you have it.  Maybe there are some more, I will add later if I recall.  Cheers!

No comments:

Post a Comment