Forum > Third party

LazarusToastMessage

(1/2) > >>

szlbz:
下载地址:
https://github.com/szlbz/LazarusToastMessage

基于pcplayer版本,修改后适用于lazarus,并可以跨平台使用
1、根据显示内容调整totast的宽度和高度,防止显示内容不完整。
2024-05-15:
显示方向增加左右上下居中
2024-05-14:
1、将System.NetEncoding改用Base64
2、增加从form底向上移动

秋风 2024-05-12

Handoko:
Nice!
Thank you for sharing it.

I saw you hardcoded the font name Segoe UI, but not all computers have this font installed.

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---  Title.Font.Name   := 'Segoe UI';

szlbz:
谢谢,字体已改为 :default

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---  Title.Font.Name   := 'default';

Handoko:
I would recommend to use multiple if-statements to find an available font, for example:


--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---const  Font1 = 'Segoe UI';  Font2 = 'Verdana'; // Available in WinXP .. Win11  Font3 = 'Liberation Sans'; // Available in most Linuxes // ...begin  S := 'default';  if Screen.Fonts.IndexOf(Font1) >= 0 then    S := Font1  else    if Screen.Fonts.IndexOf(Font2) >= 0 then      S := Font2    else      if Screen.Fonts.IndexOf(Font3) >= 0 then        S := Font3;  Title.Font.Name := S;end;

dseligo:
Nice 8)

I noticed one 'glitch'.
Sometimes when you 'ToastIt', on the upper-middle position window shows for a split second before started showing in the right position.


--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---procedure TForm1.Button1Click(Sender: TObject);begin  TToastMessage.ToastIt(Self, tpInfo, 'Proba', 'Ovo je poruka 2', 2);end;
Other than that, you have (probably) lapsus in the name 'RealseMe' - did you mean ReleaseMe?
Can you give example when this procedure is supposed to be called?

Navigation

[0] Message Index

[#] Next page

Go to full version