Bootstrap's Badges for Xojo Web.
This is a module that allows you to set badges on visual controls:
It contains two new methods, available in any control that inherits from WebUIControl:
Extension methods are a simple and powerful way to extend internal Xojo classes. You can read more about this module feature here:
Using Xojo Language > Modules > Extension Methods
Three simple steps:
- Download and open the project
- Copy the WebExtensions module into your project
- That's it, now you can use
SetBadge
andRemoveBadge
on your controls
Used to set the badge on any WebUIControl. You can use the following parameters:
- caption: The caption of the badge. If you just want to display a round circle, use an space
- indicator: One of the Bootstrap's indicators: "primary", "secondary", "success", "danger" (default), "warning", "info", "light" or "dark"
- top and right: Use these values to adjust the badge position. It will be -10 by default in both parameters
UsernameTextField.SetBadge("OK", "success")
EmailTextField.SetBadge("It can't be blank")
PasswordTextField.SetBadge("Too little", "danger", -10, 30)
NotificationButton.SetBadge(" ")
Used to remove the badge from any WebUIControl.
NotificationButton.RemoveBadge