Forum > Lazarus Extra Components
T-edit component for money
wp:
Just noticed that the TCurrSpinEditEx does not allow typing the decimal separator. Updated the version in ccr-svn. If you use the OPM version modify the following method in unit ExEditCtrls:
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---procedure TCustomCurrSpinEditEx.EditKeyPress(var Key: char);begin inherited EditKeyPress(Key); if not (Key in (Digits + AllowedControlChars + ['-', FDecimalSeparator])) then Key := #0; // <--- Add FDecimalSeparator here if (Key = '-') and IsLimited and (MinValue >= 0) then Key := #0;end;
Yes, you can type an arbitrary number of decimal places, but when editing ends the input string is rounded as specified by the Decimals property.
The spinner can be hidden by switching the property UpDownVisible to false. Note that it is still operative when the up/down arrows are pressed. If you don't want this, set the Increment property to 0.
Kalevi:
Oh, great. It's working. Thank you.
Ally:
Have a look at this.
https://forum.lazarus.freepascal.org/index.php/topic,53352.msg394615.html#msg394615
I think this component could solve your problems.
Kalevi:
This RhsPack component DecimalNumberEdit is almost complete if an empty component could still be filled in with 0.00.
Thank you, Roland, for your excellent work.
Ally:
Hello Kalevi,
It's quite simple like this:
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---DecimalNumberEdit1.Text := '0' + DefaultFormatSettings.DecimalSeparator + '00';
Greetings Roland
Navigation
[0] Message Index
[#] Next page
[*] Previous page