ProgressBar
TsgcHTMLComponent_ProgressBar — pasek postępu Bootstrap, w paski i animowany, z opcjonalną etykietą, lub skumulowany pasek wieloczęściowy, w Delphi, C++ Builder i .NET.
TsgcHTMLComponent_ProgressBar — pasek postępu Bootstrap, w paski i animowany, z opcjonalną etykietą, lub skumulowany pasek wieloczęściowy, w Delphi, C++ Builder i .NET.
Ustaw Value i Max dla pojedynczego paska, lub dodaj wpisy do Bars dla skumulowanego paska wieloczęściowego, a następnie odczytaj właściwość HTML.
TsgcHTMLComponent_ProgressBar
Pasek .progress Bootstrap 5 (pojedynczy lub skumulowany)
Delphi, C++ Builder, .NET
Ustaw Value, Max i ColorStyle, włącz Striped / Animated / ShowLabel w razie potrzeby, a następnie odczytaj HTML.
uses
sgcHTML_Enums, sgcHTML_Component_ProgressBar;
var
oBar: TsgcHTMLComponent_ProgressBar;
begin
oBar := TsgcHTMLComponent_ProgressBar.Create(nil);
try
oBar.ProgressBarID := 'upload';
oBar.Value := 72;
oBar.Max := 100;
oBar.ColorStyle := hcSuccess;
oBar.Striped := True;
oBar.Animated := True;
oBar.ShowLabel := True;
oBar.LabelFormat := '%d%% complete';
WebModule.Response := oBar.HTML; // Bootstrap progress bar
finally
oBar.Free;
end;
end;
// Or a stacked, multi-segment bar:
with oBar.Bars.Add do
begin
Value := 40;
ColorStyle := hcPrimary;
Label_ := 'Done';
end;
with oBar.Bars.Add do
begin
Value := 20;
ColorStyle := hcWarning;
Label_ := 'In progress';
end;
// includes: sgcHTML_Enums.hpp, sgcHTML_Component_ProgressBar.hpp
TsgcHTMLComponent_ProgressBar *oBar = new TsgcHTMLComponent_ProgressBar(NULL);
try
{
oBar->ProgressBarID = "upload";
oBar->Value = 72;
oBar->Max = 100;
oBar->ColorStyle = hcSuccess;
oBar->Striped = true;
oBar->Animated = true;
oBar->ShowLabel = true;
oBar->LabelFormat = "%d%% complete";
String html = oBar->HTML; // Bootstrap progress bar
// Or a stacked, multi-segment bar:
TsgcHTMLProgressBarItem *oSeg1 = oBar->Bars->Add();
oSeg1->Value = 40;
oSeg1->ColorStyle = hcPrimary;
oSeg1->Label_ = "Done";
TsgcHTMLProgressBarItem *oSeg2 = oBar->Bars->Add();
oSeg2->Value = 20;
oSeg2->ColorStyle = hcWarning;
oSeg2->Label_ = "In progress";
}
__finally
{
delete oBar;
}
using esegece.sgcWebSockets;
var bar = new TsgcHTMLComponent_ProgressBar();
bar.ProgressBarID = "upload";
bar.Value = 72;
bar.Max = 100;
bar.ColorStyle = TsgcHTMLColor.hcSuccess;
bar.Striped = true;
bar.Animated = true;
bar.ShowLabel = true;
bar.LabelFormat = "%d%% complete";
string html = bar.HTML; // Bootstrap progress bar
// Or a stacked, multi-segment bar:
var seg1 = bar.Bars.Add();
seg1.Value = 40;
seg1.ColorStyle = TsgcHTMLColor.hcPrimary;
seg1.Label_ = "Done";
var seg2 = bar.Bars.Add();
seg2.Value = 20;
seg2.ColorStyle = TsgcHTMLColor.hcWarning;
seg2.Label_ = "In progress";
Składniki, po które sięgasz najczęściej.
Value i Max (domyślnie 100) ustawiają szerokość wypełnienia w procentach; ColorStyle wybiera kolor Bootstrap, lub ustaw surowy kolor CSS za pomocą Color.
ShowLabel renderuje tekst procentowy wewnątrz paska; LabelFormat (domyślnie %d%%) określa sposób jego formatowania.
Striped dodaje ukośne paski; Animated zakłada włączone paski i animuje je wzdłuż paska.
Bars.Add dodaje TsgcHTMLProgressBarItem (Value, ColorStyle / Color, Label_); gdy Bars zawiera wpisy, zastępują one pojedynczy pasek Value.
Height ustawia niestandardową wysokość paska w CSS; ProgressBarID (lub ElementID) nadaje nazwę zewnętrznemu <div class="progress"> na potrzeby wysyłania fragmentów.
HTML zwraca kontener paska wraz z jego segmentami, gotowy do osadzenia lub przesyłania przez WebSockets przy zmianie wartości.
| Pomoc onlinePełna dokumentacja API i przewodnik użytkowania tego komponentu. | Otwórz | |
| Wszystkie komponenty sgcHTMLPrzejrzyj pełną matrycę funkcji 80+ komponentów. | Otwórz | |
| Pobierz bezpłatną wersję próbną30-dniowa wersja próbna zawiera projekty demonstracyjne 60.HTML. | Otwórz | |
| CennikLicencje Single, Team i Site z pełnym kodem źródłowym. | Otwórz |