首页 > 系统相关 >lazarus在银河麒麟国产操作系统linux下,使用TListView 使用图标样式 BUG完善

lazarus在银河麒麟国产操作系统linux下,使用TListView 使用图标样式 BUG完善

时间:2024-03-06 09:46:27浏览次数:29  
标签:vLI control Canvas TListView Text lazarus linux

lazarus在银河麒麟国产操作系统linux下,使用TListView 使用TListView vsIcon 样式,文本长了会是这样效果

尝试设置 OwnerDraw 属性为 True
自己定义方法 DrawItem 不起效果
也尝试修改 TCustomListView 源代码也不起效果,
搞了半天,后发现坑了,没仔细看帮助

When set to True, the OnDrawItem event handler is signalled to draw list items when the control is using the Report view style (ViewStyle = vsReport). The handler is signalled (when assigned) from the DrawItem method, and occurs when the CN_DRAWITEM control notification message is handled for the control. It should handle all aspects of drawing the list item to the control Canvas. If OnDrawItem has not been assigned, a basic default drawing routine is used.

只有ViewStyle = vsReport 也可调用 DrawItem
vsIcon 是调系统gtk自己画的
本质还是系统问题不是 lazarus 问题

后面不折腾了,自己程序代码完善一下
function MinimizeText(const Text: string; Canvas: TCanvas; MaxWidth: Integer): string;
var
I: Integer;
begin
Result := Text;
I := 1;
while (I <= Length(Text)) and (Canvas.TextWidth(Result) > MaxWidth) do
begin
Inc(I);
Result := Copy(Text, 1, Max(0, Length(Text) - I)) + '...';
end;
end;
长的文本加...
vLI := ListView1.Items.Add;
vLI .Caption := MinimizeText(AQry.FieldByName('sfilename').AsString, ListView1.Canvas ,100);
vLI .SubItems.Add(AQry.FieldByName('iid').AsString);
vLI .SubItems.Add(AQry.FieldByName('sfilename').AsString);

标签:vLI,control,Canvas,TListView,Text,lazarus,linux
From: https://www.cnblogs.com/fsqcling/p/18055808

相关文章

  • lazarus在银河麒麟国产操作系统linux下,使用fastreport注意事项
    参考秋.风https://www.cnblogs.com/qiufeng20141、修正编译出错的bug。打开frxDsgnIntf.pas,第1243行:withGetTypeData(GetTypeData(PropertyList[i].PropType).CompType)^do改为:{$IFDEFlinux}withGetTypeData(GetTypeData(PropertyList[i]^.PropType)^.Co......
  • Linux AWVS-14 Docker 安装
    1.什么是AWVS?一个自动化的web应用程序安全测试工具,可以扫描任何可通过web浏览器访问和遵循http/https规则的web站点和web应用程序2.安装AWVS:dockerpullsecfa/docker-awvsdockerrun-it-d-p13443:3443--cap-addLINUX_IMMUTABLEsecfa/docker-awvs浏览器访问https://i......
  • linux安装向日葵
    下载图像界面安装包https://sunlogin.oray.com/download/linux?type=personal  将下载的rpm包上传至liunx,可以放在/usr/src运行命令进行安装yuminstall-y/usr/src/SunloginClient_11.0.1.44968_amd64.rpm安装按成之后,显示完毕登录系统,在菜单互联网点击向日葵图标 ......
  • rockylinux8.4更新源更改为国内源
    国内更新如下: 机构链接支持类型带宽备注南京大学mirrors.nju.edu.cnhttp https rsync10000 上海交通大学mirrors.sjtug.sjtu.edu.cnhttps rsync1000 山东大学mirrors.sdu.edu.cnhttp https1000 重庆大学mirrors.cqu.edu.cnhttp https100......
  • U盘方式安装Rockylinux8.9 提示 “Warning: /dev/root does not exist, could not bo
    使用软碟通做好相关镜像,但在进入安装时却报找不到启动镜像,以前是直接刻成RAW格式,但这次没有刻上这个问题是木有找到你的U盘,这个配置是需要在上一步需要完成的,但在上一步我们并不知道U盘的文件名,所以索性在这一步查看一下U盘的设备名,然后再回到上一步完成配置。在#后面输入:cd......
  • linux复习基础命令
    Linux基础命令学习目标了解vm备份的两种方式了解快照和克隆的区别了解linux系统文件掌握基础命令指定vmtools的作用1vm两种备份方式为什么要进行备份保证centos操作系统的安全,必须对操作系统进行备份两种备份方式快照备份克隆备份快照备份又称还原点,就是保存在拍快照时候的系......
  • 记一次部署vika源码以及安装Falsk框架到linux服务器
    前言接受到需求,需要把python项目vika的源码修改部分内容后,部署到服务器,然后再安装一个python的快速开发框架Falsk。部署vika1.什么是vika?Vika PythonSDK是对维格表FusionAPI的官方封装,提供类似DjangoORM风格的API。2.下载源码前往源码地址(https://github.com/vikadat......
  • (20) Lazarus学习之ListFilterEdit1过滤ListBox1数据
     Delphi我写的类似功能带历史记忆,并模糊带出功能的Edit 先在ListBox1的Items里添加数据 再拖一个ListFilterEdit1要界面上,设置它的 即可看到过滤效果 同样适合CheckListBox1 ......
  • (23)lazarus memdataset的filter问题
    参考https://www.cnblogs.com/qiufeng2014/p/17388138.html链接:https://pan.baidu.com/s/1ayzgDbXjgXBnw-jM1FR4gA提取码:ogqzunitUnit1;{$modeobjfpc}{$H+}interfaceusesClasses,SysUtils,memds,db,Forms,Controls,Graphics,Dialogs,DBGrids;type{TForm1......
  • Linux入门(五)
    Linux入门(五)本篇文章主要讲述下文件处理相关的命令1:显示权限ls-lh总用量36Kdrwxrwxr-x5zhzh4.0K2月2816:47app-rw-rw-r--1zhzh5302月2218:25build.gradledrwxrwxr-x3zhzh4.0K2月2218:25gradle-rw-rw-r--1zhzh1.1K2月2608:58gr......