Panel
TsgcHTMLComponent_Panel — Delphi、C++ Builder、.NET で、ヘッダー、ボディ、フッターを備え、任意で折りたたみ・スクロール可能な Bootstrap カードパネルをレンダリングします。
TsgcHTMLComponent_Panel — Delphi、C++ Builder、.NET で、ヘッダー、ボディ、フッターを備え、任意で折りたたみ・スクロール可能な Bootstrap カードパネルをレンダリングします。
Bootstrap の card 上に構築された、囲み枠付きのコンテンツパネルです。タイトルと本文を設定し、色を選択し、折りたたみまたはスクロールを切り替えてから、HTML プロパティを読み取ります。
TsgcHTMLComponent_Panel
Bootstrap 5 の card マークアップ
Delphi, C++ Builder, .NET
Title、Body、Footer を割り当て、Color を選択してから、HTML を読み取ります — または、静的な一行の Build ヘルパーを使用します。
uses
sgcHTML_Enums, sgcHTML_Component_Panel;
var
oPanel: TsgcHTMLComponent_Panel;
begin
oPanel := TsgcHTMLComponent_Panel.Create(nil);
try
oPanel.Title := 'Account Summary';
oPanel.Body := '<p>Your plan renews on the 1st.</p>';
oPanel.Footer := 'Last updated today';
oPanel.Color := hcLight;
oPanel.Collapsible := True;
oPanel.Expanded := True;
WebModule.Response := oPanel.HTML; // Bootstrap card
finally
oPanel.Free;
end;
end;
// Or in a single line with the static helper:
Result := TsgcHTMLComponent_Panel.Build('Account Summary',
'<p>Your plan renews on the 1st.</p>', hcLight, 'Last updated today');
// includes: sgcHTML_Enums.hpp, sgcHTML_Component_Panel.hpp
TsgcHTMLComponent_Panel *oPanel = new TsgcHTMLComponent_Panel(NULL);
try
{
oPanel->Title = "Account Summary";
oPanel->Body = "<p>Your plan renews on the 1st.</p>";
oPanel->Footer = "Last updated today";
oPanel->Color = hcLight;
oPanel->Collapsible = true;
oPanel->Expanded = true;
String html = oPanel->HTML; // Bootstrap card
}
__finally
{
delete oPanel;
}
// Or in a single line with the static helper:
String html = TsgcHTMLComponent_Panel::Build("Account Summary",
"<p>Your plan renews on the 1st.</p>", hcLight, "Last updated today");
using esegece.sgcWebSockets;
var panel = new TsgcHTMLComponent_Panel();
panel.Title = "Account Summary";
panel.Body = "<p>Your plan renews on the 1st.</p>";
panel.Footer = "Last updated today";
panel.Color = TsgcHTMLColor.hcLight;
panel.Collapsible = true;
panel.Expanded = true;
string html = panel.HTML; // Bootstrap card
// Or in a single line with the static helper:
string oneLine = TsgcHTMLComponent_Panel.Build("Account Summary",
"<p>Your plan renews on the 1st.</p>", TsgcHTMLColor.hcLight, "Last updated today");
最もよく使うメンバーです。
Title はカードのヘッダーを、Body はメインの HTML コンテンツを、Footer は任意のフッター行を設定します。
Color(TsgcHTMLColor)はテーマの色を選択します。Outline は、塗りつぶしの背景の代わりに枠線付きのバリアントをレンダリングします。
Collapsible はヘッダーをトグルに変え、Expanded は本文を開いた状態で始めるかどうかを設定します。
MaxHeight を伴う Scrollable は、本文の高さに上限を設け、長いコンテンツに垂直スクロールを追加します。
PanelID は、折りたたみターゲットのアンカーとして使われる、明示的な DOM の id をカードに割り当てます。
Build(aTitle, aBody, aColor, aFooter) は、パネルの HTML を 1 回の静的呼び出しで返します。HTML は、設定済みのインスタンスをレンダリングします。