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

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.

Bileşen sınıfı

TsgcHTMLComponent_Notification

İşler

Bootstrap 5 açılır menü işaretlemesi

Diller

Delphi, C++ Builder, .NET

Oluşturun, bildirimler ekleyin, işleyin

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;

Temel özellikler & yöntemler

En sık başvurduğunuz üyeler.

Öğeler

Items, bir TsgcHTMLNotificationItems koleksiyonudur; her TsgcHTMLNotificationItem Title, Message, Timestamp, Color, Icon, Href ve Read'e sahiptir.

Bildirim ekleme

AddNotification(title, message, color, timestamp), bir öğe ekler ve atlandığında zaman damgasını geçerli saate ayarlar.

Okunmamış rozeti

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.

Başlık

Title, açılır menü başlığını ayarlar, EmptyText, öğe olmadığında yer tutucuyu ve BellIcon, tetikleyici glifini ayarlar.

Sınırlar

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.

Çıktı

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.

Keşfetmeye devam edin

Tüm sgcHTML Bileşenleri60'tan fazla bileşenin tam özellik matrisine göz atın.
Ücretsiz Deneme Sürümünü İndirin30 günlük deneme, 60.HTML demo projeleriyle birlikte gelir.
FiyatlandırmaTam kaynak kodlu Single, Team ve Site lisansları.

Başlamaya Hazır mısınız?

Ücretsiz deneme sürümünü indirin ve Delphi, C++ Builder ve .NET'te web arayüzleri oluşturmaya başlayın.