Panel

TsgcHTMLComponent_Panel — Delphi、C++ Builder、.NET で、ヘッダー、ボディ、フッターを備え、任意で折りたたみ・スクロール可能な Bootstrap カードパネルをレンダリングします。

TsgcHTMLComponent_Panel

Bootstrap の card 上に構築された、囲み枠付きのコンテンツパネルです。タイトルと本文を設定し、色を選択し、折りたたみまたはスクロールを切り替えてから、HTML プロパティを読み取ります。

コンポーネントクラス

TsgcHTMLComponent_Panel

レンダリング内容

Bootstrap 5 の card マークアップ

言語

Delphi, C++ Builder, .NET

作成し、内容を設定し、レンダリングする

TitleBodyFooter を割り当て、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");

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

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

Content

Title はカードのヘッダーを、Body はメインの HTML コンテンツを、Footer は任意のフッター行を設定します。

Appearance

ColorTsgcHTMLColor)はテーマの色を選択します。Outline は、塗りつぶしの背景の代わりに枠線付きのバリアントをレンダリングします。

Collapsing

Collapsible はヘッダーをトグルに変え、Expanded は本文を開いた状態で始めるかどうかを設定します。

Scrolling

MaxHeight を伴う Scrollable は、本文の高さに上限を設け、長いコンテンツに垂直スクロールを追加します。

Identity

PanelID は、折りたたみターゲットのアンカーとして使われる、明示的な DOM の id をカードに割り当てます。

One-line build

Build(aTitle, aBody, aColor, aFooter) は、パネルの HTML を 1 回の静的呼び出しで返します。HTML は、設定済みのインスタンスをレンダリングします。

さらに詳しく

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

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

無料体験版をダウンロードして、Delphi、C++ Builder、.NET で Web UI の構築を始めましょう。