NumPad Component — sgcHTML | eSeGeCe

NumPad

TsgcHTMLComponent_NumPad — a touch numeric and currency keypad built for point-of-sale entry, with quick amount buttons and a hidden field that always posts a locale-independent number, in Delphi, C++ Builder and .NET.

TsgcHTMLComponent_NumPad

Set Mode and DecimalPlaces, then read the HTML property; the pad posts a number like 12.50 under FieldName, never a locale-formatted 12,50.

Component class

TsgcHTMLComponent_NumPad

Renders

Calculator-style keypad + display + inline script

Languages

Delphi, C++ Builder, .NET

A number that reads the same in every browser

Every number this component writes, into the markup and into its own script, goes through a locale-independent formatter, never through a routine that honours the browser's regional settings.

uses
  sgcHTML_Component_NumPad;

var
  oPad: TsgcHTMLComponent_NumPad;
begin
  oPad := TsgcHTMLComponent_NumPad.Create(nil);
  try
    oPad.PadID := 'till_amount';
    oPad.FieldName := 'amount';
    oPad.Mode := npCurrency;
    oPad.CurrencySymbol := '$';
    oPad.DecimalPlaces := 2;
    oPad.QuickAmounts.CommaText := '5,10,20,50';   // tender shortcut buttons

    WebModule.Response := oPad.HTML;   // display + calculator-style keys + quick amounts
  finally
    oPad.Free;
  end;
end;
// includes: sgcHTML_Component_NumPad.hpp

TsgcHTMLComponent_NumPad *oPad = new TsgcHTMLComponent_NumPad(NULL);
try
{
  oPad->PadID = "till_amount";
  oPad->FieldName = "amount";
  oPad->Mode = npCurrency;
  oPad->CurrencySymbol = "$";
  oPad->DecimalPlaces = 2;
  oPad->QuickAmounts->CommaText = "5,10,20,50";

  String html = oPad->HTML;   // display + calculator-style keys + quick amounts
}
__finally
{
  delete oPad;
}
using esegece.sgcWebSockets;

var pad = new TsgcHTMLComponent_NumPad();
pad.PadID = "till_amount";
pad.FieldName = "amount";
pad.Mode = npCurrency;
pad.CurrencySymbol = "$";
pad.DecimalPlaces = 2;
pad.QuickAmounts.CommaText = "5,10,20,50";

string html = pad.HTML;   // display + calculator-style keys + quick amounts

Key properties & methods

The members you reach for most often.

Mode

npInteger (no decimal key at all), npDecimal (default) or npCurrency, prefixed by CurrencySymbol.

DecimalPlaces

Default 2, clamped 0–6. Every value the pad shows or posts is padded/rounded to this many decimals.

QuickAmounts

A TStrings of tender shortcut numbers; each entry is parsed and re-emitted through the same locale-independent formatter, so a malformed entry is dropped rather than reaching the page.

FieldName

Hidden field the normalized value posts under, default amount.

MaxValue

0 (default) means no ceiling; above 0, a keystroke that would exceed it is rejected.

WSSend / Action

Enter becomes a real submit button when either is set, pushing over the sgcHTMX WebSocket bridge or POSTing to Action; a sgc:numpad DOM event always fires.

Keep exploring

Online HelpFull API reference and usage guide for this component.
All sgcHTML ComponentsBrowse the full feature matrix of 80+ components.
Download Free TrialThe 30-day trial ships the 60.HTML demo projects.
PricingSingle, Team and Site licenses with full source code.
Best value: All-AccessEvery eSeGeCe product, Premium Support included, from €1,059/year.
See All-Access pricing

Ready to Get Started?

Download the free trial and start building web UIs in Delphi, C++ Builder and .NET.