TimePicker
TsgcHTMLComponent_TimePicker — Delphi、C++ Builder、.NET で、任意の最小・最大の範囲と秒単位の粒度を備えたネイティブ HTML5 時刻入力をレンダリングします。
TsgcHTMLComponent_TimePicker — Delphi、C++ Builder、.NET で、任意の最小・最大の範囲と秒単位の粒度を備えたネイティブ HTML5 時刻入力をレンダリングします。
HTML5 の time 型の Bootstrap form-control を出力する、ラベル付きの入力コンポーネントです。範囲を設定してから、HTML プロパティを読み取ります(または、静的な Build ヘルパーを呼び出します)。
TsgcHTMLComponent_TimePicker
ネイティブ HTML5 <input type="time">
Delphi, C++ Builder, .NET
FieldName、LabelText、MinTime/MaxTime の範囲を設定してから、HTML を読み取ります — または、静的な Build ヘルパーを呼び出して 1 行で済ませます。
uses
sgcHTML_Component_TimePicker;
var
oTime: TsgcHTMLComponent_TimePicker;
begin
oTime := TsgcHTMLComponent_TimePicker.Create(nil);
try
oTime.FieldName := 'appointment_time';
oTime.LabelText := 'Appointment time';
oTime.MinTime := '08:00';
oTime.MaxTime := '18:00';
oTime.Required := True;
WebModule.Response := oTime.HTML; // <input type="time">
finally
oTime.Free;
end;
end;
// Or the static one-liner (field name, label, value):
Result := TsgcHTMLComponent_TimePicker.Build('appointment_time', 'Appointment time');
// includes: sgcHTML_Component_TimePicker.hpp
TsgcHTMLComponent_TimePicker *oTime = new TsgcHTMLComponent_TimePicker(NULL);
try
{
oTime->FieldName = "appointment_time";
oTime->LabelText = "Appointment time";
oTime->MinTime = "08:00";
oTime->MaxTime = "18:00";
oTime->Required = true;
String html = oTime->HTML; // <input type="time">
}
__finally
{
delete oTime;
}
// Or the static one-liner:
String html = TsgcHTMLComponent_TimePicker::Build("appointment_time", "Appointment time");
using esegece.sgcWebSockets;
var time = new TsgcHTMLComponent_TimePicker();
time.FieldName = "appointment_time";
time.LabelText = "Appointment time";
time.MinTime = "08:00";
time.MaxTime = "18:00";
time.Required = true;
string html = time.HTML; // <input type="time">
// Or the static one-liner:
string html2 = TsgcHTMLComponent_TimePicker.Build("appointment_time", "Appointment time");
最もよく使うメンバーです。
Value は入力の初期値を設定します。FieldName はその name を設定します。LabelText は form-label をレンダリングします。
MinTime と MaxTime は、ネイティブの min/max 属性を介して選択可能な範囲を制限します。
StepSeconds は step 属性を直接設定します。ShowSeconds(デフォルト False)は、StepSeconds が 0 のままの場合に1秒単位の粒度を要求するショートカットです。
Required と Disabled は、ネイティブ入力にフラグを立てます。
Size(TsgcHTMLSize:hsExtraSmall…hsExtraLarge、デフォルト hsMedium)は、Bootstrap の form-control-sm/form-control-lg に対応します。
Build(fieldName, labelText, value) は、インスタンスを管理せずに 1 行でマークアップを返します。