修复lazarus linux(ubuntu/银河麒麟)Object Inspector、使用combobox、colorbox等控件style为csOwnerDraw*时下拉列表文字不显示的问题(在树莓派正常),这类问题大概率是ubuntu/银河麒麟引起的,如果使用中也遇到同样的问题可参照以下方法处理。
打开lazarus/lcl/include/customcombobox.inc,(第109行)定位TCustomComboBox.DrawItem(Index: Integer; ARect: TRect; State: TOwnerDrawState);
添加红字1行,重绘背景,重新编译应用程序就可以解决Object Inspector、combobox和colorbox列表的不显示item的问题,这方法不一定是最佳的,但能解决我遇到的问题。
修复前:
修复后:
procedure TCustomComboBox.DrawItem(Index: Integer; ARect: TRect; State: TOwnerDrawState); begin //TControlCanvas(FCanvas).UpdateTextFlags; //2022.05.28 LBZ {$ifdef linux} FCanvas.FillRect(ARect); {$endif} //2022.05.28 LBZ if Assigned(FOnDrawItem) then FOnDrawItem(Self, Index, ARect, State) else begin if not (odBackgroundPainted in State) then FCanvas.FillRect(ARect) else InternalDrawItem(Self, FCanvas, ARect, Items[Index]); end; end;
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· Manus的开源复刻OpenManus初探
· AI 智能体引爆开源社区「GitHub 热点速览」
· 从HTTP原因短语缺失研究HTTP/2和HTTP/3的设计差异
· 三行代码完成国际化适配,妙~啊~
2014-05-29 [转]xe6 android 使用距离传感器(Proximiry)