Toast
TsgcHTMLComponent_Toast — Delphi, C++ Builder 및 .NET에서 제목, 본문, 타임스탬프, 색상 및 자동 숨김을 갖춘 Bootstrap 5 토스트 알림을 위치가 지정된 컨테이너로 화면에 배치하여 렌더링합니다.
TsgcHTMLComponent_Toast — Delphi, C++ Builder 및 .NET에서 제목, 본문, 타임스탬프, 색상 및 자동 숨김을 갖춘 Bootstrap 5 토스트 알림을 위치가 지정된 컨테이너로 화면에 배치하여 렌더링합니다.
Bootstrap 5 toast 마크업을 내보내는 토스트 컴포넌트입니다. 제목, 본문 및 색상을 설정한 다음, HTML 속성을 읽습니다 — 또는 정적 Build 헬퍼를 호출하고 토스트를 위치가 지정된 BuildContainer로 감싸십시오.
TsgcHTMLComponent_Toast
Bootstrap 5 toast 마크업
Delphi, C++ Builder, .NET
빠른 토스트를 위해 Build(title, body, color, timestamp)를 호출하고 BuildContainer(toasts, position)로 감싸거나, 컴포넌트를 생성하고 AutoHide와 Delay를 설정한 다음, HTML을 읽습니다.
uses
sgcHTML_Enums, sgcHTML_Component_Toast;
// One-line static helper (primary form):
var
vToast: string;
begin
vToast := TsgcHTMLComponent_Toast.Build('Saved',
'Your changes were stored.', hcSuccess, 'just now');
WebModule.Response := TsgcHTMLComponent_Toast.BuildContainer(vToast,
tpTopEnd);
end;
// Or configure it fully:
var
oToast: TsgcHTMLComponent_Toast;
begin
oToast := TsgcHTMLComponent_Toast.Create(nil);
try
oToast.ToastID := 'saveToast';
oToast.Title := 'Saved';
oToast.Body := 'Your changes were stored.';
oToast.ColorStyle := hcSuccess;
oToast.Timestamp := 'just now';
oToast.AutoHide := True;
oToast.Delay := 4000;
WebModule.Response := oToast.HTML; // Bootstrap toast markup
finally
oToast.Free;
end;
end;
// includes: sgcHTML_Enums.hpp, sgcHTML_Component_Toast.hpp
// One-line static helper (primary form):
String toast = TsgcHTMLComponent_Toast::Build("Saved",
"Your changes were stored.", hcSuccess, "just now");
String html = TsgcHTMLComponent_Toast::BuildContainer(toast, tpTopEnd);
// Or configure it fully:
TsgcHTMLComponent_Toast *oToast = new TsgcHTMLComponent_Toast(NULL);
try
{
oToast->ToastID = "saveToast";
oToast->Title = "Saved";
oToast->Body = "Your changes were stored.";
oToast->ColorStyle = hcSuccess;
oToast->Timestamp = "just now";
oToast->AutoHide = true;
oToast->Delay = 4000;
String body = oToast->HTML; // Bootstrap toast markup
}
__finally
{
delete oToast;
}
using esegece.sgcWebSockets;
// One-line static helper (primary form):
string toast = TsgcHTMLComponent_Toast.Build("Saved",
"Your changes were stored.", TsgcHTMLColor.hcSuccess, "just now");
string html = TsgcHTMLComponent_Toast.BuildContainer(toast,
TsgcHTMLToastPosition.tpTopEnd);
// Or configure it fully:
var t = new TsgcHTMLComponent_Toast();
t.ToastID = "saveToast";
t.Title = "Saved";
t.Body = "Your changes were stored.";
t.ColorStyle = TsgcHTMLColor.hcSuccess;
t.Timestamp = "just now";
t.AutoHide = true;
t.Delay = 4000;
string body = t.HTML; // Bootstrap toast markup
가장 자주 사용하게 되는 멤버.
Title은 헤더 텍스트를, Body는 메시지를, Timestamp는 작은 시간 레이블을, Icon은 제목 앞의 인라인 아이콘을 설정합니다.
ColorStyle은 TsgcHTMLColor(예: hcSuccess 또는 hcDanger)를 받습니다. Color는 원시 Bootstrap 색상 이름 문자열을 받습니다.
AutoHide는 Delay 밀리초(기본값 5000) 후에 토스트를 자동으로 닫습니다. 고정하려면 AutoHide를 False로 설정하십시오.
ToastID는 JavaScript에서 특정 토스트를 표시하거나 숨길 수 있도록 요소 id를 할당합니다.
Build(title, body, color, timestamp)는 토스트 하나를 반환합니다. BuildContainer(toasts, position)는 이를 고정된 toast-container(TsgcHTMLToastPosition)로 감쌉니다.
HTML은 완전한 Bootstrap 토스트 마크업을 반환합니다 — 제공하거나, 페이지 템플릿의 BodyContent에 할당하십시오.