Panel

TsgcHTMLComponent_Panel — Delphi, C++ Builder 및 .NET에서 헤더, 본문 및 푸터를 갖춘, 선택적으로 접을 수 있고 스크롤 가능한 Bootstrap 카드 패널을 렌더링합니다.

TsgcHTMLComponent_Panel

Bootstrap card 위에 구축된 박스형 콘텐츠 패널입니다. 제목과 본문을 설정하고, 색상을 선택하고, 접기 또는 스크롤을 토글한 다음, HTML 속성을 읽습니다.

컴포넌트 클래스

TsgcHTMLComponent_Panel

렌더링

Bootstrap 5 card 마크업

언어

Delphi, C++ Builder, .NET

생성하고, 콘텐츠를 설정하고, 렌더링하기

Title, BodyFooter를 할당하고, 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을 반환합니다. HTML은 구성된 인스턴스를 렌더링합니다.

계속 살펴보기

모든 sgcHTML 컴포넌트60개 이상의 컴포넌트 전체 기능 매트릭스를 둘러보십시오.
무료 체험판 다운로드30일 체험판에는 60.HTML 데모 프로젝트가 포함됩니다.
가격전체 소스 코드가 포함된 Single, Team 및 Site 라이선스.

시작할 준비가 되셨습니까?

무료 체험판을 다운로드하고 Delphi, C++ Builder 및 .NET에서 웹 UI를 구축하기 시작하십시오.