Placeholder
TsgcHTMLComponent_Placeholder — Delphi、C++ Builder、.NET で、シマーアニメーションと設定可能な行、画像、タイトル、ボタンを備えた Bootstrap 5 スケルトン読み込みカードをレンダリングします。
TsgcHTMLComponent_Placeholder — Delphi、C++ Builder、.NET で、シマーアニメーションと設定可能な行、画像、タイトル、ボタンを備えた Bootstrap 5 スケルトン読み込みカードをレンダリングします。
グローまたはウェーブのシマー付きで Bootstrap 5 の placeholder マークアップを出力するスケルトンローダーコンポーネントです。行数と表示する部分を設定してから、HTML プロパティを読み取ります — または、静的な BuildCard / BuildText ヘルパーを呼び出します。
TsgcHTMLComponent_Placeholder
Bootstrap 5 の placeholder マークアップ
Delphi, C++ Builder, .NET
完全なスケルトンカードには BuildCard(lineCount, animation) を呼び出すか、コンポーネントを作成して LineCount、ShowImage、Animation を設定してから、HTML を読み取ります。
uses
sgcHTML_Enums, sgcHTML_Component_Placeholder;
// One-line static helper (primary form):
var
vHTML: string;
begin
vHTML := TsgcHTMLComponent_Placeholder.BuildCard(3, paWave);
WebModule.Response := vHTML;
end;
// Or configure it fully:
var
oPH: TsgcHTMLComponent_Placeholder;
begin
oPH := TsgcHTMLComponent_Placeholder.Create(nil);
try
oPH.LineCount := 4;
oPH.Animation := paGlow;
oPH.Color := hcSecondary;
oPH.ShowImage := True;
oPH.ShowTitle := True;
oPH.ShowButtons := True;
WebModule.Response := oPH.HTML; // Bootstrap placeholder card
finally
oPH.Free;
end;
end;
// includes: sgcHTML_Enums.hpp, sgcHTML_Component_Placeholder.hpp
// One-line static helper (primary form):
String html = TsgcHTMLComponent_Placeholder::BuildCard(3, paWave);
// Or configure it fully:
TsgcHTMLComponent_Placeholder *oPH = new TsgcHTMLComponent_Placeholder(NULL);
try
{
oPH->LineCount = 4;
oPH->Animation = paGlow;
oPH->Color = hcSecondary;
oPH->ShowImage = true;
oPH->ShowTitle = true;
oPH->ShowButtons = true;
String body = oPH->HTML; // Bootstrap placeholder card
}
__finally
{
delete oPH;
}
using esegece.sgcWebSockets;
// One-line static helper (primary form):
string html = TsgcHTMLComponent_Placeholder.BuildCard(3,
TsgcHTMLPlaceholderAnimation.paWave);
// Or configure it fully:
var ph = new TsgcHTMLComponent_Placeholder();
ph.LineCount = 4;
ph.Animation = TsgcHTMLPlaceholderAnimation.paGlow;
ph.Color = TsgcHTMLColor.hcSecondary;
ph.ShowImage = true;
ph.ShowTitle = true;
ph.ShowButtons = true;
string body = ph.HTML; // Bootstrap placeholder card
最もよく使うメンバーです。
LineCount は、レンダリングするプレースホルダーテキストの行数(既定値 3)を、実際の文章を模倣するためにさまざまな幅で設定します。
Animation は、TsgcHTMLPlaceholderAnimation を介して paGlow または paWave のシマーを選択します。
ShowImage は画像ブロックを、ShowTitle はタイトルバーを、ShowButtons は 2 つのボタンプレースホルダーを追加します。
Size は、phSmall、phNormal、phLarge、phExtraLarge でプレースホルダーの高さを設定します。Color は TsgcHTMLColor を取ります。
BuildCard(lineCount, animation) は完全なスケルトンカードを返し、BuildText(lineCount, animation) はテキスト行のみを、BuildButton(animation) は単一のボタンを返します。
HTML は完全な Bootstrap プレースホルダーカードを返します — データが読み込まれたら、実際のコンテンツに差し替えます。