Monday, December 11, 2017

dtPickerX - December 2017 version

Okay, so I changed some things (again) inside, for the better.  And aside from listing what those are here, I decided to make this post as the official guide post for dtPickerX class too.  So what are these enhancements and what are the previous features which I may have not highlighted before?


Enhancements:

1. Better Year Spinner.  I have improved SpinnerX class so I can use it here and this, IMHO, gives a better look and faster reaction than the native Spinner object I have used on the earlier versions of this class.

2. Better Time Picker.  I modified ScrollTime class too to give it a better look and new attitude too, then used that for the time picking section here instead of the previous DropTime class.

3. Dates Color Explosion.  I added back the capability to put notes and holidays found in one older version, but this time in a much easier fashion plus with more color markings to choose from (7 colors, the 8th box is for HotKey Tooltip).  Also now, the initial set of holidays are all set to blue color (first color).  Nevertheless, users can choose to use any of the colors later for that but it would be better to leave the blue for holidays.

Why different colors?  Well, you may wish to use the colors to indicate the urgency of a note.  Say for those you need to remember such as birthdays of your loved ones, then you can set those to a strong color like pink.  So immediately when you see a date that is encased in a pink box, you know that that is a birthday occassion.  Or for your wedding anniversary, you may want to set that to red as when you forgot such occassion, you are definitely in trouble.


To mark dates, all you need to do is click on a target date then click on any of the color boxes.  That will in turn open the notes section where you can enter the notes. To remove a marking, just do the same but this time make sure the notes is empty, as in addition to the dates it also detects whether the note is empty or not.



Please be aware that the class ignores the year so all of those holidays and notes will be repeated each year.  Deleting old notes anyway is very easy, just empty the previous note.

4.  Notes Privacy.  Unlike with all previous versions of this class, this one no longer shares the holiday.dbf across the app.  Each user/machine now gets its own holiday.dbf to ensure that user's personal notes won't be shared across to others using the app. 

5.  Developer Color Preference

I got tired of the plain white look of the class so I decided to give subscribers the capability to now change several color of the class.  But for backward compatibility reasons, I kept the old colors as the default.  These new look is made possible by these new properties:

MoYrBackColor = as the name implies, it changes the backcolor of the months and year section

MoYrForeColor = changes the forecolor of months and year section

MoYrHighlight = controls the backcolor of the highlight for months.  Pardon the Yr there if that confuses you since it won't affect the spinner year.  But MoYr means the section for the months and year.

nCalShade = this is for the calendar face to give it a shade a bit different than the backcolor of the months and year (MoYrBackColor).  Default is -.8.  If you want it to be the same as the background color of months and year section, change this into 1.

Here is how it looks with my test color schemes on my end:

MoYrBackColor = RGB(96,124,159)
MoYrForeColor = RGB(255,255,255)
MoYrHighlight = RGB(0,45,89)
nCalShade = -0.8



Other Features:

For those who are not yet a subscriber of ssUltimate Library, be aware that this class has three (3) levels as follows:

  • nLevel = 1 (Month Picker)
  • nLevel = 2 (Date Picker)
  • nLevel = 3 (DateTime Picker)


Shown above is nLevel 2 and 3.  And here is how it is when set as plain Month Picker (nLevel = 1).  Notice the class only shows the month and year both on the class and the dropdown section.



Return Values

Okay, maybe even some subscribers are not aware that the class can return a lot of values aside from .Value property, so here are those:

Value = the date or datetime (depending on nLevel value)

SQLDate = is the date value fixed on YYYY/MM/DD format.  So if you are after using this class to perform an SPT for other backends such as SQLServer, MySQL, MariaDB or others that rely on the aforementioned format, use .SQLDate instead of .Value property; so you do not need to convert anymore into that format.

_BOM = Always gives the beginning of the selected month, e.g., 1/12/2017

_EOM = Always gives the end of the selected month, e.g., 31/12/2017

*Note: all return values follow your SET DATE settings, except that .SQLDate

_DateTime = always returns the datetime() value no matter what level it is in.  For nLevel 1 or 2, it will pick up the OS clock value for the time portion.  For nLevel = 3, just the same as .Value

_cTime = always return the time section of the class.  This is useful too if you are on nLevel = 3 and you want to dictate the class' initial time value.

nDay = will always return the numeric day portion of the class

nMonth = will always return the numeric month portion of the class

nYear = will always return the numeric year of the class

Limiting of the date scopes

There are two (2) properties built for that as follows:

ValueMax = here is where you can set the maximum date a user can choose or enter, either by manually encoding the date or by choosing the picker.  Leave this as .F. if you do not want to limit your user's picking option.  Using this is something like this:

this.ValueMax = date(2017,12,25)

And while the users can click on the dropdown section dates beyond 25, the returned value of those will only be still up to the ValueMax set.

ValueMin = well the opposite of the ValueMax.  This is the minimum date a user can pick, again for limiting date scopes.

Miscellaneous:

IdleTime = is the number of seconds the popup section will remain open until it detects the number of seconds the class remains idle for any keyboard or mouse movements. By default it is 50 seconds, adjust it if you want.

Language = Currently the class supports 8 Languages as follows:
            0 = Indonesian
            1 = English
            2 = Italian
            3 = Spanish
            4 = Turkish
            5 = Romanian
            6 = German
            7 = Czech

            8 = Slovak

HotKeys = This is to easily navigate within the class by means of keyboard.  Here are the navigation keys:

            +,=,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

There you go!  I may have forgotten some more but as you can see, this class is full-packed with features which some subscribers may have not been even aware. So I hope this post will make them aware of all those features. Oh and yes, all of those features are also forwarded onto dtPeriod and CalendarX classes.  Cheers!



3 comments:

  1. great class, thanks for it, now i don't see the time poping in my class thanks
    Ernesto

    ReplyDelete
    Replies
    1. Hi Ernesto, you have to change nLevel to 3. That is the datetime picker version. nLevel =1 is month and year picker only, nLevel = 2 is the date picker only

      Delete