Spinner
TsgcHTMLComponent_Spinner — renderiza un spinner de carga de Bootstrap 5 en estilo border o grow, con tamaño, color y texto accesible, en Delphi, C++ Builder y .NET.
TsgcHTMLComponent_Spinner — renderiza un spinner de carga de Bootstrap 5 en estilo border o grow, con tamaño, color y texto accesible, en Delphi, C++ Builder y .NET.
Un componente de spinner de carga que emite marcado spinner de Bootstrap 5. Elige el tipo de spinner, el tamaño y el color, y luego lee la propiedad HTML — o llama al ayudante estático Build para una sola línea.
TsgcHTMLComponent_Spinner
Marcado de spinner de Bootstrap 5
Delphi, C++ Builder, .NET
Llama a Build(spinnerType, color, size) para un spinner rápido, o crea el componente, define SpinnerType, Size y ColorStyle, y luego lee HTML.
uses
sgcHTML_Enums, sgcHTML_Component_Spinner;
// One-line static helper (primary form):
var
vHTML: string;
begin
vHTML := TsgcHTMLComponent_Spinner.Build(spBorder, hcPrimary, ssNormal);
WebModule.Response := vHTML;
end;
// Or configure it fully:
var
oSpin: TsgcHTMLComponent_Spinner;
begin
oSpin := TsgcHTMLComponent_Spinner.Create(nil);
try
oSpin.SpinnerType := spGrow;
oSpin.Size := ssSmall;
oSpin.ColorStyle := hcSuccess;
oSpin.Text := 'Loading...';
oSpin.SpinnerID := 'loader';
WebModule.Response := oSpin.HTML; // Bootstrap spinner markup
finally
oSpin.Free;
end;
end;
// includes: sgcHTML_Enums.hpp, sgcHTML_Component_Spinner.hpp
// One-line static helper (primary form):
String html = TsgcHTMLComponent_Spinner::Build(spBorder, hcPrimary, ssNormal);
// Or configure it fully:
TsgcHTMLComponent_Spinner *oSpin = new TsgcHTMLComponent_Spinner(NULL);
try
{
oSpin->SpinnerType = spGrow;
oSpin->Size = ssSmall;
oSpin->ColorStyle = hcSuccess;
oSpin->Text = "Loading...";
oSpin->SpinnerID = "loader";
String body = oSpin->HTML; // Bootstrap spinner markup
}
__finally
{
delete oSpin;
}
using esegece.sgcWebSockets;
// One-line static helper (primary form):
string html = TsgcHTMLComponent_Spinner.Build(TsgcHTMLSpinnerType.spBorder,
TsgcHTMLColor.hcPrimary, TsgcHTMLSpinnerSize.ssNormal);
// Or configure it fully:
var spin = new TsgcHTMLComponent_Spinner();
spin.SpinnerType = TsgcHTMLSpinnerType.spGrow;
spin.Size = TsgcHTMLSpinnerSize.ssSmall;
spin.ColorStyle = TsgcHTMLColor.hcSuccess;
spin.Text = "Loading...";
spin.SpinnerID = "loader";
string body = spin.HTML; // Bootstrap spinner markup
Los miembros que más vas a usar.
SpinnerType selecciona spBorder (anillo giratorio) o spGrow (punto pulsante) mediante TsgcHTMLSpinnerType.
Size elige ssNormal o ssSmall mediante TsgcHTMLSpinnerSize.
ColorStyle toma un TsgcHTMLColor (como hcPrimary o hcSuccess); Color acepta una cadena con un nombre de color de Bootstrap.
Text define la etiqueta de estado oculta visualmente que leen los lectores de pantalla (por defecto el texto "Loading..." del idioma).
SpinnerID asigna el id del elemento para que puedas mostrar o eliminar el spinner desde JavaScript.
Build(spinnerType, color, size) devuelve un spinner listo; HTML emite el marcado de spinner de Bootstrap con su role y su texto oculto.