Rating
TsgcHTMLComponent_Rating — renderize uma exibição ou entrada de avaliação por estrelas (símbolo) com um campo de formulário oculto opcional, em Delphi, C++ Builder e .NET.
TsgcHTMLComponent_Rating — renderize uma exibição ou entrada de avaliação por estrelas (símbolo) com um campo de formulário oculto opcional, em Delphi, C++ Builder e .NET.
Um componente de avaliação que emite uma linha de símbolos preenchidos e vazios dimensionados e coloridos a gosto, mais uma entrada oculta opcional carregando o valor. Defina o valor e o máximo e então leia a propriedade HTML.
TsgcHTMLComponent_Rating
Avaliação por símbolo + entrada de formulário oculta
Delphi, C++ Builder, .NET
Defina Value e MaxValue, escolha uma cor e símbolos e então leia HTML — ou chame o helper estático Build para uma linha única.
uses
sgcHTML_Component_Rating;
var
oRating: TsgcHTMLComponent_Rating;
begin
oRating := TsgcHTMLComponent_Rating.Create(nil);
try
oRating.Value := 4;
oRating.MaxValue := 5;
oRating.Color := '#ffc107';
oRating.ShowValue := True;
oRating.InputName := 'score';
oRating.ReadOnly := False;
WebModule.Response := oRating.HTML; // stars + hidden input
finally
oRating.Free;
end;
end;
// Or the static one-liner (value, maxValue, color):
Result := TsgcHTMLComponent_Rating.Build(4, 5, '#ffc107');
// includes: sgcHTML_Component_Rating.hpp
TsgcHTMLComponent_Rating *oRating = new TsgcHTMLComponent_Rating(NULL);
try
{
oRating->Value = 4;
oRating->MaxValue = 5;
oRating->Color = "#ffc107";
oRating->ShowValue = true;
oRating->InputName = "score";
oRating->ReadOnly = false;
String html = oRating->HTML; // stars + hidden input
}
__finally
{
delete oRating;
}
// Or the static one-liner:
String html = TsgcHTMLComponent_Rating::Build(4, 5, "#ffc107");
using esegece.sgcWebSockets;
var rating = new TsgcHTMLComponent_Rating();
rating.Value = 4;
rating.MaxValue = 5;
rating.Color = "#ffc107";
rating.ShowValue = true;
rating.InputName = "score";
rating.ReadOnly = false;
string html = rating.HTML; // stars + hidden input
// Or the static one-liner:
string html2 = TsgcHTMLComponent_Rating.Build(4, 5, "#ffc107");
Os membros que você usa com mais frequência.
Value define quantos símbolos são preenchidos de MaxValue (padrão 5); ShowValue adiciona uma legenda value/max.
ReadOnly (padrão True) renderiza a avaliação como uma exibição estática; defina-o como False para uma entrada interativa.
Color define a cor do símbolo preenchido como uma string CSS; ColorStyle (TsgcHTMLColor, por exemplo hcWarning) escolhe uma cor Bootstrap quando Color está vazio.
FilledSymbol e EmptySymbol substituem os glifos (estrela padrão ★); Size define o tamanho da fonte.
Defina InputName para emitir um <input> oculto carregando o valor numérico para que a avaliação seja enviada junto com o formulário.
Build(value, maxValue, color) retorna o markup em uma linha; HTML retorna a linha de símbolos mais a entrada oculta opcional.
| Todos os Componentes sgcHTMLExplore a matriz completa de recursos com mais de 60 componentes. | Abrir | |
| Baixar Versão de Avaliação GratuitaA avaliação de 30 dias inclui os projetos de demonstração 60.HTML. | Abrir | |
| PreçosLicenças Single, Team e Site com código-fonte completo. | Abrir |