Notification
TsgcHTMLComponent_Notification — Delphi, C++ Builder ve .NET'te bir bildirim öğeleri koleksiyonundan oluşturulan, okunmamış rozetli, zil simgeli açılır bir bildirim merkezi işleyin.
TsgcHTMLComponent_Notification — Delphi, C++ Builder ve .NET'te bir bildirim öğeleri koleksiyonundan oluşturulan, okunmamış rozetli, zil simgeli açılır bir bildirim merkezi işleyin.
Bir Bootstrap 5 açılır menüsü üreten bir bildirim merkezi bileşeni. Onun Items koleksiyonuna öğeler ekleyin (ya da AddNotification'ı çağırın), ardından HTML özelliğini okuyun — okunmamış UnreadCount, rozeti yürütür.
TsgcHTMLComponent_Notification
Bootstrap 5 açılır menü işaretlemesi
Delphi, C++ Builder, .NET
Title ve MaxVisible'ı ayarlayın, her giriş için AddNotification(title, message, color, timestamp)'i çağırın, ardından HTML'i okuyun. Okunmamış sayısı rozeti otomatik olarak doldurur.
uses
sgcHTML_Enums, sgcHTML_Component_Notification;
var
oNotif: TsgcHTMLComponent_Notification;
begin
oNotif := TsgcHTMLComponent_Notification.Create(nil);
try
oNotif.Title := 'Notifications';
oNotif.MaxVisible := 5;
oNotif.ShowBadge := True;
oNotif.AddNotification('New order',
'Order #1042 was placed.', hcSuccess, '2 min ago');
oNotif.AddNotification('Payment failed',
'Invoice #88 could not be charged.', hcDanger, '10 min ago');
WebModule.Response := oNotif.HTML; // bell dropdown + badge
finally
oNotif.Free;
end;
end;
// Or add items via the Items collection directly:
with oNotif.Items.Add do
begin
Title := 'Welcome';
Message := 'Your account is ready.';
Color := hcInfo;
end;
// includes: sgcHTML_Enums.hpp, sgcHTML_Component_Notification.hpp
TsgcHTMLComponent_Notification *oNotif = new TsgcHTMLComponent_Notification(NULL);
try
{
oNotif->Title = "Notifications";
oNotif->MaxVisible = 5;
oNotif->ShowBadge = true;
oNotif->AddNotification("New order",
"Order #1042 was placed.", hcSuccess, "2 min ago");
oNotif->AddNotification("Payment failed",
"Invoice #88 could not be charged.", hcDanger, "10 min ago");
String html = oNotif->HTML; // bell dropdown + badge
}
__finally
{
delete oNotif;
}
// Or add items via the Items collection directly:
TsgcHTMLNotificationItem *item = oNotif->Items->Add();
item->Title = "Welcome";
item->Message = "Your account is ready.";
item->Color = hcInfo;
using esegece.sgcWebSockets;
var notif = new TsgcHTMLComponent_Notification();
notif.Title = "Notifications";
notif.MaxVisible = 5;
notif.ShowBadge = true;
notif.AddNotification("New order",
"Order #1042 was placed.", TsgcHTMLColor.hcSuccess, "2 min ago");
notif.AddNotification("Payment failed",
"Invoice #88 could not be charged.", TsgcHTMLColor.hcDanger, "10 min ago");
string html = notif.HTML; // bell dropdown + badge
// Or add items via the Items collection directly:
var item = notif.Items.Add();
item.Title = "Welcome";
item.Message = "Your account is ready.";
item.Color = TsgcHTMLColor.hcInfo;
En sık başvurduğunuz üyeler.
Items, bir TsgcHTMLNotificationItems koleksiyonudur; her TsgcHTMLNotificationItem Title, Message, Timestamp, Color, Icon, Href ve Read'e sahiptir.
AddNotification(title, message, color, timestamp), bir öğe ekler ve atlandığında zaman damgasını geçerli saate ayarlar.
UnreadCount, Read'i False olan öğeleri sayar; ShowBadge, kırmızı hapı açıp kapatır ve GetBadgeHTML, yalnızca rozet işaretlemesini döndürür.
Title, açılır menü başlığını ayarlar, EmptyText, öğe olmadığında yer tutucuyu ve BellIcon, tetikleyici glifini ayarlar.
MaxVisible, kaç öğenin işleneceğini sınırlar (varsayılan 5) ve daha fazlası olduğunda bir "Tümünü görüntüle" bağlantısı ekler; NotificationID, öğe kimliğini atar.
HTML, kapsamlı CSS'siyle birlikte eksiksiz zil simgeli açılır menüyü döndürür — sunun ya da bir sayfa şablonunun BodyContent'ine atayın.