by Brett Sheppard - GUI Computing
A new control set from Apex? That's got to be good news… But input and masking controls? Surely, they cause just about as much developer pain as gain? That may be the common opinion, but things have changed recently (and not just in Apex's offering), and developers really should take a second look.
TrueDBInput contains six data aware controls designed to provide automatic data translation, data validation and improve overall data-entry and user interface. These include a Date Control, Frame Control, Mask Control, Number Control, Text Control and Time Control.
This date control will save quite a bit of coding and has some nifty features which makes validation a non issue for the programmer. Its formatting capabilities are solid and can be set so that the user can enter simple input like 042298 and have it automatically altered into a more complex format such as Apr 22 '98. This format can be chosen at design time through a property page and there are numerous formats to choose from. The property page also offers minimum and maximum values so that a date within a certain range has to be entered - really handy if you only want dates entered for certain periods such as the last financial year.
|Another cool feature is the ability to bind the control to a database field and have it generate a format from the corresponding field. Date checking is also provided so that letters or wacky characters cannot be entered. Naturally, non existent dates are not allowed such as the 52nd of June and the 29th of Feb 1999.
Something else that I liked (and which is common through the set) is the hot key which can be set to clear the control and include the current date.
The control contains a calendar which pops up if a hot key is hit or if the down arrow is clicked. (The down arrow is optional.) Picking a date is easy as double clicking on it and the format displayed in the control reflects the style you have chosen straight away.
This control allows you to check for valid input and display it in a more desirable format. The most important features of this control can be found on the Format property page and the Lookup Mode property page.
The Format property page lets you enter what type of input is required and the way it is displayed. This format is specified using pre-defined key words that represent different types of data. For example, entering A99X would only allow an upper case value, two numeric values and a Hexadecimal value in that order to be entered. (eg. B34E). This page also allows you to enter the format in which you want the text to be displayed. So, (99) 9999-9999 would not only stop users from entering letters or characters for a phone number, but it would ensure that the data entered would be in a more readable and informative manner.
The look up mode property page defines any special characters that might be required for a field. It contains a LookUpTable where you can enter the required data or range. (eg. Entering F, M would only allow those two letters to be entered into a Sex field.). A range can also be entered here such as 3-5 or A-D. It also contains a LookUpMode that can specify if the values in LookUpTable are the only values that can be entered or not entered. This control can really save you from having to do a lot of boring coding so you can get onto the more important stuff in your program.
|You guessed it, this control is for numerical data and validates and masks any values entered into it. In keeping with the Mask control, there is a format property page that allows you to enter in the style you want your data to be displayed - you can either create your own custom style or choose from a number of already existing styles such as Currency and Percentage formats.
What makes this control a bit different however is that it comes with a drop down mini calculator where your user can perform your standard calculations such as multiplication and the like and then display the answer in the control when finished. It's a lot easier than your user having to start up their Windows calculator or search through their drawers trying to find that 10 year old solar powered number.
This control has all the features of the text control which comes with VB but includes a few more extras that might come in handy. For instance, you can validate what type of character is going to be entered into it such as allowing only upper case, lower case, numerics or punctuation marks. It also allows you to check for single and double byte characters. A popup window whose size can be altered is available enabling multiple lines to be more easily read and hot keys are also available to clear any text within it.
The time control allows data to be displayed in a format pre-defined on its property page or in a custom style that you desire. It can be shown in either 12 or 24 mode and as expected, validates any input by only accepting numerical values and correct times. Range checking is also available if you want to restrict the user to entering a certain period in time. A hot key is also on hand which automatically enters the current time when selected.
In order to provide some better 3D effects for these controls TDBFrame3D has been included in TrueDBInput. It can be used for 3D effects by placing one of the other controls on to it and setting its autosize property to true. The frame offers a little bit more control on the colours used as well as being able to change the light source for the 3D effect. It basically provides a better way to display your data. If you already have a favourite frame control, of course, you'll probably want to stick with that...
Quite a few people are sceptical of Input and Masking controls feeling the are more trouble than they are worth. I think TrueDBInput is a bit different because of its flexibility with the many different types of input that it allows and the fact that it is a solid and proven product already (the control set was initially developed for the Asian market and has now been adopted by Apex).
It really is a time saver and will provide the sort of functionality, consistency and ease of use demanded by your users. If you don't like spending a huge amount of time on writing validation and masking code (and who does??) then I would suggest taking a look at TrueDBInput.
There's a demo available from http://www.apexsc.com/downloads.
TrueDBInput is available in Australia from GUI Computing for $279