Toast
TsgcHTMLComponent_Toast — erzeugen Sie eine Bootstrap-5-Toast-Benachrichtigung mit Titel, Inhalt, Zeitstempel, Farbe und Auto-Ausblenden, auf dem Bildschirm platziert durch einen positionierten Container, in Delphi, C++ Builder und .NET.
TsgcHTMLComponent_Toast — erzeugen Sie eine Bootstrap-5-Toast-Benachrichtigung mit Titel, Inhalt, Zeitstempel, Farbe und Auto-Ausblenden, auf dem Bildschirm platziert durch einen positionierten Container, in Delphi, C++ Builder und .NET.
Eine Toast-Komponente, die Bootstrap-5-toast-Markup ausgibt. Setzen Sie Titel, Inhalt und Farbe und lesen Sie dann die HTML-Eigenschaft — oder rufen Sie den statischen Build-Helfer auf und umschließen Sie Toasts in einem positionierten BuildContainer.
TsgcHTMLComponent_Toast
Bootstrap-5-Toast-Markup
Delphi, C++ Builder, .NET
Rufen Sie Build(title, body, color, timestamp) für einen schnellen Toast auf und umschließen Sie ihn in BuildContainer(toasts, position), oder erstellen Sie die Komponente, setzen Sie AutoHide und Delay und lesen Sie dann 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
Die Member, die Sie am häufigsten verwenden.
Title setzt den Kopfzeilentext, Body die Nachricht, Timestamp die kleine Zeitbeschriftung und Icon ein Inline-Icon vor dem Titel.
ColorStyle nimmt einen TsgcHTMLColor (wie hcSuccess oder hcDanger); Color akzeptiert eine rohe Bootstrap-Farbnamen-Zeichenkette.
AutoHide blendet den Toast nach Delay Millisekunden (Standard 5000) automatisch aus; setzen Sie AutoHide auf False, um ihn fixiert zu halten.
ToastID weist die Element-id zu, sodass Sie einen bestimmten Toast aus JavaScript ein- oder ausblenden können.
Build(title, body, color, timestamp) gibt einen Toast zurück; BuildContainer(toasts, position) umschließt sie in einem festen toast-container (TsgcHTMLToastPosition).
HTML gibt das vollständige Bootstrap-Toast-Markup zurück — liefern Sie es aus oder weisen Sie es dem BodyContent einer Seitenvorlage zu.
| Alle sgcHTML-KomponentenDurchsuchen Sie die vollständige Funktionsmatrix von über 60 Komponenten. | Öffnen | |
| Kostenlose Testversion herunterladenDie 30-Tage-Testversion enthält die 60.HTML-Demoprojekte. | Öffnen | |
| PreiseSingle-, Team- und Site-Lizenzen mit vollständigem Quellcode. | Öffnen |