Toast
TsgcHTMLComponent_Toast — Delphi, C++ Builder ve .NET'te konumlandırılmış bir kapsayıcıyla ekranda yerleştirilen, başlık, gövde, zaman damgası, renk ve otomatik gizlemeye sahip bir Bootstrap 5 toast bildirimi işleyin.
TsgcHTMLComponent_Toast — Delphi, C++ Builder ve .NET'te konumlandırılmış bir kapsayıcıyla ekranda yerleştirilen, başlık, gövde, zaman damgası, renk ve otomatik gizlemeye sahip bir Bootstrap 5 toast bildirimi işleyin.
Bootstrap 5 toast işaretlemesi üreten bir toast bileşeni. Başlığı, gövdeyi ve rengi ayarlayın, ardından HTML özelliğini okuyun — ya da statik Build yardımcısını çağırın ve toast'ları konumlandırılmış bir BuildContainer içine sarın.
TsgcHTMLComponent_Toast
Bootstrap 5 toast işaretlemesi
Delphi, C++ Builder, .NET
Hızlı bir toast için Build(title, body, color, timestamp)'i çağırın ve onu BuildContainer(toasts, position) içine sarın ya da bileşeni oluşturun, AutoHide ve Delay'i ayarlayın, ardından HTML'i okuyun.
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
En sık başvurduğunuz üyeler.
Title, başlık metnini, Body, mesajı, Timestamp, küçük zaman etiketini ve Icon, başlıktan önce satır içi bir simgeyi ayarlar.
ColorStyle, bir TsgcHTMLColor alır (hcSuccess veya hcDanger gibi); Color, ham bir Bootstrap renk adı dizesi kabul eder.
AutoHide, toast'ı Delay milisaniye sonra otomatik olarak kapatır (varsayılan 5000); sabit tutmak için AutoHide'ı False yapın.
ToastID, belirli bir toast'ı JavaScript'ten gösterebilmeniz veya gizleyebilmeniz için öğe kimliğini atar.
Build(title, body, color, timestamp), bir toast döndürür; BuildContainer(toasts, position), onları sabit bir toast-container (TsgcHTMLToastPosition) içine sarar.
HTML, eksiksiz Bootstrap toast işaretlemesini döndürür — sunun ya da bir sayfa şablonunun BodyContent'ine atayın.