TimePicker コンポーネント — sgcHTML | eSeGeCe

TimePicker

TsgcHTMLComponent_TimePicker — Delphi、C++ Builder、.NET で、任意の最小・最大の範囲と秒単位の粒度を備えたネイティブ HTML5 時刻入力をレンダリングします。

TsgcHTMLComponent_TimePicker

HTML5 の time 型の Bootstrap form-control を出力する、ラベル付きの入力コンポーネントです。範囲を設定してから、HTML プロパティを読み取ります(または、静的な Build ヘルパーを呼び出します)。

コンポーネントクラス

TsgcHTMLComponent_TimePicker

レンダリング内容

ネイティブ HTML5 <input type="time">

ファミリー

フォーム & 入力

言語

Delphi, C++ Builder, .NET

作成し、範囲を設定し、レンダリングする

FieldNameLabelTextMinTime/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");

主なプロパティとメソッド

最もよく使うメンバーです。

Field

Value は入力の初期値を設定します。FieldName はその name を設定します。LabelTextform-label をレンダリングします。

Bounds

MinTimeMaxTime は、ネイティブの min/max 属性を介して選択可能な範囲を制限します。

Granularity

StepSecondsstep 属性を直接設定します。ShowSeconds(デフォルト False)は、StepSeconds0 のままの場合に1秒単位の粒度を要求するショートカットです。

Validation & state

RequiredDisabled は、ネイティブ入力にフラグを立てます。

Sizing

SizeTsgcHTMLSizehsExtraSmallhsExtraLarge、デフォルト hsMedium)は、Bootstrap の form-control-sm/form-control-lg に対応します。

Static helper

Build(fieldName, labelText, value) は、インスタンスを管理せずに 1 行でマークアップを返します。

さらに詳しく

オンラインヘルプこのコンポーネントの完全な API リファレンスと使用ガイドです。
すべての sgcHTML コンポーネント80 以上のコンポーネントの全機能マトリックスを閲覧できます。
無料体験版のダウンロード30 日間の体験版には 60.HTML デモプロジェクトが付属します。
価格完全なソースコード付きの Single、Team、Site ライセンス。

始める準備はできましたか?

無料体験版をダウンロードして、Delphi、C++ Builder、.NET の Web アプリに日付・時刻ピッカーを追加しましょう。