ButtonGroup
TsgcHTMLComponent_ButtonGroup — Delphi, C++ Builder ve .NET'te etkin ve devre dışı durumlarıyla, segmentli bir düğme ya da bağlantı kümesi işleyin.
TsgcHTMLComponent_ButtonGroup — Delphi, C++ Builder ve .NET'te etkin ve devre dışı durumlarıyla, segmentli bir düğme ya da bağlantı kümesi işleyin.
Bir Bootstrap 5 btn-group üreten bir düğme grubu bileşeni. Düğme öğeleri ekleyin, her birinin stilini ve durumunu ayarlayın, ardından HTML özelliğini okuyun.
TsgcHTMLComponent_ButtonGroup
Bootstrap 5 btn-group işaretlemesi
Delphi, C++ Builder, .NET
Düğme öğeleri ekleyin, her Text, ButtonStyle ve Active bayrağını ayarlayın, bir Size seçin, ardından HTML'i okuyun (ya da bir TsgcHTMLTemplate_Bootstrap sayfasına bırakın).
uses
sgcHTML_Enums, sgcHTML_Component_ButtonGroup;
var
oGroup: TsgcHTMLComponent_ButtonGroup;
oBtn: TsgcHTMLButtonItem;
begin
oGroup := TsgcHTMLComponent_ButtonGroup.Create(nil);
try
oGroup.Size := bgsLarge;
oGroup.AriaLabel := 'View mode';
oBtn := oGroup.Items.Add;
oBtn.Text := 'Day';
oBtn.ButtonStyle := bsOutlinePrimary;
oBtn.Active := True;
oBtn := oGroup.Items.Add;
oBtn.Text := 'Week';
oBtn.ButtonStyle := bsOutlinePrimary;
oBtn := oGroup.Items.Add;
oBtn.Text := 'Month';
oBtn.ButtonStyle := bsOutlinePrimary;
oBtn.Disabled := True;
WebModule.Response := oGroup.HTML; // Bootstrap btn-group
finally
oGroup.Free;
end;
end;
// includes: sgcHTML_Enums.hpp, sgcHTML_Component_ButtonGroup.hpp
TsgcHTMLComponent_ButtonGroup *oGroup = new TsgcHTMLComponent_ButtonGroup(NULL);
try
{
oGroup->Size = bgsLarge;
oGroup->AriaLabel = "View mode";
TsgcHTMLButtonItem *oBtn = oGroup->Items->Add();
oBtn->Text = "Day";
oBtn->ButtonStyle = bsOutlinePrimary;
oBtn->Active = true;
oBtn = oGroup->Items->Add();
oBtn->Text = "Week";
oBtn->ButtonStyle = bsOutlinePrimary;
oBtn = oGroup->Items->Add();
oBtn->Text = "Month";
oBtn->ButtonStyle = bsOutlinePrimary;
oBtn->Disabled = true;
String html = oGroup->HTML; // Bootstrap btn-group
}
__finally
{
delete oGroup;
}
using esegece.sgcWebSockets;
var group = new TsgcHTMLComponent_ButtonGroup();
group.Size = TsgcHTMLButtonGroupSize.bgsLarge;
group.AriaLabel = "View mode";
var btn = group.Items.Add();
btn.Text = "Day";
btn.ButtonStyle = TsgcHTMLButtonStyle.bsOutlinePrimary;
btn.Active = true;
btn = group.Items.Add();
btn.Text = "Week";
btn.ButtonStyle = TsgcHTMLButtonStyle.bsOutlinePrimary;
btn = group.Items.Add();
btn.Text = "Month";
btn.ButtonStyle = TsgcHTMLButtonStyle.bsOutlinePrimary;
btn.Disabled = true;
string html = group.HTML; // Bootstrap btn-group
En sık başvurduğunuz üyeler.
Items, TsgcHTMLButtonItems koleksiyonudur; Items.Add, Text, Href, Active, Disabled ve ButtonStyle içeren bir TsgcHTMLButtonItem döndürür.
Her öğenin ButtonStyle'ı (bsOutlinePrimary gibi bir TsgcHTMLButtonStyle) çeşidini ayarlar ve BtnClass bunu ham sınıflarla geçersiz kılar; bir Href, öğeyi bir düğme yerine bir bağlantı olarak işler.
Size, bgsDefault, bgsSmall ya da bgsLarge'ı seçer; Vertical, düğmeleri bir btn-group-vertical içinde üst üste yığar.
AriaLabel, ekran okuyucular için grubun aria-label'ını ayarlar; GroupID öğe kimliğini atar.
HTML, btn-group sarmalayıcısını ve düğme / bağlantı alt öğelerini döndürür — sunun ya da bir sayfa şablonunun BodyContent'ine atayın.