Two Calculators become One, One Calendar becomes Two.

In ESBPCS for VCL, we had two non-visual components for Scientific Calculators – TESBCalculator which controlled a standard popup calculator and TESBSciCalculator which controlled a “scientific notation” calculator. (We also have another component TESBProgCalculator that is tied to a different Engine for our Programmer’s Calculator but we haven’t done the redesign and improvements scheduled for that yet). Now both used the same Calculator Engine – so for ESBDevLib we have combined the two into a single component TEDLCalculator which has a “Calculator Type” Property to pick between the two Calculator types.

TEDLCalculator Properties

Note also that the handling of custom Calculator Dialogs is also now handled via the Calculator Type (and associated events).

The VCL versions of these two Calculators have been done but still have a bit of work to do on the FireMonkey version – since we haven’t yet done a “Spin Edit” for the FMX Controls. I had been thinking of a spin edit like our VCL version – which for ESBDevLib is based on the Embarcadero, TSpinEdit. However there is still a fair bit for us to learn about “under the hood” with FMX and so we will probably make an ESBDevLib version of the FMX TSpinBox.

For the first release, the visual side for FMX support will be pretty basic – especially if we decide to keep support for XE2 and XE3 (which I’m leaning towards) – and we will aim at improving the FMX visual side of things for XE4 and above. The non-visual side of things should be almost as robust as it is in the VCL version given the overlap.

For Calendars, ESBPCS for VCL has one component – but in ESBDevLib we will have two TEDLCalendar and TEDLCalendarRD – the latter will support our Reference Dates:

type
/// <summary>
/// Stores the Reference Date, which is based on days from the day prior to 1 January 1
/// AD/CE assuming that the Gregorian Calendar has always been in use.
/// </summary>
/// <remarks>
/// This approach is used by Dershowitz and Reingold in their Calendrical Calculations, /// so this allows us to use their Sample Data to check algorithms.
/// </remarks>
TEDLRefDate = type Integer;

And TEDLCalendarRD will support a Calendar that displays not only standard Gregorian Calendar but also Julian Calendar – and allows for Years prior to 1 AD/CE – and this latter feature rules out TDateTime support. Through Reference Dates we are do also supply routines for Jewish and Muslim Calendars – and plan on adding more and more to this – so this new component is where a lot of new features will be added.

However for standard TDateTime using Gregorian Calendar then TEDLCalendar will be the way to go!

TEDLCalendar Dialog

About esbglenn

Software Developer working at our Family owned business, ESB Consultancy, which is located in Kalgoorlie-Boulder, in the Eastern Goldfields of Western Australia.
This entry was posted in Beta Development, ESBPCS, FireMonkey and tagged , , , , , , , , . Bookmark the permalink.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.