Popover

TsgcHTMLComponent_Popover — Delphi, C++ Builder 및 .NET에서 구성 가능한 배치, 트리거 및 닫기 동작과 함께 제목과 본문이 있는 Bootstrap 5 팝오버를 어떤 트리거 요소에든 연결합니다.

TsgcHTMLComponent_Popover

트리거 요소를 Bootstrap 5 popover 데이터 속성과 자동 초기화 스크립트로 감싸는 팝오버 컴포넌트입니다. 콘텐츠, 제목 및 본문을 설정한 다음, HTML 속성을 읽습니다 — 또는 한 줄짜리 정적 Build 헬퍼를 호출하십시오.

컴포넌트 클래스

TsgcHTMLComponent_Popover

렌더링

Bootstrap 5 popover 마크업

언어

Delphi, C++ Builder, .NET

한 줄로 구성하거나, 완전하게 구성하기

팝오버 버튼을 위해 BuildButton(text, title, body, style, placement)을 호출하거나, 컴포넌트를 생성하고 PlacementTrigger를 설정한 다음, HTML을 읽습니다.

uses
  sgcHTML_Enums, sgcHTML_Component_Popover;

// One-line static helper (primary form):
var
  vHTML: string;
begin
  vHTML := TsgcHTMLComponent_Popover.BuildButton('More info',
    'Pricing', 'All licenses include full source code.',
    bsPrimary, plTop);
  WebModule.Response := vHTML;
end;

// Or configure it fully:
var
  oPop: TsgcHTMLComponent_Popover;
begin
  oPop := TsgcHTMLComponent_Popover.Create(nil);
  try
    oPop.Content := '<a href="#" class="btn btn-info">Details</a>';
    oPop.Title := 'Shipping';
    oPop.Body := 'Free delivery on orders over 50.';
    oPop.Placement := plRight;
    oPop.Trigger := ptHover;
    oPop.Dismissible := True;

    WebModule.Response := oPop.HTML;   // trigger + popover init script
  finally
    oPop.Free;
  end;
end;
// includes: sgcHTML_Enums.hpp, sgcHTML_Component_Popover.hpp

// One-line static helper (primary form):
String html = TsgcHTMLComponent_Popover::BuildButton("More info",
  "Pricing", "All licenses include full source code.",
  bsPrimary, plTop);

// Or configure it fully:
TsgcHTMLComponent_Popover *oPop = new TsgcHTMLComponent_Popover(NULL);
try
{
  oPop->Content = "<a href=\"#\" class=\"btn btn-info\">Details</a>";
  oPop->Title = "Shipping";
  oPop->Body = "Free delivery on orders over 50.";
  oPop->Placement = plRight;
  oPop->Trigger = ptHover;
  oPop->Dismissible = true;

  String html = oPop->HTML;   // trigger + popover init script
}
__finally
{
  delete oPop;
}
using esegece.sgcWebSockets;

// One-line static helper (primary form):
string html = TsgcHTMLComponent_Popover.BuildButton("More info",
    "Pricing", "All licenses include full source code.",
    TsgcHTMLButtonStyle.bsPrimary, TsgcHTMLPlacement.plTop);

// Or configure it fully:
var pop = new TsgcHTMLComponent_Popover();
pop.Content = "<a href=\"#\" class=\"btn btn-info\">Details</a>";
pop.Title = "Shipping";
pop.Body = "Free delivery on orders over 50.";
pop.Placement = TsgcHTMLPlacement.plRight;
pop.Trigger = TsgcHTMLPopoverTrigger.ptHover;
pop.Dismissible = true;

string html = pop.HTML;   // trigger + popover init script

주요 속성 및 메서드

가장 자주 사용하게 되는 멤버.

콘텐츠

Content는 트리거 요소의 내부 HTML입니다. 비어 있으면 TitleContentStyle로 구성된 스타일이 적용된 버튼이 대신 사용됩니다.

팝오버 텍스트

Title은 팝오버 제목을, Body는 그 텍스트(Bootstrap data-bs-content)를 설정합니다.

배치

PlacementTsgcHTMLPlacement를 통해 팝오버를 plTop, plBottom, plLeft 또는 plRight에 배치합니다.

트리거

TriggerptClick, ptHover, ptFocus 또는 ptManual을 선택합니다. Dismissible은 다음 외부 클릭 시 이를 닫습니다.

초기화

AutoInit은 모든 팝오버에 대해 new bootstrap.Popover를 호출하는 스크립트를 추가합니다. InitScript를 통해 스크립트를 재정의하십시오.

정적 헬퍼 및 출력

Build(content, title, body, placement, trigger)BuildButton(text, title, body, style, placement)은 준비된 마크업을 반환합니다. HTML은 트리거와 그 초기화 스크립트를 내보냅니다.

계속 살펴보기

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

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

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