Placeholder
TsgcHTMLComponent_Placeholder — renderizza una card di caricamento skeleton Bootstrap 5 con un’animazione shimmer e righe, immagine, titolo e pulsanti configurabili, in Delphi, C++ Builder e .NET.
TsgcHTMLComponent_Placeholder — renderizza una card di caricamento skeleton Bootstrap 5 con un’animazione shimmer e righe, immagine, titolo e pulsanti configurabili, in Delphi, C++ Builder e .NET.
Un componente skeleton-loader che emette markup placeholder Bootstrap 5 con uno shimmer glow o wave. Imposta il numero di righe e quali parti mostrare, quindi leggi la proprietà HTML — oppure chiama gli helper statici BuildCard / BuildText.
TsgcHTMLComponent_Placeholder
Bootstrap 5 placeholder markup
Delphi, C++ Builder, .NET
Chiama BuildCard(lineCount, animation) per una card skeleton completa, oppure crea il componente, imposta LineCount, ShowImage e Animation, quindi leggi HTML.
uses
sgcHTML_Enums, sgcHTML_Component_Placeholder;
// One-line static helper (primary form):
var
vHTML: string;
begin
vHTML := TsgcHTMLComponent_Placeholder.BuildCard(3, paWave);
WebModule.Response := vHTML;
end;
// Or configure it fully:
var
oPH: TsgcHTMLComponent_Placeholder;
begin
oPH := TsgcHTMLComponent_Placeholder.Create(nil);
try
oPH.LineCount := 4;
oPH.Animation := paGlow;
oPH.Color := hcSecondary;
oPH.ShowImage := True;
oPH.ShowTitle := True;
oPH.ShowButtons := True;
WebModule.Response := oPH.HTML; // Bootstrap placeholder card
finally
oPH.Free;
end;
end;
// includes: sgcHTML_Enums.hpp, sgcHTML_Component_Placeholder.hpp
// One-line static helper (primary form):
String html = TsgcHTMLComponent_Placeholder::BuildCard(3, paWave);
// Or configure it fully:
TsgcHTMLComponent_Placeholder *oPH = new TsgcHTMLComponent_Placeholder(NULL);
try
{
oPH->LineCount = 4;
oPH->Animation = paGlow;
oPH->Color = hcSecondary;
oPH->ShowImage = true;
oPH->ShowTitle = true;
oPH->ShowButtons = true;
String body = oPH->HTML; // Bootstrap placeholder card
}
__finally
{
delete oPH;
}
using esegece.sgcWebSockets;
// One-line static helper (primary form):
string html = TsgcHTMLComponent_Placeholder.BuildCard(3,
TsgcHTMLPlaceholderAnimation.paWave);
// Or configure it fully:
var ph = new TsgcHTMLComponent_Placeholder();
ph.LineCount = 4;
ph.Animation = TsgcHTMLPlaceholderAnimation.paGlow;
ph.Color = TsgcHTMLColor.hcSecondary;
ph.ShowImage = true;
ph.ShowTitle = true;
ph.ShowButtons = true;
string body = ph.HTML; // Bootstrap placeholder card
I membri che utilizzerai più spesso.
LineCount imposta quante righe di testo placeholder vengono renderizzate (predefinito 3) con larghezze variabili per imitare un testo reale.
Animation seleziona lo shimmer paGlow o paWave tramite TsgcHTMLPlaceholderAnimation.
ShowImage aggiunge un blocco immagine, ShowTitle una barra del titolo e ShowButtons due placeholder per pulsanti.
Size imposta l’altezza del placeholder con phSmall, phNormal, phLarge o phExtraLarge; Color accetta un TsgcHTMLColor.
BuildCard(lineCount, animation) restituisce una card skeleton completa; BuildText(lineCount, animation) solo righe di testo; BuildButton(animation) un singolo pulsante.
HTML restituisce la card placeholder Bootstrap completa — sostituiscila con il contenuto reale una volta caricati i dati.