Re: HMGSCRIPT 2012: Programming For The Web in The Right Way
Posted: Thu Jul 05, 2012 3:26 am
Nice contribution. We shall add this to the contrib.js.
Exclusive forum for HMG, a Free / Open Source xBase WIN32/64 Bits / GUI Development System
http://www.hmgforum.com/
Enjoy!- new setCurrency Textbox method:
setCurrency ( nIintDigits, nDecimals, cDecimalSeparator, cGgroupSeparator, cCurrencySymbol )
- new setMask Textbox method:
setMask ( cMask )
# digit
A alphabetic
U uppercase
L lowercase
C capitalize
? any character
\ to escape
- fixed: problems in query server module.
- changed: Browse demo (append checks for duplicates).
- changed: Query demo (getting multiple records).
- changed: Textbox demo to show how to use setMask and setCurrency.
setCurrency and setMask uses JavaScripTools library (http://javascriptools.sourceforge.net)
included now in HMGSCRIPT distribution.
Yeah!rathinagiri wrote:That's it Roberto.
Creating an HMG compatible inputmask in JS, is possible, but since I have not enough time to do it, I've opted for use a third party library instead.rathinagiri wrote:For whole numbers the numeric textbox is good. But with decimal, the first digit we press is taken as a number after the decimal point even though we don't press the decimal separator. This is some what different behavior from the HMG desktop counterpart.
Code: Select all
TextBox.prototype.setNumericMask = function ( nDigits, nDecimals, cDecimalSeparator, cGroupSeparator, lMinusAllowed )
{
var numParser3 = new NumberParser( nDecimals, cDecimalSeparator, cGroupSeparator, true );
var numMask3 = new NumberMask( numParser3, document.getElementById( this.getId() ), nDigits );
numMask3.allowNegative = lMinusAllowed;
numMask3.leftToRight = true;
}
TextBox.prototype.isValid = function ()
{
return getObject( this.getId() ).mask.isComplete();
}
Yes.rathinagiri wrote:That's it Roberto.
I think this tool includes a dynamic table too.
Regarding setNumericMask, I could modify setCurrency method to expose more NumberParser properties and have only one method with different functionalities.rathinagiri wrote:While implementing the numeric mask, I have seen that, HMG compatible numeric text box is possible if we don't have currency symbol.
So, these are the new methods for textbox for contrib.js:
Code: Select all
TextBox.prototype.setNumericMask = function ( nDigits, nDecimals, cDecimalSeparator, cGroupSeparator, lMinusAllowed ) { var numParser3 = new NumberParser( nDecimals, cDecimalSeparator, cGroupSeparator, true ); var numMask3 = new NumberMask( numParser3, document.getElementById( this.getId() ), nDigits ); numMask3.allowNegative = lMinusAllowed; numMask3.leftToRight = true; }